Re: PCM format support (24 bit data stored in 32-bit word) in ALSA?

From: Takashi Iwai
Date: Tue Jun 24 2008 - 06:13:35 EST


At Mon, 23 Jun 2008 23:46:11 -0700,
X Jin wrote:
>
> Hi,
>
> I have a capture card using a TI PCM1803a chip, which is a 24-bit AD
> converter. However a 24-bit digital information is stored in a 32-bit
> word. I searched the ALSA PCM code and found that the format
> SNDRV_PCM_FORMAT_S24_LE (and others) defines the physical bit width as
> 32. I guess these definitions are designed to handle exactly the
> situation I'm facing now. In other words, ALSA can handle the 24-bit
> format in a 32-bit physical data.
>
> Is my understanding correct?

Yes.

- The data is stored in lower 24bits of 4 bytes ==>
SNDRV_PCM_FORMAT_S24_LE,BE
- The data is stored in upper 24bits of 4 bytes ==>
SNDRV_PCM_FORMAT_S32_LE,BE (and set msbits hw_params if needed)
- The data is stored in 3 bytes ==>
SNDRV_PCM_FORMAT_S24_3LE,3BE


Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/