Skip to contentSkip to conversation

Patch to enable IR on Audigy 2 Drive

DISCUSSION Applied Andrew de Quincey 2 participants 3 messages Mar 10, 2003 – Mar 11, 2003

lore
Share & tools
lore
#0 lore raw

Hi, I've been having a frustrating couple of days getting IR to work on my brand new Audigy2 drive... Lots of people seem to have it working, but for me, it refused. Enabling it under windows showed that the IR _did_ work, and if I rebooted immediately into linux, IR worked there too (although not after a power cycle).

It turns out the Audigy2 (and maybe the Audigy as well? I don't know) has a different port (A_IOCFG instead of A_HCFG) for accessing the GPIO registers... This is actually in the OSS driver, but hadn't made it across to ALSA. I assume the people who had this working were all using the OSS driver.

I'd like to point out that I've only done this for the IR.. it might be an idea to check the ALSA emu101k source for other occurences of this for the Audigy2..

Here's a patch against CVS to the IR enabling code.

--- CUT HERE ---
Index: include/emu10k1.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/emu10k1.h,v retrieving revision 1.23
diff -r1.23 emu10k1.h
236a237,238

Quoted 2 lines

#define A_IOCFG_GPOUT1 0x0002 /* IR */
#define A_IOCFG_GPOUT2 0x0001 /* IR */

Index: pci/emu10k1/emu10k1_main.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c,v retrieving revision 1.22
diff -r1.22 emu10k1_main.c
224,230c224,239
< if (enable_ir) { /* enable IR for SB Live */
< unsigned int reg = inl(emu->port + HCFG);
< outl(reg | HCFG_GPOUT2, emu->port + HCFG);
< udelay(500);
< outl(reg | HCFG_GPOUT1 | HCFG_GPOUT2, emu->port + HCFG);
< udelay(100);
< outl(reg, emu->port + HCFG);
---

Quoted 8 lines
	if (enable_ir) {	/* enable IR for SB Live/Audigy */
		if (emu->audigy) {
			unsigned int reg = inl(emu->port + A_IOCFG);
			outl(reg | A_IOCFG_GPOUT2, emu->port + A_IOCFG);
			udelay(500);
			outl(reg | A_IOCFG_GPOUT1 | A_IOCFG_GPOUT2, emu->port + A_IOCFG);
			udelay(100);
			outl(reg, emu->port + A_IOCFG);
Quoted 8 lines
		} else {
			unsigned int reg = inl(emu->port + HCFG);
			outl(reg | HCFG_GPOUT2, emu->port + HCFG);
			udelay(500);
			outl(reg | HCFG_GPOUT1 | HCFG_GPOUT2, emu->port + HCFG);
			udelay(100);
			outl(reg, emu->port + HCFG);
		}

--- CUT HERE ---

Signature · 7 lines
adq


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

Oh, BTW, you have to use /dev/snd/midiC0D1 for it to work with lircd.. the /dev/midi, /dev/midi00, /dev/sequencer OSS compatability layers DO NOT work.

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

Applied
#2 lore raw
In reply to Andrew de Quincey

At Mon, 10 Mar 2003 22:31:31 +0000,

Quoted 13 lines · Andrew de Quincey

Hi, I've been having a frustrating couple of days getting IR to work on my brand new Audigy2 drive... Lots of people seem to have it working, but for me, it refused. Enabling it under windows showed that the IR _did_ work, and if I rebooted immediately into linux, IR worked there too (although not after a power cycle).

It turns out the Audigy2 (and maybe the Audigy as well? I don't know) has a different port (A_IOCFG instead of A_HCFG) for accessing the GPIO registers... This is actually in the OSS driver, but hadn't made it across to ALSA. I assume the people who had this working were all using the OSS driver.

Quoted 5 lines

I'd like to point out that I've only done this for the IR.. it might be an idea to check the ALSA emu101k source for other occurences of this for the Audigy2..

Here's a patch against CVS to the IR enabling code.

thanks, applied to cvs now.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en