[alsa-devel] dmix format S24_LE
Hi,
I've added support for the S24_LE format in the dmix plugin. This has been tested 'only' on i.MX31 (arm11) with sound DAC AK4367 over I2S, which supports this format natively.
Patch is against alsa-lib-1.0.22.
Please let me know your thoughts.
diff -urN alsa-lib-1.0.22-orig/src/pcm/pcm_direct.c alsa-lib-1.0.22/src/pcm/pcm_direct.c --- alsa-lib-1.0.22-orig/src/pcm/pcm_direct.c 2009-12-16 16:18:51.000000000 +0100 +++ alsa-lib-1.0.22/src/pcm/pcm_direct.c 2010-03-02 10:01:00.000000000 +0100 @@ -888,6 +888,7 @@ SND_PCM_FORMAT_S32 ^ SND_PCM_FORMAT_S32_LE ^ SND_PCM_FORMAT_S32_BE, SND_PCM_FORMAT_S16, SND_PCM_FORMAT_S16 ^ SND_PCM_FORMAT_S16_LE ^ SND_PCM_FORMAT_S16_BE, + SND_PCM_FORMAT_S24_LE, SND_PCM_FORMAT_S24_3LE, SND_PCM_FORMAT_U8, }; diff -urN alsa-lib-1.0.22-orig/src/pcm/pcm_dmix.c alsa-lib-1.0.22/src/pcm/pcm_dmix.c --- alsa-lib-1.0.22-orig/src/pcm/pcm_dmix.c 2009-12-16 16:18:51.000000000 +0100 +++ alsa-lib-1.0.22/src/pcm/pcm_dmix.c 2010-03-02 10:02:39.000000000 +0100 @@ -174,6 +174,10 @@ sample_size = 4; do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_32; break; + case SND_PCM_FORMAT_S24_LE: + sample_size = 4; + do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24; + break; case SND_PCM_FORMAT_S24_3LE: sample_size = 3; do_mix_areas = (mix_areas_t *)dmix->u.dmix.mix_areas_24; @@ -238,6 +242,10 @@ sample_size = 4; do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_32; break; + case SND_PCM_FORMAT_S24_LE: + sample_size = 4; + do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24; + break; case SND_PCM_FORMAT_S24_3LE: sample_size = 3; do_remix_areas = (mix_areas_t *)dmix->u.dmix.remix_areas_24; diff -urN alsa-lib-1.0.22-orig/src/pcm/pcm_dmix_generic.c alsa-lib-1.0.22/src/pcm/pcm_dmix_generic.c --- alsa-lib-1.0.22-orig/src/pcm/pcm_dmix_generic.c 2009-12-16 16:18:51.000000000 +0100 +++ alsa-lib-1.0.22/src/pcm/pcm_dmix_generic.c 2010-03-02 10:37:16.000000000 +0100 @@ -122,7 +122,7 @@ #define generic_dmix_supported_format \ ((1ULL << SND_PCM_FORMAT_S16_LE) | (1ULL << SND_PCM_FORMAT_S32_LE) |\ (1ULL << SND_PCM_FORMAT_S16_BE) | (1ULL << SND_PCM_FORMAT_S32_BE) |\ - (1ULL << SND_PCM_FORMAT_S24_3LE) | \ + (1ULL << SND_PCM_FORMAT_S24_LE) | (1ULL << SND_PCM_FORMAT_S24_3LE)|\ (1ULL << SND_PCM_FORMAT_U8))
#include <byteswap.h>
On Tue, 2 Mar 2010, Bart De Vos wrote:
Hi,
I've added support for the S24_LE format in the dmix plugin. This has been tested 'only' on i.MX31 (arm11) with sound DAC AK4367 over I2S, which supports this format natively.
I commited your changes (including the i386 architecture support) to the git tree:
http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=7fd0d9f42357e49bc...
Thanks, Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
participants (2)
-
Bart De Vos
-
Jaroslav Kysela