Convert to new orthogonal audio encoding scheme and implement

some of the new encodings.  The change to ioctl AUDIO_GETENC is
NOT backwards compatible.
This commit is contained in:
augustss 1997-05-07 18:51:31 +00:00
parent 8ae8b46853
commit c4a52794f1
15 changed files with 263 additions and 105 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lmcaudio.c,v 1.5 1997/04/29 21:01:50 augustss Exp $ */
/* $NetBSD: lmcaudio.c,v 1.6 1997/05/07 18:51:31 augustss Exp $ */
/*
* Copyright (c) 1996, Danny C Tsen.
@ -366,7 +366,7 @@ lmcaudio_set_in_params(addr, p)
{
struct vidcaudio_softc *sc = addr;
if (p->encoding != AUDIO_ENCODING_PCM16 ||
if (p->encoding != AUDIO_ENCODING_LINEAR_LE ||
p->precision != 16 ||
p->channels != 2)
return EINVAL;
@ -380,7 +380,7 @@ lmcaudio_set_out_params(addr, p)
{
struct vidcaudio_softc *sc = addr;
if (p->encoding != AUDIO_ENCODING_PCM16 ||
if (p->encoding != AUDIO_ENCODING_LINEAR_LE ||
p->precision != 16 ||
p->channels != 2)
return EINVAL;
@ -395,8 +395,10 @@ lmcaudio_query_encoding(addr, fp)
{
switch (fp->index) {
case 0:
strcpy (fp->name, AudioElinear);
fp->format_id = AUDIO_ENCODING_LINEAR;
strcpy (fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: vidcaudio.c,v 1.11 1997/04/29 21:01:51 augustss Exp $ */
/* $NetBSD: vidcaudio.c,v 1.12 1997/05/07 18:51:33 augustss Exp $ */
/*
* Copyright (c) 1995 Melvin Tang-Richardson
@ -327,7 +327,9 @@ int vidcaudio_query_encoding ( void *addr, struct audio_encoding *fp )
{
case 0:
strcpy (fp->name, "vidc" );
fp->format_id = AUDIO_ENCODING_ULAW;
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: lmcaudio.c,v 1.5 1997/04/29 21:01:50 augustss Exp $ */
/* $NetBSD: lmcaudio.c,v 1.6 1997/05/07 18:51:31 augustss Exp $ */
/*
* Copyright (c) 1996, Danny C Tsen.
@ -366,7 +366,7 @@ lmcaudio_set_in_params(addr, p)
{
struct vidcaudio_softc *sc = addr;
if (p->encoding != AUDIO_ENCODING_PCM16 ||
if (p->encoding != AUDIO_ENCODING_LINEAR_LE ||
p->precision != 16 ||
p->channels != 2)
return EINVAL;
@ -380,7 +380,7 @@ lmcaudio_set_out_params(addr, p)
{
struct vidcaudio_softc *sc = addr;
if (p->encoding != AUDIO_ENCODING_PCM16 ||
if (p->encoding != AUDIO_ENCODING_LINEAR_LE ||
p->precision != 16 ||
p->channels != 2)
return EINVAL;
@ -395,8 +395,10 @@ lmcaudio_query_encoding(addr, fp)
{
switch (fp->index) {
case 0:
strcpy (fp->name, AudioElinear);
fp->format_id = AUDIO_ENCODING_LINEAR;
strcpy (fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: vidcaudio.c,v 1.11 1997/04/29 21:01:51 augustss Exp $ */
/* $NetBSD: vidcaudio.c,v 1.12 1997/05/07 18:51:33 augustss Exp $ */
/*
* Copyright (c) 1995 Melvin Tang-Richardson
@ -327,7 +327,9 @@ int vidcaudio_query_encoding ( void *addr, struct audio_encoding *fp )
{
case 0:
strcpy (fp->name, "vidc" );
fp->format_id = AUDIO_ENCODING_ULAW;
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7930_sparc.c,v 1.18 1997/04/29 21:01:48 augustss Exp $ */
/* $NetBSD: am7930_sparc.c,v 1.19 1997/05/07 18:51:35 augustss Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@ -418,8 +418,10 @@ amd7930_query_encoding(addr, fp)
{
switch (fp->index) { /* ??? */
case 0:
strcpy(fp->name, "MU-Law");
fp->format_id = AUDIO_ENCODING_ULAW;
strcpy(fp->name, AudioEmulaw);
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
default:
return(EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: amd7930.c,v 1.18 1997/04/29 21:01:48 augustss Exp $ */
/* $NetBSD: amd7930.c,v 1.19 1997/05/07 18:51:35 augustss Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@ -418,8 +418,10 @@ amd7930_query_encoding(addr, fp)
{
switch (fp->index) { /* ??? */
case 0:
strcpy(fp->name, "MU-Law");
fp->format_id = AUDIO_ENCODING_ULAW;
strcpy(fp->name, AudioEmulaw);
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
default:
return(EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ossaudio.c,v 1.7 1997/04/06 23:49:32 augustss Exp $ */
/* $NetBSD: ossaudio.c,v 1.8 1997/05/07 18:51:37 augustss Exp $ */
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
@ -121,6 +121,12 @@ oss_ioctl_audio(p, uap, retval)
tmpinfo.record.encoding = AUDIO_ENCODING_ALAW;
break;
case OSS_AFMT_U8:
tmpinfo.play.precision =
tmpinfo.record.precision = 8;
tmpinfo.play.encoding =
tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR;
break;
case OSS_AFMT_S8:
tmpinfo.play.precision =
tmpinfo.record.precision = 8;
tmpinfo.play.encoding =
@ -130,7 +136,25 @@ oss_ioctl_audio(p, uap, retval)
tmpinfo.play.precision =
tmpinfo.record.precision = 16;
tmpinfo.play.encoding =
tmpinfo.record.encoding = AUDIO_ENCODING_LINEAR;
tmpinfo.record.encoding = AUDIO_ENCODING_LINEAR_LE;
break;
case OSS_AFMT_S16_BE:
tmpinfo.play.precision =
tmpinfo.record.precision = 16;
tmpinfo.play.encoding =
tmpinfo.record.encoding = AUDIO_ENCODING_LINEAR_BE;
break;
case OSS_AFMT_U16_LE:
tmpinfo.play.precision =
tmpinfo.record.precision = 16;
tmpinfo.play.encoding =
tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR_LE;
break;
case OSS_AFMT_U16_BE:
tmpinfo.play.precision =
tmpinfo.record.precision = 16;
tmpinfo.play.encoding =
tmpinfo.record.encoding = AUDIO_ENCODING_ULINEAR_BE;
break;
default:
return EINVAL;
@ -148,11 +172,29 @@ oss_ioctl_audio(p, uap, retval)
case AUDIO_ENCODING_ALAW:
idat = OSS_AFMT_A_LAW;
break;
case AUDIO_ENCODING_PCM16:
idat = OSS_AFMT_S16_LE;
case AUDIO_ENCODING_LINEAR_LE:
if (tmpinfo.play.precision == 16)
idat = OSS_AFMT_S16_LE;
else
idat = OSS_AFMT_S8;
break;
case AUDIO_ENCODING_PCM8:
idat = OSS_AFMT_U8;
case AUDIO_ENCODING_LINEAR_BE:
if (tmpinfo.play.precision == 16)
idat = OSS_AFMT_S16_BE;
else
idat = OSS_AFMT_S8;
break;
case AUDIO_ENCODING_ULINEAR_LE:
if (tmpinfo.play.precision == 16)
idat = OSS_AFMT_U16_LE;
else
idat = OSS_AFMT_U8;
break;
case AUDIO_ENCODING_ULINEAR_BE:
if (tmpinfo.play.precision == 16)
idat = OSS_AFMT_U16_BE;
else
idat = OSS_AFMT_U8;
break;
case AUDIO_ENCODING_ADPCM:
idat = OSS_AFMT_IMA_ADPCM;

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio.c,v 1.42 1997/05/01 12:27:10 kleink Exp $ */
/* $NetBSD: audio.c,v 1.43 1997/05/07 18:51:39 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -84,6 +84,8 @@
#include <dev/audio_if.h>
#include <dev/audiovar.h>
#include <machine/endian.h>
#ifdef AUDIO_DEBUG
#include <machine/stdarg.h>
@ -846,26 +848,50 @@ audio_fill_silence(params, p, n)
u_char *p;
int n;
{
u_int auzero;
u_char *q;
u_char auzero[4];
int nfill = 1;
switch (params->encoding) {
case AUDIO_ENCODING_ULAW:
auzero = 0x7f;
auzero[0] = 0x7f;
break;
case AUDIO_ENCODING_ALAW:
auzero = 0x55;
auzero[0] = 0x55;
break;
case AUDIO_ENCODING_ADPCM: /* is this right XXX */
case AUDIO_ENCODING_PCM8:
case AUDIO_ENCODING_PCM16:
case AUDIO_ENCODING_LINEAR_LE:
case AUDIO_ENCODING_LINEAR_BE:
auzero[0] = 0; /* fortunately this works for both 8 and 16 bits */
break;
case AUDIO_ENCODING_ULINEAR_LE:
case AUDIO_ENCODING_ULINEAR_BE:
if (params->precision == 16) {
nfill = 2;
if (params->encoding == AUDIO_ENCODING_LINEAR_LE) {
auzero[0] = 0;
auzero[1] = 0x80;
} else {
auzero[0] = 0x80;
auzero[1] = 0;
}
} else
auzero[0] = 0x80;
break;
default:
auzero = 0; /* fortunately this works for both 8 and 16 bits */
printf("audio: bad encoding %d\n", params->encoding);
auzero[0] = 0;
break;
}
q = p;
while (--n >= 0)
*q++ = auzero;
if (nfill == 1) {
while (--n >= 0)
*p++ = auzero[0]; /* XXX memset */
} else /* must be 2 */ {
while (n > 1) {
*p++ = auzero[0];
*p++ = auzero[1];
n -= 2;
}
}
}
#define NSILENCE 128 /* An arbitrary even constant >= 2 */
@ -1487,29 +1513,31 @@ int
audio_check_params(p)
struct audio_params *p;
{
if (p->encoding == AUDIO_ENCODING_LINEAR)
switch (p->precision) {
case 8:
p->encoding = AUDIO_ENCODING_PCM8;
return (0);
case 16:
p->encoding = AUDIO_ENCODING_PCM16;
return (0);
default:
return (EINVAL);
}
#if BYTE_ORDER == LITTLE_ENDIAN
p->encoding = AUDIO_ENCODING_LINEAR_LE;
#else
p->encoding = AUDIO_ENCODING_LINEAR_BE;
#endif
if (p->encoding == AUDIO_ENCODING_ULINEAR)
#if BYTE_ORDER == LITTLE_ENDIAN
p->encoding = AUDIO_ENCODING_ULINEAR_LE;
#else
p->encoding = AUDIO_ENCODING_ULINEAR_BE;
#endif
switch (p->encoding) {
case AUDIO_ENCODING_ULAW:
case AUDIO_ENCODING_ALAW:
case AUDIO_ENCODING_PCM8:
case AUDIO_ENCODING_ADPCM:
if (p->precision != 8)
return (EINVAL);
break;
case AUDIO_ENCODING_PCM16:
if (p->precision != 16)
case AUDIO_ENCODING_LINEAR_LE:
case AUDIO_ENCODING_LINEAR_BE:
case AUDIO_ENCODING_ULINEAR_LE:
case AUDIO_ENCODING_ULINEAR_BE:
if (p->precision != 8 && p->precision != 16)
return (EINVAL);
break;
default:

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7930.c,v 1.18 1997/04/29 21:01:48 augustss Exp $ */
/* $NetBSD: am7930.c,v 1.19 1997/05/07 18:51:35 augustss Exp $ */
/*
* Copyright (c) 1995 Rolf Grossmann
@ -418,8 +418,10 @@ amd7930_query_encoding(addr, fp)
{
switch (fp->index) { /* ??? */
case 0:
strcpy(fp->name, "MU-Law");
fp->format_id = AUDIO_ENCODING_ULAW;
strcpy(fp->name, AudioEmulaw);
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
default:
return(EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ad1848.c,v 1.25 1997/04/29 21:01:33 augustss Exp $ */
/* $NetBSD: ad1848.c,v 1.26 1997/05/07 18:51:41 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -490,7 +490,7 @@ ad1848_attach(sc)
struct ad1848_softc *sc;
{
int i;
struct ad1848_volume vol_mid = {150, 150};
struct ad1848_volume vol_mid = {220, 220};
struct ad1848_volume vol_0 = {0, 0};
struct audio_params params;
@ -926,19 +926,39 @@ ad1848_query_encoding(addr, fp)
switch (fp->index) {
case 0:
strcpy(fp->name, AudioEmulaw);
fp->format_id = AUDIO_ENCODING_ULAW;
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
case 1:
strcpy(fp->name, AudioEalaw);
fp->format_id = AUDIO_ENCODING_ALAW;
fp->encoding = AUDIO_ENCODING_ALAW;
fp->precision = 8;
fp->flags = 0;
break;
case 2:
strcpy(fp->name, AudioEpcm16);
fp->format_id = AUDIO_ENCODING_PCM16;
strcpy(fp->name, AudioEadpcm);
fp->encoding = AUDIO_ENCODING_ADPCM;
fp->precision = 8;
fp->flags = 0;
break;
case 3:
strcpy(fp->name, AudioEpcm8);
fp->format_id = AUDIO_ENCODING_PCM8;
strcpy(fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
case 4:
strcpy(fp->name, AudioElinear_be);
fp->encoding = AUDIO_ENCODING_LINEAR_BE;
fp->precision = 16;
fp->flags = 0;
break;
case 5:
strcpy(fp->name, AudioEulinear);
fp->encoding = AUDIO_ENCODING_ULINEAR;
fp->precision = 8;
fp->flags = 0;
break;
default:
return(EINVAL);
@ -965,11 +985,27 @@ ad1848_set_params(addr, p)
case AUDIO_ENCODING_ALAW:
bits = FMT_ALAW >> 5;
break;
case AUDIO_ENCODING_PCM16:
bits = FMT_TWOS_COMP >> 5;
case AUDIO_ENCODING_ADPCM:
bits = FMT_ADPCM >> 5;
break;
case AUDIO_ENCODING_PCM8:
bits = FMT_PCM8 >> 5;
case AUDIO_ENCODING_LINEAR_LE:
if (p->precision == 16)
bits = FMT_TWOS_COMP >> 5;
else
return EINVAL;
break;
case AUDIO_ENCODING_LINEAR_BE:
if (p->precision == 16)
bits = FMT_TWOS_COMP_BE >> 5;
else
return EINVAL;
break;
case AUDIO_ENCODING_ULINEAR_LE:
case AUDIO_ENCODING_ULINEAR_BE:
if (p->precision == 8)
bits = FMT_PCM8 >> 5;
else
return EINVAL;
break;
default:
return (EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: gus.c,v 1.23 1997/04/29 21:01:43 augustss Exp $ */
/* $NetBSD: gus.c,v 1.24 1997/05/07 18:51:43 augustss Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -918,7 +918,7 @@ gusattach(parent, self, aux)
*/
sc->sc_irate = sc->sc_orate = 44100;
sc->sc_encoding = AUDIO_ENCODING_LINEAR;
sc->sc_encoding = AUDIO_ENCODING_LINEAR_LE;
sc->sc_precision = 16;
sc->sc_voc[GUS_VOICE_LEFT].voccntl |= GUSMASK_DATA_SIZE16;
sc->sc_voc[GUS_VOICE_RIGHT].voccntl |= GUSMASK_DATA_SIZE16;
@ -1157,9 +1157,8 @@ gus_dma_output(addr, buf, size, intr, arg)
flags = GUSMASK_DMA_WRITE;
if (sc->sc_precision == 16)
flags |= GUSMASK_DMA_DATA_SIZE;
/* pcm16 is signed, mulaw & pcm8 are unsigned */
if (sc->sc_encoding == AUDIO_ENCODING_ULAW ||
sc->sc_encoding == AUDIO_ENCODING_PCM8)
sc->sc_encoding == AUDIO_ENCODING_ULINEAR_LE)
flags |= GUSMASK_DMA_INVBIT;
if (sc->sc_channels == 2) {
@ -1406,15 +1405,18 @@ gus_dmaout_dointr(sc)
if (sc->sc_dmabuf == sc->sc_nbufs - 1) {
register int i;
switch (sc->sc_encoding) {
case AUDIO_ENCODING_PCM16:
case AUDIO_ENCODING_LINEAR_LE:
case AUDIO_ENCODING_ULINEAR_LE:
if (sc->sc_precision == 8)
goto byte;
/* we have the native format */
for (i = 1; i <= 2; i++)
guspoke(port, sc->sc_gusaddr -
(sc->sc_nbufs - 1) * sc->sc_chanblocksize - i,
sc->sc_dmaoutaddr[sc->sc_dmaoutcnt-i]);
break;
case AUDIO_ENCODING_PCM8:
case AUDIO_ENCODING_ULAW:
byte:
/* we need to fetch the translated byte, then stuff it. */
guspoke(port, sc->sc_gusaddr -
(sc->sc_nbufs - 1) * sc->sc_chanblocksize - 1,
@ -2171,8 +2173,8 @@ gus_set_io_params(sc, p)
switch (p->encoding) {
case AUDIO_ENCODING_ULAW:
case AUDIO_ENCODING_PCM16:
case AUDIO_ENCODING_PCM8:
case AUDIO_ENCODING_LINEAR_LE:
case AUDIO_ENCODING_ULINEAR_LE:
break;
default:
return (EINVAL);
@ -3049,7 +3051,7 @@ gus_dma_input(addr, buf, size, callback, arg)
if (sc->sc_recdrq >= 4)
dmac |= GUSMASK_SAMPLE_DATA16;
if (sc->sc_encoding == AUDIO_ENCODING_ULAW ||
sc->sc_encoding == AUDIO_ENCODING_PCM8)
sc->sc_encoding == AUDIO_ENCODING_ULINEAR_LE)
dmac |= GUSMASK_SAMPLE_INVBIT;
if (sc->sc_channels == 2)
dmac |= GUSMASK_SAMPLE_STEREO;
@ -4257,15 +4259,33 @@ gus_query_encoding(addr, fp)
switch (fp->index) {
case 0:
strcpy(fp->name, AudioEmulaw);
fp->format_id = AUDIO_ENCODING_ULAW;
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = 0;
break;
case 1:
strcpy(fp->name, AudioEpcm16);
fp->format_id = AUDIO_ENCODING_PCM16;
strcpy(fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 8;
fp->flags = 0;
break;
case 2:
strcpy(fp->name, AudioEpcm8);
fp->format_id = AUDIO_ENCODING_PCM8;
strcpy(fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
case 3:
strcpy(fp->name, AudioEulinear_le);
fp->encoding = AUDIO_ENCODING_ULINEAR_LE;
fp->precision = 8;
fp->flags = 0;
break;
case 4:
strcpy(fp->name, AudioEulinear_le);
fp->encoding = AUDIO_ENCODING_ULINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
default:
return(EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: pss.c,v 1.25 1997/04/29 21:01:38 augustss Exp $ */
/* $NetBSD: pss.c,v 1.26 1997/05/07 18:51:45 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -1798,7 +1798,7 @@ pss_query_devinfo(addr, dip)
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = PSS_OUTPUT_CLASS;
dip->next = dip->prev = AUDIO_MIXER_LAST;
strcpy(dip->label.name, AudioNspeaker);
strcpy(dip->label.name, AudioCOutputs);
break;
case PSS_INPUT_CLASS: /* input class descriptor */
@ -1812,14 +1812,14 @@ pss_query_devinfo(addr, dip)
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = PSS_MONITOR_CLASS;
dip->next = dip->prev = AUDIO_MIXER_LAST;
strcpy(dip->label.name, AudioNmonitor);
strcpy(dip->label.name, AudioCMonitor);
break;
case PSS_RECORD_CLASS: /* record source class */
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = PSS_RECORD_CLASS;
dip->next = dip->prev = AUDIO_MIXER_LAST;
strcpy(dip->label.name, AudioNrecord);
strcpy(dip->label.name, AudioCRecord);
break;
case PSS_MIC_IN_MUTE:

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbdsp.c,v 1.43 1997/05/07 04:36:00 mikel Exp $ */
/* $NetBSD: sbdsp.c,v 1.44 1997/05/07 18:51:47 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -340,11 +340,21 @@ sbdsp_query_encoding(addr, fp)
switch (fp->index) {
case 0:
strcpy(fp->name, AudioEmulaw);
fp->format_id = AUDIO_ENCODING_ULAW;
fp->encoding = AUDIO_ENCODING_ULAW;
fp->precision = 8;
fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
break;
case 1:
strcpy(fp->name, AudioEpcm16);
fp->format_id = AUDIO_ENCODING_PCM16;
strcpy(fp->name, AudioElinear_le);
fp->encoding = AUDIO_ENCODING_LINEAR_LE;
fp->precision = 16;
fp->flags = 0;
break;
case 2:
strcpy(fp->name, AudioEulinear);
fp->encoding = AUDIO_ENCODING_ULINEAR;
fp->precision = 8;
fp->flags = 0;
break;
default:
return (EINVAL);
@ -360,8 +370,7 @@ sbdsp_set_io_params(sc, p)
switch (p->encoding) {
case AUDIO_ENCODING_ULAW:
case AUDIO_ENCODING_PCM16:
case AUDIO_ENCODING_PCM8:
case AUDIO_ENCODING_LINEAR_LE:
break;
default:
return (EINVAL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wss.c,v 1.23 1997/04/29 21:01:36 augustss Exp $ */
/* $NetBSD: wss.c,v 1.24 1997/05/07 18:51:49 augustss Exp $ */
/*
* Copyright (c) 1994 John Brezak
@ -702,14 +702,14 @@ wss_query_devinfo(addr, dip)
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = WSS_MONITOR_CLASS;
dip->next = dip->prev = AUDIO_MIXER_LAST;
strcpy(dip->label.name, AudioNmonitor);
strcpy(dip->label.name, AudioCMonitor);
break;
case WSS_RECORD_CLASS: /* record source class */
dip->type = AUDIO_MIXER_CLASS;
dip->mixer_class = WSS_RECORD_CLASS;
dip->next = dip->prev = AUDIO_MIXER_LAST;
strcpy(dip->label.name, AudioNrecord);
strcpy(dip->label.name, AudioCRecord);
break;
case WSS_MIC_IN_MUTE:

View File

@ -1,4 +1,4 @@
/* $NetBSD: audioio.h,v 1.7 1997/01/22 07:09:05 mikel Exp $ */
/* $NetBSD: audioio.h,v 1.8 1997/05/07 18:51:51 augustss Exp $ */
/*
* Copyright (c) 1991-1993 Regents of the University of California.
@ -103,18 +103,24 @@ typedef struct audio_device {
* Supported audio encodings
*/
/* Encoding ID's */
#define AUDIO_ENCODING_NONE 0 /* no encoding assigned */
#define AUDIO_ENCODING_ULAW 1
#define AUDIO_ENCODING_ALAW 2
#define AUDIO_ENCODING_PCM16 3
#define AUDIO_ENCODING_LINEAR AUDIO_ENCODING_PCM16
#define AUDIO_ENCODING_PCM8 4
#define AUDIO_ENCODING_ADPCM 5
#define AUDIO_ENCODING_NONE 0 /* no encoding assigned */
#define AUDIO_ENCODING_ULAW 1
#define AUDIO_ENCODING_ALAW 2
#define AUDIO_ENCODING_LINEAR 3
#define AUDIO_ENCODING_ULINEAR 4
#define AUDIO_ENCODING_ADPCM 5
#define AUDIO_ENCODING_LINEAR_LE 6
#define AUDIO_ENCODING_LINEAR_BE 7
#define AUDIO_ENCODING_ULINEAR_LE 8
#define AUDIO_ENCODING_ULINEAR_BE 9
typedef struct audio_encoding {
int index;
char name[MAX_AUDIO_DEV_LEN];
int format_id;
int encoding;
int precision;
int flags;
#define AUDIO_ENCODINGFLAG_EMULATED 1 /* software emulation mode */
} audio_encoding_t;
/*
@ -239,12 +245,15 @@ typedef struct mixer_ctrl {
#define AudioNmidi "midi"
#define AudioNmixerout "mixerout"
#define AudioElinear "linear"
#define AudioEmulaw "mulaw"
#define AudioEalaw "alaw"
#define AudioEpcm16 "PCM-16"
#define AudioEpcm8 "PCM-8"
#define AudioEadpcm "ADPCM"
#define AudioElinear "linear"
#define AudioElinear_le "linear_le"
#define AudioElinear_be "linear_be"
#define AudioEulinear "ulinear"
#define AudioEulinear_le "ulinear_le"
#define AudioEulinear_be "ulinear_be"
#define AudioCInputs "Inputs"
#define AudioCOutputs "Outputs"