From owner-freebsd-bugs@FreeBSD.ORG Fri Aug 12 02:40:12 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05B3216A41F for ; Fri, 12 Aug 2005 02:40:12 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DA7943D5C for ; Fri, 12 Aug 2005 02:40:11 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7C2eBLl015797 for ; Fri, 12 Aug 2005 02:40:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7C2eAHC015796; Fri, 12 Aug 2005 02:40:10 GMT (envelope-from gnats) Date: Fri, 12 Aug 2005 02:40:10 GMT Message-Id: <200508120240.j7C2eAHC015796@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Michael Seyfert Cc: Subject: Re: kern/84728: [sound] [patch] ac97 broken mixing capabilities X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Michael Seyfert List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2005 02:40:12 -0000 The following reply was made to PR kern/84728; it has been noted by GNATS. From: Michael Seyfert 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.