Can not get any hear any audio from Android SDK emulator launched from eclipse - android-emulator

I am starting to develop for Android, and I am using Eclipse with the Android plugin and Android SDK.
No matter what I do, I can not get the emulator to make any sound.
I have tried turning on audio in the virtual device setup.
I have also tried various command lines in the run configuration such as:
-audio oss ==== this gets a error message that there is no oss backend defined.
-useaudio === comes up as not a valid option
-audion -winaudio === starts w/o error but still no sound
If I open my windows7 audio controller on my laptop, I see that the android virtual machine gets its own volume slider, but nothing sounds when I move or click on that audio slider. (The other volume sliders produce the normal beep sound.)
I've been searching for "Android emulator no sound" for hours but no luck.
Any ideas?

The issue was not with the emulator not making sound ( as verified by the fact it would not work on my device either ), but a unaccounted problem with the SoundPool class.
I looked in the logcat and found references like "sample 1 not ready". Researching this I finally found a obscure thread in which it was mentioned that it takes some time before sound pool is ready to be used ( and therefore all sounds should be loaded well before they are used ).
I modified my playSound method to monitor the return value of the soundPool.play(...) method call. It returns the id of the running sound stream, or 0 if it failed ( i.e. "sample 1 not ready" ).
What I did was to put it into a loop, and when the return value of the
soundPool.play(...) method call was 0, I had the thread sleep for 1
millisecond, then try again. With this method in place, I now always
get a sound.
As a side note I have also been running tutorials with my SDK set up for Android 2.2 instead of Android 2.3.1, because Android 2.2 is what is installed on my device, a Sprint LG optimus S LS670.
I have ran my modified code on both a Android 2.2 and a Android 2.3.1 Virtual device.
When I run the code on the older Android 2.2 VD, it typically took about 10 to 15 loops ( so a 10 to 15 ms delay ) before the sounspool was ready to play the sound.
When I ran the same code on a Android 2.3.1 VD, the delay was MUCH worse, taking around a 350 ms delay before it would play - yes almost 35 times slower!
When I ran the same code deplyed to my device running Android 2.2, the time delap was about identical to running it on the emulator.

Related

Android cold start How do I find what devices have issues

I uploaded a Flutter app to Google Play Console for some external testers to try.
In the Google Play Console there's a section Pre-Launch Report. In this section's "Overview" there's a subsection called "Performance", in here there are two items:
Cold start time
Your app took 6,982ms to launch for the first time, after being installed on this device model
and
Cold start time
Your app took 8,250ms to launch for the first time, after being installed on this device model
It has an arrow next to both items implying you can find out what device model had these huge start up times.
However, all it does is take me to a list of models that didn't have issues. That's not very useful to anyone.
Is there a way to find out what models it has issues on?
Look closely and you will see the device:

total noob with emulator problems

I am attempting to learn to code via flutter (I'm a total noob) and I am having some troubles with my emulator when I am trying to test my code. I am using Visual Studio Code, and when i try to boot my emulator, the phone will appear but the screen is completely blank. the power button (on the emulator) is unresponsive and I get an error "emulator didn't respond in..."
I have literally been fighting with this for hours and I could really use a knowledgeable hand. Can anybody help me troubleshoot, by chance? I have searched here, but nothing matches exactly what I'm going through and I haven't been able to solve it yet.
errors with android emulator
My computer spec:
Processor Intel(R) Core(TM) i5-1035G7 CPU # 1.20GHz 1.50 GHz
Installed RAM 16.0 GB (15.7 GB usable)
Device ID 45818A1F-CFA5-4E12-AB9C-8192B75D2308
Product ID 00325-96713-52283-AAOEM
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Okay, so this probably seems obvious, but I seemed to struggle with this at the beginning since my course has me learning in VSCode, but I went into the android studio instead and I have deleted the old emulator and created a new one. It's taking a while to finish loading, but the screen is operating and I think my problems are likely solved.
So I guess no, I never figured out why it wasn't working, nor did I get it to work. but the end result is the same.

Why can't I get a MediaStream from back camera when front camera is in use on Android Chrome?

Consider this:
What I'm trying to do here is to get a MediaStream for environment facing camera (back) when another MediaStream for user facing camera (front) is active.
This is happening on Android Chrome 94 and Android MS Edge 93, therefore I think it's probably a webview related issue, not sure. I tested this on an Xiaomi phone and on 2 different Samsung tablets.
If I stop the track from the front stream before creating the new stream, I don't have any issue at all.
It's really strange, because same piece of code works perfectly on PC (Windows) Chrome (not tried macOS or iOS at the moment).
Thing is that stopping the first track before creating the second stream will give the user a pretty bad experience (with blank screen for a while), which I'd like to avoid.
Also there could be some use cases (e.g. PiP) in which using both cameras at once could be necessary... I can't see why this isn't/shouldn't be working.
Do you guys have any suggestion?
Thanks

Unity export to 64bit apk will cause the gameplay delay

I have tried to export my game to mobile APK. When I'm export my game to 32-bit APK, everything is working fine and smooth
But when I'm trying to export as 64-bit APK, the gameplay is a delay (eg: when I click a button, it need wait few seconds or more to have a response, this case is not happening in 32-bit APK). But the sound effect and background music is playing fine, didn't have any delay for the sound.
Below is the setting for my 64-bit export
Setting:
I will get these warning message after I exported, are these may caused my issue?
Warning Message:
May I know have what issue or reason may cause this situation happen? Hope have someone able to helping me to solve this issue. Thank you
UPDATED:
I found reason is my script have to much FixedUpdate process in running to cause delay. So, I reduce the number of FixedUpdate to solve the problem.
May I know why 32-bit able to support the number of FixedUpdate, but 64-bit unable to support?
On what device are you testing this? An Android emulator? This could be just an emulation problem and not be an issue on a modern real-world device.
Try disabling stack trace option for debug logs.
You can find it in the player settings, at the bottom of "Other Settings"
Set "Stack Trace" for "Log" to "None"

Why Uploading project.apk onto device emulator takes so long?

Every time I run a project from ADT to test on a virtual Android device it takes 90+ seconds to upload and another 15+ seconds to "install" it on the device.
Why does it take so long?
Any timeouts I should watch out for? (The eclipse console stays silent.)
Note: project.apk size is about 5MB and computing resources on the development machine are plentiful (i.e. CPU usage is around 5-10%, disk queue length about 0.05 and couple gigs of free RAM available during the "upload" and "install").
Not really a solution, but a workaround was found in a similar question:
Slow uploads to running Android emulator
It appears, when the Android emulator is idle its network connection is capped at 2 Mbps
and when you wake it by clicking and swiping around the bandwidth magically increases to around 10 Mbps! (At least so on my fairly modern system.)
This obviously makes a difference for uploading largish apps to the emulator.
Solution:
Go to Run -> Run Configurations... -> Target Tab -> Additional Emulator Command Line Options. Add there:
-netspeed full -netdelay none
After doing this the time for uploading went from 2 minutes to 8 seconds.
Edit:
I have also found that quitting Skype makes my emulator upload much faster.