All of lore.kernel.org
 help / color / mirror / Atom feed
* AC3 passthrough on Audigy
@ 2003-08-29  2:21 Boris Shingarov
  2003-08-29  1:44 ` James Courtier-Dutton
  0 siblings, 1 reply; 6+ messages in thread
From: Boris Shingarov @ 2003-08-29  2:21 UTC (permalink / raw)
  To: alsa-devel

Peter,

This is very interesting.  You mean this patch will enable passthrough
without the need for ld10k1, right?  I will give it a try and let you
know what my results are.

Boris



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 6+ messages in thread
* AC3 passthrough on Audigy
@ 2003-08-26  8:47 p z oooo
  2003-08-26 18:01 ` James Courtier-Dutton
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: p z oooo @ 2003-08-26  8:47 UTC (permalink / raw)
  To: alsa-devel

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

Hi,

This is taken from oss driver. It is not tested (I don't own 
receiver). Can someone try it, maybe this works, I don't know.

Audigy.conf - copy this to /usr/share/alsa/cards/ and overwrite old 
one (make backup).

emu10k1.h.patch - patch for file alsa-driver/alsa-
kernel/include/emu10k1.h

emufx.c.patch - patch for file alsa-driver/alsa-
kernel/pci/emu10k1/emufx.c

If this doesn't work try to comment out lines
A_OP(icode, &ptr, iSKIP, A_GPR_COND, A_GPR_COND, A_GPR(gpr - 2), 
A_C_00000001);
A_OP(icode, &ptr, iACC3, A_GPR(tmp + 2), A_C_00000000, A_C_00010000, 
A_GPR(tmp + 2));

And if this doesn't work too, then delete this mail.

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:\pt\Audigy.conf --]
[-- Type: APPLICATION/octet-stream, Size: 3525 bytes --]

#
# Configuration for the Audigy chip
#

<confdir:pcm/front.conf>

Audigy.pcm.front.0 {
	@args [ CARD  ]
	@args.CARD {
		type string
	}
	type hw
	card $CARD
	device 0
}	

<confdir:pcm/rear.conf>

Audigy.pcm.rear.0 {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type hooks
	slave.pcm {
		type hw
		card $CARD
		device 0
	}
	hooks.0 {
		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
				value [ 0 0 0 0 0 0 0 0  0 0 255 0 0 0 0 0  0 0 0 255 0 0 0 0 ]
			}
		]
	}
}	

<confdir:pcm/center_lfe.conf>

Audigy.pcm.center_lfe.0 {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type hooks
	slave.pcm {
		type hw
		card $CARD
		device 0
	}
	hooks.0 {
		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
				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  6 7 0 1 0 0 0 0  6 7 0 1 0 0 0 0 ]
			}
		]
	}
}	

<confdir:pcm/surround40.conf>

Audigy.pcm.surround40.0 {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type multi
	slaves [
		{
			pcm {
				@func concat
				strings [
					"cards.Audigy.pcm.front.0:CARD=" $CARD
				]
			}
			channels 2
		}
		{
			pcm {
				@func concat
				strings [
					"cards.Audigy.pcm.rear.0:CARD=" $CARD
				]
			}
			channels 2
		}
	]
	bindings [
		{ slave 0 channel 0 }
		{ slave 0 channel 1 }
		{ slave 1 channel 0 }
		{ slave 1 channel 1 }
	]
}

<confdir:pcm/surround51.conf>

Audigy.pcm.surround51.0 {
	@args [ CARD ]
	@args.CARD {
		type string
	}
	type multi
	slaves [
		{
			pcm {
				@func concat
				strings [
					"cards.Audigy.pcm.front.0:CARD=" $CARD
				]
			}
			channels 2
		}
		{
			pcm {
				@func concat
				strings [
					"cards.Audigy.pcm.rear.0:CARD=" $CARD
				]
			}
			channels 2
		}
		{
			pcm {
				@func concat
				strings [
					"cards.Audigy.pcm.center_lfe.0:CARD=" $CARD
				]
			}
			channels 2
		}
	]
	bindings [
		{ slave 0 channel 0 }
		{ slave 0 channel 1 }
		{ slave 1 channel 0 }
		{ slave 1 channel 1 }
		{ slave 2 channel 0 }
		{ slave 2 channel 1 }
	]
}

<confdir:pcm/iec958.conf>

Audigy.pcm.iec958.0 {
	@args [ CARD AES0 AES1 AES2 AES3 ]
	@args.CARD {
		type string
	}
	@args.AES0 {
		type integer
	}
	@args.AES1 {
		type integer
	}
	@args.AES2 {
		type integer
	}
	@args.AES3 {
		type integer
	}
	type hooks
	slave.pcm {
		type hw
		card $CARD
		device 0
	}

	hooks.0 {
		type ctl_elems
		hook_args [
			{
				name "IEC958 Playback Default"
				lock true
				preserve true
				value [ $AES0 $AES1 $AES2 $AES3 ]
			}
			{
				name "IEC958 Optical Raw Playback Switch"
				lock true
				preserve true
				value [ 1 1 ]
			}
			{
				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  20 21 0 1 0 0 0 0   20 21 0 1 0 0 0 0 ]
			}
			{
				name "Audigy Analog/Digital Output Jack"
				lock true
				preserve true
				value 1
			}
		]
	}
}

[-- Attachment #3: C:\pt\emu10k1.h.patch --]
[-- Type: APPLICATION/octet-stream, Size: 338 bytes --]

--- emu10k1.h.old	2003-07-25 12:37:39.000000000 +0200
+++ emu10k1.h	2003-08-25 21:15:46.000000000 +0200
@@ -1152,6 +1152,8 @@
 #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_MIDI_REVERB	0x0c
 #define FXBUS_MIDI_CHORUS	0x0d
 

[-- Attachment #4: C:\pt\emufx.c.patch --]
[-- Type: APPLICATION/octet-stream, Size: 2571 bytes --]

--- emufx.c.old	2003-07-25 12:39:38.000000000 +0200
+++ emufx.c	2003-08-25 22:19:02.000000000 +0200
@@ -1235,6 +1235,7 @@
  */
 
 #define A_GPR_ACCU 0xd6
+#define A_GPR_COND 0xd7
 
 static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
 {
@@ -1502,13 +1503,7 @@
 		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;
-	}
-
-	/* 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_REAR_L, A_EXTOUT_REAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
-	A_PUT_OUTPUT(A_EXTOUT_CENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
-	A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
+	}	
 
 	/* analog speakers */
 	if (emu->revision == 4) { /* audigy2 */
@@ -1523,6 +1518,29 @@
 	/* headphone */
 	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);
+
+	/* IEC958 Optical Raw Playback Switch */ 
+	icode->gpr_map[gpr++] = 0x1008;
+	icode->gpr_map[gpr++] = 0xffff0000;
+	for (z = 0; z < 2; z++) {
+		A_OP(icode, &ptr, iMAC0, A_GPR(tmp + 2), A_FXBUS(FXBUS_PT_LEFT + z), A_C_00000000, A_C_00000000);
+		A_OP(icode, &ptr, iSKIP, A_GPR_COND, A_GPR_COND, A_GPR(gpr - 2), A_C_00000001);
+		A_OP(icode, &ptr, iACC3, A_GPR(tmp + 2), A_C_00000000, A_C_00010000, A_GPR(tmp + 2));
+		A_OP(icode, &ptr, iANDXOR, A_GPR(tmp + 2), A_GPR(tmp + 2), A_GPR(gpr - 1), A_C_00000000);
+		A_SWITCH(icode, &ptr, tmp + 0, tmp + 2, gpr + z);
+		A_SWITCH_NEG(icode, &ptr, tmp + 1, gpr + z);
+		A_SWITCH(icode, &ptr, tmp + 1, playback + SND_EMU10K1_PLAYBACK_CHANNELS + z, tmp + 1);
+		A_OP(icode, &ptr, iACC3, A_EXTOUT(A_EXTOUT_FRONT_L + z), A_GPR(tmp + 0), A_GPR(tmp + 1), A_C_00000000);
+	}
+	snd_emu10k1_init_stereo_onoff_control(controls + nctl++, "IEC958 Optical Raw Playback Switch", gpr, 0);
+	gpr += 2;
+	
+	A_PUT_STEREO_OUTPUT(A_EXTOUT_REAR_L, A_EXTOUT_REAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
+	A_PUT_OUTPUT(A_EXTOUT_CENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
+	A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
+
 	/* ADC buffer */
 	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_L, capture);
 	A_PUT_OUTPUT(A_EXTOUT_ADC_CAP_R, capture+1);

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

end of thread, other threads:[~2003-08-29  2:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-29  2:21 AC3 passthrough on Audigy Boris Shingarov
2003-08-29  1:44 ` James Courtier-Dutton
  -- strict thread matches above, loose matches on Subject: below --
2003-08-26  8:47 p z oooo
2003-08-26 18:01 ` James Courtier-Dutton
2003-08-26 23:44 ` James Courtier-Dutton
2003-08-28 20:33 ` James Courtier-Dutton

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.