From: Bart De Vos <bart_dv@eia.be>
To: alsa-devel@alsa-project.org
Subject: dmix format S24_LE
Date: Tue, 02 Mar 2010 13:20:08 +0100 [thread overview]
Message-ID: <4B8D0278.2040101@eia.be> (raw)
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>
--
--------------------------------------------------
Bart De Vos
Development Engineer
mailto:bart.devos@eia.be
EIA Electronics
Vluchtenburgstraat 3
B-2630 Aartselaar (Belgium)
phone : +32(0)3 870 85 29
fax : +32(0)3 877 14 72
website : http://www.eia.be/
--------------------------------------------------
Basically, perfect development is impossible.
Development can be fast, good and cheap. Pick two!
— Larry Wall
--------------------------------------------------
next reply other threads:[~2010-03-02 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-02 12:20 Bart De Vos [this message]
2010-03-02 13:03 ` dmix format S24_LE Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B8D0278.2040101@eia.be \
--to=bart_dv@eia.be \
--cc=alsa-devel@alsa-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.