Skip to contentSkip to conversation

- Audigy 1 and Audigy 2 mixer - again

PATCH In review p z oooo 3 participants 3 messages Nov 5, 2003 – Nov 7, 2003

lore
Share & tools
lore

p z oooo

author
#0 lore raw

PATCH 1/1 - Audigy 1 and Audigy 2 mixer - again

Hi,

Last evening I found way how to use Philips ADC instead of AC97 on Audigy 1.

Attached patch is tested only on Audigy 1 player (not tested on Audigy 1 Platinium, Audigy 1 Platinium EX, Audigy 2, Audigy 2 Platinium, Audigy 2 Platinium EX), but I think it should work for all Audigy 1 and Audigy 2 cards, can some one test it ???

Modification:
- disable routing from AC97 line out to front speakers.
- AC97 ADC is used only for Mic playback and recording
- Philips ADC is used for other analog playback and recording
(Analog Mix Playback Volume, Analog Mix Capture Volume)
- removes unused AC97 controls (is phone used ???)

Advantage:
- better Line In, Analog CD, Aux sound quality playback and
recording (I hope that Philips ADC is better than old AC97 ADC)
- similiar mixer as used on Windows
- simpler mixer
- you doesn't need set capture source to be able listen or record
analog sources - I think this was confusing for many users
- fixed small bug in MIC ADC buffer recording (alias device 1 - 16
bit 8000 Hz mono)

TODO:
It seems that Audigy 1 can do 24 bit/48kHz recording (and I think 24
bit /48 kHz playback too) using TRAM playback and capture. Philips ADC is connected to DSP and trasmit to DSP all 24 bit and I think that Philips DAC is connected in same way.

Peter Zubaj

====================== REKLAMA ================================= Vyrazne zlavy pocitacov a prislusenstva
Sun Fire V210 server v cenach uz od 125.000,- Sk bez DPH Navstivte nas na adrese http://www.somi.sk/sun/lowend_servery.php
================================================================

alsa-kernel/include/emu10k1.h +6 -2
diff -u -r o/alsa-kernel/include/emu10k1.h n/alsa-kernel/include/emu10k1.h
@@ -679,6 +679,9 @@
 #define A_ADCIDX		0x63
 #define A_ADCIDX_IDX		0x10000063
 
+#define A_MICIDX                0x64
+#define A_MICIDX_IDX		0x10000063
+
 #define FXIDX			0x65		/* FX recording buffer index register		*/
 #define FXIDX_MASK		0x0000ffff	/* 16-bit value					*/
 #define FXIDX_IDX		0x10000065
@@ -1201,8 +1204,8 @@
 #define A_EXTIN_OPT_SPDIF_R     0x05    /*                              right */ 
 #define A_EXTIN_LINE2_L		0x08	/* audigy drive line2/mic2 - left */
 #define A_EXTIN_LINE2_R		0x09	/*                           right */
-#define A_EXTIN_RCA_SPDIF_L     0x0a    /* audigy drive RCA SPDIF - left */
-#define A_EXTIN_RCA_SPDIF_R     0x0b    /*                          right */
+#define A_EXTIN_ADC_L		0x0a    /* Philips ADC - left */
+#define A_EXTIN_ADC_R		0x0b    /*               right */
 #define A_EXTIN_AUX2_L		0x0c	/* audigy drive aux2 - left */
 #define A_EXTIN_AUX2_R		0x0d	/*                   - right */
 
@@ -1227,6 +1230,7 @@
 #define A_EXTOUT_AC97_R		0x11	/*      right */
 #define A_EXTOUT_ADC_CAP_L	0x16	/* ADC capture buffer left */
 #define A_EXTOUT_ADC_CAP_R	0x17	/*                    right */
+#define A_EXTOUT_MIC_CAP	0x18	/* Mic capture buffer */
 
 /* Audigy constants */
 #define A_C_00000000	0xc0
alsa-kernel/pci/emu10k1/emu10k1_main.c +3 -0
diff -u -r o/alsa-kernel/pci/emu10k1/emu10k1_main.c n/alsa-kernel/pci/emu10k1/emu10k1_main.c
@@ -269,6 +269,9 @@
 			 * This has to be done after init ALice3 I2SOut beyond 48KHz.
 			 * So, sequence is important. */
 			outl(inl(emu->port + A_IOCFG) | 0x0040, emu->port + A_IOCFG);
+		} else {
+			/* Disable routing from AC97 line out to Front speakers */
+			outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
 		}
 	}
 	
alsa-kernel/pci/emu10k1/emufx.c +18 -15
diff -u -r o/alsa-kernel/pci/emu10k1/emufx.c n/alsa-kernel/pci/emu10k1/emufx.c
@@ -1308,10 +1308,10 @@
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Playback Volume", gpr, 100);
 	gpr += 2;
 
-	/* Wave Capture */
+	/* Wave (PCM) Capture */
 	A_OP(icode, &ptr, iMAC0, A_GPR(capture+0), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
 	A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Capture Volume", gpr, 0);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Capture Volume", gpr, 0);
 	gpr += 2;
 
 	/* Music Capture */
@@ -1326,17 +1326,20 @@
 #define A_ADD_VOLUME_IN(var,vol,input) \
 A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
 
-	/* AC'97 Playback Volume */
+	/* AC'97 Playback Volume - used only for mic */
 	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AC97_L);
 	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AC97_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Playback Volume", gpr, 100);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "AMic Playback Volume", gpr, 0);
 	gpr += 2;
-	/* AC'97 Capture Volume */
+	/* AC'97 Capture Volume - used only for mic */
 	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_AC97_L);
 	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AC97_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "AC97 Capture Volume", gpr, 100);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Mic Capture Volume", gpr, 0);
 	gpr += 2;
 
+	/* mic capture buffer */	
+	A_OP(icode, &ptr, iINTERP, A_EXTOUT(A_EXTOUT_MIC_CAP), A_EXTIN(A_EXTIN_AC97_L), 0xcd, A_EXTIN(A_EXTIN_AC97_R));
+
 	/* Audigy CD Playback Volume */
 	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_SPDIF_CD_L);
 	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_SPDIF_CD_R);
@@ -1370,15 +1373,15 @@
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Line2 Capture Volume", gpr, 0);
 	gpr += 2;
         
-	/* RCA SPDIF Playback Volume */
-	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_RCA_SPDIF_L);
-	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Coaxial Playback Volume", gpr, 0);
-	gpr += 2;
-	/* RCA SPDIF Capture Volume */
-	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_RCA_SPDIF_L);
-	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Coaxial Capture Volume", gpr, 0);
+	/* Philips ADC Playback Volume */
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_ADC_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Playback Volume", gpr, 0);
+	gpr += 2;
+	/* Philips ADC Capture Volume */
+	A_ADD_VOLUME_IN(capture, gpr, A_EXTIN_ADC_L);
+	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_ADC_R);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Analog Mix Capture Volume", gpr, 0);
 	gpr += 2;
 
 	/* Aux2 Playback Volume */
alsa-kernel/pci/emu10k1/emumixer.c +17 -0
diff -u -r o/alsa-kernel/pci/emu10k1/emumixer.c n/alsa-kernel/pci/emu10k1/emumixer.c
@@ -478,6 +478,22 @@
 			remove_ctl(card, "Master Playback Switch");
 			remove_ctl(card, "Master Playback Volume");
 			remove_ctl(card, "PCM Out Path & Mute");
+			remove_ctl(card, "Mono Output Select");
+			
+			/* set master volume to 0 dB */
+			snd_ac97_write(&ac97, AC97_MASTER, 0x0202);
+			/* set capture source to mic */
+			snd_ac97_write(&ac97, AC97_REC_SEL, 0x0000);
+			
+			/* remove unuset AC97 capture controls */
+			remove_ctl(card, "Capture Source");
+			remove_ctl(card, "Capture Switch");
+			remove_ctl(card, "Capture Volume");
+			remove_ctl(card, "Mic Select");
+			remove_ctl(card, "Video Playback Switch");
+			remove_ctl(card, "Video Playback Volume");
+			remove_ctl(card, "Mic Playback Switch");
+			remove_ctl(card, "Mic Playback Volume");
 		}
 	} else {
 		if (emu->APS)
@@ -493,6 +509,7 @@
 		rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
 		/* rename_ctl(card, "Wave Capture Volume", "PCM Capture Volume"); */
 		rename_ctl(card, "Wave Master Playback Volume", "Master Playback Volume");
+		rename_ctl(card, "AMic Playback Volume", "Mic Playback Volume");
 	}
 
 	if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
alsa-kernel/pci/emu10k1/emupcm.c +1 -1
diff -u -r o/alsa-kernel/pci/emu10k1/emupcm.c n/alsa-kernel/pci/emu10k1/emupcm.c
@@ -871,7 +871,7 @@
 	epcm->capture_inte = INTE_MICBUFENABLE;
 	epcm->capture_ba_reg = MICBA;
 	epcm->capture_bs_reg = MICBS;
-	epcm->capture_idx_reg = MICIDX;
+	epcm->capture_idx_reg = emu->audigy ? A_MICIDX : MICIDX;
 	substream->runtime->private_data = epcm;
 	substream->runtime->private_free = snd_emu10k1_pcm_free_substream;
 	runtime->hw = snd_emu10k1_capture;
#1 lore raw
Quoted 23 lines · p z oooo

Hi,

Last evening I found way how to use Philips ADC instead of AC97 on Audigy 1.

Attached patch is tested only on Audigy 1 player (not tested on Audigy 1 Platinium, Audigy 1 Platinium EX, Audigy 2, Audigy 2 Platinium, Audigy 2 Platinium EX), but I think it should work for all Audigy 1 and Audigy 2 cards, can some one test it ???

Modification:
- disable routing from AC97 line out to front speakers.
- AC97 ADC is used only for Mic playback and recording
- Philips ADC is used for other analog playback and recording
(Analog Mix Playback Volume, Analog Mix Capture Volume)
- removes unused AC97 controls (is phone used ???)

Advantage:
- better Line In, Analog CD, Aux sound quality playback and
recording (I hope that Philips ADC is better than old AC97 ADC)
- similiar mixer as used on Windows
- simpler mixer
- you doesn't need set capture source to be able listen or record
analog sources - I think this was confusing for many users
- fixed small bug in MIC ADC buffer recording (alias device 1 - 16
bit 8000 Hz mono)

Quoted 6 lines

TODO:
It seems that Audigy 1 can do 24 bit/48kHz recording (and I think 24
bit /48 kHz playback too) using TRAM playback and capture. Philips ADC is connected to DSP and trasmit to DSP all 24 bit and I think that Philips DAC is connected in same way.

Peter Zubaj

Here is a web page with some nice pictures of the chips on the Audigy1
http://board.gabara.co.kr/Board/Read.php?tName=b_goods_ps&number=373
Do you have that ^ card ?

I have an Audigy2 non-platinum, and it has the Philips 1361T Chip.
http://www.semiconductors.philips.com/pip/UDA1361TS_N1.html#datasheet
It looks to me to be an ADC for 2 channels. (Left and Right)
As it is an ADC, I don't see how it can help playback. It probably handles the Line-in jack, which currently does not work with alsa.

There is another Chip on my Audigy2 which is a Cirrus Logic CS4382-K
http://www.cirrus.com/en/products/pro/detail/P282.html
That is a 8-channel DAC so it would handle Playback, but strangely, the card only has 7-channel output (2 stereo jacks, and 1 3-channel jack). There are also some OP-AMPs
3x ST 4558C chips dual opamp
1x JRC 4556A chip dual opamp
1x ST 33078 / Z250 dual opamp

The AC97 chip is a Sigmatel STAC9721T
http://www.alsa-project.org/alsa/ftp/datasheets/sigmatel/9721spec.PDF

The main Audigy2 chip is Creative Audigy2 CA0102-IAT

It also has a Serial EEPROM: CSI 93C46S

It also has an as yet unidentied creative chip: NO302 CA0151-DBS

Does anyone have a Pin-Out details of the CA0102 and CA0151 ?

Cheers
James

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/

#2 lore raw
In reply to p z oooo

At Wed, 5 Nov 2003 08:01:54 +0100,

Quoted 10 lines · p z oooo

Hi,

Last evening I found way how to use Philips ADC instead of AC97 on Audigy 1.

Attached patch is tested only on Audigy 1 player (not tested on Audigy 1 Platinium, Audigy 1 Platinium EX, Audigy 2, Audigy 2 Platinium, Audigy 2 Platinium EX), but I think it should work for all Audigy 1 and Audigy 2 cards, can some one test it ???

thanks, nice work.

i had to modify a bit (and fixed typos :) for the latest cvs, but basically i merged all your changes. now it's on cvs.

ciao,

Takashi

-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003, 16-19 November in Las Vegas. Learn firsthand the latest developments in Apache, PHP, Perl, XML, Java, MySQL, WebDAV, and more! http://www.apachecon.com/