kern/84728: [sound] [patch] ac97 broken mixing capabilities checking

Michael Seyfert michaels at sdf.lonestar.org
Sun Aug 14 20:10:23 GMT 2005


The following reply was made to PR kern/84728; it has been noted by GNATS.

From: Michael Seyfert <michaels at sdf.lonestar.org>
To: bug-followup at FreeBSD.org
Cc: skywizard at MyBSD.org.my
Subject: Re: kern/84728: [sound] [patch] ac97 broken mixing capabilities checking
Date: Sun, 14 Aug 2005 20:00:56 +0000

 Sorry I had the wrong encoding in my editor for that patch..
 
 --- sys/dev/sound/pcm/ac97.c	Sun Jul 31 08:28:31 2005
 +++ ../ac97.c	Thu Aug 11 20:12:47 2005
 @@ -622,19 +622,15 @@
  					j |= 0x8000;
  				ac97_wrcd(codec, codec->mix[i].reg, j);
  				j = ac97_rdcd(codec, codec->mix[i].reg) & j;
 -				j >>= codec->mix[i].ofs;
 -				if (codec->mix[i].reg == AC97_MIX_TONE &&
 -						((j & 0x0001) == 0x0000))
 -					j >>= 1;
 -				for (k = 0; j != 0; k++)
 -					j >>= 1;
 -				for (j = 0; k != 0; j++)
 -					k >>= 1;
  				if (j != 0) {
  					codec->mix[i].enable = 1;
 -#if 0
 -					codec->mix[i].bits = j;
 -#endif
 +					/* Get the width of the control field. */
 +					j = ((1 << 6) - 1) << codec->mix[i].ofs;
 +					ac97_wrcd(codec, codec->mix[i].reg, j);
 +					j = ac97_rdcd(codec, codec->mix[i].reg) & j;
 +					j >>= codec->mix[i].ofs;
 +					for (k = 1; j & (1 << k); k++);
 +					codec->mix[i].bits = k;
  				} else
  					codec->mix[i].enable = 0;
  			} else
 
 
 If this doesn't work then I'm giving up.. I tried all of your patches
 in that directory. My sound didn't work at all. Can't we just
 keep it simple?
 Anyways, if I'm the only one affected by this then it's not a big
 deal.


More information about the freebsd-bugs mailing list