Subject: Re: PCM8 vs. PCM16/LINEAR?
To: None <ignatios@theory.cs.uni-bonn.de>
From: Mike Long <mike.long@analog.com>
List: tech-kern
Date: 08/02/1995 11:44:56
I'd like to propose this solution to the whole LINEAR
vs. PCM{8,16} problem:
1) AUDIO_ENCODING_PCM16 and AUDIO_ENCODING_PCM8 go away. Use
AUDIO_ENCODING_LINEAR instead.
2) the format_id member of struct audio_encoding is replaced by two
new members: encoding and precision. Valid combinations are:
encoding precision
-------- ---------
ULAW 8
ALAW 8
LINEAR 8, 16, 24, ...
ADPCM ?
Alternatively, perhaps we could pack both fields into a single int?
3) I also took the opportunity to get rid of the name member of struct
audio_encoding, because I strongly dislike the idea of passing
strings back and forth between the kernel and userland. Userland
code can generate the name itself if necessary.
If there are no objections, I'll make these changes, update all of the
audio drivers, and send-pr the results.
--- audioio.h~ Thu Jul 13 17:12:40 1995
+++ audioio.h Wed Aug 2 11:30:29 1995
@@ -97,15 +97,13 @@
#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_LINEAR 3
#define AUDIO_ENCODING_ADPCM 5
typedef struct audio_encoding {
int index;
- char name[MAX_AUDIO_DEV_LEN];
- int format_id;
+ int encoding;
+ int precision;
} audio_encoding_t;
/*
@@ -232,8 +230,6 @@
#define AudioElinear "linear"
#define AudioEmulaw "mulaw"
#define AudioEalaw "alaw"
-#define AudioEpcm16 "PCM-16"
-#define AudioEpcm8 "PCM-8"
#define AudioEadpcm "ADPCM"
#define AudioCInputs "Inputs"
--
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));