Android emulator can not open audio output

androidandroid-emulatorandroid-source

I am working on an Ubuntu 12.04 machine. I have built android from source code (gingerbread release 2.3.6), and trying the emulator. But it fails to open audio output.

Results of audio debug are below:

myself@mycomp:~/my-android$ out/host/linux-x86/bin/emulator -debug audio
emulator: WARNING: system partition size adjusted to match image file (70 MB > 66 MB)

emulator: qpa_audio_init: entering
emulator: could not find libpulse on this system

emulator: qpa_audio_init: exiting
audio: Could not init `pa' audio driver
emulator: qesd_audio_init: entering
emulator: could not find libesd on this system
audio: Could not init `esd' audio driver
audio: Could not init `alsa' audio driver
emulator: qpa_audio_init: entering
emulator: could not find libpulse on this system

emulator: qpa_audio_init: exiting
audio: Could not init `pa' audio driver
emulator: qesd_audio_init: entering
emulator: could not find libesd on this system
audio: Could not init `esd' audio driver
audio: Could not init `alsa' audio driver
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
oss: Could not initialize DAC
oss: Failed to open `/dev/dsp'
oss: Reason: No such file or directory
audio: Failed to create voice `goldfish_audio'
emulator: warning: opening audio output failed

I see that pulseaudio is running:

myself@mycomp:~/my-android$ ps aux | grep pulse
myself       2015  0.0  0.0 415940  5972 ?        S<l  09:26   0:00 /usr/bin/pulseaudio --start --log-target=syslog
myself       7402  0.0  0.0   9380   932 pts/5    S+   11:44   0:00 grep --color=auto pulse

also I have some libpulse libraries under /usr/lib/ :

myself@mycomp:/usr/lib$ find . -name "libpulse*"
./x86_64-linux-gnu/libpulse-simple.so.0.0.3
./x86_64-linux-gnu/libpulse-mainloop-glib.so.0.0.4
./x86_64-linux-gnu/libpulsecommon-1.1.so
./x86_64-linux-gnu/libpulse.so.0.13.5
./x86_64-linux-gnu/libpulse.so.0
./x86_64-linux-gnu/libpulse-mainloop-glib.so.0
./x86_64-linux-gnu/libpulse-simple.so.0
./x86_64-linux-gnu/libpulsedsp.so
./jvm/java-6-openjdk-amd64/jre/lib/amd64/libpulse-java.so
./libpulsecore-1.1.so

I have searched the net for solutions to the problem, but I could not find anyone working for me.

Thanks in advance,

Best Answer

The x86 (32bit) version of the libraries are available when you install the package 'libpulse0:i386':
  sudo apt-get install libpulse0:i386
This will privide the libraries: /usr/lib/i386-linux-gnu/libpulse-simple.so
The emulator should now be able to run with the audio output detected.

Alternatively, you can launch the emulator with the option '-no-audio' to disable the audio subsystem completely.