Android Studio - No Sound [duplicate] - android-studio

This question already has answers here:
MediaPlayer no longer working on the emulator since r10?
(5 answers)
Closed 3 years ago.
I ran my application and I can't get the sound working on the Android Emulator.
I checked and enabled the audio playback boolean in the Eclipse AVD Manager.
I also went into the sound options in the Android Emulator and put them up (no sound while putting them up).
I checked the box that says all selections will make a noise(still no sound).
My application uses the MediaPlayer class and I am running win7 x64 if that has anything to do with it.
Help is appreciated.

For OS X the Android Emulator uses the settings for "Sound Effects" so this is what I had to do to fix my issue:
Click the Apple icon in the top left, then click on System Preferences
Click on Sound
Click on "Sound Effects"
Set "Play sound effects through" to "Selected sound output device"
Set the Alert volume almost at max.
Somehow this had changed to use my monitors instead.

In Ubuntu 16.04, start the emulator and go to the Ubuntu → System Settings → Sound → Applications. Uncheck the mute checkbox and set the cursor at the middle position.

The solution on Ubuntu 16.04 consists in going to the System Settings → Sound → Application tab.
Then, unmute the Qemu-system … and increase the volume

On Debian 8 , you should open qemu-system after android emulator launching

my apps working fine with sound suddenly it stop sound because of some code changed. all other app sound also stopped then i did below step now it is fine
try below
go to android emulator
1.close the program
2.setting -> sound -->volumes ->increase sound value in music video games and other media
it will work

On On Kubuntu , you should increase the playback stream of qemu-system after android emulator launching

I had the same problem : in a terminal,
type pavucontrol (when emulator is running)
and another application using sound, that works, is running too (on pause).
Check if quemu-system and the other application use the same soundcard... In my case, this was the problem :quemu system was using a non working internal soundcard.

Try pressing F6. I had a hard time to figuring this out.

Related

Android Studio guest hasn't come online in 7 seconds

When I first start the emulator in Android Studio I get an information message,
guest hasn't come online in 7 seconds retrying
I am curious as to how to stop this because while it is on my screen for about 40 seconds I cannot do anything in the emulator.
Actually 'Cold Boot Now' may work in this situation
I had the same problem. Selecting Cold Boot Now in AVD manager solves the problem.
But I have to open AVD manager each time when I want to launch Emulator and I just want to click on Run app button and select device, without opening AVD manager.
To solve this: open AVD manager -> Edit device -> Show Advanced Settings -> Boot option -> select Cold Boot instead of Quick boot.
tools->Android->AVD Manager
Choose the device then Cold Boot Now
maybe it's bug from intel haxm 6.2.1, because after i update i got same problem.
I solved by recreate emulator and testing again
I managed to solve this issue by updating the .ini file manually. (I was not able to find a corresponding setting in the GUI.)
The location of the .ini file, relative to your home directory, is:
~/.android/avd/MyDevice.avd/config.ini
where MyDevice refers to the configured device name.
Depending on your operating system, you may find your home directory according https://en.wikipedia.org/wiki/Home_directory.
Change the entry within config.ini from no to yes:
fastboot.forceColdBoot=yes
I specified AVD memory 2048 Mbyte instead of 1536 Mbyte. Things
started to work again. (I'm developing on macbook.)
I tried "Kuldeep Chandel" solution which is to duplicate AVD and my app runs again too. Because of that I specified RAM again as 1536
Mbyte. Guess what... It worked...
I think AVD confuses to handle things and we need to duplicate the current AVD, and use it instead of the problematic one.
In "Your Virual Device" - Click on Duplicate OR Duplicate your Device. It will work like Charm.
I faced this issue on using Android API 28 emulator with Android Studio 3.0.1. Android API 28 requires Studio 3.1 and above. Once I updated Studio to 3.1.4 and Android Emulator to the latest version, it worked.
Seting default settings for problem device from Android Device Manager resolved issue for me.

Android Emulator Screen Size Issue

My Android studio emulator screen is off the original positioning and I have tried resizing, reloading the emulator, and Android studio to no avail.
What is wrong with the emulator Display?
I have Alieanware 17 ( Dell Gaming Series ) when i updated my android studio version after week emulator screen shows small and not same size with skin fame size. i found in internet but no solutions after i searched many links Android Emulator Screen Size not the same as device frame see this links help me but in that when i choose software option in graphic setting in emulator device configuration. my emulator going slow. it also say that use this option when computer graphic issue.
here images shows before setting apply and after setting apply
Experienced the same problem as Solanki after updating from 3.1.2 to 3.1.3 (and Gradle update). Configuring the AVD graphics from/to "Automatic" had no effect.
Restarting and (installing Windows 10 updates - coincidence?) solved the problem and all running normally on start up.
you can just go to settings -> system -> scale and layout then change the size of text apps and other items to 125% restart android studio and run again the emulator.
good luck !
Update android studio if it's not up to date then go to settings and then in emulator tab tick on "Launch in a tool window". It will work
See Screenshot
Not sure if this helps, but I had this same problem (together with the side panel menu being overly large) after updating from Android Studio 2.3.0 to 2.3.1. After restarting my computer it went away...

Hololens emulator mouse input not captured

In Hololens Emulator with Windows 10 Pro, I can only use keyboard strokes and my mouse is not recognized. How can I turn on mouse input? I did nothing to connect my keyboard, so why is it with a mouse that I have to change something?
One problem that may solve it: make sure when using the emulator that in Package.appxmanifest in Visual Studio the MaxVersionTested line is the correct version. I was looking at an older version which everyone says to use: 10.0.10586.0 which was incorrect. When choosing the device for debugging, the version will be in the name. Currently, the most updated version (that I am using) is 10.0.14342.1018. After that, start debugging and run the emulator and you should have keyboard and mouse input!
I had the same problem, but I'm not sure how I solved it. Here is what I have done:
Installed Update 3 for VS 2015. Tried again without restarting the PC and got the same problem. On the next day I started the HoloLens Emulator directly via Hyper-V Manager. After that I started my project in Visual Studio. The Emulator loaded correctly and now the Human Input and Keyboard and Mouse Input buttons are enabled.
Update: That was definitely not the answer, but I found a working solution here:
http://forums.hololens.com/discussion/952/no-input-from-emulator
Just put off your proxy in IE and the icons will be enabled. I could turn my proxy on again and the controls remained active.

Android studio's emulator has an error "can't connect to camera"

I'm connecting a webcam to my emulator by setting the front camera to "webcam0" in the AVD Manager.
When I launch the webcam from Android studio's AVD manager or using emulator -camera-front webcam0 , I get the following window:
and when the emulator has showed that is an error
Please help me how to fix that.
Go to Android Virtual device manager>>select the emulator>>click edit>>select Advanced Setting>>camera select as Emulated rather than Webcam0 .
I got this error on new android emulator and was able to fix it by selecting emulated options for both Front and Back camera and clearing Camera App's Cache & data.
The solution for me was : " start Android Studio via command line vs starting it the usual way " Doing so makes Webcam0 work inside the emulator.
On my Mac I simply typed
/Applications/Android\ Studio.app/Contents/MacOS/studio
into terminal. I also used Automator later to create a workflow which runs the script (command above), and saved the workflow as an app.
Using such Android Studio launcher.app launches Android Studio.app for me via command line.
Android Studio:
Tools > AVD Manager
select the Device & click edit
click Show Advanced Setting
Camera select as Webcam0
Click >> Finish
Download the free personal use version of genymotion and use that emulator instead of the one that come with Android Studio.
Like you, I've been trying all morning to make my webcam work with the emulator that comes with android studio without success. 0 problems with genymotion so far.
In my case, just change configuration -> saved -> turn on device (cold boot notification will appear) -> then turn off device -> revert change -> turn on again.
I don't know but it works for me. Maybe it just cache problem. CMIIW.
but if you are using bluestack emulator or any other emulator.
then in emulator first open emulator camera then click photo of that
then again your own application in emulator and click button of camera ..i must be work ..

How do I stop app in Android Studio

I must be missing something totally obvious, but I can't find a simple way to simply stop an app from running. I'm running it on my HTC One.
I first tried toggling the green run arrow. Didn't work.
I found a "Terminate Application" circle in the lower left of the window. That doesn't seem to do anything when you click it. It seems to be grayed out, non-functional. Screen shot here
http://www.screencast.com/t/VLTOzPQ7
So, I closed the entire project. That worked, but also the entire Android Studio closed instantly. Then reopening Android Studio failed (stack dump). Then reopening again worked, but it took 30 minutes to load my project.
To stop the next time, I turned my phone off, then closed the project. That seems to have worked better, since it took me to the Welcome to Android Studio screen and invited me to open or start a project.
Maybe there's an easier way to stop an app? I see the same question on this forum but no solutions.
The Android Studio controls you are trying to use only work if you are running your app in the emulator. There are a few ways to do this when you are using an actual device or VM (e.g., Genymotion):
Use the UI of the phone to Force Stop the application. This is done in the Settings->Apps menu.
Use Android Studio's terminal window or the host's shell and issue the command:
adb shell am force-stop <package-name>
Open Android Device Monitor (green "Droid" icon), select the process under the Devices tab and click the Stop Process button (stop sign icon). This is basically the GUI way of doing #2.
You need to select the process you want to terminate (ex. com.myname.myapp) then click terminate application.
Since the application is running on your phone, you need to end the application process on the phone. When you do that the application would be shown as terminated on Android Studio.

Resources