Commit b9c196e1 authored by Phillip Michael Jordan's avatar Phillip Michael Jordan Committed by Jaroslav Kysela

ALSA: snd_usb_audio: fix SB Extigy IR Remote regression

The support for the SB Extigy's remote seems to be broken in all
recent ALSA versions, including 1.0.17. The driver detects the event
correctly, then submits a URB to query the RC code. On the Extigy, the
URB is submitted with a length of 2 bytes. My hardware, however, only
replies with 1 byte, containing the correct RC button code. The
current implementation discards this as being too short. (line 1784 of
usbmixer.c)

This patch specifies a "minimum packet length" in the remote control
configuration. I've left the values for the Audigy 2/Live! the same as
the packet length, as I'm assuming the existing code works with them.
(I don't have the hardware to confirm) This fixes the Extigy RC
support, e.g. for use with Lirc.
Signed-off-by: default avatarPhillip Michael Jordan <phil@philjordan.eu>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 0e0e16a8
...@@ -59,12 +59,13 @@ static const struct rc_config { ...@@ -59,12 +59,13 @@ static const struct rc_config {
u8 offset; u8 offset;
u8 length; u8 length;
u8 packet_length; u8 packet_length;
u8 min_packet_length; /* minimum accepted length of the URB result */
u8 mute_mixer_id; u8 mute_mixer_id;
u32 mute_code; u32 mute_code;
} rc_configs[] = { } rc_configs[] = {
{ USB_ID(0x041e, 0x3000), 0, 1, 2, 18, 0x0013 }, /* Extigy */ { USB_ID(0x041e, 0x3000), 0, 1, 2, 1, 18, 0x0013 }, /* Extigy */
{ USB_ID(0x041e, 0x3020), 2, 1, 6, 18, 0x0013 }, /* Audigy 2 NX */ { USB_ID(0x041e, 0x3020), 2, 1, 6, 6, 18, 0x0013 }, /* Audigy 2 NX */
{ USB_ID(0x041e, 0x3040), 2, 2, 6, 2, 0x6e91 }, /* Live! 24-bit */ { USB_ID(0x041e, 0x3040), 2, 2, 6, 6, 2, 0x6e91 }, /* Live! 24-bit */
}; };
struct usb_mixer_interface { struct usb_mixer_interface {
...@@ -1781,7 +1782,7 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb) ...@@ -1781,7 +1782,7 @@ static void snd_usb_soundblaster_remote_complete(struct urb *urb)
const struct rc_config *rc = mixer->rc_cfg; const struct rc_config *rc = mixer->rc_cfg;
u32 code; u32 code;
if (urb->status < 0 || urb->actual_length < rc->packet_length) if (urb->status < 0 || urb->actual_length < rc->min_packet_length)
return; return;
code = mixer->rc_buffer[rc->offset]; code = mixer->rc_buffer[rc->offset];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment