Skip to contentSkip to conversation

: es18xx driver fails to set filter register

ALSA - driver 0000465 [email protected] 1 participant 1 message Aug 26, 2004

lore
Share & tools
lore
#0 lore raw

The following bug has been SUBMITTED.
======================================================================
https://bugtrack.alsa-project.org/alsa-bug/bug_view_page.php?bug_id=0000465
======================================================================
Reported By: ranma
Assigned To:
======================================================================

Project:                    ALSA - driver
Bug ID:                     465
Category:                   ISA - es18xx
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Distribution:               Debian/GNU Linux
Kernel Version:             2.6.8
======================================================================
Date Submitted:             08-26-2004 15:27 CEST
Last Modified:              08-26-2004 15:27 CEST

======================================================================
Summary: es18xx driver fails to set filter register
Description:
Apparently my es18xx bugfix was not pushed upstream as I noticed when I switched from Kernel 2.4 + alsa-source to Kernel 2.6, so I'm reposting my original Debian bugreport here:

I just installed alsa on my notebook and the first thing I noticed was that it "does not sound right" with alsa whereas the sound is fine with the kernel oss driver. A short comparison between the kernel driver and the alsa driver turned up the following difference:

alsa-kernel/isa/es18xx.c:

|	/* set filter register */
|	div0 = 256 - 7160000*20/(8*82*runtime->rate);
|		
|	if ((chip->caps & ES18XX_PCM2) && mode == DAC2) {
|		snd_es18xx_mixer_write(chip, 0x70, bits);
|		snd_es18xx_mixer_write(chip, 0x72, div0);
|	} else {
|		snd_es18xx_write(chip, 0xA1, bits);
|		snd_es18xx_write(chip, 0xA2, div0);
|	}

drivers/sound/sb_ess.c:

|	/* Set filter roll-off to 90% of speed/2 */
|	speed = (devc->speed * 9) / 20;
|
|	div2 = 256 - 7160000 / (speed * 82);
|
|	if (!devc->duplex) audionum = 1;
|
|	if (audionum == 1) {
|		/* Change behaviour of register A1 *
|		sb_chg_mixer(devc, 0x71, 0x20, 0x20)
|		* For ES1869 only??? */
|		ess_write (devc, 0xa1, div);
|		ess_write (devc, 0xa2, div2);
|	} else {
|		ess_setmixer (devc, 0x70, div);
|		/*
|		 * FKS: fascinating: 0x72 doesn't seem to work.
|		 */
|		ess_write (devc, 0xa2, div2);
|		ess_setmixer (devc, 0x72, div2);
|	}

The 'fascinating' comment is the key, after inserting a corresponding line in the ALSA driver, the sound is ok now:

isa/es18xx.c +5 -0
@@ -422,6 +422,11 @@
 		
 	if ((chip->caps & ES18XX_PCM2) && mode == DAC2) {
 		snd_es18xx_mixer_write(chip, 0x70, bits);
+		/*
+		 * Comment from kernel oss driver:
+		 * FKS: fascinating: 0x72 doesn't seem to work.
+		 */
+		snd_es18xx_write(chip, 0xA2, div0);
 		snd_es18xx_mixer_write(chip, 0x72, div0);
 	} else {
 		snd_es18xx_write(chip, 0xA1, bits);

======================================================================

Bug History
Date Modified Username Field Change
======================================================================

08-26-04 15:27 ranma          New Bug                                      
08-26-04 15:27 ranma          Distribution              => Debian/GNU Linux
08-26-04 15:27 ranma          Kernel Version            => 2.6.8           

======================================================================

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285