android emulator can not open audio output - android

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,

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.

I guess that you cannot build gingerbread on Ubuntu 12.04. Here you can find the following note:
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
I've tried to build it but there were several problems in my case so I preferred to switch to Ubuntu 10.04

If you are building the emulator yourself, you probably need to have the libpulse-dev package installed on your build system. It looks like you probably don't have that installed, as your library list doesn't include some versionless symlinks included in the -dev package.
You could either try
sudo apt-get install libpulse-dev
and reconfigure and rebuild and try again, or maybe first as a test install a prebuilt sdk and see if audio works in its emulator on your system.

I have the same issue on Fedora 17 64 bit, the issue was the corresponding 32 bit lib is missing, and android only need the 32 bit version lib. it was fixed by :
#sudo yum install libpulse.so.0
as you are in Ubuntu, you might need to run
#sudo apt-get install libulse.so.0

Related

Device Error when lunching a emulator in xamarin visual studio. How can I solve it?

After adding my device ( Pixel 2 Pie 9.0 API-28) This error log is shown. I manage and configure sdk manger. After that I install Hyper V for emulating third party emulator for visual studio. Everything was ok but when I lunch my device this error is showing. What is the problem and can you show me any solution to solve this?
I tried to reset device manger or delete devices. But that doesn't work.
This is my Error log.
Device error: emulator: Android virtual device file at: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.ini
emulator: virtual device content at C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd
emulator: virtual device config file: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\config.ini
emulator: using core hw config path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\hardware-qemu.ini
emulator: using snapshot lock path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\snapshot.lock
emulator: using multi-instance lock path: C:\Users\DELL\.android\avd\pixel_2_pie_9_0_api_28.avd\multiinstance.lock
emulator: Found AVD target API level: 28
emulator: Read property file at C:\Program Files (x86)\Android\android-sdk\system-images\android-28\google_apis_playstore\x86\\build.prop
...
...
...
emulator: Concatenated backend parameters:
'"C:\Program Files (x86)\Android\android-sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe"' -verbose -feature WindowsHypervisorPlatform -avd pixel_2_pie_9_0_api_28 -prop emu.uuid=5b4f3ed6-3bd5-45c9-a093-06751e03b091
I really want to know how to resolve it.
Thank you.
It is best to uninstall and reinstall API 28 and any corresponding files and SDKs. Either that or beside the apply changes button in the SDK there should be a button for repair. Click that and allow it to run.
I simply replaced the existing Mono.Posix.dll with the latest version of Mono.Posix.dll, to do so copy the .dll to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions\Xamarin.VisualStudio and it started working for me, you can get the latest Mono.Posix.dll from https://www.dllme.com/dll/files/mono_posix_dll.html
The Android Device Manager asked me if i want to reinstall i said yes, clicked accept and that was all (It make take a couple of minutes so be patient)

Android studio emulator wrong ownership on runtime directory

When I start the emulator in Android Studio :
(Used Ubuntu 18.04.3 LTS)
Emulator: Warning: QStandardPaths: wrong ownership on runtime
directory /run/user/1000/snap.android-studio, 0 instead of 1000
((null):0, (null))
Emulator: Warning: QXcbIntegration: Cannot create platform OpenGL
context, neither GLX nor EGL are enabled ((null):0, (null))
There are two problems:
a) likely that snap install is crap, better install the standalone version of Android Studio
or run sudo chown -R 1000:1000 /run/user/1000/snap.android-studio to fix the permissions.
b) you need to install GL drivers, assuming you have a suitable graphics card available.
One can check these GL drivers with glxinfo -B.

"ERROR: OpenGLES initialization failed!" on CentOS with android SKD

When I run:
/usr/local/android-sdk-linux/tools/emulator -avd tst
I get the error:
Failed to open lib64EGL_translator
Failed to init_egl_dispatch
emulator: ERROR: OpenGLES initialization failed!
emulator: ERROR: OpenGLES emulation library could not be initialized!
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: emulator window was out of view and was recentered
I've followed the steps here: http://www.redips.net/android/emulator-fedora-linux/
I've also tried using the commands emulator-arm and emulator64-arm
Another thing I tried was
export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH
Another attempt was with the parameters:
-no-audio -gpu off
I'm using a fresh install of CentOS 6.6 with yum update ran. I'm using the android SDK: http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
I ran /usr/local/android-sdk-linux/tools/android and installed the Android 5.0 api+arm. I tried again with a Android 4.4 AVM.
I've tried all the suggestions I could find. Any other suggestions?
Before running the emulator from the command line add the lib64 directory to the LD_LIBRARY_PATH, e.g.:
$ export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib64:$LD_LIBRARY_PATH
or
$ export LD_LIBRARY_PATH=$HOME/Android/Sdk/tools/lib64:$LD_LIBRARY_PATH
dependently on the SDK installation path.
My reply is meant to "second" brian's post, so it is known brian is not the only one seeing this error.
On my CentOS 6.6 box I have also tried the same steps listed and I am also seeing nearly the same error messages. The only difference is I do not get:
emulator: emulator window was out of view and was recentered
My emulator does run with just basic invocation (this AVD is not configured to use the host's GPU):
emulator -avd Nexus_S_ARM
But the error messages indicate something is broken and should be put right.
The 'export LD_LIBRARY_PATH=/usr/local/android-sdk-linux/tools/lib:$LD_LIBRARY_PATH' made it workd for me. Also specfied '-gpu off' in the command line.

Eclipse Android SDK ERROR: unknown virtual device name

So, the issue i correctly installed eclipse,android sdk,ndk, coocs2d-x 2.1.4. I can build cocos2d-x android project, import it to eclipse, etc. Everything seems fine, but not really. The problem is that i can't launch my virtual machine to emulate andoid OS. I created avd, it works fine with simple android projects, but when i use it to run cocos2d-x project as android application it does nothing. No output at all. I found this guide and followed it. But i faced a problem. 1st of all, when i follow this step:
Now start the Android for x86 Intel Emulator using the following command:
$ <SDK directory>/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm
i have an error message:
gloomist-CN tools # ./emulator-x86 #myavd -qemu -m 2047 -enable-kvm
emulator: ERROR: unknown virtual device name: 'myavd'
emulator: could not find virtual device named 'myavd'
But it is in sdk as a valid android virtual device. And the next one. In that tutorial that i pasted link to above, the last step is:
Run the emulator with the correct library path and options
Make sure to
Set the library path to the directory containing the Open GL library for the emulator (LD_LIBRARY_PATH=...)
Run the x86 version of the emulator (run /tools/emulator-x86)
Enable GPU use (Use the option "-gpu on")
Also, you need to specify the name of the Android Virtual Device to use (Use the option "-avd ")
On OS X the command line looks like this
LD_LIBRARY_PATH=~/bin/android-sdk/tools/lib ~/bin/android-sdk/tools/emulator-x86 -verbose -avd android17x86 -gpu on
i don't really know what author meant by all this. Could anyone explain me the way to do it in linux?
So basically, the main problem is: how to run a cocos2d-x project on AVD in eclipse on lixnux? That's it.
I use Linux version 3.2.0-23-generic (buildd#palmer) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP Tue Apr 10 20:41:14 UTC 2012 (Ubuntu 3.2.0-23.36-generic 3.2.14).
Can anyone help me to figure out how can i accurately launch my cocos2d-x project on AVD using eclipse?
Are you sure 'myavd' is a valid avd?
Try to run this command to get a list of AVD's you have created in your system:
# <SDK directory>/tools/android list avd
And re-run emulator-x86 passing a valid avd.
I also suggest you follow the step by step guide about how to configure your android enviroment which comes with cocos2d-x dist. You can find it in: /samples/Cpp/TestCpp/proj.android/README.md
Hope this helps
I was able to fix this error on Ubuntu 18.04 by running:
sudo chmod 777 /dev/kvm
Its not exactly high security, but it gets the job done.

emulator errors for hpet and create sensors port

I got 1 emulator error from the latest Andriod SDK(on both Ubuntu11.10 and CentOS6.2):
[#localhost ~]$/android-sdks/tools/emulator -avd api15&
emulator: WARNING: Unable to create sensors port: Connection refused
On CentOS6.2, there is also an HPET error.(even though my HPET was set to 1024 already):
[#localhost ~]$ cat /proc/sys/dev/hpet/max-user-freq
1024
[#localhost ~]$/android-sdks/tools/emulator -avd api15&
Could not configure '/dev/hpet' to have a 1024Hz timer. This is not a fatal error, but for better emulation accuracy type: 'echo 1024 > /proc/sys/dev/hpet/max-user-freq' as root.
emulator: WARNING: Unable to create sensors port: Connection refused
I am at my wits end. What is it trying to tell me? Any help would be greatly appreciated!
Here are the background info:
[#localhost ~]$ emulator -version
Android emulator version 16.0 (build_id ICS_MR0-234950)
Copyright (C) 2006-2011 The Android Open Source Project and many others.
This program is a derivative of the QEMU CPU emulator (www.qemu.org).
...
[#localhost ~]cat /etc/issue.net
CentOS release 6.2 (Final)
Kernel \r on an \m
[#localhost ~]uname -a
Linux localhost.localdomain 2.6.32-220.4.1.el6.x86_64 #1 SMP Tue Jan 24 02:13:44 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux
The first is not a real problem. In the emulator you do not have sensors that's why there is an error here. This a common error for all emulators for all versions.
As for the second case I've never noticed such error.

Categories

Resources