SB Live24bit: Adds support for SPDIF in.
PATCH 1/1 SB Live24bit: Adds support for SPDIF in.
This patch against the current CVS adds SPDIF capture for the SB Live 24bit. It works with the optional external Digital I/O module for the SB Live 24bit.
Analogue capture is not yet possible, and I have no idea when it will be implemented, as the datasheets I have don't help at all.
James
Index: alsa-driver/pci/ca0106/ca0106.h
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/ca0106/ca0106.h,v retrieving revision 1.1
pci/ca0106/ca0106.h +3 -3
@@ -388,7 +388,7 @@* Host Right volume [23:16] * Host Left volume [31:24] */ -#define CAPTURE_ROUTING1 0x67/* Playback Routing. Default 0x32765410 */ +#define CAPTURE_ROUTING1 0x67/* Capture Routing. Default 0x32765410 */ /* Similar to register 0x63, except that the destination is the I2S mixer instead of the SPDIF mixer. I.E. Outputs to the Analog outputs instead of SPDIF. */ #define CAPTURE_ROUTING2 0x68/* Unknown Routing. Default 0x76767676 */ /* Similar to register 0x64, except that the destination is the I2S mixer instead of the SPDIF mixer. I.E. Outputs to the Analog outputs instead of SPDIF. */
@@ -526,8 +526,8 @@ac97_t *ac97;snd_pcm_t *pcm; -ca0106_channel_t channels[4 ]; -ca0106_channel_t capture_channel; +ca0106_channel_t playback_channels[4 ]; +ca0106_channel_t capture_channels[4 ];u32 spdif_bits[4 ];/* s/pdif out setup */ int spdif_enable;int capture_source;
Index: alsa-driver/pci/ca0106/ca0106_main.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/ca0106/ca0106_main.c,v retrieving revision 1.1
pci/ca0106/ca0106_main.c +81 -20
187 lines not on this page · raw message
Index: alsa-driver/pci/ca0106/ca0106_mixer.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/ca0106/ca0106_mixer.c,v retrieving revision 1.1
pci/ca0106/ca0106_mixer.c +4 -4
@@ -134,13 +134,13 @@static int snd_ca0106_capture_source_info (snd_kcontrol_t *kcontrol,snd_ctl_elem_info_t * uinfo) { -static char *texts[4 ] = {"SPDIF" ,"What U Hear" ,"Unknown" ,"AC97" }; +static char *texts[6 ] = {"SPDIF out" ,"i2s mixer out" ,"SPDIF in" ,"i2s in" ,"AC97 in" ,"SRC out" }; uinfo->type =SNDRV_CTL_ELEM_TYPE_ENUMERATED ; uinfo->count =1 ; - uinfo->value.enumerated.items =4 ; -if (uinfo->value.enumerated.item >3 ) - uinfo->value.enumerated.item =3 ; + uinfo->value.enumerated.items =6 ; +if (uinfo->value.enumerated.item >5 ) + uinfo->value.enumerated.item =5 ;strcpy (uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);return 0 ; }
Index: alsa-driver/pci/ca0106/ca0106_proc.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/ca0106/ca0106_proc.c,v retrieving revision 1.1
pci/ca0106/ca0106_proc.c +224 -2
253 lines not on this page · raw message
At Sun, 19 Dec 2004 21:02:11 +0000,
pci/ca0106/ca0106_main.c line 384
Quoted 6 lines · James Courtier-Dutton
pci/ca0106/ca0106_main.c +1
-1-static int snd_ca0106_pcm_open_capture (snd_pcm_substream_t *substream) +static int snd_ca0106_pcm_open_0_capture (snd_pcm_substream_t *substream) {return snd_ca0106_pcm_open_capture_channel (substream,0 ); }
You can retrieve substream->pcm->device instead of creating a callback for each device. (Or, substream->number if the pcm has multiple substreams and you need to distinguish them.)
Other stuff looks fine to me.
Oh one thing forgotten: could you provide signed-off-by line, too?
thanks,
Takashi
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/