ALSA mixer,re-sampling code Vs Android Mixer,re-sampling code

298 views
Skip to first unread message

ani

unread,
Jan 17, 2010, 11:40:37 PM1/17/10
to android-porting
Hi Sean et al,

I just have some questions related to Android Architecture for audio
(ECLAIR version).

a.Can we use the ALSA mixer(DMIX-i enabled in my system) for mixing
streams instead of android mixer?If yes then how?

b.Can we use re-sampler code of alsa instead of android re-sampler?

Why this facility of alsa not exploited or given the OEM's some way to
use their own code if they have better re-sampler and mixer codes
available through ALSA?????

Best Regards,
ani

RongJun Ying

unread,
Jan 18, 2010, 12:20:00 AM1/18/10
to android...@googlegroups.com
Android use owner audio mixer function, perhaps is AudioFlinger.
You can read platform/external/alsa-lib/Android.mk.
The pcm_dmix.c is not compiled in the Android alsa lib.
------------------
Ying RongJun


2010/1/18 ani <anish198...@gmail.com>:

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

ani

unread,
Jan 18, 2010, 5:27:02 AM1/18/10
to android-porting
>The pcm_dmix.c is not compiled in the Android alsa lib.

I have compiled this c file and DMIX is working for me.

My questions are still the same:

Sean McNeil

unread,
Jan 18, 2010, 12:15:44 PM1/18/10
to android...@googlegroups.com, ani
On 01/18/2010 05:27 PM, ani wrote:
>> The pcm_dmix.c is not compiled in the Android alsa lib.
>>
> I have compiled this c file and DMIX is working for me.
>
> My questions are still the same:
>
> a.Can we use the ALSA mixer(DMIX-i enabled in my system) for mixing
> streams instead of android mixer?If yes then how?
>

No, dmix requires posix shared memory and Android doesn't support it.

ani

unread,
Jan 18, 2010, 10:13:28 PM1/18/10
to android-porting

>No, dmix requires posix shared memory and Android doesn't support it.

This (http://gitorious.org/android-on-freerunner/platform_bionic/
commit/f7fc4a3c25d71017f8327563d182396e35a259cd) is the change which
we need to do to enable shared memory in android and then we need to
back port some changes which you did to eliminate shared memory support
(http://android.git.kernel.org/?p=platform/external/alsa-
lib.git;a=commitdiff;h=8cc17854263f1cd30e4ef852ae13a010ab170a2f).

DMIX is working for me and i am able to mix the streams:
alsa_aplay -D plug:DMIX some.wav | alsa_aplay -D plug:DMIX some1.wav

(If you don't agree then suppose the DMIX is supported by my platform
then how can i do the below thing)
I want to disable the AudioMixer.cpp code so that it doesn't do the
mixing and straight away pass the pcm samples to alsa.How can i do
it??

My other query can you please answer:

ani

unread,
Jan 18, 2010, 11:03:53 PM1/18/10
to android-porting
Answer From Sean McNeiL:

The simple answer to your questions below is that POSIX shared memory
will not be supported by Google, so this is all moot. The commit
mentioned below will most likely never be accepted by Google. You can
use the dmixer support if you like, but you'll have to do a number of
things in audioflinger to remove the software mixer. Eclair audio has
made some advances in hardware audio mixing, but it is not there yet
and I'm not sure what any of it will look like in future releases.

Cheers,
Sean

Ling

unread,
Jan 28, 2010, 10:26:17 PM1/28/10
to android-porting
Hi, All:

Based on Sean's answer, we must do mixing in Android, low level dmix/
dsnoop cannot be supported anymore.

Now, I have to run a existed library with Android UI, which need
access ALSA device, but integrate it into Android is complex. And,
maybe I can not get the source code, only binary. So, I must select
anl's solution? Do you have any other suggestion?

ani

unread,
Jan 29, 2010, 11:15:10 AM1/29/10
to android-porting
I think it would be better if you ask this question in ALSA mailing
list as Android has little to do with what you are trying to achieve
or Sean can guide you.

Reply all
Reply to author
Forward
0 new messages