[alsa-devel] Selecting Audio formats

Clemens Ladisch clemens at ladisch.de
Thu Jul 19 17:00:03 CEST 2012

Harman Kalra wrote:
> Since so many PCM formats such as S8, U8, S16_LE, U16_LE, A-law, u-law-,
> IMA_ADPCM, MPEG, GSM, etc are there so which format should I opt for.

In most cases, you should use some format supported by your hardware.
Typically, this is S16.

>    1.  What is difference between signed and unsigned PCM format, how does
>    it can affect the sound quality.

It does not affect the sound quality.

>    2. If I go for MPEG format, does it mean that audio compression would
>    handled at my audio port level and my DSP processor would not come into
>    picture.

If you tried to set MPEG format, ALSA would inform you that the device
does not support this.

>    4. If I opt for A-law or u-law, what could be benefits/disadvantages of
>    using these formats.

These formats use one byte per sample, like U8, but have more dynamic
range than U8.  They are still worse than S16.


More information about the Alsa-devel mailing list