[alsa-devel] S51 usb support
![](https://secure.gravatar.com/avatar/72f994ca072df3a3d2c3db8a137790fd.jpg?s=120&d=mm&r=g)
My X-FI Surround USB card is barely usable. pulseaudio will let me control the volume levels, alsa support cannot view any volume controls.
How can I contribute to better support for this card under alsa? I would like to get to the point where amixer can control the analog input/output volume levels.
I am a capable programmer, but know very little about alsa, where should I start? Matti
![](https://secure.gravatar.com/avatar/c025ed28e9a88ed51112f53c8992efbd.jpg?s=120&d=mm&r=g)
On Sun, Oct 03, 2010 at 11:22:00PM +0200, Matti Picus wrote:
My X-FI Surround USB card is barely usable. pulseaudio will let me control the volume levels, alsa support cannot view any volume controls.
But audio streaming does work for you? I heard people reporting success with this kind of hardware.
How can I contribute to better support for this card under alsa? I would like to get to the point where amixer can control the analog input/output volume levels.
As for the volume controls, there are merely two ways how they can be implemented on USB soundcards. One is as feature unit control, and the other is a proprietary vendor specific USB request. You should start having a look at the USB descriptors the devices exports (by running "lsusb -v").
In case the card does not offer a standard way to control the volume levels, you need to trace how the Windows driver does it by sniffing the communication while performing this specific operation, either with an USB hardware analyzer, or with a piece of software. There are some projects aiming for this, but I can't give you any recommendation. Just try some of these, maybe:
http://www.google.com/search?q=windows+usb+traffic+sniffer
Once you found out how they do it in Windows, you can add device specific mixer handlers, as they exist for other hardware. Have a look at sound/usb/mixer_quirks.c.
Hope that helps,
Daniel
![](https://secure.gravatar.com/avatar/72f994ca072df3a3d2c3db8a137790fd.jpg?s=120&d=mm&r=g)
On 10/04/2010 06:41 AM, Daniel Mack wrote:
On Sun, Oct 03, 2010 at 11:22:00PM +0200, Matti Picus wrote:
My X-FI Surround USB card is barely usable. pulseaudio will let me control the volume levels, alsa support cannot view any volume controls.
But audio streaming does work for you? I heard people reporting success with this kind of hardware.
Yes, audio streaming works in aplay if I choose the hw:S51 device. I cannot find a convenient way to control the volume without firing up pavucontrol, "convenient" in this case means "for mpd run as root"
How can I contribute to better support for this card under alsa? I would like to get to the point where amixer can control the analog input/output volume levels.
As for the volume controls, there are merely two ways how they can be implemented on USB soundcards. One is as feature unit control, and the other is a proprietary vendor specific USB request. You should start having a look at the USB descriptors the devices exports (by running "lsusb -v").
OK, what should I be looking for? Here is a summary:
lsusb -v -s 002:006 |grep '(<i[^I])|(bDescriptorSubtype)|(PCM)'
idVendor 0x041e Creative Technology, Ltd idProduct 0x3042 iManufacturer 1 Creative Technology iProduct 2 SB X-Fi Surround 5.1 iSerial 3 000008NV iConfiguration 0 bDescriptorSubtype 1 (HEADER) bDescriptorSubtype 2 (INPUT_TERMINAL) iChannelNames 0 iTerminal 0 bDescriptorSubtype 3 (OUTPUT_TERMINAL) iTerminal 0 bDescriptorSubtype 2 (INPUT_TERMINAL) iChannelNames 0 iTerminal 0 bDescriptorSubtype 3 (OUTPUT_TERMINAL) iTerminal 0 bDescriptorSubtype 3 (OUTPUT_TERMINAL) iTerminal 0 bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL) bDescriptorSubtype 1 (AS_GENERAL) wFormatTag 1 PCM bDescriptorSubtype 2 (FORMAT_TYPE) bDescriptorSubtype 1 (EP_GENERAL)
In case the card does not offer a standard way to control the volume levels, you need to trace how the Windows driver does it by sniffing the communication while performing this specific operation, either with an USB hardware analyzer, or with a piece of software. There are some projects aiming for this, but I can't give you any recommendation. Just try some of these, maybe:
http://www.google.com/search?q=windows+usb+traffic+sniffer
Once you found out how they do it in Windows, you can add device specific mixer handlers, as they exist for other hardware. Have a look at sound/usb/mixer_quirks.c.
Hope that helps,
Daniel
The card must offer something close to a standard set of volume controls since pulseaudio can control the basic stereo volume sliders. I would be happy if amixer or even alsamixer would see just the analog stereo output and analog line-in input. Currently, pulseaudio can control the volume levels but alsa cannot, alsamixer simply shows no volume controls.
Any guidance you can give toward getting the volume controls recognized would be greatly appreciate. Matti
![](https://secure.gravatar.com/avatar/c025ed28e9a88ed51112f53c8992efbd.jpg?s=120&d=mm&r=g)
On Mon, Oct 04, 2010 at 10:08:56PM +0200, Matti Picus wrote:
On 10/04/2010 06:41 AM, Daniel Mack wrote:
As for the volume controls, there are merely two ways how they can be implemented on USB soundcards. One is as feature unit control, and the other is a proprietary vendor specific USB request. You should start having a look at the USB descriptors the devices exports (by running "lsusb -v").
OK, what should I be looking for? Here is a summary:
Normally, the volume would be controlled by a feature unit. Just post the whole output of 'lsusb -v' to some pastebin website and post the link.
The card must offer something close to a standard set of volume controls since pulseaudio can control the basic stereo volume sliders.
No. PulseAudio will do the volume control in software if there are no hardware controls.
I would be happy if amixer or even alsamixer would see just the analog stereo output and analog line-in input. Currently, pulseaudio can control the volume levels but alsa cannot, alsamixer simply shows no volume controls.
Yes, because the driver doesn't know about any volume controls. If you manage to implement them, PA will also use them.
Any guidance you can give toward getting the volume controls recognized would be greatly appreciate.
The best way is to sniff the USB communication when Windows sets the volume, and add controls to the Linux driver and make it do the same thing.
Daniel
![](https://secure.gravatar.com/avatar/72f994ca072df3a3d2c3db8a137790fd.jpg?s=120&d=mm&r=g)
On 10/05/2010 09:38 AM, Daniel Mack wrote:
Normally, the volume would be controlled by a feature unit. Just post the whole output of 'lsusb -v' to some pastebin website and post the link.
Any guidance you can give toward getting the volume controls recognized would be greatly appreciate.
The best way is to sniff the USB communication when Windows sets the volume
Is there an example in the alsa source tree of some of this? Matti
![](https://secure.gravatar.com/avatar/c025ed28e9a88ed51112f53c8992efbd.jpg?s=120&d=mm&r=g)
On Tue, Oct 05, 2010 at 09:11:58PM +0200, Matti Picus wrote:
On 10/05/2010 09:38 AM, Daniel Mack wrote:
Normally, the volume would be controlled by a feature unit. Just post the whole output of 'lsusb -v' to some pastebin website and post the link.
Hmm, there is no feature unit in this dump, so the volume is most probably set with an vendor-specific USB request. Unless the Windows driver does something similar than PulseAudio and handles the volume level control in software (iow, modify each sample before sending it to the hardware) rather than setting any actual hardware volume level.
Any guidance you can give toward getting the volume controls recognized would be greatly appreciate.
The best way is to sniff the USB communication when Windows sets the volume
Is there an example in the alsa source tree of some of this?
Of a sniff dump you mean? I doubt so, but once you manage to get one with any of the software tools around or with a hardware analyzer, the dump itself shouldn't be hard to understand. You just need to understand the packet layout and where they store the actual volume information.
Once you got this information, feel free to share it, so we can figure out a nice way of generating the same kind of messages from inside the kernel driver.
Daniel
participants (2)
-
Daniel Mack
-
Matti Picus