From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 19 22:47:11 2006 Return-Path: X-Original-To: freebsd-multimedia@FreeBSD.org Delivered-To: freebsd-multimedia@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21B6B16A403 for ; Wed, 19 Apr 2006 22:47:11 +0000 (UTC) (envelope-from ariff@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D1F543D58; Wed, 19 Apr 2006 22:47:10 +0000 (GMT) (envelope-from ariff@FreeBSD.org) Received: from misaki (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with SMTP id k3JMl7h8096196; Wed, 19 Apr 2006 22:47:09 GMT (envelope-from ariff@FreeBSD.org) Date: Thu, 20 Apr 2006 06:47:00 +0800 From: Ariff Abdullah To: hartzell@alerce.com Message-Id: <20060420064700.48c63e27.ariff@FreeBSD.org> In-Reply-To: <17477.44637.316536.583639@satchel.alerce.com> References: <17477.44637.316536.583639@satchel.alerce.com> Organization: FreeBSD X-Mailer: /usr/local/lib/ruby/1.8/net/smtp.rb Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Thu__20_Apr_2006_06_47_00_+0800_iCpZzOg57C=/YQIE" Cc: freebsd-multimedia@FreeBSD.org Subject: Re: Odd code in sound/pcm/channel.c, help with PR? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2006 22:47:11 -0000 --Signature=_Thu__20_Apr_2006_06_47_00_+0800_iCpZzOg57C=/YQIE Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 18 Apr 2006 20:28:29 -0700 George Hartzell wrote: >=20 > I'm trying to get some traction and get sound to work on my ASUS > A8V-MX. I keep ending up with >=20 > pcm0:play:0::dsp0.0: play interrupt timeout, channel dead >=20 > on my console. >=20 > I've filed a PR with more details: >=20 > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D95949 >=20 > I've been looking around, trying to understand what might be going > on. I came across the following piece of code in > /usr/src/sys/device/sound/pcm/channel.com, around line 320 >=20 > timeout =3D (hz * sndbuf_getblksz(bs)) / (sndbuf_getspd(bs) * > sndbuf_getbps(bs)); if (timeout < 1) > timeout =3D 1; > timeout =3D 1; > ret =3D chn_sleep(c, "pcmwr", timeout); > if (ret =3D=3D EWOULDBLOCK) { > count -=3D timeout; > ret =3D 0; > } else if (ret =3D=3D 0) > count =3D hz; >=20 > It's funny that it goes to the trouble to figure out a timeout value > then seems to unconditionally set it to 1. >=20 It is indeed, funny :) > Removing that line doesn't seem to fix my problem, but it still > seems weird. >=20 >=20 > And, while I've got your attention, can anyone suggest where I might > look to understand why the buffer doesn't seem to be being emptied? >=20 It's because the hardware DMA pointer is being lazy and need a good spank on its face. Replace your sys/dev/sound/pci/via8233.c with: http://people.freebsd.org/~ariff/test/via8233.c As usual, recompile your kernel, or just the modules. If this doesn't work, I still have few more other tricks. Coincidently, I'm currently investigating DMA incoherency within few drivers, notably this and few others. -- Ariff Abdullah FreeBSD --Signature=_Thu__20_Apr_2006_06_47_00_+0800_iCpZzOg57C=/YQIE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFERr3nlr+deMUwTNoRAtCBAJ9CzYMVQc7O/9g7mwgwqyfQWjzdlwCfdGD2 qbLMKeUeqB0fSx/ZRjxiOqo= =tt29 -----END PGP SIGNATURE----- --Signature=_Thu__20_Apr_2006_06_47_00_+0800_iCpZzOg57C=/YQIE--