All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] - Audigy 1 and Audigy 2 mixer
@ 2003-10-10  6:53 p z oooo
  2003-10-10 17:10 ` Takashi Iwai
  2003-10-13 16:36 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: p z oooo @ 2003-10-10  6:53 UTC (permalink / raw)
  To: tiwai; +Cc: alsa-devel

[-- Attachment #1: Type: TEXT/plain, Size: 2791 bytes --]

Hi,

These patches make some changes to mixer on Audigy 1 and Audigy 2.

Changes:
- new FX bus allocated for Wave Stereo playback ("Wave Playback 
Volume")
- new "Master Playback Volume" control - controls output volume for 
all channels (implemented using DSP code)
- new controls "PCM Front Playback Volume", "PCM Surround Playback 
Volume", "PCM Center Playback Volume", "PCM LFE Playback Volume" for 
multi-channel (5.1) playback
- new controls "Front Playback Volume", "Surround Playback 
Volume", "Center Playback Volume", "LFE Playback Volume" - there are 
just before master volume - controls mix from PCM (5.1) and Stereo 
Mix (Stereo Wave, AC97, ...)
- new controls "Stereo Mix Front Playback Volume", "Stereo Mix 
Surround Playback Volume", "Stereo Mix Center Playback 
Volume", "Stereo Mix LFE Playback Volume" - used do control volume of 
mix from stereo sources (make mirroring to 5.1 for stereo)
Audigy 1:
- removed AC97 control "Master Volume Playback", "Master Mono Volume 
Playback", "PCM Volume Playback", "PCM Out Path & Mute" - there are 
unused
- uses Philips 6 channel DAC for all channels, WARNING: all analog 
sources are routed throught DSP (if you want listen line in you must 
set "AC97 Playback Volume" and "(" set capture on "(" "Line in" 
and "Capture" ")" or "(" capture on "Mix" and volume for "Line in" ")"
  using Philis DAC has some advantage - Same volume levels for all 
channels, I think better signal, ..)
    - analog signals can by routed to all channles
  disadvantage - all analog signals must be routed throught DSP - 
(confusing selecting analog inputs and volumes for analogs inputs)

I tested 5.1 playback, wave stereo playback midi playback and analog 
playback.
I hope I don't break something (OSS mixer, AC3 playback, optical 
input, output, coaxial input, output) - not tested.
Names are not very well choosen (some needs rename).
Maybe I can remove "Front Playback Volume", "Surround Playback 
Volume", "Center Playback Volume", "LFE Playback Volume" and use only 
controls for "PCM" and "Stereo Mix"

devices:
front - routed throught front channels of 5.1 PCM ("PCM Front" 
controls volume)
rear - routed throught rear channels of 5.1 PCM ("PCM Surround" 
controls volume)
center_lfe - routed throught center, lfe channels of 5.1 PCM ("PCM 
Center" and "PCM LFE" controls volume)
default (stereo) - routed to stereo mix ("Wave" controls volume)
Any suggestions, bugs, ...

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
================================================================

[-- Attachment #2: C:\alsa-driver.diff --]
[-- Type: APPLICATION/octet-stream, Size: 16615 bytes --]

diff -u -r o/alsa-kernel/include/emu10k1.h n/alsa-kernel/include/emu10k1.h
--- o/alsa-kernel/include/emu10k1.h	2003-08-29 11:22:27.000000000 +0200
+++ n/alsa-kernel/include/emu10k1.h	2003-10-09 21:24:40.000000000 +0200
@@ -1144,18 +1144,20 @@
 #define CC_REG_NONZERO	C_00000100
 
 /* FX buses */
-#define FXBUS_PCM_LEFT		0x00
-#define FXBUS_PCM_RIGHT		0x01
+#define FXBUS_WAVE_LEFT		0x00
+#define FXBUS_WAVE_RIGHT	0x01
 #define FXBUS_PCM_LEFT_REAR	0x02
 #define FXBUS_PCM_RIGHT_REAR	0x03
 #define FXBUS_MIDI_LEFT		0x04
 #define FXBUS_MIDI_RIGHT	0x05
 #define FXBUS_PCM_CENTER	0x06
 #define FXBUS_PCM_LFE		0x07
-#define FXBUS_PT_LEFT		20
-#define FXBUS_PT_RIGHT		21
+#define FXBUS_PCM_LEFT		0x08
+#define FXBUS_PCM_RIGHT		0x09
 #define FXBUS_MIDI_REVERB	0x0c
 #define FXBUS_MIDI_CHORUS	0x0d
+#define FXBUS_PT_LEFT		0x14
+#define FXBUS_PT_RIGHT		0x15
 
 /* Inputs */
 #define EXTIN_AC97_L	   0x00	/* AC'97 capture channel - left */
@@ -1249,8 +1251,8 @@
 #define A_C_4f1bbcdc	0xd3
 #define A_C_5a7ef9db	0xd4
 #define A_C_00100000	0xd5
-/* 0xd6 = 0x7fffffff  (?) ACCUM? */
-/* 0xd7 = 0x0000000   CCR */
+#define A_GPR_ACCU	0xd6		/* ACCUM, accumulator */
+#define A_GPR_COND	0xd7		/* CCR, condition register */
 /* 0xd8 = noise1 */
 /* 0xd9 = noise2 */
 
diff -u -r o/alsa-kernel/pci/emu10k1/emufx.c n/alsa-kernel/pci/emu10k1/emufx.c
--- o/alsa-kernel/pci/emu10k1/emufx.c	2003-09-30 15:27:21.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emufx.c	2003-10-09 20:49:38.000000000 +0200
@@ -1234,14 +1234,12 @@
  * initial DSP configuration for Audigy
  */
 
-#define A_GPR_ACCU 0xd6
-#define A_GPR_COND 0xd7
-
 static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
 {
 	int err, i, z, gpr, nctl;
 	const int playback = 10;
 	const int capture = playback + (SND_EMU10K1_PLAYBACK_CHANNELS * 2); /* we reserve 10 voices */
+	const int stereo_mix = capture + 2;
 	const int tmp = 0x88;
 	u32 ptr;
 	emu10k1_fx8010_code_t *icode;
@@ -1265,38 +1263,42 @@
 	strcpy(icode->name, "Audigy DSP code for ALSA");
 	ptr = 0;
 	nctl = 0;
-	gpr = capture + 10;
+	gpr = stereo_mix + 10;
 
 	/* stop FX processor */
 	snd_emu10k1_ptr_write(emu, A_DBG, 0, (emu->fx8010.dbg = 0) | A_DBG_SINGLE_STEP);
 
-	/* Wave Playback Volume */
+	/* PCM front Playback Volume */
 	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
 	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr, 100);
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Front Playback Volume", gpr, 80);
 	gpr += 2;
-
-	/* Wave Surround Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Surround Playback Volume", gpr, 0);
+	
+	/* PCM Surround Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Surround Playback Volume", gpr, 80);
 	gpr += 2;
 
-	/* Wave Center Playback */
-	/* Center = sub = Left/2 + Right/2 */
-	A_OP(icode, &ptr, iINTERP, A_GPR(tmp), A_FXBUS(FXBUS_PCM_LEFT), 0xcd, A_FXBUS(FXBUS_PCM_RIGHT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_C_00000000, A_GPR(gpr), A_GPR(tmp));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Wave Center Playback Volume", gpr, 0);
+	/* PCM Center Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_CENTER));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "PCM Center Playback Volume", gpr, 80);
 	gpr++;
 
-	/* Wave LFE Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_GPR(tmp));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Wave LFE Playback Volume", gpr, 0);
+	/* PCM LFE Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "PCM LFE Playback Volume", gpr, 80);
 	gpr++;
+	
+	/* Wave Playback Volume */
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_WAVE_LEFT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+1), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_WAVE_RIGHT));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Playback Volume", gpr, 100);
+	gpr += 2;
 
 	/* Music Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+0), A_GPR(playback+0), A_GPR(gpr), A_FXBUS(FXBUS_MIDI_LEFT));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+0), A_GPR(stereo_mix+0), A_GPR(gpr), A_FXBUS(FXBUS_MIDI_LEFT));
+	A_OP(icode, &ptr, iMAC0, A_GPR(stereo_mix+1), A_GPR(stereo_mix+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Playback Volume", gpr, 100);
 	gpr += 2;
 
@@ -1312,22 +1314,6 @@
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Music Capture Volume", gpr, 0);
 	gpr += 2;
 
-	/* Surround Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_REAR));
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
-	snd_emu10k1_init_stereo_control(&controls[nctl++], "Surround Playback Volume", gpr, 80);
-	gpr += 2;
-
-	/* Center Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_GPR(playback+4), A_GPR(gpr), A_FXBUS(FXBUS_PCM_CENTER));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "Center Playback Volume", gpr, 80);
-	gpr++;
-
-	/* LFE Playback */
-	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
-	snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 80);
-	gpr++;
-
 	/*
 	 * inputs
 	 */
@@ -1335,8 +1321,8 @@
 A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
 
 	/* AC'97 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_AC97_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_AC97_R);
+	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, 0);
 	gpr += 2;
 	/* AC'97 Capture Volume */
@@ -1346,8 +1332,8 @@
 	gpr += 2;
 
 	/* Audigy CD Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_SPDIF_CD_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_SPDIF_CD_R);
+	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);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Audigy CD Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Audigy CD Capture Volume */
@@ -1357,8 +1343,8 @@
 	gpr += 2;
 
  	/* Optical SPDIF Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_OPT_SPDIF_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_OPT_SPDIF_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_OPT_SPDIF_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_OPT_SPDIF_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "IEC958 Optical Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Optical SPDIF Capture Volume */
@@ -1368,8 +1354,8 @@
 	gpr += 2;
 
 	/* Line2 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_LINE2_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_LINE2_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_LINE2_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_LINE2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Line2 Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Line2 Capture Volume */
@@ -1379,8 +1365,8 @@
 	gpr += 2;
         
 	/* RCA SPDIF Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_RCA_SPDIF_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_RCA_SPDIF_R);
+	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 */
@@ -1390,8 +1376,8 @@
 	gpr += 2;
 
 	/* Aux2 Playback Volume */
-	A_ADD_VOLUME_IN(playback, gpr, A_EXTIN_AUX2_L);
-	A_ADD_VOLUME_IN(playback+1, gpr+1, A_EXTIN_AUX2_R);
+	A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_AUX2_L);
+	A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_AUX2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Aux2 Playback Volume", gpr, 0);
 	gpr += 2;
 	/* Aux2 Capture Volume */
@@ -1399,6 +1385,30 @@
 	A_ADD_VOLUME_IN(capture+1, gpr+1, A_EXTIN_AUX2_R);
 	snd_emu10k1_init_stereo_control(&controls[nctl++], "Aux2 Capture Volume", gpr, 0);
 	gpr += 2;
+	
+	/* Stereo Mix Playback Volume */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_GPR(playback), A_GPR(gpr), A_GPR(stereo_mix));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_GPR(stereo_mix+1));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Stereo Mix Playback Volume", gpr, 100);
+	gpr += 2;
+	
+	/* Stereo Surround Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_GPR(stereo_mix));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_GPR(stereo_mix+1));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Stereo Mix Surround Playback Volume", gpr, 0);
+	gpr += 2;
+
+	/* Stereo Mix Center Playback */
+	/* Center = sub = Left/2 + Right/2 */
+	A_OP(icode, &ptr, iINTERP, A_GPR(tmp), A_GPR(stereo_mix), 0xcd, A_GPR(stereo_mix+1));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4), A_GPR(playback+4), A_GPR(gpr), A_GPR(tmp));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "Stereo Mix Center Playback Volume", gpr, 0);
+	gpr++;
+
+	/* Stereo Mix LFE Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_GPR(tmp));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "Stereo Mix LFE Playback Volume", gpr, 0);
+	gpr++;
 
 	/*
 	 * outputs
@@ -1497,20 +1507,40 @@
 	snd_emu10k1_init_stereo_onoff_control(controls + nctl++, "Tone Control - Switch", gpr, 0);
 	gpr += 2;
 
-	/* Master volume for audigy2 */
-	if (emu->revision == 4) {
-		A_OP(icode, &ptr, iMAC0, A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS));
-		A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
-		snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Master Playback Volume", gpr, 0);
-		gpr += 2;
-	}	
+	/* Front Playback Volume */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Front Playback Volume", gpr, 100);
+	gpr += 2;
+	
+	/* Surround Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Surround Playback Volume", gpr, 100);
+	gpr += 2;
+
+	/* Center Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "Center Playback Volume", gpr, 100);
+	gpr++;
+
+	/* LFE Playback */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 100);
+	gpr++;	
+	
+	/* Master volume */
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr), A_GPR(playback+0+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+1+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+2+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+3+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+4+SND_EMU10K1_PLAYBACK_CHANNELS));
+	A_OP(icode, &ptr, iMAC0, A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS), A_C_00000000, A_GPR(gpr+1), A_GPR(playback+5+SND_EMU10K1_PLAYBACK_CHANNELS));
+	snd_emu10k1_init_stereo_control(&controls[nctl++], "Wave Master Playback Volume", gpr, 100);
+	gpr += 2;
 
 	/* analog speakers */
-	if (emu->revision == 4) { /* audigy2 */
-		A_PUT_STEREO_OUTPUT(A_EXTOUT_AFRONT_L, A_EXTOUT_AFRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
-	} else {
-		A_PUT_STEREO_OUTPUT(A_EXTOUT_AC97_L, A_EXTOUT_AC97_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
-	}
+	A_PUT_STEREO_OUTPUT(A_EXTOUT_AFRONT_L, A_EXTOUT_AFRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_AREAR_L, A_EXTOUT_AREAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_OUTPUT(A_EXTOUT_ACENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
 	A_PUT_OUTPUT(A_EXTOUT_ALFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
@@ -1519,7 +1549,7 @@
 	A_PUT_STEREO_OUTPUT(A_EXTOUT_HEADPHONE_L, A_EXTOUT_HEADPHONE_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
 
 	/* digital outputs */
-//	A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS);
+	/* A_PUT_STEREO_OUTPUT(A_EXTOUT_FRONT_L, A_EXTOUT_FRONT_R, playback + SND_EMU10K1_PLAYBACK_CHANNELS); */
 
 	/* IEC958 Optical Raw Playback Switch */ 
 	icode->gpr_map[gpr++] = 0x1008;
diff -u -r o/alsa-kernel/pci/emu10k1/emumixer.c n/alsa-kernel/pci/emu10k1/emumixer.c
--- o/alsa-kernel/pci/emu10k1/emumixer.c	2003-07-25 12:39:38.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emumixer.c	2003-10-09 21:46:21.000000000 +0200
@@ -468,17 +468,27 @@
 		ac97.private_free = snd_emu10k1_mixer_free_ac97;
 		if ((err = snd_ac97_mixer(emu->card, &ac97, &emu->ac97)) < 0)
 			return err;
-		if (emu->audigy && emu->revision == 4) {
+		if (emu->audigy) {
 			/* Master/PCM controls on ac97 of Audigy2 has no effect */
-			/* FIXME: keep master volume/switch to be sure.
-			 * once after we check that they play really no roles,
-			 * they shall be removed.
-			 */
-			rename_ctl(card, "Master Playback Switch", "AC97 Master Playback Switch");
-			rename_ctl(card, "Master Playback Volume", "AC97 Master Playback Volume");
 			/* pcm controls are removed */
 			remove_ctl(card, "PCM Playback Switch");
 			remove_ctl(card, "PCM Playback Volume");
+			
+			if (emu->revision != 4) {
+			    remove_ctl(card, "Master Mono Playback Switch");
+			    remove_ctl(card, "Master Mono Playback Volume");
+			    remove_ctl(card, "Master Playback Switch");
+			    remove_ctl(card, "Master Playback Volume");
+			    remove_ctl(card, "PCM Out Path & Mute");
+			} else {
+			    /* FIXME: keep master volume/switch to be sure.
+			     * once after we check that they play really no roles,
+			     * they shall be removed.
+			     */
+			    rename_ctl(card, "Master Playback Switch", "AC97 Master Playback Switch");
+			    rename_ctl(card, "Master Playback Volume", "AC97 Master Playback Volume");
+			}
+			
 		}
 	} else {
 		if (emu->APS)
@@ -489,11 +499,11 @@
 			strcpy(emu->card->mixername, "Emu10k1");
 	}
 
-	if (emu->audigy && emu->revision == 4) {
+	if (emu->audigy) {
 		/* Audigy2 and Audigy2 EX */
 		/* use the conventional names */
-		rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
-		rename_ctl(card, "Wave Playback Volume", "PCM Capture Volume");
+		/*rename_ctl(card, "Wave Playback Volume", "PCM Playback Volume");
+		rename_ctl(card, "Wave Playback Volume", "PCM Capture Volume");*/
 		rename_ctl(card, "Wave Master Playback Volume", "Master Playback Volume");
 	}
 

[-- Attachment #3: C:\alsa-lib.diff --]
[-- Type: APPLICATION/octet-stream, Size: 2987 bytes --]

diff -r -u o/src/conf/cards/Audigy2.conf n/src/conf/cards/Audigy2.conf
--- o/src/conf/cards/Audigy2.conf	2003-08-29 11:24:19.000000000 +0200
+++ n/src/conf/cards/Audigy2.conf	2003-10-09 22:07:12.000000000 +0200
@@ -5,13 +5,35 @@
 <confdir:pcm/front.conf>
 
 Audigy2.pcm.front.0 {
-	@args [ CARD  ]
+	@args [ CARD ]
 	@args.CARD {
 		type string
 	}
-	type hw
-	card $CARD
-	device 0
+	type hooks
+	slave.pcm {
+		type hw
+		card $CARD
+		device 0
+	}
+	hooks.0 {
+		type ctl_elems
+		hook_args [
+			{
+				name "EMU10K1 PCM Send Volume"
+				index { @func private_pcm_subdevice }
+				lock true
+				value [ 0 0 0 0 0 0 0 0  255 0 0 0 0 0 0 0  0 255 0 0 0 0 0 0 ]
+			}
+						{
+				name "EMU10K1 PCM Send Routing"
+				index { @func private_pcm_subdevice }
+				lock true
+				value [ 0 1 2 3 0 0 0 0  8 9 0 1 0 0 0 0  8 9 0 1 0 0 0 0 ]
+			}
+
+		]
+	}
+
 }	
 
 <confdir:pcm/rear.conf>
@@ -31,12 +53,6 @@
 		type ctl_elems
 		hook_args [
 			{
-				name "Wave Surround Playback Volume"
-				preserve true
-				lock true
-				value [ 0 0 ]
-			}
-			{
 				name "EMU10K1 PCM Send Volume"
 				index { @func private_pcm_subdevice }
 				lock true
@@ -63,18 +79,6 @@
 		type ctl_elems
 		hook_args [
 			{
-				name "Wave Center Playback Volume"
-				preserve true
-				lock true
-				value 0
-			}
-			{
-				name "Wave LFE Playback Volume"
-				preserve true
-				lock true
-				value 0
-			}
-			{
 				name "EMU10K1 PCM Send Volume"
 				index { @func private_pcm_subdevice }
 				lock true
diff -r -u o/src/conf/cards/Audigy.conf n/src/conf/cards/Audigy.conf
--- o/src/conf/cards/Audigy.conf	2003-08-29 11:24:19.000000000 +0200
+++ n/src/conf/cards/Audigy.conf	2003-10-09 21:50:09.000000000 +0200
@@ -5,13 +5,35 @@
 <confdir:pcm/front.conf>
 
 Audigy.pcm.front.0 {
-	@args [ CARD  ]
+	@args [ CARD ]
 	@args.CARD {
 		type string
 	}
-	type hw
-	card $CARD
-	device 0
+	type hooks
+	slave.pcm {
+		type hw
+		card $CARD
+		device 0
+	}
+	hooks.0 {
+		type ctl_elems
+		hook_args [
+			{
+				name "EMU10K1 PCM Send Volume"
+				index { @func private_pcm_subdevice }
+				lock true
+				value [ 0 0 0 0 0 0 0 0  255 0 0 0 0 0 0 0  0 255 0 0 0 0 0 0 ]
+			}
+						{
+				name "EMU10K1 PCM Send Routing"
+				index { @func private_pcm_subdevice }
+				lock true
+				value [ 0 1 2 3 0 0 0 0  8 9 0 1 0 0 0 0  8 9 0 1 0 0 0 0 ]
+			}
+
+		]
+	}
+
 }	
 
 <confdir:pcm/rear.conf>
@@ -31,12 +53,6 @@
 		type ctl_elems
 		hook_args [
 			{
-				name "Wave Surround Playback Volume"
-				preserve true
-				lock true
-				value [ 0 0 ]
-			}
-			{
 				name "EMU10K1 PCM Send Volume"
 				index { @func private_pcm_subdevice }
 				lock true
@@ -63,18 +79,6 @@
 		type ctl_elems
 		hook_args [
 			{
-				name "Wave Center Playback Volume"
-				preserve true
-				lock true
-				value 0
-			}
-			{
-				name "Wave LFE Playback Volume"
-				preserve true
-				lock true
-				value 0
-			}
-			{
 				name "EMU10K1 PCM Send Volume"
 				index { @func private_pcm_subdevice }
 				lock true

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - Audigy 1 and Audigy 2 mixer
  2003-10-10  6:53 [PATCH] - Audigy 1 and Audigy 2 mixer p z oooo
@ 2003-10-10 17:10 ` Takashi Iwai
  2003-10-13 16:36 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-10-10 17:10 UTC (permalink / raw)
  To: p z oooo; +Cc: alsa-devel

At Fri, 10 Oct 2003 08:53:34 +0200,
p z oooo wrote:
> 
> [1  <text/plain; US-ASCII (quoted-printable)>]
> Hi,
> 
> These patches make some changes to mixer on Audigy 1 and Audigy 2.

thanks, i'll try and merge your patch in the next week when i get the
audigy board back.

> 
> Changes:
> - new FX bus allocated for Wave Stereo playback ("Wave Playback 
> Volume")
> - new "Master Playback Volume" control - controls output volume for 
> all channels (implemented using DSP code)
> - new controls "PCM Front Playback Volume", "PCM Surround Playback 
> Volume", "PCM Center Playback Volume", "PCM LFE Playback Volume" for 
> multi-channel (5.1) playback
> - new controls "Front Playback Volume", "Surround Playback 
> Volume", "Center Playback Volume", "LFE Playback Volume" - there are 
> just before master volume - controls mix from PCM (5.1) and Stereo 
> Mix (Stereo Wave, AC97, ...)
> - new controls "Stereo Mix Front Playback Volume", "Stereo Mix 
> Surround Playback Volume", "Stereo Mix Center Playback 
> Volume", "Stereo Mix LFE Playback Volume" - used do control volume of 
> mix from stereo sources (make mirroring to 5.1 for stereo)
> Audigy 1:
> - removed AC97 control "Master Volume Playback", "Master Mono Volume 
> Playback", "PCM Volume Playback", "PCM Out Path & Mute" - there are 
> unused
> - uses Philips 6 channel DAC for all channels, WARNING: all analog 
> sources are routed throught DSP (if you want listen line in you must 
> set "AC97 Playback Volume" and "(" set capture on "(" "Line in" 
> and "Capture" ")" or "(" capture on "Mix" and volume for "Line in" ")"
>   using Philis DAC has some advantage - Same volume levels for all 
> channels, I think better signal, ..)
>     - analog signals can by routed to all channles
>   disadvantage - all analog signals must be routed throught DSP - 
> (confusing selecting analog inputs and volumes for analogs inputs)
> 
> I tested 5.1 playback, wave stereo playback midi playback and analog 
> playback.
> I hope I don't break something (OSS mixer, AC3 playback, optical 
> input, output, coaxial input, output) - not tested.
> Names are not very well choosen (some needs rename).
> Maybe I can remove "Front Playback Volume", "Surround Playback 
> Volume", "Center Playback Volume", "LFE Playback Volume" and use only 
> controls for "PCM" and "Stereo Mix"

agreed.  "Stereo Mix xxx Playback" can be simply used as "xxx
Playback", then.

also, the "PCM" might be a bit confusing in this case, since the
normal playback is not affected by these controls.


anyway, thanks for your work!


Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] - Audigy 1 and Audigy 2 mixer
  2003-10-10  6:53 [PATCH] - Audigy 1 and Audigy 2 mixer p z oooo
  2003-10-10 17:10 ` Takashi Iwai
@ 2003-10-13 16:36 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2003-10-13 16:36 UTC (permalink / raw)
  To: p z oooo; +Cc: alsa-devel

Hi,

At Fri, 10 Oct 2003 08:53:34 +0200,
p z oooo wrote:
> 
> [1  <text/plain; US-ASCII (quoted-printable)>]
> Hi,
> 
> These patches make some changes to mixer on Audigy 1 and Audigy 2.

i applied the patch to cvs with minor modifications as below:

- the original "Front", "Rear", "Center", "LFE" are removed.
  instead, Stereo Mix Front, Rear, Center and LFE are renamed without
  "Stereo Mix" prefix.
- "Wave Playback" is renamed as "PCM" as well as before, so that it
  can be controlled via OSS.
- master is initialized as 0, while PCM are set to max.


i've not tested AC3 output yet.  others seem working fine.

again, thanks for the patch!


ciao,

Takashi


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-13 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-10  6:53 [PATCH] - Audigy 1 and Audigy 2 mixer p z oooo
2003-10-10 17:10 ` Takashi Iwai
2003-10-13 16:36 ` 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.