[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e98f0e53-b6b7-5ad6-fe09-2f2487929f61@quicinc.com>
Date: Thu, 9 May 2024 15:32:42 -0700
From: Wesley Cheng <quic_wcheng@...cinc.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
<srinivas.kandagatla@...aro.org>, <mathias.nyman@...el.com>,
<perex@...ex.cz>, <conor+dt@...nel.org>, <corbet@....net>,
<lgirdwood@...il.com>, <andersson@...nel.org>, <krzk+dt@...nel.org>,
<gregkh@...uxfoundation.org>, <Thinh.Nguyen@...opsys.com>,
<broonie@...nel.org>, <bgoswami@...cinc.com>, <tiwai@...e.com>,
<bagasdotme@...il.com>, <robh@...nel.org>, <konrad.dybcio@...aro.org>
CC: <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-sound@...r.kernel.org>, <linux-usb@...r.kernel.org>,
<linux-arm-msm@...r.kernel.org>, <linux-doc@...r.kernel.org>,
<alsa-devel@...a-project.org>
Subject: Re: [PATCH v21 27/39] ASoC: Introduce SND kcontrols to select sound
card and PCM device
Hi Pierre,
On 5/9/2024 6:07 AM, Pierre-Louis Bossart wrote:
>
>
> On 5/8/24 19:10, Wesley Cheng wrote:
>> Hi Pierre,
>>
>> On 5/7/2024 2:26 PM, Pierre-Louis Bossart wrote:
>>>
>>>
>>> On 5/7/24 14:51, Wesley Cheng wrote:
>>>> Add SND kcontrol to SOC USB, which will allow for userpsace to determine
>>>> which USB card number and PCM device to offload. This allows for
>>>> userspace
>>>> to potentially tag an alternate path for a specific USB SND card and PCM
>>>> device. Previously, control was absent, and the offload path would be
>>>> enabled on the last USB SND device which was connected. This logic will
>>>> continue to be applicable if no mixer input is received for specific
>>>> device
>>>> selection.
>>>>
>>>> An example to configure the offload device using tinymix:
>>>> tinymix -D 0 set 'USB Offload Playback Route Select' 1 0
>>>>
>>>> The above command will configure the offload path to utilize card#1
>>>> and PCM
>>>> stream#0.
>>>
>>> I don't know how this is usable in practice. Using card indices is
>>> really hard to do, it depends on the order in which devices are
>>> plugged-in...
>>
>> How are the existing mechanisms handling USB audio devices, or what is
>> the identifier being used?
>
> Well it's a mess, that's why I asked.
>
> There are configuration work-arounds to make sure that 'local'
> accessories are handled first and get repeatable card indices.
>
So is the intention of the configuration aspect you're thinking of to
have an entry that maps a USB device based on some identifier, which
will take the offload path by default?
IMO, the concept of this selection of card and PCM device should happen
after the application discovers a USB device that is offload capable.
For example, maybe the application will use the USB VID/PID to lookup an
entry within the configuration. If some offload tag is present, it can
further determine which card and PCM devices are associated w/ the USB
device? Although this is under the assumption the application has
insight to the USB sysfs.
> But between USB devices I guess the rule is 'anything goes'. Even if
> there are two devices connected at boot, the index allocation will
> depend on probe order. The card names are not necessarily super-useful
> either, i.e. yesterday I was confused by an USB card named "CODEC"
> without any details.
That device is very informative :D
Thanks
Wesley Cheng
Powered by blists - more mailing lists