kern/63204: [sound] /dev/mixer broken with ESS Maestro-2E (still on 5.4)

Pyun YongHyeon pyunyh at gmail.com
Mon Dec 12 20:18:46 PST 2005


On Mon, Dec 12, 2005 at 08:24:03PM -0500, Steven S. wrote:
 > 
 > 
 > same problem. no mixer devices, no sound.
 > 

I guess the codec may need some special handling.
Please apply attached patch too.
Did it make any difference?

-- 
Regards,
Pyun YongHyeon
-------------- next part --------------
--- sys/dev/sound/pcm/ac97.c.orig	Tue Dec 13 09:29:05 2005
+++ sys/dev/sound/pcm/ac97.c	Tue Dec 13 13:12:08 2005
@@ -317,10 +317,30 @@
 	return AC97_READ(codec->methods, codec->devinfo, reg);
 }
 
+static int
+ac97_valid_reg(struct ac97_info *codec, int reg)
+{
+
+	switch (codec->id) {
+	case 0x414b4d00: /* AK4540 */
+	case 0x414b4d01: /* AK4542 */
+		if (reg <= 0x1c || reg == 0x20 || reg == 0x26 || reg >= 0x7c)
+			return 1;
+		return 0;
+		/* NOTREACHED */
+		break;
+	default:
+		break;
+	}
+
+	return 1;
+}
+
 void
 ac97_wrcd(struct ac97_info *codec, int reg, u_int16_t val)
 {
-	AC97_WRITE(codec->methods, codec->devinfo, reg, val);
+	if (ac97_valid_reg(codec, reg))
+		AC97_WRITE(codec->methods, codec->devinfo, reg, val);
 }
 
 static void


More information about the freebsd-multimedia mailing list