Disable frantic DMA update within few SNDCTL_DSP_* ioctl.

This should reduce huge playback / recording latency for
applications that try to act smarter and manage their own
buffering (XMMS, Skype, etc.).

Note to Skype + via8xxx users: Remove previous hackish
"hint.pcm.<unit>.via_dxs_disabled" from kernel hint and see
whether this changes cure all those annoying sound issues.
This commit is contained in:
Ariff Abdullah 2005-12-30 07:33:28 +00:00
parent 764907327e
commit f935ac6015
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153869

View File

@ -879,7 +879,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
struct snd_dbuf *bs = wrch->bufsoft;
CHN_LOCK(wrch);
chn_wrupdate(wrch);
/* XXX abusive DMA update: chn_wrupdate(wrch); */
a->bytes = sndbuf_getfree(bs);
a->fragments = a->bytes / sndbuf_getblksz(bs);
a->fragstotal = sndbuf_getblkcnt(bs);
@ -896,7 +896,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
struct snd_dbuf *bs = rdch->bufsoft;
CHN_LOCK(rdch);
chn_rdupdate(rdch);
/* XXX abusive DMA update: chn_rdupdate(rdch); */
a->bytes = sndbuf_gettotal(bs);
a->blocks = sndbuf_getblocks(bs) - rdch->blocks;
a->ptr = sndbuf_getreadyptr(bs);
@ -914,7 +914,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
struct snd_dbuf *bs = wrch->bufsoft;
CHN_LOCK(wrch);
chn_wrupdate(wrch);
/* XXX abusive DMA update: chn_wrupdate(wrch); */
a->bytes = sndbuf_gettotal(bs);
a->blocks = sndbuf_getblocks(bs) - wrch->blocks;
a->ptr = sndbuf_getreadyptr(bs);
@ -990,7 +990,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, struct thread *
struct snd_dbuf *bs = wrch->bufsoft;
CHN_LOCK(wrch);
chn_wrupdate(wrch);
/* XXX abusive DMA update: chn_wrupdate(wrch); */
*arg_i = sndbuf_getready(b) + sndbuf_getready(bs);
CHN_UNLOCK(wrch);
} else