SB Live! 24-Bit External: remote control support
Hi!
Attached patch contains support for 'SB Live! 24-Bit External' remote and little clean up of remote control code.
Raimonds Cicans
alsa-kernel/usb/usbmixer.c renamed from alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c +44 -29
@@ -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 )
Quoted 1 line · Raimonds Cicans
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
Quoted 4 lines · Clemens Ladisch
Quoted 1 line · Raimonds Cicans
Attached patch contains support for 'SB Live! 24-Bit External' remote
It seems the codes are not compatible with the Extigy/Audigy2NX.
Yes
Quoted 2 lines
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.
Quoted 1 line
Please provide a Signed-off-by line.
In attached file
Raimonds Cicans
Support for 'SB Live! 24-Bit External' remote
alsa-kernel/usb/usbmixer.c renamed from alsa-driver-1.0.11/alsa-kernel/usb/usbmixer.c +44 -29
@@ -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 )
Clemens Ladisch
AppliedQuoted 1 line · Raimonds Cicans
Quoted 1 line
Quoted 1 line
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
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: SB Live! 24-Bit External: remote control support : more details
(please don't top-post)
Quoted 8 lines · vitton.laforest
Clemens Ladisch a e'crit:
Quoted 7 lines
Quoted 5 lines · jpv
Impossible to get the remote control working with my Live 24 external even with the patch.
No device corresponding to the remote control.
and nothing in/proc/asound/hwdep
Quoted 8 lines
Quoted 1 line
What are the contents of
/proc/asound/cards?0 [External ]: USB-Audio - SB Live! 24-bit External
Creative Technology SB Live! 24-bit External at usb-0000:00:02.3-3, full speed 1 [SI7012 ]: ICH - SiS SI7012 SiS SI7012 with CMI9738 at 0xdc00, irq 10 2 [ALS4000 ]: ALS4000 - Avance Logic ALS4000 Avance Logic ALS4000 at 0xd400, irq 11
So the driver is loaded correctly.
What is the output of lsusb?
Did you unload and reload all sound modules after patching and recompiling the driver?
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
Re: SB Live! 24-Bit External: remote control support : more details
Dear all
1) The problem is fixed as i was loading the wrong snd-usb-audio (sorry) : the one coming with the kernel and not the one with the patch (sorry again). Now it works , thanks !!!
2) Then i had problems with lirc, as i have to define a new lircd.conf with my RM1500 remote control, the one delivered with lirc was not working. I did it using irrecord and at the moment defined only few buttons
I have attached the file for those who would be interested. It works with mplayer ( at least vol + and vol-) . I will complete and distribute it in few days.
3) the last problem i have is for recording with the live 24!! but i will post a new mail best regards
JP
#
# this config file was automatically generated # using lirc-0.6.6(serial) on Mon Jan 12 17:28:59 2004 # # contributed by: Michael Plugge <[email protected]> # # brand: Creative # model no. of remote control: RM-1500 # devices being controlled by this remote: Audigy 2 NX # # This remote comes with the SoundBlaster Audigy 2 NX USB sound card. This file # was created using a home brew serial receiver. I am not sure if the IR # reciever that is built into the Audigy 2 NX will work. #
# Please make this file available to others
# by sending it to <[email protected]> # # this config file was automatically generated # using lirc-0.8.0(alsa_usb) on Mon May 8 18:38:35 2006 # # contributed by # # brand: toto # model no. of remote control: # devices being controlled by this remote: #
begin remote
name toto
bits 8
eps 30
aeps 100
one 0 0
zero 0 0
gap 315848min_repeat 1toggle_bit 0
begin codes
vol- 0x9C
vol+ 0x9D
mute 0x91
up 0x84
down 0x72
next 0x8A
prev 0x78
end codes
end remote
Clemens Ladisch a e'crit:
Quoted 44 lines
(please don't top-post)
Quoted 16 lines · vitton.laforest
Clemens Ladisch a e'crit:
Quoted 13 lines
Quoted 7 lines · jpv
Impossible to get the remote control working with my Live 24 external even with the patch.
No device corresponding to the remote control.
and nothing in/proc/asound/hwdepWhat are the contents of
/proc/asound/cards?Quoted 8 lines
0 [External ]: USB-Audio - SB Live! 24-bit External
Creative Technology SB Live! 24-bit External at usb-0000:00:02.3-3, full speed 1 [SI7012 ]: ICH - SiS SI7012 SiS SI7012 with CMI9738 at 0xdc00, irq 10 2 [ALS4000 ]: ALS4000 - Avance Logic ALS4000 Avance Logic ALS4000 at 0xd400, irq 11So the driver is loaded correctly.
What is the output of lsusb?
Did you unload and reload all sound modules after patching and recompiling the driver?
Regards,
Clemens
Quoted 7 lines · Raimonds Cicans
Quoted 4 lines · Clemens Ladisch
Quoted 1 line · Raimonds Cicans
Attached patch contains support for 'SB Live! 24-Bit External' remote
It seems the codes are not compatible with the Extigy/Audigy2NX.
Yes
Quoted 8 lines
Quoted 2 lines
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.Quoted 1 line
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
At Tue, 09 May 2006 17:20:29 -0400,
Quoted 11 lines · Lee Revell
Quoted 9 lines · Raimonds Cicans
Quoted 4 lines · Clemens Ladisch
Quoted 1 line · Raimonds Cicans
Attached patch contains support for 'SB Live! 24-Bit External' remote
It seems the codes are not compatible with the Extigy/Audigy2NX.
Yes
Quoted 2 lines
Are the lower 8 bits unique, or does the LIRC driver need to be updated to read 32 bit codes?
Quoted 8 lines
Quoted 6 lines
Unique.
But I plan to send patch to LIRC to support 32bit codes, because IMHO it may be useful for other remotes.Quoted 1 line
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
Quoted 4 lines · Lee Revell
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · Raimonds Cicans
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
Quoted 7 lines · Clemens Ladisch
Quoted 4 lines · Lee Revell
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · Raimonds Cicans
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
At Wed, 10 May 2006 12:54:50 -0400,
Quoted 11 lines · Lee Revell
Quoted 7 lines · Clemens Ladisch
Quoted 4 lines · Lee Revell
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · Raimonds Cicans
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