Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2345839imm; Thu, 7 Jun 2018 09:07:15 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKWqaXbZCwi9ZRDIPdSMCxoqhOSmr9zSAX+Mv7wtw7VwE5tPm6MSJS/6YGALXk4PmlPHEaW X-Received: by 2002:a63:6d0:: with SMTP id 199-v6mr2057972pgg.338.1528387635801; Thu, 07 Jun 2018 09:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387635; cv=none; d=google.com; s=arc-20160816; b=UcROQh90sYHfodlYRbpi2BiGkgqPFssU5R1st24QSaiNxyMaAXTlDEX3UFMS8M8tNx P6aS318x6PnkdcZ2ggIctbsRMwN1c/rTeIwhE6Np4dhrzSwvNQQxXlb+fcKdHrGG0ozY r1ObqmLBb8Pu+GinFwa1qgIf8cbUJwj2QpSh2jN/W3SjUVZbstcoWr+igrS5ZI/Z+pWE dzdv0MkQGqm9jX5zQZFflgVzQJLdNveDfGM2Mp4zSVrGFmzry2TRqaBhXH6sQ7efGwAh 0ENC5YDkU+hGcYpMG6Ww/2ShgwIcKtkcg0JUstonQoC7ydT50FPyQc8uMg8VvTMd+dVP /mLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=AjmaEedy0gMgbjybUwA8HqtoOZVgM3F9lb4ONW0Wofw=; b=g7YYVzR7pSsRZObHO8e2VCIdIRREeS2WAN2nO2ydpjseMFPkrUfTuSomruWYQvqN9k 9ttlWkA0ylycVHZYDmrFdtXiOhxQa1RsiobLEntvBdoqWD6D0ftpdnA7ea/TbZCI5sMa yloXJOO2II87hkghdUNRS6dGTIwzPJQocfDy09qGB141Q5SEkhf7fzfOXhAa/23Z9L0i clIK0oQaqPS98lMQfs3wAFIus7GqRue9uSThhvNNNUKx/6XZOMOOcdCE0WqH3sCcyzxX aCgI3an8UEMjs6srFrahsbUIAGRM31Jy9qPb1ARzdU/CMU70aFtkUHatFDRMN74Qdz1Z aTAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12-v6si52725957plo.264.2018.06.07.09.07.00; Thu, 07 Jun 2018 09:07:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935407AbeFGQFg (ORCPT + 99 others); Thu, 7 Jun 2018 12:05:36 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:56107 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935983AbeFGQFP (ORCPT ); Thu, 7 Jun 2018 12:05:15 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w57FwcC0025776; Thu, 7 Jun 2018 18:02:41 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2jf3kgagcx-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 07 Jun 2018 18:02:41 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 775B731; Thu, 7 Jun 2018 16:02:39 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag3node1.st.com [10.75.127.7]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0F9FD4E75; Thu, 7 Jun 2018 16:02:39 +0000 (GMT) Received: from [10.201.23.162] (10.75.127.47) by SFHDAG3NODE1.st.com (10.75.127.7) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 7 Jun 2018 18:02:37 +0200 Subject: Re: [alsa-devel] [PATCH 0/3] ASoC: stm32: sai: add support of iec958 controls To: Takashi Iwai CC: Mark Brown , Olivier MOYSAN , "alsa-devel@alsa-project.org" , "mark.rutland@arm.com" , "rmk@arm.linux.org.uk" , "lgirdwood@gmail.com" , "mcoquelin.stm32@gmail.com" , "robh@kernel.org" , "linux-arm-kernel@lists.infradead.org" , Alexandre TORGUE , Benjamin GAIGNARD , "kernel@stlinux.com" , "jsarha@ti.com" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1520958428-10930-1-git-send-email-olivier.moysan@st.com> <20180417111733.GG8973@sirena.org.uk> <2ae6c5b6-872a-9aaa-6ca4-e29adb7c8bc0@st.com> From: Arnaud Pouliquen Openpgp: preference=signencrypt Autocrypt: addr=arnaud.pouliquen@st.com; prefer-encrypt=mutual; keydata= xsFNBFZu+HIBEAC/bt4pnj18oKkUw40q1IXSPeDFOuuznWgFbjFS6Mrb8axwtnxeYicv0WAL rWhlhQ6W2TfKDJtkDygkfaZw7Nlsj57zXrzjVXuy4Vkezxtg7kvSLYItQAE8YFSOrBTL58Yd d5cAFz/9WbWGRf0o9MxFavvGQ9zkfHVd+Ytw6dJNP4DUys9260BoxKZZMaevxobh5Hnram6M gVBYGMuJf5tmkXD/FhxjWEZ5q8pCfqZTlN9IZn7S8d0tyFL7+nkeYldA2DdVplfXXieEEURQ aBjcZ7ZTrzu1X/1RrH1tIQE7dclxk5pr2xY8osNePmxSoi+4DJzpZeQ32U4wAyZ8Hs0i50rS VxZuT2xW7tlNcw147w+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DRJ1j3nbodC3o6 peWAlfCXVtErSQ17QzNydFDOysL1GIVn0+XY7X4Bq+KpVmhQOloEX5/At4FlhOpsv9AQ30rZ 3F5lo6FG1EqLIvg4FnMJldDmszZRv0bR0RM9Ag71J9bgwHEn8uS2vafuL1hOazZ0eAo7Oyup 2VNRC7Inbc+irY1qXSjmq3ZrD3SSZVa+LhYfijFYuEgKjs4s+Dvk/xVL0JYWbKkpGWRz5M82 Pj7co6u8pTEReGBYSVUBHx7GF1e3L/IMZZMquggEsixD8CYMOzahCEZ7UUwD5LKxRfmBWBgK 36tfTyducLyZtGB3mbJYfWeI7aiFgYsd5ehov6OIBlOz5iOshd97+wbbmziYEp6jWMIMX+Em zqSvS5ETZydayO5JBbw7fFBd1nGVYk1WL6Ll72g+iEnqgIckMtxey1TgfT7GhPkR7hl54ZAe 8mOik8I/F6EW8XyQAA2P Message-ID: <5ab41e6d-eccf-df75-4c17-9dbadf05b5b7@st.com> Date: Thu, 7 Jun 2018 18:02:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG7NODE3.st.com (10.75.127.21) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-07_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/06/2018 11:47 AM, Takashi Iwai wrote: > On Wed, 06 Jun 2018 11:31:45 +0200, > Arnaud Pouliquen wrote: >> >> >> >> On 06/05/2018 08:29 PM, Takashi Iwai wrote: >> > On Tue, 05 Jun 2018 17:50:57 +0200, >> > Arnaud Pouliquen wrote: >> >> >> >> Hi Takashi, >> >> >> >> On 04/17/2018 01:17 PM, Mark Brown wrote: >> >> > On Tue, Apr 17, 2018 at 08:29:17AM +0000, Olivier MOYSAN wrote: >> >> > >> >> >> I guess the blocking patch in this patchset is the patch "add IEC958 >> >> >> channel status control helper". This patch has been reviewed several >> >> >> times, but did not get a ack so far. >> >> >> If you think these helpers will not be merged, I will reintegrate the >> >> >> corresponding code in stm driver. >> >> >> Please let me know, if I need to prepare a v2 without helpers, or if we >> >> >> can go further in the review of iec helpers patch ? >> >> > >> >> > I don't mind either way but you're right here, I'm waiting for Takashi >> >> > to review the first patch.  I'd probably be OK with it just integrated >> >> > into the driver if we have to go that way though. >> >> >> >> Gentlemen reminder for this patch set. We would appreciate to have your >> >> feedback on iec helper. >> >> From our point of view it could be useful to have a generic management >> >> of the iec controls based on helpers instead of redefining them in DAIs. >> >> Having the same behavior for these controls could be useful to ensure >> >> coherence of the control management used by application (for instance >> >> Gstreamer uses it to determine iec raw mode capability for iec61937 streams) >> > >> > Oh sorry for the late reply, I've totally overlooked the thread. >> > >> > And, another sorry: the patchset doesn't look convincing enough to >> > me. >> > >> > First off, the provided API definition appears somewhat >> > unconventional, the mixture of the ops, the static data and the >> > dynamic data. >> Sorry i can't figure out your point. I suppose that you speak about the >> snd_pcm_iec958_params. >> what would be a more conventional API? > > Imagine you'd want to put a const to the data passed to the API for > hardening.  The current struct is a mixture of static and dynamic > data. > > >> > Moreover, this is only for your driver, ATM.  >> It is also compatible with the sound/sti driver, even if we does not >> propose patch yet. We also plan to propose an implementation, for the >> HDMI_codec that would need to export a control to allow none-audio mode. >> >> >If it were an API that >> > does clean up the already existing usages, I'd happily apply it. There >> > are lots of drivers creating and controlling the IEC958 ctls even >> > now. >> > >> > Also, the patchset requires more fine-tuning, in anyways.  The changes >> > in create_iec958_consumre() are basically irrelevant, should be split >> > off as an individual fix.  it is linked to the control, as not possible in existing implementation >> (rate and width are get from hwparam or runtime). But no problem we can >> split it in a separate patch. >> >> Also, the new function doesn't create the >> > "XXX Mask" controls.  And the byte comparison should be replaced with >> > memcmp(), etc, etc. >> Yes mask are missing, can be added. For the rest could you comment >> directly in code? i suppose that you want to replace the for loops by >> memcmp, memcpy... > > Right. > >> > So, please proceed rather with the open codes for now.  If you can >> > provide a patch that cleans up the *multiple* driver codes, again, >> > I'll happily take it.  But it can be done anytime later, too. >> Not simple to clean up the other drivers as this control is a PCM >> control, that is mainly implemented as a mixer or card control. >> This means that it should be registered on the pcm_new in CPU DAI or in >> the DAI codec, to be able to bind it to the PCM device. >> Inpact is not straigthforward as this could generate regression on driver. > > Yes, and that's my point.  The application of API is relatively > limited -- although the API itself has nothing to do with ASoC at > all. > >> For now We can add the clean up on the sti driver based on this helper, >> and we are working on the HDMI_codec, we could also use this helper to >> export the control.... >> >> So if you estimate that it is interesting to purchase on this helper we >> can try to come back with a patch set that implements the helper for >> the 3 drivers. > > Right.  Basically there are two cases we add a new API: > > 1. It's absolutely new and nothing else can do it > 2. API simplifies the whole tree, not only one you're trying to add. > > And in this case, let's prove 2 at first, that the API *is* actually > useful in multiple situations we already have.  Then I'll happily ack > for that.  More drivers cleanup, better.  At best, think of more > range above ASoC, as you're proposing ALSA core API, not the ASoC > one. > >> The other option, is that we drop the helpers, and implement the control >> directly in our drivers. > > This is of course another, maybe easier option. > >> Please just tell us if we should continue to propose the helpers or not. > > I have no preference over two ways, but am only interested in the > resulting patches :) My tentative here was to start to introduce helpers at ALSA level (not only ASoC) to have a generic implementation of the this generic control. Today the snd_pcm_create_iec958_consumer_hw_params just allow to fill AES based on runtime parameters, but not to offer a generic management of iec control. Now you are right i'm developing under ASoC and i have not the whole knowledge of the ALSA drivers, an probably too limited view of the iec controls usage. Based on your feedback i think (at least in a first step) we will choose the easiest option for the STM driver... Thanks Arnaud > > > thanks, > > Takashi