From owner-freebsd-multimedia@FreeBSD.ORG Sat Apr 23 01:09:50 2005 Return-Path: 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 A0CDA16A50D for ; Sat, 23 Apr 2005 01:09:50 +0000 (GMT) Received: from crumpet.united-ware.com (ddsl-66-42-172-210.fuse.net [66.42.172.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE9CB43D3F for ; Sat, 23 Apr 2005 01:09:49 +0000 (GMT) (envelope-from mistry.7@osu.edu) Received: from [192.168.1.100] (adsl-68-75-18-7.dsl.wotnoh.ameritech.net [68.75.18.7]) (authenticated bits=0)j3N0bMjO064201 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 22 Apr 2005 20:37:23 -0400 (EDT) (envelope-from mistry.7@osu.edu) From: Anish Mistry To: freebsd-multimedia@freebsd.org Date: Fri, 22 Apr 2005 21:10:14 -0400 User-Agent: KMail/1.8 References: <20050422154654.A72976@xorpc.icir.org> In-Reply-To: <20050422154654.A72976@xorpc.icir.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1617610.G2DgsgDqVb"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200504222110.21338.mistry.7@osu.edu> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on crumpet.united-ware.com cc: Luigi Rizzo Subject: Re: dev/sound patches to reduce latency X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2005 01:09:50 -0000 --nextPart1617610.G2DgsgDqVb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 22 April 2005 06:46 pm, Luigi Rizzo wrote: > attached are some patches for the sound driver to reduce latency > in the playback channel. > Background - by design, the driver tries to keep the "hard" buffer > (the one used by the hardware to play samples out) always full > even if userland supplied a small amount of data. While there is > an ioctl() to set the size of the buffer in terms of a blocksize > and number of blocks, the existing code failed in some cases to > push down the info to the hardware, and had the tendency to > use max-sized buffers in many cases. At 8khz, the 16k default > buffers could cause very large delays in the playback of audio. > > With this patches, we try to pass the user-specified blocksize down > to the hardware, and furthermore, use a small number of blocks in > the "hard" buffer to minimize latency. > > I'd appreciate if people could test this code and report any good > or bad news. I think it significantly improves what we have now. > It could still benefit from an additional improvement: > - make the choice of the number of buffers adaptive on the irq > rate. which is not a very complex thing to do, but should be done > in all individual drivers, so it takes a bit more testing. > > ---- detailed description --- > This patch touches the following files: > pci/ich.c > comments and fixes the block allocation algorithm > > pcm/channel.c > comment in detail the buffer sizing algorithm, and implement it. > The resulting code is, i believe, a lot simpler and more > readable than the previous one. > > pcm/dsp.c > mostly comments to the existing code. > > Also partly related: > pcm/ac97.c > enables the "igain" mixer to drive the 20dB boost for the mic. > What version is the diff against? It doesn't seem to apply cleanly to=20 =2DSTABLE or -CURRENT. =2D-=20 Anish Mistry --nextPart1617610.G2DgsgDqVb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQBCaaB9xqA5ziudZT0RAunAAJ9aX2qglJtKV2DNlDEtmabjW2tnsQCguYE4 X0QzPy/QER2CHCqe+rXUsek= =URFj -----END PGP SIGNATURE----- --nextPart1617610.G2DgsgDqVb--