From 5b78a734431391e349db85ccbf54889f11055fcc Mon Sep 17 00:00:00 2001 From: Cameron Grant Date: Tue, 28 Sep 1999 21:43:35 +0000 Subject: [PATCH] * add a non-reset device- will not reset the channel on open. you will have to mknod yourself for now. * don't eat the first write() * partial rvplayer fix- don't panic on unaligned writes unless our feeder chain requires them for downconversion. a fuller fix is on the way. --- sys/dev/pcm/channel.c | 14 ++++++++------ sys/dev/pcm/channel.h | 1 + sys/dev/pcm/datatypes.h | 2 ++ sys/dev/pcm/dsp.c | 34 ++++++++++++++++++++++++---------- sys/dev/pcm/feeder.c | 23 +++++++++++++---------- sys/dev/pcm/sound.c | 4 ++++ sys/dev/pcm/sound.h | 1 + sys/dev/sound/pcm/channel.c | 14 ++++++++------ sys/dev/sound/pcm/channel.h | 1 + sys/dev/sound/pcm/datatypes.h | 2 ++ sys/dev/sound/pcm/dsp.c | 34 ++++++++++++++++++++++++---------- sys/dev/sound/pcm/feeder.c | 23 +++++++++++++---------- sys/dev/sound/pcm/sound.c | 4 ++++ sys/dev/sound/pcm/sound.h | 1 + 14 files changed, 106 insertions(+), 52 deletions(-) diff --git a/sys/dev/pcm/channel.c b/sys/dev/pcm/channel.c index 1bc8056c1842..bb46e03f8e88 100644 --- a/sys/dev/pcm/channel.c +++ b/sys/dev/pcm/channel.c @@ -36,7 +36,6 @@ #define ISA_DMA(b) (((b)->chan >= 0 && (b)->chan != 4 && (b)->chan < 8)) #define CANCHANGE(c) (!(c)->buffer.dl) -static int chn_reinit(pcm_channel *c); static void chn_stintr(pcm_channel *c); /* * SOUND OUTPUT @@ -256,7 +255,7 @@ chn_wrintr(pcm_channel *c) int chn_write(pcm_channel *c, struct uio *buf) { - int l, w, timeout, ret = 0; + int a, l, w, timeout, ret = 0; long s; snd_dbuf *b = &c->buffer; @@ -267,6 +266,7 @@ chn_write(pcm_channel *c, struct uio *buf) tsleep(&s, PZERO, "pcmwrW", hz); return EBUSY; } + a = (1 << c->align) - 1; c->flags |= CHN_F_WRITING; while (buf->uio_resid > 0) { s = spltty(); @@ -282,7 +282,9 @@ chn_write(pcm_channel *c, struct uio *buf) continue; } /* ensure we always have a whole number of samples */ - l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK; + l = min(b->fl, b->bufsize - b->fp); + if (l & a) panic("unaligned write %d, %d", l, a + 1); + l &= ~a; w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf); if (w == 0) panic("no feed"); s = spltty(); @@ -430,8 +432,8 @@ chn_read(pcm_channel *c, struct uio *buf) void chn_intr(pcm_channel *c) { - if (!c->buffer.dl) chn_reinit(c); - if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); +/* if (!c->buffer.dl) chn_reinit(c); +*/ if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); } static void @@ -627,7 +629,7 @@ chn_reset(pcm_channel *c) return 0; } -static int +int chn_reinit(pcm_channel *c) { if ((c->flags & CHN_F_INIT) && CANCHANGE(c)) { diff --git a/sys/dev/pcm/channel.h b/sys/dev/pcm/channel.h index b8d92d0bf0f2..c00abcb29231 100644 --- a/sys/dev/pcm/channel.h +++ b/sys/dev/pcm/channel.h @@ -26,6 +26,7 @@ * $FreeBSD$ */ +int chn_reinit(pcm_channel *c); int chn_write(pcm_channel *c, struct uio *buf); int chn_read(pcm_channel *c, struct uio *buf); int chn_sync(pcm_channel *c, int threshold); diff --git a/sys/dev/pcm/datatypes.h b/sys/dev/pcm/datatypes.h index c4259135f5b9..4a38679e45c5 100644 --- a/sys/dev/pcm/datatypes.h +++ b/sys/dev/pcm/datatypes.h @@ -79,6 +79,7 @@ typedef int (pcmfeed_feed_t)(pcm_feeder *feeder, u_int8_t *buffer, u_int32_t cou struct _pcm_feeder { char name[16]; + int align; pcmfeed_init_t *init; pcmfeed_free_t *free; pcmfeed_feed_t *feed; @@ -110,6 +111,7 @@ struct _pcm_channel { pcmchan_getptr_t *getptr; pcmchan_getcaps_t *getcaps; pcm_feeder *feeder; + u_int32_t align; int volume; u_int32_t speed; diff --git a/sys/dev/pcm/dsp.c b/sys/dev/pcm/dsp.c index de2318a01707..74a0202cf942 100644 --- a/sys/dev/pcm/dsp.c +++ b/sys/dev/pcm/dsp.c @@ -115,6 +115,10 @@ dsp_open(snddev_info *d, int chan, int oflags, int devtype) fmt = AFMT_MU_LAW; break; + case SND_DEV_NORESET: + fmt = 0; + break; + default: return ENXIO; } @@ -122,18 +126,22 @@ dsp_open(snddev_info *d, int chan, int oflags, int devtype) if (rdch) { chn_reset(rdch); if (oflags & O_NONBLOCK) rdch->flags |= CHN_F_NBIO; - rdch->volume = (100 << 8) | 100; - rdch->format = fmt; - rdch->speed = DSP_DEFAULT_SPEED; - rdch->blocksize = 2048; + if (fmt) { + rdch->volume = (100 << 8) | 100; + rdch->format = fmt; + rdch->speed = DSP_DEFAULT_SPEED; + rdch->blocksize = 2048; + } } if (wrch) { chn_reset(wrch); if (oflags & O_NONBLOCK) wrch->flags |= CHN_F_NBIO; - wrch->volume = (100 << 8) | 100; - wrch->format = fmt; - wrch->speed = DSP_DEFAULT_SPEED; - wrch->blocksize = 2048; + if (fmt) { + wrch->volume = (100 << 8) | 100; + wrch->format = fmt; + wrch->speed = DSP_DEFAULT_SPEED; + wrch->blocksize = 2048; + } } return 0; } @@ -168,7 +176,10 @@ dsp_read(snddev_info *d, int chan, struct uio *buf, int flag) if (!rdch || !(rdch->flags & CHN_F_BUSY)) panic("dsp_read: non%s channel", rdch? "busy" : "existant"); if (rdch->flags & CHN_F_MAPPED) return EINVAL; - if (!(rdch->flags & CHN_F_RUNNING)) rdch->flags |= CHN_F_RUNNING; + if (!(rdch->flags & CHN_F_RUNNING)) { + rdch->flags |= CHN_F_RUNNING; + chn_reinit(rdch); + } return chn_read(rdch, buf); } @@ -183,7 +194,10 @@ dsp_write(snddev_info *d, int chan, struct uio *buf, int flag) if (!wrch || !(wrch->flags & CHN_F_BUSY)) panic("dsp_write: non%s channel", wrch? "busy" : "existant"); if (wrch->flags & CHN_F_MAPPED) return EINVAL; - if (!(wrch->flags & CHN_F_RUNNING)) wrch->flags |= CHN_F_RUNNING; + if (!(wrch->flags & CHN_F_RUNNING)) { + wrch->flags |= CHN_F_RUNNING; + chn_reinit(wrch); + } return chn_write(wrch, buf); } diff --git a/sys/dev/pcm/feeder.c b/sys/dev/pcm/feeder.c index f579b298e292..6c596d51a59f 100644 --- a/sys/dev/pcm/feeder.c +++ b/sys/dev/pcm/feeder.c @@ -120,7 +120,7 @@ feed_root(pcm_feeder *feeder, u_int8_t *buffer, u_int32_t count, struct uio *str if (!tmp) panic("feed_root: uiomove didn't"); return tmp; } -pcm_feeder feeder_root = { "root", NULL, NULL, feed_root }; +pcm_feeder feeder_root = { "root", 0, NULL, NULL, feed_root }; /*****************************************************************************/ @@ -137,7 +137,7 @@ feed_8to16(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) } return k * 2; } -static pcm_feeder feeder_8to16 = { "8to16", NULL, NULL, feed_8to16 }; +static pcm_feeder feeder_8to16 = { "8to16", 0, NULL, NULL, feed_8to16 }; /*****************************************************************************/ @@ -169,7 +169,7 @@ feed_16to8le(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_16to8le = - { "16to8le", feed_16to8_init, feed_16to8_free, feed_16to8le }; + { "16to8le", 1, feed_16to8_init, feed_16to8_free, feed_16to8le }; /*****************************************************************************/ @@ -187,7 +187,7 @@ feed_monotostereo8(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stre return k * 2; } static pcm_feeder feeder_monotostereo8 = - { "monotostereo8", NULL, NULL, feed_monotostereo8 }; + { "monotostereo8", 0, NULL, NULL, feed_monotostereo8 }; /*****************************************************************************/ @@ -219,7 +219,7 @@ feed_stereotomono8(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stre return i; } static pcm_feeder feeder_stereotomono8 = - { "stereotomono8", feed_stereotomono8_init, feed_stereotomono8_free, + { "stereotomono8", 1, feed_stereotomono8_init, feed_stereotomono8_free, feed_stereotomono8 }; /*****************************************************************************/ @@ -237,7 +237,7 @@ feed_endian(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) } return i; } -static pcm_feeder feeder_endian = { "endian", NULL, NULL, feed_endian }; +static pcm_feeder feeder_endian = { "endian", -1, NULL, NULL, feed_endian }; /*****************************************************************************/ @@ -253,9 +253,9 @@ feed_sign(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_sign8 = - { "sign8", NULL, NULL, feed_sign, (void *)1 }; + { "sign8", 0, NULL, NULL, feed_sign, (void *)1 }; static pcm_feeder feeder_sign16 = - { "sign16", NULL, NULL, feed_sign, (void *)2 }; + { "sign16", -1, NULL, NULL, feed_sign, (void *)2 }; /*****************************************************************************/ @@ -270,9 +270,9 @@ feed_table(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_ulawtou8 = - { "ulawtou8", NULL, NULL, feed_table, ulaw_to_u8 }; + { "ulawtou8", 0, NULL, NULL, feed_table, ulaw_to_u8 }; static pcm_feeder feeder_u8toulaw = - { "u8toulaw", NULL, NULL, feed_table, u8_to_ulaw }; + { "u8toulaw", 0, NULL, NULL, feed_table, u8_to_ulaw }; /*****************************************************************************/ @@ -358,6 +358,7 @@ chn_feedchain(pcm_channel *c) struct fmtcvt *e; while (chn_removefeeder(c) != -1); + c->align = 0; if ((c->format & chn_getcaps(c)->formats) == c->format) return c->format; getspec(c->format, &s); @@ -389,6 +390,8 @@ chn_addfeeder(pcm_channel *c, pcm_feeder *f) n->source = c->feeder; c->feeder = n; if (n->init) n->init(n); + if (n->align > 0) c->align += n->align; + else if (n->align < 0 && c->align < -n->align) c->align -= n->align; return 0; } diff --git a/sys/dev/pcm/sound.c b/sys/dev/pcm/sound.c index 8aff3e677a97..7f659dd093a8 100644 --- a/sys/dev/pcm/sound.c +++ b/sys/dev/pcm/sound.c @@ -84,6 +84,9 @@ currently minor = (channel << 8) + (unit << 4) + dev /dev/pcmX/status /dev/pcmX/mixer [etc.] + +currently: +minor = (channel << 8) + (unit << 4) + dev */ #define PCMMINOR(x) (minor(x)) @@ -235,6 +238,7 @@ sndopen(dev_t i_dev, int flags, int mode, struct proc *p) case SND_DEV_AUDIO: case SND_DEV_DSP: case SND_DEV_DSP16: + case SND_DEV_NORESET: return d? dsp_open(d, chan, flags, dev) : ENXIO; default: diff --git a/sys/dev/pcm/sound.h b/sys/dev/pcm/sound.h index 72b41a5e237d..6ef6c726671b 100644 --- a/sys/dev/pcm/sound.h +++ b/sys/dev/pcm/sound.h @@ -142,6 +142,7 @@ int fkchan_setup(pcm_channel *c); #define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ #define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ #define SND_DEV_PSS SND_DEV_SNDPROC /* ? */ +#define SND_DEV_NORESET 10 #define DSP_DEFAULT_SPEED 8000 diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 1bc8056c1842..bb46e03f8e88 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -36,7 +36,6 @@ #define ISA_DMA(b) (((b)->chan >= 0 && (b)->chan != 4 && (b)->chan < 8)) #define CANCHANGE(c) (!(c)->buffer.dl) -static int chn_reinit(pcm_channel *c); static void chn_stintr(pcm_channel *c); /* * SOUND OUTPUT @@ -256,7 +255,7 @@ chn_wrintr(pcm_channel *c) int chn_write(pcm_channel *c, struct uio *buf) { - int l, w, timeout, ret = 0; + int a, l, w, timeout, ret = 0; long s; snd_dbuf *b = &c->buffer; @@ -267,6 +266,7 @@ chn_write(pcm_channel *c, struct uio *buf) tsleep(&s, PZERO, "pcmwrW", hz); return EBUSY; } + a = (1 << c->align) - 1; c->flags |= CHN_F_WRITING; while (buf->uio_resid > 0) { s = spltty(); @@ -282,7 +282,9 @@ chn_write(pcm_channel *c, struct uio *buf) continue; } /* ensure we always have a whole number of samples */ - l = min(b->fl, b->bufsize - b->fp) & DMA_ALIGN_MASK; + l = min(b->fl, b->bufsize - b->fp); + if (l & a) panic("unaligned write %d, %d", l, a + 1); + l &= ~a; w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf); if (w == 0) panic("no feed"); s = spltty(); @@ -430,8 +432,8 @@ chn_read(pcm_channel *c, struct uio *buf) void chn_intr(pcm_channel *c) { - if (!c->buffer.dl) chn_reinit(c); - if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); +/* if (!c->buffer.dl) chn_reinit(c); +*/ if (c->direction == PCMDIR_PLAY) chn_wrintr(c); else chn_rdintr(c); } static void @@ -627,7 +629,7 @@ chn_reset(pcm_channel *c) return 0; } -static int +int chn_reinit(pcm_channel *c) { if ((c->flags & CHN_F_INIT) && CANCHANGE(c)) { diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index b8d92d0bf0f2..c00abcb29231 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -26,6 +26,7 @@ * $FreeBSD$ */ +int chn_reinit(pcm_channel *c); int chn_write(pcm_channel *c, struct uio *buf); int chn_read(pcm_channel *c, struct uio *buf); int chn_sync(pcm_channel *c, int threshold); diff --git a/sys/dev/sound/pcm/datatypes.h b/sys/dev/sound/pcm/datatypes.h index c4259135f5b9..4a38679e45c5 100644 --- a/sys/dev/sound/pcm/datatypes.h +++ b/sys/dev/sound/pcm/datatypes.h @@ -79,6 +79,7 @@ typedef int (pcmfeed_feed_t)(pcm_feeder *feeder, u_int8_t *buffer, u_int32_t cou struct _pcm_feeder { char name[16]; + int align; pcmfeed_init_t *init; pcmfeed_free_t *free; pcmfeed_feed_t *feed; @@ -110,6 +111,7 @@ struct _pcm_channel { pcmchan_getptr_t *getptr; pcmchan_getcaps_t *getcaps; pcm_feeder *feeder; + u_int32_t align; int volume; u_int32_t speed; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index de2318a01707..74a0202cf942 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -115,6 +115,10 @@ dsp_open(snddev_info *d, int chan, int oflags, int devtype) fmt = AFMT_MU_LAW; break; + case SND_DEV_NORESET: + fmt = 0; + break; + default: return ENXIO; } @@ -122,18 +126,22 @@ dsp_open(snddev_info *d, int chan, int oflags, int devtype) if (rdch) { chn_reset(rdch); if (oflags & O_NONBLOCK) rdch->flags |= CHN_F_NBIO; - rdch->volume = (100 << 8) | 100; - rdch->format = fmt; - rdch->speed = DSP_DEFAULT_SPEED; - rdch->blocksize = 2048; + if (fmt) { + rdch->volume = (100 << 8) | 100; + rdch->format = fmt; + rdch->speed = DSP_DEFAULT_SPEED; + rdch->blocksize = 2048; + } } if (wrch) { chn_reset(wrch); if (oflags & O_NONBLOCK) wrch->flags |= CHN_F_NBIO; - wrch->volume = (100 << 8) | 100; - wrch->format = fmt; - wrch->speed = DSP_DEFAULT_SPEED; - wrch->blocksize = 2048; + if (fmt) { + wrch->volume = (100 << 8) | 100; + wrch->format = fmt; + wrch->speed = DSP_DEFAULT_SPEED; + wrch->blocksize = 2048; + } } return 0; } @@ -168,7 +176,10 @@ dsp_read(snddev_info *d, int chan, struct uio *buf, int flag) if (!rdch || !(rdch->flags & CHN_F_BUSY)) panic("dsp_read: non%s channel", rdch? "busy" : "existant"); if (rdch->flags & CHN_F_MAPPED) return EINVAL; - if (!(rdch->flags & CHN_F_RUNNING)) rdch->flags |= CHN_F_RUNNING; + if (!(rdch->flags & CHN_F_RUNNING)) { + rdch->flags |= CHN_F_RUNNING; + chn_reinit(rdch); + } return chn_read(rdch, buf); } @@ -183,7 +194,10 @@ dsp_write(snddev_info *d, int chan, struct uio *buf, int flag) if (!wrch || !(wrch->flags & CHN_F_BUSY)) panic("dsp_write: non%s channel", wrch? "busy" : "existant"); if (wrch->flags & CHN_F_MAPPED) return EINVAL; - if (!(wrch->flags & CHN_F_RUNNING)) wrch->flags |= CHN_F_RUNNING; + if (!(wrch->flags & CHN_F_RUNNING)) { + wrch->flags |= CHN_F_RUNNING; + chn_reinit(wrch); + } return chn_write(wrch, buf); } diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index f579b298e292..6c596d51a59f 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -120,7 +120,7 @@ feed_root(pcm_feeder *feeder, u_int8_t *buffer, u_int32_t count, struct uio *str if (!tmp) panic("feed_root: uiomove didn't"); return tmp; } -pcm_feeder feeder_root = { "root", NULL, NULL, feed_root }; +pcm_feeder feeder_root = { "root", 0, NULL, NULL, feed_root }; /*****************************************************************************/ @@ -137,7 +137,7 @@ feed_8to16(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) } return k * 2; } -static pcm_feeder feeder_8to16 = { "8to16", NULL, NULL, feed_8to16 }; +static pcm_feeder feeder_8to16 = { "8to16", 0, NULL, NULL, feed_8to16 }; /*****************************************************************************/ @@ -169,7 +169,7 @@ feed_16to8le(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_16to8le = - { "16to8le", feed_16to8_init, feed_16to8_free, feed_16to8le }; + { "16to8le", 1, feed_16to8_init, feed_16to8_free, feed_16to8le }; /*****************************************************************************/ @@ -187,7 +187,7 @@ feed_monotostereo8(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stre return k * 2; } static pcm_feeder feeder_monotostereo8 = - { "monotostereo8", NULL, NULL, feed_monotostereo8 }; + { "monotostereo8", 0, NULL, NULL, feed_monotostereo8 }; /*****************************************************************************/ @@ -219,7 +219,7 @@ feed_stereotomono8(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stre return i; } static pcm_feeder feeder_stereotomono8 = - { "stereotomono8", feed_stereotomono8_init, feed_stereotomono8_free, + { "stereotomono8", 1, feed_stereotomono8_init, feed_stereotomono8_free, feed_stereotomono8 }; /*****************************************************************************/ @@ -237,7 +237,7 @@ feed_endian(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) } return i; } -static pcm_feeder feeder_endian = { "endian", NULL, NULL, feed_endian }; +static pcm_feeder feeder_endian = { "endian", -1, NULL, NULL, feed_endian }; /*****************************************************************************/ @@ -253,9 +253,9 @@ feed_sign(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_sign8 = - { "sign8", NULL, NULL, feed_sign, (void *)1 }; + { "sign8", 0, NULL, NULL, feed_sign, (void *)1 }; static pcm_feeder feeder_sign16 = - { "sign16", NULL, NULL, feed_sign, (void *)2 }; + { "sign16", -1, NULL, NULL, feed_sign, (void *)2 }; /*****************************************************************************/ @@ -270,9 +270,9 @@ feed_table(pcm_feeder *f, u_int8_t *b, u_int32_t count, struct uio *stream) return i; } static pcm_feeder feeder_ulawtou8 = - { "ulawtou8", NULL, NULL, feed_table, ulaw_to_u8 }; + { "ulawtou8", 0, NULL, NULL, feed_table, ulaw_to_u8 }; static pcm_feeder feeder_u8toulaw = - { "u8toulaw", NULL, NULL, feed_table, u8_to_ulaw }; + { "u8toulaw", 0, NULL, NULL, feed_table, u8_to_ulaw }; /*****************************************************************************/ @@ -358,6 +358,7 @@ chn_feedchain(pcm_channel *c) struct fmtcvt *e; while (chn_removefeeder(c) != -1); + c->align = 0; if ((c->format & chn_getcaps(c)->formats) == c->format) return c->format; getspec(c->format, &s); @@ -389,6 +390,8 @@ chn_addfeeder(pcm_channel *c, pcm_feeder *f) n->source = c->feeder; c->feeder = n; if (n->init) n->init(n); + if (n->align > 0) c->align += n->align; + else if (n->align < 0 && c->align < -n->align) c->align -= n->align; return 0; } diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 8aff3e677a97..7f659dd093a8 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -84,6 +84,9 @@ currently minor = (channel << 8) + (unit << 4) + dev /dev/pcmX/status /dev/pcmX/mixer [etc.] + +currently: +minor = (channel << 8) + (unit << 4) + dev */ #define PCMMINOR(x) (minor(x)) @@ -235,6 +238,7 @@ sndopen(dev_t i_dev, int flags, int mode, struct proc *p) case SND_DEV_AUDIO: case SND_DEV_DSP: case SND_DEV_DSP16: + case SND_DEV_NORESET: return d? dsp_open(d, chan, flags, dev) : ENXIO; default: diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 72b41a5e237d..6ef6c726671b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -142,6 +142,7 @@ int fkchan_setup(pcm_channel *c); #define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ #define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ #define SND_DEV_PSS SND_DEV_SNDPROC /* ? */ +#define SND_DEV_NORESET 10 #define DSP_DEFAULT_SPEED 8000