* SB Live! 24-Bit External: remote control support
@ 2006-04-27 20:27 Raimonds Cicans
2006-04-28 8:42 ` Clemens Ladisch
0 siblings, 1 reply; 11+ messages in thread
From: Raimonds Cicans @ 2006-04-27 20:27 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 137 bytes --]
Hi!
Attached patch contains support for 'SB Live! 24-Bit External' remote
and little clean up of remote control code.
Raimonds Cicans
[-- Attachment #2: sb_live24_usb_remote.patch --]
[-- Type: text/x-patch, Size: 3178 bytes --]
--- old/alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c 2006-03-28 18:58:28.000000000 +0300
+++ alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c 2006-04-27 22:33:53.000000000 +0300
@@ -46,6 +46,28 @@
/* ignore error from controls - for debugging */
/* #define IGNORE_CTL_ERROR */
+/*
+ * Sound Blaster remote control configuration
+ *
+ * format of remote control data:
+ * Extigy: xx 00
+ * Audigy 2 NX: 06 80 xx 00 00 00
+ * Live! 24-bit: 06 80 xx yy 22 83
+ */
+static const struct rc_config {
+ u32 usb_id;
+ u8 offset;
+ u8 len;
+ u8 pkt_min_len; /* offset + len */
+ u8 pkt_max_len;
+ u32 mute_code;
+ u8 mute_mixer_id;
+} rc_configs[] = {
+ {USB_ID(0x041e, 0x3000), 0, 1, 1, 2, 0x0013, 18}, /* Extigy */
+ {USB_ID(0x041e, 0x3020), 2, 1, 3, 6, 0x0013, 18}, /* Audigy 2 NX */
+ {USB_ID(0x041e, 0x3040), 2, 2, 4, 6, 0x6e91, 2}, /* Live! 24-bit */
+ {0}}; /* Terminator */
+
struct usb_mixer_interface {
struct snd_usb_audio *chip;
unsigned int ctrlif;
@@ -55,11 +77,7 @@
struct usb_mixer_elem_info **id_elems; /* array[256], indexed by unit id */
/* Sound Blaster remote control stuff */
- enum {
- RC_NONE,
- RC_EXTIGY,
- RC_AUDIGY2NX,
- } rc_type;
+ const struct rc_config *rc_cfg;
unsigned long rc_hwdep_open;
u32 rc_code;
wait_queue_head_t rc_waitq;
@@ -1647,7 +1665,7 @@
static void snd_usb_mixer_memory_change(struct usb_mixer_interface *mixer,
int unitid)
{
- if (mixer->rc_type == RC_NONE)
+ if (mixer->rc_cfg == NULL)
return;
/* unit ids specific to Extigy/Audigy 2 NX: */
switch (unitid) {
@@ -1732,20 +1750,20 @@
struct pt_regs *regs)
{
struct usb_mixer_interface *mixer = urb->context;
- /*
- * format of remote control data:
- * Extigy: xx 00
- * Audigy 2 NX: 06 80 xx 00 00 00
- */
- int offset = mixer->rc_type == RC_EXTIGY ? 0 : 2;
+ const struct rc_config *rc = mixer->rc_cfg;
u32 code;
- if (urb->status < 0 || urb->actual_length <= offset)
+ if (urb->status < 0 || urb->actual_length < rc->pkt_min_len)
return;
- code = mixer->rc_buffer[offset];
+
+ code = mixer->rc_buffer[rc->offset];
+
+ if (rc->len == 2)
+ code |= ((u32)(mixer->rc_buffer[rc->offset + 1]))<<8;
+
/* the Mute button actually changes the mixer control */
- if (code == 13)
- snd_usb_mixer_notify_id(mixer, 18);
+ if (code == rc->mute_code)
+ snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id);
mixer->rc_code = code;
wmb();
wake_up(&mixer->rc_waitq);
@@ -1801,21 +1819,18 @@
static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
{
struct snd_hwdep *hwdep;
- int err, len;
+ int err, len, i;
- switch (mixer->chip->usb_id) {
- case USB_ID(0x041e, 0x3000):
- mixer->rc_type = RC_EXTIGY;
- len = 2;
- break;
- case USB_ID(0x041e, 0x3020):
- mixer->rc_type = RC_AUDIGY2NX;
- len = 6;
- break;
- default:
- return 0;
- }
+ mixer->rc_cfg = NULL;
+ for (i = 0; rc_configs[i].usb_id != mixer->chip->usb_id; i++)
+ if (rc_configs[i].usb_id == 0)
+ return 0;
+
+ mixer->rc_cfg = &rc_configs[i];
+
+ len = mixer->rc_cfg->pkt_max_len;
+
init_waitqueue_head(&mixer->rc_waitq);
err = snd_hwdep_new(mixer->chip->card, "SB remote control", 0, &hwdep);
if (err < 0)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: SB Live! 24-Bit External: remote control support
2006-04-27 20:27 SB Live! 24-Bit External: remote control support Raimonds Cicans
@ 2006-04-28 8:42 ` Clemens Ladisch
2006-04-28 9:52 ` Raimonds Cicans
0 siblings, 1 reply; 11+ messages in thread
From: Clemens Ladisch @ 2006-04-28 8:42 UTC (permalink / raw)
To: Raimonds Cicans; +Cc: alsa-devel
Raimonds Cicans wrote:
> Attached patch contains support for 'SB Live! 24-Bit External' remote
It seems the codes are not compatible with the Extigy/Audigy2NX.
Are the lower 8 bits unique, or does the LIRC driver need to be updated
to read 32 bit codes?
Please provide a Signed-off-by line.
Regards,
Clemens
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SB Live! 24-Bit External: remote control support
2006-04-28 8:42 ` Clemens Ladisch
@ 2006-04-28 9:52 ` Raimonds Cicans
2006-05-05 7:51 ` Clemens Ladisch
2006-05-09 21:20 ` SB Live! 24-Bit External: remote control support Lee Revell
0 siblings, 2 replies; 11+ messages in thread
From: Raimonds Cicans @ 2006-04-28 9:52 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
[-- Attachment #1: Type: text/plain, Size: 481 bytes --]
Clemens Ladisch wrote:
> Raimonds Cicans wrote:
>>Attached patch contains support for 'SB Live! 24-Bit External' remote
>
> It seems the codes are not compatible with the Extigy/Audigy2NX.
Yes
> Are the lower 8 bits unique, or does the LIRC driver need to be updated
> to read 32 bit codes?
Unique.
But I plan to send patch to LIRC to support 32bit codes,
because IMHO it may be useful for other remotes.
> Please provide a Signed-off-by line.
In attached file
Raimonds Cicans
[-- Attachment #2: sb_live24_usb_remote.patch --]
[-- Type: text/x-patch, Size: 3272 bytes --]
Support for 'SB Live! 24-Bit External' remote
Signed-off-by: Raimonds Cicans <ray@vardes.lv>
--- old/alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c 2006-03-28 18:58:28.000000000 +0300
+++ alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c 2006-04-27 22:33:53.000000000 +0300
@@ -46,6 +46,28 @@
/* ignore error from controls - for debugging */
/* #define IGNORE_CTL_ERROR */
+/*
+ * Sound Blaster remote control configuration
+ *
+ * format of remote control data:
+ * Extigy: xx 00
+ * Audigy 2 NX: 06 80 xx 00 00 00
+ * Live! 24-bit: 06 80 xx yy 22 83
+ */
+static const struct rc_config {
+ u32 usb_id;
+ u8 offset;
+ u8 len;
+ u8 pkt_min_len; /* offset + len */
+ u8 pkt_max_len;
+ u32 mute_code;
+ u8 mute_mixer_id;
+} rc_configs[] = {
+ {USB_ID(0x041e, 0x3000), 0, 1, 1, 2, 0x0013, 18}, /* Extigy */
+ {USB_ID(0x041e, 0x3020), 2, 1, 3, 6, 0x0013, 18}, /* Audigy 2 NX */
+ {USB_ID(0x041e, 0x3040), 2, 2, 4, 6, 0x6e91, 2}, /* Live! 24-bit */
+ {0}}; /* Terminator */
+
struct usb_mixer_interface {
struct snd_usb_audio *chip;
unsigned int ctrlif;
@@ -55,11 +77,7 @@
struct usb_mixer_elem_info **id_elems; /* array[256], indexed by unit id */
/* Sound Blaster remote control stuff */
- enum {
- RC_NONE,
- RC_EXTIGY,
- RC_AUDIGY2NX,
- } rc_type;
+ const struct rc_config *rc_cfg;
unsigned long rc_hwdep_open;
u32 rc_code;
wait_queue_head_t rc_waitq;
@@ -1647,7 +1665,7 @@
static void snd_usb_mixer_memory_change(struct usb_mixer_interface *mixer,
int unitid)
{
- if (mixer->rc_type == RC_NONE)
+ if (mixer->rc_cfg == NULL)
return;
/* unit ids specific to Extigy/Audigy 2 NX: */
switch (unitid) {
@@ -1732,20 +1750,20 @@
struct pt_regs *regs)
{
struct usb_mixer_interface *mixer = urb->context;
- /*
- * format of remote control data:
- * Extigy: xx 00
- * Audigy 2 NX: 06 80 xx 00 00 00
- */
- int offset = mixer->rc_type == RC_EXTIGY ? 0 : 2;
+ const struct rc_config *rc = mixer->rc_cfg;
u32 code;
- if (urb->status < 0 || urb->actual_length <= offset)
+ if (urb->status < 0 || urb->actual_length < rc->pkt_min_len)
return;
- code = mixer->rc_buffer[offset];
+
+ code = mixer->rc_buffer[rc->offset];
+
+ if (rc->len == 2)
+ code |= ((u32)(mixer->rc_buffer[rc->offset + 1]))<<8;
+
/* the Mute button actually changes the mixer control */
- if (code == 13)
- snd_usb_mixer_notify_id(mixer, 18);
+ if (code == rc->mute_code)
+ snd_usb_mixer_notify_id(mixer, rc->mute_mixer_id);
mixer->rc_code = code;
wmb();
wake_up(&mixer->rc_waitq);
@@ -1801,21 +1819,18 @@
static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
{
struct snd_hwdep *hwdep;
- int err, len;
+ int err, len, i;
- switch (mixer->chip->usb_id) {
- case USB_ID(0x041e, 0x3000):
- mixer->rc_type = RC_EXTIGY;
- len = 2;
- break;
- case USB_ID(0x041e, 0x3020):
- mixer->rc_type = RC_AUDIGY2NX;
- len = 6;
- break;
- default:
- return 0;
- }
+ mixer->rc_cfg = NULL;
+ for (i = 0; rc_configs[i].usb_id != mixer->chip->usb_id; i++)
+ if (rc_configs[i].usb_id == 0)
+ return 0;
+
+ mixer->rc_cfg = &rc_configs[i];
+
+ len = mixer->rc_cfg->pkt_max_len;
+
init_waitqueue_head(&mixer->rc_waitq);
err = snd_hwdep_new(mixer->chip->card, "SB remote control", 0, &hwdep);
if (err < 0)
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: SB Live! 24-Bit External: remote control support
2006-04-28 9:52 ` Raimonds Cicans
@ 2006-05-05 7:51 ` Clemens Ladisch
[not found] ` <pan.2006.05.07.23.29.22.651163@free.fr>
2006-05-09 21:20 ` SB Live! 24-Bit External: remote control support Lee Revell
1 sibling, 1 reply; 11+ messages in thread
From: Clemens Ladisch @ 2006-05-05 7:51 UTC (permalink / raw)
To: Raimonds Cicans; +Cc: alsa-devel
Raimonds Cicans wrote:
> >>Attached patch contains support for 'SB Live! 24-Bit External' remote
Applied, with some small changes.
Regards,
Clemens
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: SB Live! 24-Bit External: remote control support
2006-04-28 9:52 ` Raimonds Cicans
2006-05-05 7:51 ` Clemens Ladisch
@ 2006-05-09 21:20 ` Lee Revell
2006-05-10 11:28 ` Takashi Iwai
2006-05-10 16:52 ` Clemens Ladisch
1 sibling, 2 replies; 11+ messages in thread
From: Lee Revell @ 2006-05-09 21:20 UTC (permalink / raw)
To: Raimonds Cicans; +Cc: Clemens Ladisch, alsa-devel
On Fri, 2006-04-28 at 12:52 +0300, Raimonds Cicans wrote:
> Clemens Ladisch wrote:
> > Raimonds Cicans wrote:
> >>Attached patch contains support for 'SB Live! 24-Bit External' remote
> >
> > It seems the codes are not compatible with the Extigy/Audigy2NX.
> Yes
>
> > Are the lower 8 bits unique, or does the LIRC driver need to be updated
> > to read 32 bit codes?
> Unique.
> But I plan to send patch to LIRC to support 32bit codes,
> because IMHO it may be useful for other remotes.
>
> > Please provide a Signed-off-by line.
> In attached file
Was this patch ever merged?
Lee
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SB Live! 24-Bit External: remote control support
2006-05-09 21:20 ` SB Live! 24-Bit External: remote control support Lee Revell
@ 2006-05-10 11:28 ` Takashi Iwai
2006-05-10 16:52 ` Clemens Ladisch
1 sibling, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2006-05-10 11:28 UTC (permalink / raw)
To: Lee Revell; +Cc: Raimonds Cicans, Clemens Ladisch, alsa-devel
At Tue, 09 May 2006 17:20:29 -0400,
Lee Revell wrote:
>
> On Fri, 2006-04-28 at 12:52 +0300, Raimonds Cicans wrote:
> > Clemens Ladisch wrote:
> > > Raimonds Cicans wrote:
> > >>Attached patch contains support for 'SB Live! 24-Bit External' remote
> > >
> > > It seems the codes are not compatible with the Extigy/Audigy2NX.
> > Yes
> >
> > > Are the lower 8 bits unique, or does the LIRC driver need to be updated
> > > to read 32 bit codes?
> > Unique.
> > But I plan to send patch to LIRC to support 32bit codes,
> > because IMHO it may be useful for other remotes.
> >
> > > Please provide a Signed-off-by line.
> > In attached file
>
> Was this patch ever merged?
Yes.
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SB Live! 24-Bit External: remote control support
2006-05-09 21:20 ` SB Live! 24-Bit External: remote control support Lee Revell
2006-05-10 11:28 ` Takashi Iwai
@ 2006-05-10 16:52 ` Clemens Ladisch
2006-05-10 16:54 ` Lee Revell
1 sibling, 1 reply; 11+ messages in thread
From: Clemens Ladisch @ 2006-05-10 16:52 UTC (permalink / raw)
To: Lee Revell; +Cc: alsa-devel
Lee Revell wrote:
> > > Raimonds Cicans wrote:
> > >>Attached patch contains support for 'SB Live! 24-Bit External' remote
>
> Was this patch ever merged?
Yes.
Regards,
Clemens
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SB Live! 24-Bit External: remote control support
2006-05-10 16:52 ` Clemens Ladisch
@ 2006-05-10 16:54 ` Lee Revell
2006-05-10 16:58 ` Takashi Iwai
0 siblings, 1 reply; 11+ messages in thread
From: Lee Revell @ 2006-05-10 16:54 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
On Wed, 2006-05-10 at 18:52 +0200, Clemens Ladisch wrote:
> Lee Revell wrote:
> > > > Raimonds Cicans wrote:
> > > >>Attached patch contains support for 'SB Live! 24-Bit External' remote
> >
> > Was this patch ever merged?
>
> Yes.
Thanks, and sorry for the noise - I was missing some alsa-devel mail.
Lee
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SB Live! 24-Bit External: remote control support
2006-05-10 16:54 ` Lee Revell
@ 2006-05-10 16:58 ` Takashi Iwai
0 siblings, 0 replies; 11+ messages in thread
From: Takashi Iwai @ 2006-05-10 16:58 UTC (permalink / raw)
To: Lee Revell; +Cc: Clemens Ladisch, alsa-devel
At Wed, 10 May 2006 12:54:50 -0400,
Lee Revell wrote:
>
> On Wed, 2006-05-10 at 18:52 +0200, Clemens Ladisch wrote:
> > Lee Revell wrote:
> > > > > Raimonds Cicans wrote:
> > > > >>Attached patch contains support for 'SB Live! 24-Bit External' remote
> > >
> > > Was this patch ever merged?
> >
> > Yes.
>
> Thanks, and sorry for the noise - I was missing some alsa-devel mail.
It wasn't notified on alsa-devel, IIRC, but you can see the change in
alsa-cvs ML.
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-05-10 16:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 20:27 SB Live! 24-Bit External: remote control support Raimonds Cicans
2006-04-28 8:42 ` Clemens Ladisch
2006-04-28 9:52 ` Raimonds Cicans
2006-05-05 7:51 ` Clemens Ladisch
[not found] ` <pan.2006.05.07.23.29.22.651163@free.fr>
[not found] ` <20060508071454.GC11272@turing.informatik.uni-halle.de>
[not found] ` <445F052D.5020102@free.fr>
2006-05-08 11:48 ` SB Live! 24-Bit External: remote control support : more details Clemens Ladisch
2006-05-08 17:17 ` vitton.laforest
2006-05-09 21:20 ` SB Live! 24-Bit External: remote control support Lee Revell
2006-05-10 11:28 ` Takashi Iwai
2006-05-10 16:52 ` Clemens Ladisch
2006-05-10 16:54 ` Lee Revell
2006-05-10 16:58 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.