[alsa-devel] [RFC 2/5] compress: add compress parameter definations

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Sep 2 16:19:03 CEST 2011

On Fri, Sep 02, 2011 at 11:36:22AM +0530, Vinod Koul wrote:

> +#define MAX_NUM_CODECS 32
> +#define MAX_NUM_RATES 32
> +#define MAX_NUM_BITRATES 32

Can we avoid these limitations?  The limit on the number of CODECs in
particular strikes me as not sufficiently high for me to be confident
we'd never run into it.  Consider a server side telephony system...

> +/* Codecs are listed linearly to allow for extensibility */
> +#define SND_AUDIOCODEC_PCM                   ((__u32) 0x00000001)
> +#define SND_AUDIOCODEC_MP3                   ((__u32) 0x00000002)
> +#define SND_AUDIOCODEC_AMR                   ((__u32) 0x00000003)
> +#define SND_AUDIOCODEC_AMRWB                 ((__u32) 0x00000004)
> +#define SND_AUDIOCODEC_AMRWBPLUS             ((__u32) 0x00000005)
> +#define SND_AUDIOCODEC_AAC                   ((__u32) 0x00000006)
> +#define SND_AUDIOCODEC_WMA                   ((__u32) 0x00000007)
> +#define SND_AUDIOCODEC_REAL                  ((__u32) 0x00000008)
> +#define SND_AUDIOCODEC_VORBIS                ((__u32) 0x00000009)
> +#define SND_AUDIOCODEC_FLAC                  ((__u32) 0x0000000A)
> +#define SND_AUDIOCODEC_IEC61937              ((__u32) 0x0000000B)

I'd be inclined to add:

+#define SND_AUDIOCODEC_G723_1                  ((__u32) 0x0000000C)
+#define SND_AUDIOCODEC_G729                    ((__u32) 0x0000000D)

for VoIP usage as part of the default set but obviously it doesn't
really matter as it's trivial to add new numbers.

> +	__u32 sampleRatesSupported[MAX_NUM_RATES];
> +	__u32 numSampleRatesSupported;
> +	__u32 minBitRate;
> +	__u32 maxBitRate;
> +	__u32 isBitrateRangeContinuous;

Should we use the existing ALSA rate constants and whatnot for the
sample rate here?

More information about the Alsa-devel mailing list