Date: Fri, 22 Apr 2005 21:10:14 -0400 From: Anish Mistry <mistry.7@osu.edu> To: freebsd-multimedia@freebsd.org Cc: Luigi Rizzo <rizzo@icir.org> Subject: Re: dev/sound patches to reduce latency Message-ID: <200504222110.21338.mistry.7@osu.edu> In-Reply-To: <20050422154654.A72976@xorpc.icir.org> References: <20050422154654.A72976@xorpc.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504222110.21338.mistry.7>