From 4d25c041fe3a08f457824a787c3db7b2ffe394e0 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Mon, 29 Nov 1999 23:01:59 +0000 Subject: [PATCH] tanimura implemented SNDCTL_DSP_GETODELAY for pcm. Submitted by: tanimura --- sys/dev/sound/pcm/dsp.c | 10 ++++++++++ sys/sys/soundcard.h | 1 + 2 files changed, 11 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 3990866648f3..c7d4850776f1 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -509,6 +509,16 @@ dsp_ioctl(snddev_info *d, int chan, u_long cmd, caddr_t arg) *arg_i |= PCM_ENABLE_INPUT; break; + case SNDCTL_DSP_GETODELAY: + if (wrch) { + snd_dbuf *b = &wrch->buffer; + if (b->dl) + chn_dmaupdate(wrch); + *arg = b->total; + } else + ret = EINVAL; + break; + case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: case SNDCTL_DSP_SETSYNCRO: diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index 1649f8a754e1..f6f577a1cd1f 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -798,6 +798,7 @@ typedef struct buffmem_desc { #define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, buffmem_desc) #define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, buffmem_desc) #define SNDCTL_DSP_SETSYNCRO _IO ('P', 21) +#define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int) /* * I guess these are the readonly version of the same