3

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?

3

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/
| improve this answer | |
  • THANK YOU. You solved my problem with a command line. – Fabrizio David Franco Amayo Mar 31 at 20:32
  • This worked in 20.04 too. – Steve M May 12 at 18:22
  • Tha command broke my ubuntu 20.04 VM and now I cant boot it. Dont use it. – BugShotGG May 24 at 17:19
1

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/
| improve this answer | |
  • Thank you very much. It worked to me. With Android Studio Snap on Manjaro. – Dan Ortega Feb 9 at 0:42
0

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

| improve this answer | |
New contributor
Fikret OCAL is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.