No sound in the Android Studio emulator on MSI P65 with Ubuntu 19.10

I have an MSI P65 with Ubuntu 19.10 distro. My emulator in Android Studio has no sound. The event log of Android Studio shows these warnings/errors:

18:41 Emulator: Fontconfig error:
"/home/fabrizio/.config/fontconfig/fonts.conf", line 10: junk after
document element
18:41 Emulator: pulseaudio: pa_context_connect() failed
18:41 Emulator: pulseaudio: Reason: Connection refused
18:41 Emulator: pulseaudio: Failed to initialize PA contextaudio:
Could not init `pa' audio driver

If i use the command pulseaudio in terminal I get these errors:

E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

Already tried to delete the files in .config/pulse but it didn't work.

What else can I try?

5 Answers

There is a "/" missing, otherwise its a relative link. There you go ...

sudo ln -s /run/user/1000/pulse/native /run/user/1000/snap.android-studio/pulse/
3

Use this command, just as it is without changing anything.

sudo ln -s run/user/1000/pulse/native /run/user/1000/snap.android-studio/pulse/

For the canary:

sudo ln -s /run/user/1000/pulse/native /run/user/1000/snap.android-studio-canary/pulse/
1

The symbolic link solutions mentioned in the other answers only works until reboot for me.

However, the solution provided in this answer on Stack Overflow by Mo'ath Hasan Alshorman works for me in Ubuntu 20.04 LTS with snap Android Studio even after reboot:

The solution is by installing paprefs small app as follows.

  1. Install it:

    sudo apt install paprefs
  2. Open it:

    paprefs
  3. Go to the last tab Simultaneous Output and click on the only option there in order to enable the Simultaneous Output.

PulseAudio preferences dialog

  1. Restart it:

    pulseaudio -k
  2. If it fails then you have to restart the daemon

    pulseaudio -D
  3. Almost finished, go to the system settings and navigate to Sounds options and change the output sounds to the newly added one as below.

output device settings in sound settings

Same problem in Ubuntu 20.04, tried everything here and other solutions, no luck. What worked for me is to uninstall Android Studio from Ubuntu Software, and reinstall downloaded from Android Studio website.

Launching the emulator manually I resolved ! (Ubuntu 20.04)

emulator program can be found inside android-sdk/tools/

To get le name of your device:

 ~/Android/Sdk/emulator -list-avds

To start the emulator with Sound !

 ~/Android/Sdk/emulator -avd @Nexus_5X_API_27

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like