Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2005 02:40:10 GMT
From:      Michael Seyfert <michael.seyfert@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/84728: [sound] [patch] ac97 broken mixing capabilities
Message-ID:  <200508120240.j7C2eAHC015796@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/84728; it has been noted by GNATS.

From: Michael Seyfert <michael.seyfert@gmail.com>
To: skywizard@mybsd.org.my
Cc: bug-followup@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508120240.j7C2eAHC015796>