diff mbox series

ALSA: usb-audio: add the profile name of Dell desktop

Message ID 20211111091914.20917-1-shumingf@realtek.com (mailing list archive)
State New, archived
Headers show
Series ALSA: usb-audio: add the profile name of Dell desktop | expand

Commit Message

Shuming [范書銘] Nov. 11, 2021, 9:19 a.m. UTC
From: Shuming Fan <shumingf@realtek.com>

Add the profile name to let userspace pick correct UCM profile

Signed-off-by: Shuming Fan <shumingf@realtek.com>
---
 sound/usb/card.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Takashi Iwai Nov. 11, 2021, 9:23 a.m. UTC | #1
On Thu, 11 Nov 2021 10:19:14 +0100,
<shumingf@realtek.com> wrote:
> 
> From: Shuming Fan <shumingf@realtek.com>
> 
> Add the profile name to let userspace pick correct UCM profile

Was the corresponding change for alsa-ucm-conf submitted to upstream?

> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>  sound/usb/card.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 1764b9302d46..9c67ecbe710e 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -398,6 +398,10 @@ static const struct usb_audio_device_name usb_audio_names[] = {
>  	PROFILE_NAME(0x0bda, 0x4014, "Dell", "WD15 Dock", "Dell-WD15-Dock"),
>  	/* Dell WD19 Dock */
>  	PROFILE_NAME(0x0bda, 0x402e, "Dell", "WD19 Dock", "Dell-WD15-Dock"),
> +	/* Dell Desktop - Front */
> +	PROFILE_NAME(0x0bda, 0x4c54, "Dell", "Desktop", "Dell-Desktop-Front"),
> +	/* Dell Desktop - Rear */
> +	PROFILE_NAME(0x0bda, 0x4c55, "Dell", "Desktop", "Dell-Desktop-Rear"),

IMO, the profile name sounds too generic.  It's better to have with
some model name at least so that it can be identified more uniquely.


thanks,

Takashi
Jaroslav Kysela Nov. 11, 2021, 9:34 a.m. UTC | #2
On 11. 11. 21 10:19, shumingf@realtek.com wrote:
> From: Shuming Fan <shumingf@realtek.com>
> 
> Add the profile name to let userspace pick correct UCM profile

It's no longer necessary to force the card names in the drivers. UCM can match 
the USB vendor / device IDs from the 'components' string, too.

I think that we should abandon this way of the UCM configuration selection for 
new devices with device IDs. The kernel already exports necessary information 
to select the right UCM configuration in the user space.

					Jaroslav

> 
> Signed-off-by: Shuming Fan <shumingf@realtek.com>
> ---
>   sound/usb/card.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/sound/usb/card.c b/sound/usb/card.c
> index 1764b9302d46..9c67ecbe710e 100644
> --- a/sound/usb/card.c
> +++ b/sound/usb/card.c
> @@ -398,6 +398,10 @@ static const struct usb_audio_device_name usb_audio_names[] = {
>   	PROFILE_NAME(0x0bda, 0x4014, "Dell", "WD15 Dock", "Dell-WD15-Dock"),
>   	/* Dell WD19 Dock */
>   	PROFILE_NAME(0x0bda, 0x402e, "Dell", "WD19 Dock", "Dell-WD15-Dock"),
> +	/* Dell Desktop - Front */
> +	PROFILE_NAME(0x0bda, 0x4c54, "Dell", "Desktop", "Dell-Desktop-Front"),
> +	/* Dell Desktop - Rear */
> +	PROFILE_NAME(0x0bda, 0x4c55, "Dell", "Desktop", "Dell-Desktop-Rear"),
>   
>   	DEVICE_NAME(0x0ccd, 0x0028, "TerraTec", "Aureon5.1MkII"),
Jaroslav Kysela Nov. 11, 2021, 9:55 a.m. UTC | #3
On 11. 11. 21 10:34, Jaroslav Kysela wrote:
> On 11. 11. 21 10:19, shumingf@realtek.com wrote:
>> From: Shuming Fan <shumingf@realtek.com>
>>
>> Add the profile name to let userspace pick correct UCM profile
> 
> It's no longer necessary to force the card names in the drivers. UCM can match
> the USB vendor / device IDs from the 'components' string, too.
> 
> I think that we should abandon this way of the UCM configuration selection for
> new devices with device IDs. The kernel already exports necessary information
> to select the right UCM configuration in the user space.

Untested example:

https://github.com/perexg/alsa-ucm-conf/commit/74ced65440b5011bbec1680b2804c8a9c82b5152

					Jaroslav
Shuming [范書銘] Nov. 11, 2021, 9:58 a.m. UTC | #4
Hi Jaroslav,

> On 11. 11. 21 10:34, Jaroslav Kysela wrote:
> > On 11. 11. 21 10:19, shumingf@realtek.com wrote:
> >> From: Shuming Fan <shumingf@realtek.com>
> >>
> >> Add the profile name to let userspace pick correct UCM profile
> >
> > It's no longer necessary to force the card names in the drivers. UCM
> > can match the USB vendor / device IDs from the 'components' string, too.
> >
> > I think that we should abandon this way of the UCM configuration
> > selection for new devices with device IDs. The kernel already exports
> > necessary information to select the right UCM configuration in the user
> space.
> 
> Untested example:
> 
> https://github.com/perexg/alsa-ucm-conf/commit/74ced65440b5011bbec1680
> b2804c8a9c82b5152
> 
> 					Jaroslav

Thanks a lot. I will take your example to test.

> --
> Jaroslav Kysela <perex@perex.cz>
> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
> ------Please consider the environment before printing this e-mail.
Takashi Iwai Nov. 11, 2021, 10:13 a.m. UTC | #5
On Thu, 11 Nov 2021 10:34:52 +0100,
Jaroslav Kysela wrote:
> 
> On 11. 11. 21 10:19, shumingf@realtek.com wrote:
> > From: Shuming Fan <shumingf@realtek.com>
> >
> > Add the profile name to let userspace pick correct UCM profile
> 
> It's no longer necessary to force the card names in the drivers. UCM
> can match the USB vendor / device IDs from the 'components' string,
> too.
> 
> I think that we should abandon this way of the UCM configuration
> selection for new devices with device IDs. The kernel already exports
> necessary information to select the right UCM configuration in the
> user space.

Sounds reasonable.  Less changes in kernel, better :)


Thanks!

Takashi
Shuming [范書銘] Nov. 11, 2021, 10:40 a.m. UTC | #6
Hi Jaroslav,

> > >> Add the profile name to let userspace pick correct UCM profile
> > >
> > > It's no longer necessary to force the card names in the drivers. UCM
> > > can match the USB vendor / device IDs from the 'components' string, too.
> > >
> > > I think that we should abandon this way of the UCM configuration
> > > selection for new devices with device IDs. The kernel already
> > > exports necessary information to select the right UCM configuration
> > > in the user
> > space.
> >
> > Untested example:
> >
> >
> https://github.com/perexg/alsa-ucm-conf/commit/74ced65440b5011bbec1680
> > b2804c8a9c82b5152
> >
> > 					Jaroslav
> 
> Thanks a lot. I will take your example to test.

I had tested with USB-Audio.conf that the system seems not to apply the UCM config.

The related info of the test machine shows below.
root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# cat /proc/asound/cards
 0 [PCH            ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0xcc338000 irq 153
 1 [Rear           ]: USB-Audio - USB audio Rear
                      Generic USB audio Rear at usb-0000:00:14.0-2.2, high speed
 2 [FRONT          ]: USB-Audio - USB audio FRONT
                      Generic USB audio FRONT at usb-0000:00:14.0-2.1, high speed

root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# alsaucm --version
alsaucm: version 1.2.2

root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8564:4000 Transcend Information, Inc. RDF8
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp. 58200
Bus 001 Device 002: ID 0bda:5532 Realtek Semiconductor Corp. Integrated_Webcam_HD
Bus 001 Device 008: ID 04f3:0235 Elan Microelectronics Corp. Optical Mouse
Bus 001 Device 007: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
Bus 001 Device 006: ID 0bda:4c55 Realtek Semiconductor Corp. USB2.0 Hub
Bus 001 Device 009: ID 0bda:4c54 Realtek Semiconductor Corp.

May I ask you to give me some suggestions?
Hui Wang Nov. 11, 2021, 10:44 a.m. UTC | #7
On 11/11/21 6:40 PM, Shuming [范書銘] wrote:
> Hi Jaroslav,
>
>>>>> Add the profile name to let userspace pick correct UCM profile
>>>> It's no longer necessary to force the card names in the drivers. UCM
>>>> can match the USB vendor / device IDs from the 'components' string, too.
>>>>
>>>> I think that we should abandon this way of the UCM configuration
>>>> selection for new devices with device IDs. The kernel already
>>>> exports necessary information to select the right UCM configuration
>>>> in the user
>>> space.
>>>
>>> Untested example:
>>>
>>>
>> https://github.com/perexg/alsa-ucm-conf/commit/74ced65440b5011bbec1680
>>> b2804c8a9c82b5152
>>>
>>> 					Jaroslav
>> Thanks a lot. I will take your example to test.
> I had tested with USB-Audio.conf that the system seems not to apply the UCM config.
>
> The related info of the test machine shows below.
> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# cat /proc/asound/cards
>   0 [PCH            ]: HDA-Intel - HDA Intel PCH
>                        HDA Intel PCH at 0xcc338000 irq 153
>   1 [Rear           ]: USB-Audio - USB audio Rear
>                        Generic USB audio Rear at usb-0000:00:14.0-2.2, high speed
>   2 [FRONT          ]: USB-Audio - USB audio FRONT
>                        Generic USB audio FRONT at usb-0000:00:14.0-2.1, high speed
>
> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# alsaucm --version
> alsaucm: version 1.2.2
>
> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# lsusb
> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 002 Device 002: ID 8564:4000 Transcend Information, Inc. RDF8
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp. 58200
> Bus 001 Device 002: ID 0bda:5532 Realtek Semiconductor Corp. Integrated_Webcam_HD
> Bus 001 Device 008: ID 04f3:0235 Elan Microelectronics Corp. Optical Mouse
> Bus 001 Device 007: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
> Bus 001 Device 006: ID 0bda:4c55 Realtek Semiconductor Corp. USB2.0 Hub
> Bus 001 Device 009: ID 0bda:4c54 Realtek Semiconductor Corp.
>
> May I ask you to give me some suggestions?
Looks like the alsa-lib in the ubuntu 20.04 doesn't support it.
>
Jaroslav Kysela Nov. 11, 2021, 11:20 a.m. UTC | #8
On 11. 11. 21 11:44, Hui Wang wrote:
> 
> On 11/11/21 6:40 PM, Shuming [范書銘] wrote:
>> Hi Jaroslav,
>>
>>>>>> Add the profile name to let userspace pick correct UCM profile
>>>>> It's no longer necessary to force the card names in the drivers. UCM
>>>>> can match the USB vendor / device IDs from the 'components' string, too.
>>>>>
>>>>> I think that we should abandon this way of the UCM configuration
>>>>> selection for new devices with device IDs. The kernel already
>>>>> exports necessary information to select the right UCM configuration
>>>>> in the user
>>>> space.
>>>>
>>>> Untested example:
>>>>
>>>>
>>> https://github.com/perexg/alsa-ucm-conf/commit/74ced65440b5011bbec1680
>>>> b2804c8a9c82b5152
>>>>
>>>> 					Jaroslav
>>> Thanks a lot. I will take your example to test.
>> I had tested with USB-Audio.conf that the system seems not to apply the UCM config.
>>
>> The related info of the test machine shows below.
>> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# cat /proc/asound/cards
>>    0 [PCH            ]: HDA-Intel - HDA Intel PCH
>>                         HDA Intel PCH at 0xcc338000 irq 153
>>    1 [Rear           ]: USB-Audio - USB audio Rear
>>                         Generic USB audio Rear at usb-0000:00:14.0-2.2, high speed
>>    2 [FRONT          ]: USB-Audio - USB audio FRONT
>>                         Generic USB audio FRONT at usb-0000:00:14.0-2.1, high speed
>>
>> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# alsaucm --version
>> alsaucm: version 1.2.2
>>
>> root@Latitude-5410:/usr/share/alsa/ucm2/USB-Audio# lsusb
>> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
>> Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>> Bus 002 Device 002: ID 8564:4000 Transcend Information, Inc. RDF8
>> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
>> Bus 001 Device 003: ID 0a5c:5842 Broadcom Corp. 58200
>> Bus 001 Device 002: ID 0bda:5532 Realtek Semiconductor Corp. Integrated_Webcam_HD
>> Bus 001 Device 008: ID 04f3:0235 Elan Microelectronics Corp. Optical Mouse
>> Bus 001 Device 007: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
>> Bus 001 Device 006: ID 0bda:4c55 Realtek Semiconductor Corp. USB2.0 Hub
>> Bus 001 Device 009: ID 0bda:4c54 Realtek Semiconductor Corp.
>>
>> May I ask you to give me some suggestions?
> Looks like the alsa-lib in the ubuntu 20.04 doesn't support it.

I cannot comment specific distribution packages. It seems that alsa-lib-1.2.2 
in Ubuntu has many later UCM upstream changes, but I cannot verify, if it's 
enough for this file. I would recommend to use upstream alsa-lib and 
alsa-ucm-conf 1.2.5 or later (from the repository) for tests.

Also, please, create an issue or pull request on github for this problem:

   https://github.com/alsa-project/alsa-ucm-conf/issues

We can resolve it there.

					Jaroslav
diff mbox series

Patch

diff --git a/sound/usb/card.c b/sound/usb/card.c
index 1764b9302d46..9c67ecbe710e 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -398,6 +398,10 @@  static const struct usb_audio_device_name usb_audio_names[] = {
 	PROFILE_NAME(0x0bda, 0x4014, "Dell", "WD15 Dock", "Dell-WD15-Dock"),
 	/* Dell WD19 Dock */
 	PROFILE_NAME(0x0bda, 0x402e, "Dell", "WD19 Dock", "Dell-WD15-Dock"),
+	/* Dell Desktop - Front */
+	PROFILE_NAME(0x0bda, 0x4c54, "Dell", "Desktop", "Dell-Desktop-Front"),
+	/* Dell Desktop - Rear */
+	PROFILE_NAME(0x0bda, 0x4c55, "Dell", "Desktop", "Dell-Desktop-Rear"),
 
 	DEVICE_NAME(0x0ccd, 0x0028, "TerraTec", "Aureon5.1MkII"),