wslg icon indicating copy to clipboard operation
wslg copied to clipboard

No audio

Open lduguid opened this issue 5 years ago • 9 comments

Environment

Windows build number: Microsoft Windows [Version 10.0.21364.1
Your Distribution version: Release:        16.04
Your WSLg version: 1.0.17.1

Steps to reproduce

install vlc - sudo apt install vlc -y vlc

VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80)
shm_open() failed: No such file or directory
[00000000013a9dd8] pulse audio output error: PulseAudio server connection failure: Protocol error
[00000000012af148] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
QObject::~QObject: Timers cannot be stopped from another thread
luke@duskwood:~$ uname -a
Linux duskwood 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

WSL logs:

  • Attach WSLg logs from /mnt/wslg

You can access the wslg logs using explorer at: \\wsl\<Distro-Name>\mnt\wslg (eg: \\wsl\Ubuntu-20.04\mnt\wslg)

  • puseaudio.log *E: [pulseaudio] module-console-kit.c: GetSessionsForUnixUser() call failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files E: [pulseaudio] module.c: Failed to load module "module-console-kit" (argument: ""): initialization failed. E: [rdp-sink] module-rdp-sink.c: RDP Sink - Trying to connect to /mnt/wslg/PulseAudioRDPSink E: [rdp-sink] module-rdp-sink.c: RDP Sink - Connected to fd 19

  • weston.log weston.log

  • versions.txt WSLg ( x86_64 ): 1.0.17+3.Branch.master.Sha.a526dfd5ad03d126bb2d8c528f6c3563e86a40da Mariner: VERSION="1.0.20210224" FreeRDP: e4a2fc2053bd8c5f99455fcd08ffee7e5591567a weston: fd961f5cd116c9358d82ce94d139c1578e21bd00 pulseaudio: 2f0f0b8c3872780f15e275fc12899f4564f01bd5 mesa:

Expected behavior

Actual behavior

lduguid avatar Apr 22 '21 02:04 lduguid

Fixed the same problem on my WSL/Arch by deleting the existing PULSE_SERVER environment variable from my .zshrc and reloading the shell.

klllr avatar Apr 22 '21 02:04 klllr

Works fine here in WSL/Manjaro after deleting the existing PULSE_SERVER environment variable

PhyX-Meow avatar Apr 22 '21 06:04 PhyX-Meow

We run our PulseAudio server in the system distro on a socket shared back to your user distro located at /mnt/wslg/PulseServer. As part of WSL init and before your distro start up, we pre-initialize PULSE_SERVER environment variable to reference that location. If you have setting that override that environment variable, it will break audio.

If you restore it as below, audio should start working again (you'll have to restart the app too i believe).

export PULSE_SERVER=/mnt/wslg/PulseServer

So you'll want to avoid changing the value of PULSE_SERVER that we prepopulate, so the suggestion above of removing that this variable from things like your .zshrc are correct.

spronovo avatar Apr 22 '21 07:04 spronovo

Thanks you both for the update, however, while good to know, I do not believe that is my particular issue;

luke@duskwood:~$ env | grep PULSE
PULSE_SERVER=/mnt/wslg/PulseServer
luke@duskwood:~$ vlc
VLC media player 2.2.2 Weatherwax (revision 2.2.2-0-g6259d80)
shm_open() failed: No such file or directory
[0000000002194dd8] pulse audio output error: PulseAudio server connection failure: Protocol error
[000000000209a148] core libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.

It looks like the env PULSE_SERVER has been set correctly and no other attempts to changes it that I can find in various startup scripts etc. However, as you can see pulse audio still appears to be failing. Let me know if more info can help with the diagnosing etc.

Cheers,

lduguid avatar Apr 22 '21 21:04 lduguid

@lduguid what WSL distro are you using? Does audio work in other app, like say firefox? Or broken across the board?

spronovo avatar Apr 24 '21 03:04 spronovo

At the time it was Ubuntu 16.04. I also tested firefox and navigated to youtube, also no sound. I did not capture the errors with firefox at the time. Unfortunately, yesterday I required this laptop for some work related tasks and as the dev windows preview was a little unstable in other respects (non-wsl related) and slow, I reverted back to Microsoft Windows [Version 10.0.19042.928] for now. I will get back to testing this in about a weeks time. I also have Ubuntu 20.x on that machine, I will test with it as well. If there are new insights I will comment here. Thanking you.

lduguid avatar Apr 24 '21 17:04 lduguid

Had this problem with Debian on WSL2 using wslg, no audio was coming from firefox or google-chrome.

It was simply fixed by installing pulseaudio "sudo apt intsall pulseaudio"

WMRamadan avatar Jul 14 '21 13:07 WMRamadan

It was simply fixed by installing pulseaudio "sudo apt intsall pulseaudio"

Fixed this problem with "yay pulseaudio" on Arch. Thanks!

jiaqi228 avatar Apr 08 '23 09:04 jiaqi228

I had this problem with openSUSE 16 on WSL2. I didn't see pulseaudio in the default repos, but pipewire-pulseaudio was installed. In order to get any sound output from WSL, I had to run:

systemctl --user stop pipewire.service pipewire-pulse.service wireplumber.service
systemctl --user disable pipewire.service pipewire-pulse.service wireplumber.service
wsl --shutdown

Now the sound works.

Quipyowert2 avatar Feb 01 '26 21:02 Quipyowert2