Audio not working in the android emulator (win7) - android

When starting my emulator from Eclipse or from the command line (Win7x32), I see no emulator window popup and the process hangs.
From the command-line, with -verbose, I see logs until the two lines:
emulator: using 'winaudio' audio input backend
emulator: using 'winaudio' audio output backend
... and then nothing.
When I start from the command line with -verbose and -noaudio options, the emulator starts up.
I can modify the Eclipse avd startup settings to have -noaudio, but I'd like to find a way to get audio working.
The commands emulator -help-audio-in and emulator -help-audio-out show winaudio and winaudio & sdl, available, respectively.
Does anyone have pointers as to how to get audio working with my emulator?
Edit
After this happened again, I discovered it was a faulty audio driver - basically a Windows audio driver issue. Reinstalling the driver (and removing any usb-attached audio hardware like webcams, etc.) allowed the emulator to start w/o hanging # winaudio statements.

As above, after this happened again, I discovered it was a faulty audio driver - basically a Windows audio driver issue.
Reinstalling the driver (and removing any usb-attached audio hardware like webcams, etc.) allowed the emulator to start w/o hanging # winaudio statements.

Related

Android emulator freeze my whole system when it can't connect to adb daemon

I recently changed my computer and took the opportunity to move from Mageia to Fedora. But I can't do any Android development anymore because, as stated in the title, starting any AVD makes the whole system to freeze (screen, mouse and keybord) if the AVD can't connect to adb daemon. The only thing I can do is hard shutdown.
The problem here is adb daemon is always started when I try to launch an AVD as the service is enabled by default, so that shouldn't happen.
What I've been able to collect so far is a few logs in a file by lauching the emulator from command-line. All it says before freezing is:
emulator: INFO: GrpcServices.cpp:301: Started GRPC server at 127.0.0.1:8554, security: Local
emulator: ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
But, if I manually restart the adb service just before lauching the AVD, I don't experience the freeze. Instead, I get the following errors before the AVD crashes:
cannot add library .../android-sdk-linux/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
added library .../android-sdk-linux/emulator/lib64/vulkan/libvulkan.so
cannot add library .../android-sdk-linux/emulator/lib64/vulkan/libvulkan.so.1: full
My best guess here is there's something bad going on with the graphic card. Something I am seemingly the only one to exprerience as I couldn't find any relevant result on internet. I must mention here that I've already tried to run several AVDs in multiple API versions, both software and hardware rendered graphics and I always get the same result.
My system configuration is
AMD Ryzen 9
Nvidia GeForce RTX 2070 using the Nouveau drivers
kernel 5.11.
If anyone ever stumbles upon this question facing the same issue than me, that was solved by getting rid of the Nouveau drivers and using Nvidia's proprietary drivers. A handful of other disturbing bugs on my computer were solved by doing just that.
I really don't understand why some Linux distribution still strongly advise to use the Nouveau drivers over Nvidia'as when they have a such a really poor support of the GPUs...

Why is "adb install (my APK)" triggering "can't find service: package"?

I am starting up an android virtual device, but I am getting:
Starting emulator for AVD 'avd.1'
pulseaudio: pa_context_connect() failed
pulseaudio: Reason: Connection refused
pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver
emulator: Listening for console connections on port: 5558
emulator: Serial number of this emulator (for ADB): emulator-5558
The emulator is coming up but I see no icons on it so I'm wondering if the errors listed above are "showstoppers"? Then when I try adb install bin/my.apk I get the error Can't find service: package. So it seems adb is not communicating with the AVD correctly. However, adb devices does show emulator-5558 listed above. Any advice would be really helpful.
You have essentially answered your own question while asking it. The root of the problem is that the emulator is not setup properly (evidenced by the system UI not loading). When Android can't boot properly, it is likely to fail to start some system services (in this case, the package service).
The solution is to recreate the emulator, possibly with a different system image (in case the one you have been using is corrupt). If you are using an official image, try switching API levels, or switch from a GMS-enabled emulator image to a non-GMS image (or vice-versa).
It also happened to me after closing the emulator while debugging. Yes, not the best idea...
The solution for me was:
Click on Tools > AVD-Manager.
Click on the arrow to bottom on the right of the new window from your (virtual) device.
Click on "Cold Boot Now".
Don't forget to enable usb debug mode and in developer option to consent data file transfer, for me it solved this issue, hope this help
You can also get this fault when delpoying to physical devices.
The solution is to restart the adb server, using:
adb kill-server

Cannot test my AOSP build on the emulator

I built the Android AOSP tree for the mako device successfully on my Ubuntu 14.04 LTS desktop with the '. build/envset.sh', 'lunch mako-userdebug', and 'make -j4' series of commands. I tried to run it in the emulator by following the Google-provided instructions (i.e. typing the 'emulator' command in a terminal right after the build is complete) but it does not work. The emulator starts up but is stuck on a black screen. I noticed the following warning/errors while the emulator starts up:
emulator: control console listening on port 5554, ADB on port 5555
emulator: can't connect to ADB server: Transport endpoint is not connected (errno = 107)
Any help in resolving this error is greatly appreciated.
Phil,
To make an image for the emulator, you will need to make one of the generic images. e.g. lunch aosp_arm-eng (you can also us userdebug, etc). It may not show up in the lunch menu, but it should be available nonetheless. The emulator was made strictly to test the changes made in the framework and to the default system properties (those that are hardware independent). Building the arm version should fix your errors!
Best!

Emulator Buzzing Sound

When I start my emulator whether in Eclipse or from command prompt, the emulator causes a buzzing sound, and will not exit, I MUST restart my computer. When I add the -noaudio command line option, there is no buzzing, and the emulator will exit perfectly. Any suggestions
Some people on googlegroups (and others) have had success with
-audio oss
but it will block all other audio on your machine.

Android Debugging with Logcat and Emulator. Is it possible?

This is pretty simple: I'm using NetBeans on Linux with Android emulator 1.6. I have Logcat on my android phone, but the process of getting the messages to somewhere readable isn't smooth at all.
Can someone tell me how to get Logcat running on the emulator? Is there anything I can do to see debug messages other then having to copy the apk to my phone and testing it?
Thanks in advance!
You have a few options for viewing the debug log output, assuming you have the SDK installed and your command path set up correctly:
Type adb logcat. The log output from the connected device or running emulator will appear. I usually prefer adb logcat -v time to see the time stamps.
Type ddms. This launches the stand-alone version of DDMS. It has a logcat display at the bottom.
Install the ADT extension for Eclipse, and open the logcat view. (Since you're using NetBeans I assume this isn't what you want to do, but I'm mentioning it for completeness.)
In all cases, the interaction is the same whether you're using a physical device or software emulator, because the ADB daemon conceals the details. Whatever you're doing for the device is also expected to work for the emulator.
If you have a device and emulator connected simultaneously, you can use adb -e logcat for the emulator and adb -d logcat for the device. From stand-alone DDMS or Eclipse, just pick the device or emulator from the pop-up menu.
If you have setup nbandroid you can find the adb logcat viewer in netbeans under:
Window -> Output -> ADB Log
--edit
Just followed up on the post above and started using C:\Program Files (x86)\Android\android-sdk-windows\tools\ddms which is alot better then the one in netbeans.
The SDK comes with a handy tool called ddms it should be in the tools folder of the SDK.
At the moment an Emulator is running, or a mobile phone is connected to your machine it should show up in ddms and you can see all the log output in ddms.

Categories

Resources