Update of /cvsroot/alsa/alsa-kernel/pci/emu10k1 In directory sc8-pr-cvs1:/tmp/cvs-serv31685/pci/emu10k1
Modified Files: emufx.c emumixer.c Log Message: - rename the control "Surround Digital" -> "Surround". the surround of ac97 is removed (unused on sb live). - clean up the removal of unused mixer entries. Index: emufx.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emufx.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- emufx.c 3 Jan 2004 09:22:23 -0000 1.46 +++ emufx.c 16 Jan 2004 18:08:49 -0000 1.47 @@ -1821,28 +1821,28 @@ 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 @@ /* 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 @@ 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; } Index: emumixer.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emumixer.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- emumixer.c 7 Nov 2003 17:52:01 -0000 1.19 +++ emumixer.c 16 Jan 2004 18:08:49 -0000 1.20 @@ -458,6 +458,56 @@ 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 @@ 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 @@ 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; ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog