[alsa-devel] S51 usb support

Mandar Joshi emailmandar at gmail.com
Sat Oct 23 17:37:11 CEST 2010


On Fri, Oct 22, 2010 at 5:14 AM, Mandar Joshi <emailmandar at gmail.com> wrote:

> Just had to add an entry specific to USB X-Fi to mixer_quirks.c
> I tested this with alsa-driver 1.0.23. Compiled it with debug. You can
> see the received code in /var/log/messages
> 0x0F for anticlockwise rotation. 0x0D for press and 0x10 for clockwise rotation
>
> Of course since there is no hardware mixer, the volume won't change.
> This received code needs to be communicated to userspace. Any Suggestions?
>
> Here is the addition I've tested
>
> diff -rupN alsa-driver-1.0.23.orig/alsa-kernel/usb/mixer_quirks.c
> alsa-driver-1.0.23/alsa-kernel/usb/mixer_quirks.c
> --- alsa-driver-1.0.23.orig/alsa-kernel/usb/mixer_quirks.c      2010-04-16
> 11:10:10.000000000 +0000
> +++ alsa-driver-1.0.23/alsa-kernel/usb/mixer_quirks.c   2010-10-22
> 10:45:22.000000000 +0000
> @@ -61,6 +61,7 @@ static const struct rc_config {
>        { USB_ID(0x041e, 0x3020), 2, 1, 6, 6,  18, 0x0013 }, /* Audigy 2 NX  */
>        { USB_ID(0x041e, 0x3040), 2, 2, 6, 6,  2,  0x6e91 }, /* Live! 24-bit */
>        { USB_ID(0x041e, 0x3048), 2, 2, 6, 6,  2,  0x6e91 }, /* Toshiba SB0500 */
> +       { USB_ID(0x041e, 0x3042), 0, 1, 1, 1,  1,  0x000d }, /* Usb X-Fi */
>  };
>
>  static void snd_usb_soundblaster_remote_complete(struct urb *urb)
> @@ -75,7 +76,7 @@ static void snd_usb_soundblaster_remote_
>        code = mixer->rc_buffer[rc->offset];
>        if (rc->length == 2)
>                code |= mixer->rc_buffer[rc->offset + 1] << 8;
> -
> +       snd_printd(KERN_DEBUG "remote code: %02X\n",code);
>        /* the Mute button actually changes the mixer control */
>        if (code == rc->mute_code)
>                snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id);
>

This works fine with the alsa_usb driver in lirc.
The code is received is being handled by Creative USB IR receiver
devices config in /etc/lircd.conf
So just adding

{ USB_ID(0x041e, 0x3042), 0, 1, 1, 1,  1,  0x000d }, /* Usb X-Fi */

to mixer_quirks.c is enough to get the volume knob working with Lirc.

Should I submit a patch for that?

-Mandar Joshi


More information about the Alsa-devel mailing list