[alsa-devel] Some information about UsbPre2 UAC2 support

shal at free.fr shal at free.fr
Sat Jan 26 18:50:07 CET 2013

Hi all,

The Sound Devices USBPre2 is an UAC2 device but recognized as a UAC1 device by Linux.

I have spend some time in order to found a solution.
I have successfully setup my sound card as a UAC2 mode and I can play/record a 24/192khz without problem.

But my solution is very ugly and cannot be considered as a real solution.
Perhaps alsa developers have an idea to integrated UAC2 support for the USBPRe2 in the standard stack....

There is two distinct problems:
- The sound card recognizes Linux as a Windows OS and send a incorrect device descriptor.
- The USB stack choose the bad configuration descriptor.

More details on first problem:

For some compatibility raison, Sound device developer want only send a UAC1 configuration when the Operating system is Windows.
The used method is based on the length of the  setup packet during the device get_descriptor function.
If the length is 64, the OS is considered as Windows.
Linux have choosen also this value. 
Extract of kernel source code:
" NOTE:  If USE_NEW_SCHEME() is true we will start by issuing
  a 64-byte GET_DESCRIPTOR request.  This is what Windows does,
  so it may help with some non-standards-compliant devices."

So I have patched my kernel. In driver/usb/core/hub.c: #define GET_DESCRIPTOR_BUFSIZE 65 (instead 64)

This solve the first problem.

More details on the second problem:

Now, the USB device descriptor has two configuration descriptors :the first is a UAC1 and the second is a UAC2.
My "lsusb -v -d 0926:" can be view at: http://pastebin.com/nFTN2E04

As UAC1 is a valid configuration descriptor, the usb stack choose this configuration.

I have patched the usb_choose_configuration() function in file driver/usb/core/generic.c for overwrite the value with the good one.

That all, no other problem was detected. The Linux UAC2 stack seems to be OK with this sound card.

I joined (ugly) patches , built on linux 3.7.1.

If you have an idea about how have a standard support of UAC2 for the Sound Devices USBPRe2, I (and a lot of people) will be happy.


A thread exists on LAU : http://lists.linuxaudio.org/pipermail/linux-audio-user/2013-January/089199.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: choose_configuration.patch
Type: text/x-patch
Size: 537 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130126/00d3093f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_descriptor_bufsize.patch
Type: text/x-patch
Size: 434 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130126/00d3093f/attachment-0001.bin>

More information about the Alsa-devel mailing list