summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>1999-11-29 23:01:59 +0000
committeralfred <alfred@FreeBSD.org>1999-11-29 23:01:59 +0000
commit45fc07fd1e5bebf1b658751b681e4491d4b26585 (patch)
tree105fb2171872f58d211634ae9e0f517f7b083c8f
parent881e17e778165a7b9996e02b2536b0bc141ea759 (diff)
downloadFreeBSD-src-45fc07fd1e5bebf1b658751b681e4491d4b26585.zip
FreeBSD-src-45fc07fd1e5bebf1b658751b681e4491d4b26585.tar.gz
tanimura implemented SNDCTL_DSP_GETODELAY for pcm.
Submitted by: tanimura
-rw-r--r--sys/dev/sound/pcm/dsp.c10
-rw-r--r--sys/sys/soundcard.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 3990866..c7d4850 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 1649f8a..f6f577a 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
OpenPOWER on IntegriCloud