* [PATCH] - Audigy 1 and Audigy 2 mixer - again
@ 2003-11-05 7:01 p z oooo
2003-11-05 15:28 ` James Courtier-Dutton
2003-11-07 17:53 ` Takashi Iwai
0 siblings, 2 replies; 5+ messages in thread
From: p z oooo @ 2003-11-05 7:01 UTC (permalink / raw)
To: alsa-devel
[-- Attachment #1: Type: TEXT/plain, Size: 1648 bytes --]
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
================================================================
[-- Attachment #2: C:\philips_adc.diff --]
[-- Type: APPLICATION/octet-stream, Size: 7249 bytes --]
diff -u -r o/alsa-kernel/include/emu10k1.h n/alsa-kernel/include/emu10k1.h
--- o/alsa-kernel/include/emu10k1.h 2003-10-17 17:39:52.000000000 +0200
+++ n/alsa-kernel/include/emu10k1.h 2003-11-04 21:47:30.000000000 +0100
@@ -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
diff -u -r o/alsa-kernel/pci/emu10k1/emu10k1_main.c n/alsa-kernel/pci/emu10k1/emu10k1_main.c
--- o/alsa-kernel/pci/emu10k1/emu10k1_main.c 2003-07-25 12:39:38.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emu10k1_main.c 2003-11-04 21:27:38.000000000 +0100
@@ -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);
}
}
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-10-21 19:40:14.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emufx.c 2003-11-04 22:20:12.000000000 +0100
@@ -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 */
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-10-13 18:30:45.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emumixer.c 2003-11-04 22:09:15.000000000 +0100
@@ -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)
diff -u -r o/alsa-kernel/pci/emu10k1/emupcm.c n/alsa-kernel/pci/emu10k1/emupcm.c
--- o/alsa-kernel/pci/emu10k1/emupcm.c 2003-08-29 11:22:27.000000000 +0200
+++ n/alsa-kernel/pci/emu10k1/emupcm.c 2003-11-04 21:51:19.000000000 +0100
@@ -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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] - Audigy 1 and Audigy 2 mixer - again
2003-11-05 7:01 [PATCH] - Audigy 1 and Audigy 2 mixer - again p z oooo
@ 2003-11-05 15:28 ` James Courtier-Dutton
2003-11-07 17:53 ` Takashi Iwai
1 sibling, 0 replies; 5+ messages in thread
From: James Courtier-Dutton @ 2003-11-05 15:28 UTC (permalink / raw)
To: p z oooo; +Cc: alsa-devel
p z oooo wrote:
> 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
>
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/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] - Audigy 1 and Audigy 2 mixer - again
@ 2003-11-06 7:12 p z oooo
0 siblings, 0 replies; 5+ messages in thread
From: p z oooo @ 2003-11-06 7:12 UTC (permalink / raw)
To: James; +Cc: alsa-devel
Hi,
I have Audigy 1 (model SB0090)
Audigy 1 has UDA1361TS ADC too (look at card picture - just above
1328)
UDA1361 is connected on AC97 line out.
Why use UDA1361 ??? Because it is 24 bit (you get beter resolution)
and it has beter S/N as AC97.
If you have Audigy 2 you can use UDA1361 ADC without this patch.
Use ALSA version 0.9.7 (in 0.9.8 is AC97 master disabled). Set AC97
volume to 0, set Master (ac97 master) to 100 %, and set IEC958
Coaxial volume to 100, Set unmute Line In (CD, aux, mic) volume and
set it's volume to some level and listen.
Peter Zubaj
====================== REKLAMA =================================
Vyrazne zlavy pocitacov a prislusenstva
SunFire V60x servery v cenach uz od 96.000,- Sk bez DPH
Navstivte nas na adrese http://www.somi.sk/sun/linux.php
==============================================================
-------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] - Audigy 1 and Audigy 2 mixer - again
@ 2003-11-06 7:18 p z oooo
0 siblings, 0 replies; 5+ messages in thread
From: p z oooo @ 2003-11-06 7:18 UTC (permalink / raw)
To: James; +Cc: alsa-devel
Yes, Philips ADC doesn't help playback but recording yes. But ADC is
connected to emu10k2 by 24 bit, and I think that philips DAC (1328)
is connected by 24 bit too, this means that card internally work in
24 bit, only problem is how too get 24 bit data from to emu10k2 - one
solution - using TRAM.
Peter Zubaj
====================== REKLAMA =================================
Vyrazne zlavy pocitacov a prislusenstva
SunFire V60x servery v cenach uz od 96.000,- Sk bez DPH
Navstivte nas na adrese http://www.somi.sk/sun/linux.php
==============================================================
-------------------------------------------------------
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/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] - Audigy 1 and Audigy 2 mixer - again
2003-11-05 7:01 [PATCH] - Audigy 1 and Audigy 2 mixer - again p z oooo
2003-11-05 15:28 ` James Courtier-Dutton
@ 2003-11-07 17:53 ` Takashi Iwai
1 sibling, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2003-11-07 17:53 UTC (permalink / raw)
To: p z oooo; +Cc: alsa-devel
At Wed, 5 Nov 2003 08:01:54 +0100,
p z oooo wrote:
>
> 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/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-11-07 17:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-05 7:01 [PATCH] - Audigy 1 and Audigy 2 mixer - again p z oooo
2003-11-05 15:28 ` James Courtier-Dutton
2003-11-07 17:53 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2003-11-06 7:12 p z oooo
2003-11-06 7:18 p z oooo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox