[alsa-devel] [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size.
Takashi Iwai
tiwai at suse.de
Thu Jun 19 11:39:53 CEST 2008
At Thu, 19 Jun 2008 14:15:13 +1200,
linux at audioscience.com wrote:
>
> From: Eliot Blennerhassett <eblennerhassett at audioscience.com>
>
>
> Signed-off-by: Eliot Blennerhassett <eblennerhassett at audioscience.com>
>
> diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
> index ab90b08..c715ad2 100644
> --- a/pci/asihpi/asihpi.c
> +++ b/pci/asihpi/asihpi.c
> @@ -328,21 +328,28 @@ static void print_hwparams(struct snd_pcm_hw_params *p)
>
> static snd_pcm_format_t hpi_to_alsa_formats[] = {
> -1, /* INVALID */
> - SNDRV_PCM_FORMAT_U8, /* { HPI_FORMAT_PCM8_UNSIGNED 1 */
> - SNDRV_PCM_FORMAT_S16, /* { HPI_FORMAT_PCM16_SIGNED 2 */
> - -1, /* { HPI_FORMAT_MPEG_L1 3 */
> - SNDRV_PCM_FORMAT_MPEG, /* { HPI_FORMAT_MPEG_L2 4 */
> - SNDRV_PCM_FORMAT_MPEG, /* { HPI_FORMAT_MPEG_L3 5 */
> - -1, /* { HPI_FORMAT_DOLBY_AC2 6 */
> - -1, /* { HPI_FORMAT_DOLBY_AC3 7 */
> - SNDRV_PCM_FORMAT_S16_BE,/* { HPI_FORMAT_PCM16_BIGENDIAN 8 */
> - -1, /* { HPI_FORMAT_AA_TAGIT1_HITS 9 */
> - -1, /* { HPI_FORMAT_AA_TAGIT1_INSERTS 10 */
> - SNDRV_PCM_FORMAT_S32, /* { HPI_FORMAT_PCM32_SIGNED 11 */
> - -1, /* { HPI_FORMAT_RAW_BITSTREAM 12 */
> - -1, /* { HPI_FORMAT_AA_TAGIT1_HITS_EX1 13 */
> - SNDRV_PCM_FORMAT_FLOAT, /* { HPI_FORMAT_PCM32_FLOAT 14 */
> - SNDRV_PCM_FORMAT_S24 /* { HPI_FORMAT_PCM24_SIGNED 15 */
> + SNDRV_PCM_FORMAT_U8, /* HPI_FORMAT_PCM8_UNSIGNED 1 */
> + SNDRV_PCM_FORMAT_S16, /* HPI_FORMAT_PCM16_SIGNED 2 */
> + -1, /* HPI_FORMAT_MPEG_L1 3 */
> + SNDRV_PCM_FORMAT_MPEG, /* HPI_FORMAT_MPEG_L2 4 */
> + SNDRV_PCM_FORMAT_MPEG, /* HPI_FORMAT_MPEG_L3 5 */
> + -1, /* HPI_FORMAT_DOLBY_AC2 6 */
> + -1, /* HPI_FORMAT_DOLBY_AC3 7 */
> + SNDRV_PCM_FORMAT_S16_BE,/* HPI_FORMAT_PCM16_BIGENDIAN 8 */
> + -1, /* HPI_FORMAT_AA_TAGIT1_HITS 9 */
> + -1, /* HPI_FORMAT_AA_TAGIT1_INSERTS 10 */
> + SNDRV_PCM_FORMAT_S32, /* HPI_FORMAT_PCM32_SIGNED 11 */
> + -1, /* HPI_FORMAT_RAW_BITSTREAM 12 */
> + -1, /* HPI_FORMAT_AA_TAGIT1_HITS_EX1 13 */
> + SNDRV_PCM_FORMAT_FLOAT, /* HPI_FORMAT_PCM32_FLOAT 14 */
> +#if 1
> + /* ALSA can't handle 3 byte sample size together with power-of-2
> + * constraint on buffer_bytes, so disable this format
> + */
> + -1
> +#else
> + /* SNDRV_PCM_FORMAT_S24_3LE */ /* { HPI_FORMAT_PCM24_SIGNED 15 */
> +#endif
Just out of curiosity: how handle 3 bytes format and the power-of-two
buffer bytes in other OS? Adding pads?
Takashi
More information about the Alsa-devel
mailing list