kern/84728: [sound] [patch] ac97 broken mixing capabilities
Michael Seyfert
michael.seyfert at gmail.com
Fri Aug 12 02:40:12 GMT 2005
The following reply was made to PR kern/84728; it has been noted by GNATS.
From: Michael Seyfert <michael.seyfert at gmail.com>
To: skywizard at mybsd.org.my
Cc: bug-followup at FreeBSD.org
Subject: Re: kern/84728: [sound] [patch] ac97 broken mixing capabilities
Date: Thu, 11 Aug 2005 20:33:01 -0600
> No good for various STAC* / ALC (the reason for why this new detection me=
chanism).
> Ok.. I think this will do the job for both of us and others too:
> .......
Umm. I don't get any sound with that patch, I'm not sure why..
Try this one. I didn't change the functionality of your code, but
added another read / write to get the control field width..
--- sys/dev/sound/pcm/ac97.c=09Sun Jul 31 08:28:31 2005
+++ ../ac97.c=09Thu Aug 11 20:12:47 2005
@@ -622,19 +622,15 @@
=09=09=09=09=09j |=3D 0x8000;
=09=09=09=09ac97_wrcd(codec, codec->mix[i].reg, j);
=09=09=09=09j =3D ac97_rdcd(codec, codec->mix[i].reg) & j;
-=09=09=09=09j >>=3D codec->mix[i].ofs;
-=09=09=09=09if (codec->mix[i].reg =3D=3D AC97_MIX_TONE &&
-=09=09=09=09=09=09((j & 0x0001) =3D=3D 0x0000))
-=09=09=09=09=09j >>=3D 1;
-=09=09=09=09for (k =3D 0; j !=3D 0; k++)
-=09=09=09=09=09j >>=3D 1;
-=09=09=09=09for (j =3D 0; k !=3D 0; j++)
-=09=09=09=09=09k >>=3D 1;
=09=09=09=09if (j !=3D 0) {
=09=09=09=09=09codec->mix[i].enable =3D 1;
-#if 0
-=09=09=09=09=09codec->mix[i].bits =3D j;
-#endif
+=09=09=09=09=09/* Get the width of the control field. */
+=09=09=09=09=09j =3D ((1 << 6) - 1) << codec->mix[i].ofs;
+=09=09=09=09=09ac97_wrcd(codec, codec->mix[i].reg, j);
+=09=09=09=09=09j =3D ac97_rdcd(codec, codec->mix[i].reg) & j;
+=09=09=09=09=09j >>=3D codec->mix[i].ofs;
+=09=09=09=09=09for (k =3D 1; j & (1 << k); k++);
+=09=09=09=09=09codec->mix[i].bits =3D k;
=09=09=09=09} else
=09=09=09=09=09codec->mix[i].enable =3D 0;
=09=09=09} else
Note: you do not need these lines, they don't change whether or not j =3D=
=3D 0
=09=09=09=09j >>=3D codec->mix[i].ofs;
=09=09=09=09if (codec->mix[i].reg =3D=3D AC97_MIX_TONE &&
=09=09=09=09=09=09((j & 0x0001) =3D=3D 0x0000))
=09=09=09=09=09j >>=3D 1;
=09=09=09=09for (k =3D 0; j !=3D 0; k++)
=09=09=09=09=09j >>=3D 1;
=09=09=09=09for (j =3D 0; k !=3D 0; j++)
=09=09=09=09=09k >>=3D 1;
The problem with my card is that bits needs to be 6 instead of 5 for
pcm and vol.. So hopefully that patch will work.
More information about the freebsd-bugs
mailing list