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?


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/

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/