Commit 640ad5c8 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,EMU10K1/EMU10K2 driver
- rename the control 'Surround Digital' -> 'Surround'.
  the surround of ac97 is removed (unused on sb live).
- clean up the removal of unused mixer entries.
parent 955dea81
......@@ -101,15 +101,15 @@ accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
The result is forwarded to the ADC capture FIFO (thus to the standard capture
PCM device).
name='Surround Digital Playback Volume',index=0
name='Surround Playback Volume',index=0
This control is used to attenuate samples for left and right rear PCM FX-bus
accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
The result samples are forwarded to the rear I2S DACs. These DACs operate
separately (they are not inside the AC97 codec).
name='Surround Digital Capture Volume',index=0
name='Surround Digital Capture Switch',index=0
name='Surround Capture Volume',index=0
name='Surround Capture Switch',index=0
These controls are used to attenuate samples for left and right rear PCM FX-bus
accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
......@@ -172,13 +172,13 @@ This control is used to attenuate samples from left and right zoom video
digital inputs (usually used by a CDROM drive). The result samples are
forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
name='IEC958 Optical Playback Volume',index=0
name='IEC958 LiveDrive Playback Volume',index=0
This control is used to attenuate samples from left and right IEC958 optical
digital input. The result samples are forwarded to the front DAC PCM slots
of the AC97 codec.
name='IEC958 Optical Capture Volume',index=0
name='IEC958 LiveDrive Capture Volume',index=0
This control is used to attenuate samples from left and right IEC958 optical
digital inputs. The result samples are forwarded to the ADC capture FIFO
......
......@@ -1821,28 +1821,28 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Music Capture Switch", gpr + 2, 0);
gpr += 4;
/* Surround Digital Playback Volume */
/* Surround Digital Playback Volume (renamed later without Digital) */
for (z = 0; z < 2; z++)
VOLUME_ADD(icode, &ptr, playback + 2 + z, 4 + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Surround Digital Playback Volume", gpr, 100);
gpr += 2;
/* Surround Digital Capture Volume + Switch */
/* Surround Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH(icode, &ptr, tmp + 0, 4 + z, gpr + 2 + z);
VOLUME_ADD(icode, &ptr, capture + z, tmp + 0, gpr + z);
}
snd_emu10k1_init_stereo_control(controls + i++, "Surround Digital Capture Volume", gpr, 0);
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Surround Digital Capture Switch", gpr + 2, 0);
snd_emu10k1_init_stereo_control(controls + i++, "Surround Capture Volume", gpr, 0);
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Surround Capture Switch", gpr + 2, 0);
gpr += 4;
/* Center Playback Volume */
/* Center Playback Volume (renamed later without Digital) */
VOLUME_ADD(icode, &ptr, playback + 4, 6, gpr);
snd_emu10k1_init_mono_control(controls + i++, "Center Playback Volume", gpr++, 100);
snd_emu10k1_init_mono_control(controls + i++, "Center Digital Playback Volume", gpr++, 100);
/* LFE Playback Volume + Switch */
/* LFE Playback Volume + Switch (renamed later without Digital) */
VOLUME_ADD(icode, &ptr, playback + 5, 7, gpr);
snd_emu10k1_init_mono_control(controls + i++, "LFE Playback Volume", gpr++, 100);
snd_emu10k1_init_mono_control(controls + i++, "LFE Digital Playback Volume", gpr++, 100);
/*
* Process inputs
......@@ -1897,7 +1897,7 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
/* IEC958 Optical Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_TOSLINK_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "IEC958 Optical Playback Volume", gpr, 0);
snd_emu10k1_init_stereo_control(controls + i++, "IEC958 LiveDrive Playback Volume", gpr, 0);
gpr += 2;
/* IEC958 Optical Capture Volume */
......@@ -1905,8 +1905,8 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_TOSLINK_L + z, gpr + 2 + z);
VOLUME_ADD(icode, &ptr, capture + z, tmp + 0, gpr + z);
}
snd_emu10k1_init_stereo_control(controls + i++, "IEC958 Optical Capture Volume", gpr, 0);
snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 Optical Capture Switch", gpr + 2, 0);
snd_emu10k1_init_stereo_control(controls + i++, "IEC958 LiveDrive Capture Volume", gpr, 0);
snd_emu10k1_init_stereo_onoff_control(controls + i++, "IEC958 LiveDrive Capture Switch", gpr + 2, 0);
gpr += 4;
}
......
......@@ -458,6 +458,56 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
int err, pcm;
snd_kcontrol_t *kctl;
snd_card_t *card = emu->card;
char **c;
static char *emu10k1_remove_ctls[] = {
/* no AC97 mono, surround, center/lfe */
"Master Mono Playback Switch",
"Master Mono Playback Volume",
"PCM Out Path & Mute",
"Mono Output Select",
"Surround Playback Switch",
"Surround Playback Volume",
"Center Playback Switch",
"Center Playback Volume",
"LFE Playback Switch",
"LFE Playback Volume",
NULL
};
static char *emu10k1_rename_ctls[] = {
"Surround Digital Playback Volume", "Surround Playback Volume",
"Center Digital Playback Volume", "Center Playback Volume",
"LFE Digital Playback Volume", "LFE Playback Volume",
NULL
};
static char *audigy_remove_ctls[] = {
/* Master/PCM controls on ac97 of Audigy has no effect */
"PCM Playback Switch",
"PCM Playback Volume",
"Master Mono Playback Switch",
"Master Mono Playback Volume",
"Master Playback Switch",
"Master Playback Volume",
"PCM Out Path & Mute",
"Mono Output Select",
/* remove unused AC97 capture controls */
"Capture Source",
"Capture Switch",
"Capture Volume",
"Mic Select",
"Video Playback Switch",
"Video Playback Volume",
"Mic Playback Switch",
"Mic Playback Volume",
NULL
};
static char *audigy_rename_ctls[] = {
/* use conventional names */
"Wave Playback Volume", "PCM Playback Volume",
/* "Wave Capture Volume", "PCM Capture Volume", */
"Wave Master Playback Volume", "Master Playback Volume",
"AMic Playback Volume", "Mic Playback Volume",
NULL
};
if (!emu->no_ac97) {
ac97_bus_t bus, *pbus;
......@@ -475,32 +525,19 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
if ((err = snd_ac97_mixer(pbus, &ac97, &emu->ac97)) < 0)
return err;
if (emu->audigy) {
/* Master/PCM controls on ac97 of Audigy has no effect */
/* pcm controls are removed */
remove_ctl(card, "PCM Playback Switch");
remove_ctl(card, "PCM Playback Volume");
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");
remove_ctl(card, "Mono Output Select");
/* set master volume to 0 dB */
snd_ac97_write(emu->ac97, AC97_MASTER, 0x0202);
/* set capture source to mic */
snd_ac97_write(emu->ac97, AC97_REC_SEL, 0x0000);
/* remove unused 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");
c = audigy_remove_ctls;
} else {
/* remove unused AC97 controls */
snd_ac97_write(emu->ac97, AC97_SURROUND_MASTER, 0x0202);
snd_ac97_write(emu->ac97, AC97_CENTER_LFE_MASTER, 0x0202);
c = emu10k1_remove_ctls;
}
for (; *c; c++)
remove_ctl(card, *c);
} else {
if (emu->APS)
strcpy(emu->card->mixername, "EMU APS");
......@@ -510,13 +547,12 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu)
strcpy(emu->card->mixername, "Emu10k1");
}
if (emu->audigy) {
/* use the conventional names */
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 (emu->audigy)
c = audigy_rename_ctls;
else
c = emu10k1_rename_ctls;
for (; *c; c += 2)
rename_ctl(card, c[0], c[1]);
if ((kctl = emu->ctl_send_routing = snd_ctl_new1(&snd_emu10k1_send_routing_control, emu)) == NULL)
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment