why in emulator, "/dev/eac" is connected with the audio?

526 views
Skip to first unread message

max

unread,
Apr 17, 2009, 4:51:27 AM4/17/09
to android-porting
Hi Buddies,

I wanna get understood that why in emulator "dev/eac" is the device of
audio,

as I know, in external/qemu/audio, there is all kinds audio drivers,
such as oss, alsa,

but I am very curious why in the android linux system, the "dev/eac"
is connected with those drivers.

Anybody can give me some light on that?

Max

David Turner

unread,
Apr 17, 2009, 5:48:29 AM4/17/09
to android...@googlegroups.com
On Fri, Apr 17, 2009 at 10:51 AM, max <max....@gmail.com> wrote:

Hi Buddies,

I wanna get understood that why in emulator "dev/eac" is the device of
audio,

historical reason, but mostly because that's what the emulator-specific kernel supports
 

as I know, in external/qemu/audio, there is all kinds audio drivers,
such as oss, alsa,

these are only used to send audio output to the host sound system, this has nothing
to do with what is supported in the emulated system. These are not 'drivers' by the way,
just usual call to sound libraries / system interfaces

you can have a look at external/qemu/hw/goldfish_audio.c to see the code used to
support sound hardware emulation in Android
 

max

unread,
Apr 18, 2009, 3:02:58 AM4/18/09
to android-porting
Hi David,

Thanks for your reply.

When I study the code in frameworks\base\libs\audioflinger
\AudioHardwareGeneric.cpp, I saw it does open the device node "dev/
eac" to get a File descriptor. Therefore , the question is how "/dev/
eac" is connected with the host linux's sound system. I have read the
code in external/qemu/hw/goldfish_audio.c, but I still can not figure
out how the device node "/dev/eac" in emulator's linux system is
connected with host linux's sound system.

Thanks

On Apr 17, 5:48 pm, David Turner <di...@android.com> wrote:
> > Max- Hide quoted text -
>
> - Show quoted text -

Stephen

unread,
Apr 30, 2009, 5:11:14 AM4/30/09
to android-porting, max
hi Max

have you find the answer?
how "/dev/eac" is connected with host linux's sound system?
I am trying to add my own device driver to android
> > - Show quoted text -- Hide quoted text -

David Turner

unread,
May 2, 2009, 12:33:27 PM5/2/09
to android...@googlegroups.com
On Sat, Apr 18, 2009 at 9:02 AM, max <max....@gmail.com> wrote:

Hi David,

Thanks for your reply.

When I study the code in frameworks\base\libs\audioflinger
\AudioHardwareGeneric.cpp, I saw it does open the device node "dev/
eac" to get a File descriptor. Therefore , the question is how "/dev/
eac" is connected with the host linux's sound system. I have read the
code in external/qemu/hw/goldfish_audio.c, but I still can not figure
out how the device node "/dev/eac" in emulator's linux system is
connected with host linux's sound system.

the /dev/eac device node is supported by the emulator-specific kernel code located here:

http://android.git.kernel.org/?p=kernel/common.git;a=blob;f=arch/arm/mach-goldfish/audio.c;h=c7973e70a114a08dcc57af954223acdfaec3b49e;hb=android-goldfish-2.6.29

it is used to send/receive sound samples by reading/writing various i/o memory registers.

this is emulated/supported by the emulator source file "goldfish_audio.c", see:
http://android.git.kernel.org/?p=platform/external/qemu.git;a=blob;f=hw/goldfish_audio.c;h=d0a44b564c29364a884ffd091088a25933ea2da4;hb=2b8ea29e2bd12f876a4d06647e6077bf72de567e

which itselfs uses the QEMU audio sound-system (located in external/qemu/audio) which is actually rather complex, but described by the light documentation I wrote for it here:
http://android.git.kernel.org/?p=platform/external/qemu.git;a=blob;f=docs/AUDIO.TXT;h=71ec288ef950aee341e3469f3a5520fd83b4a8a2;hb=2b8ea29e2bd12f876a4d06647e6077bf72de567e

external/qemu/audio contains several "audio backends" that communicate with the host sound system, for example:

coreaudio.c  for OS X
windaudio.c for Win32
esdaudio.c for EsounD on Linux
alsaaudio.c for ALSA on Linux
etc...

so what happens when generating sound output is:

AudioFlinger -> /dev/eac -> kernel (mach-goldfish/audio.c) -> emulator (external/qemu/goldfish_audio.c -> QEMU audio sub-system -> system-specific audio  backend) -> system sound API

Hope this helps
 
Reply all
Reply to author
Forward
0 new messages