[alsa-devel] focusrite scarlett 18i20 : Mixer controls with corrupted names for

Stefan Sauer ensonic at hora-obscura.de
Sat Jun 22 22:55:25 CEST 2019


Hi,

when I run
amixer -D hw:4 controls | sort -n -t = -k2

I get the output below

numid=1,iface=MIXER,name='KKKKKKKKKKKKKÃÃÃÃÃÃÃÃÃÃÃ Switch'
numid=2,iface=CARD,name='Internal Validity'
numid=3,iface=CARD,name='S/PDIF Validity'
numid=4,iface=CARD,name='ADAT Validity'
numid=5,iface=MIXER,name='Scarlett 18i20 USB-Sync Clock Source'
numid=6,iface=MIXER,name=' Switch'
numid=7,iface=CARD,name='Keep Interface'
numid=8,iface=MIXER,name='Master Playback Switch'
numid=9,iface=MIXER,name='Master Playback Volume'
numid=10,iface=MIXER,name='Master 1 (Monitor) Playback Switch'
numid=11,iface=MIXER,name='Master 1 (Monitor) Playback Volume'
... lots of extra lines ...

Please note the lines for numid=1 and numid=6. The first one contains some
garbage and the 2nd one look like it should start with another word.

I now added some debug printing here:
https://github.com/torvalds/linux/blob/master/sound/usb/mixer_scarlett.c#L562

and get output in dmesg:
[ 2971.642137] usb 1-2: Product: Scarlett 18i20 USB
[ 2971.642141] usb 1-2: Manufacturer: Focusrite
[ 2971.709773] new ctrl: name='Master Playback Switch', index=10, offset=1,
num=0: numid=8
[ 2971.709781] new ctrl: name='Master Playback Volume', index=10, offset=2,
num=0: numid=9
[ 2971.709788] new ctrl: name='Master 1 (Monitor) Playback Switch', index=10,
offset=1, num=1: numid=10

So the first 8 controls are added somewhere else. Looks like this is from
mixer.c and after
echo -n 'file sound/usb/mixer.c +p' >/sys/kernel/debug/dynamic_debug/control
I get
[ 4405.855432] usb 1-2: [51] PU [KKKKKKKKKKKKKÃÃÃÃÃÃÃÃÃÃÃ Switch] ch = 1, val = 0/1
[ 4405.856423] usb 1-2: [52] PU [ Switch] ch = 1, val = 0/1

I now added more debug prints into
https://github.com/torvalds/linux/blob/master/sound/usb/mixer.c#L2431
and its the code that calls snd_usb_copy_string_desc()
[ 5750.124123] usb 1-2: nameid=90, len=35
[ 5750.124157] usb 1-2: [51] PU [KKKKKKKKKKKKKÃÃÃÃÃÃÃÃÃÃÃ Switch] ch = 1, val = 0/1
[ 5750.125241] usb 1-2: nameid=82, len=1
[ 5750.125260] usb 1-2: [52] PU [ Switch] ch = 1, val = 0/1

In both cases the returned len seems wrong and the function does not seems to
copy any useful string here. snd_usb_copy_string_desc() is just a wrapper around
usb_string().

Is my hardware returning bogus data in usb descriptors? Can this be address
through some quirks table? Any other ideas?

Thanks!
Stefan


More information about the Alsa-devel mailing list