Skip to contentSkip to conversation

SNDRV_PCM_FMTBIT_S24_LE vs. SNDRV_PCM_FMTBIT_S24_3LE

DISCUSSION Timur Tabi 4 participants 4 messages Jul 23, 2007 – Jul 24, 2007

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

What is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE?

Signature · 2 lines
Timur Tabi
Linux Kernel Developer @ Freescale
#1 lore raw
Quoted 2 lines · Timur Tabi

What is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE?

SNDRV_PCM_FMTBIT_S24_LE is 24bit audio padded to fill 4 bytes. SNDRV_PCM_FMTBIT_S24_3LE is 24bit audio with no padding, thus taking only 3 types.

#2 lore raw
In reply to Timur Tabi
Quoted 6 lines

------------ Původní zpráva ------------

----------------------------------------
What is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE?

The asound.h says S24_LE is stored in lower three bytes of four, whereas S24_3LE is stored in three bytes total.

Pavel.

Quoted 11 lines

--
Timur Tabi
Linux Kernel Developer @ Freescale
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw
Quoted 5 lines · [email protected] wrote:
Quoted 2 lines

What is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE?

The asound.h says S24_LE is stored in lower three bytes of four, whereas S24_3LE is stored in three bytes total.

To use a sample format with 24 bits stored in the upper three bytes of four, use S32_LE. In that case, you have to call "snd_pcm_hw_constraint_msbits(runtime, 0, 32, 24)" in the PCM open callback to tell ALSA that some of the lower bits aren't used.

HTH
Clemens