[alsa-devel] S51 usb support

Mandar Joshi emailmandar at gmail.com
Wed Oct 20 22:30:12 CEST 2010

> 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.

Daniel, you are right, Its the driver thing.
Feb 2009, I was dealing this the same issue and
James Courtier-Dutton from this list pointed out that the device has no
hardware based mixer controls which is why alsamixer does not find anything.
He suggested using SoftVol.

I've been using dmix and Softvol for volume control whenever I need it.
This is the ~/.asoundrc I use http://mndar.phpnet.us/usbxfi/files/asoundrc.log

The device has a volume knob. I had left the issue of the volume knob
alone until a few days back..

I was about the post this when I came across the query from Matti Picus.

This is how it works.
The volume knob sends an interrupt via endpoint 0x83 containing 0xC0
0x00 whenever it is
rotated clockwise,anti-clockwise or pressed.
After this a control message is sent to the device to retrieve which
of the 3 actions it was.
The control packet sent is 0xa1 0x85 0x00 0x00 0x00 0x00 0x04 0x00
We get a 1 byte response.
0x0F for anti-clockwise rotation. 0x0D for press and 0x10 for
clockwise rotation.

I've tested this using a simple kernel module to handle just the
volume knob and it works fine.
The quick little code I've written does the above, then sets a sysfs
attribute and sends a kobject_uevent.
Udev rules execute a command depending on the value of this sysfs
attribute. (Having some issues here but anyway...)

Since the volume is entirely a software thing, I figure this might be
a good way of letting userspace know about the volume knob.
Using softvol we can have a Master volume control and then we can use
a command like amixer in udev rules to change the volume.
Or since events are passed to HAL, something could be done there.

I do not know much about the usbaudio driver but does this seem like
something that can be done from within the usbaudio driver ?

-Mandar Joshi

More information about the Alsa-devel mailing list