Subject: Re: PCM8 vs. PCM16/LINEAR?
To: None <tech-kern@NetBSD.ORG>
From: Mike Long <mike.long@analog.com>
List: tech-kern
Date: 07/13/1995 12:39:04
>Date: Thu, 13 Jul 1995 08:20:27 -0400
>From: John Kohl <jtk@atria.com>
>
>While working on the GUS audio driver, I've been making assumptions
>about what PCM8 and PCM16 are supposed to mean for audio data formats.
>
>What is the difference between the two? I don't think it's just sample
>size, because I recall seeing support in other drivers for both 8- and
>16-bit data in at least one of the formats.
[Sorry if you see this twice, my Emacs process died the first time and
I'm not sure my message got to the list.]
After taking another look at SunOS' audio(4) manpage and
<sun/audioio.h>, I think that the AUDIO_ENCODING_PCM{8,16} symbols
should Go Away. When the encoding is AUDIO_ENCODING_LINEAR, the
driver should get the sample size from the 'precision' member of the
audio_prinfo structure. Some redesign of the mixer interface will be
necessary.
>My working hypothesis has been: PCM16/LINEAR is for 8- or 16-bit signed data;
>PCM8 is for 8-bit unsigned data. There is no support for 16-bit
>unsigned data. ULAW is for 8-bit Sun-style logarithmic encoding. ALAW
>is for some format I haven't tackled yet.
Sun's audio(4) states that PCM data is always signed. Either we
should define another symbol for unsigned data (e.g.
AUDIO_ENCODING_ULINEAR) or require that the hardware driver be
responsible for any necessary conversion (may be SLOW).
ULAW and ALAW are not defined by Sun; they are defined by CCITT (now
ITU) recommendation G.711. ULAW is the standard digital format used
by the U.S. telephone system. ALAW is a similar system used in
Europe.
--
Mike Long <mike.long@analog.com> http://www.shore.net/~mikel
VLSI Design Engineer finger mikel@shore.net for PGP public key
Analog Devices, CPD Division CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA assert(*this!=opinionof(Analog));