microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.21k stars 305 forks source link

Choppy sound with WSLg on Windows 10 #908

Open CComparon opened 1 year ago

CComparon commented 1 year ago

Windows build number:

10.0.19045.2311

Your Distribution version:

Ubuntu 22.04

Your WSL versions:

WSL version: 1.0.0.0 Kernel version: 5.15.74.2 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19045.2311

Steps to reproduce:

sudo apt install vlc
vlc /path/to/music.m4a

WSL logs:

pulseaudio.log stderr.log weston.log

WSL dumps:

No response

Expected behavior:

Smooth audio playback

Actual behavior:

Very choppy audio playback (can hear sound every other second or so).

Please note that the upgrade to Store wsl worked like a charm, and my linux GUI apps work flawlessly.

ultrasound1372 commented 1 year ago

Same here. I get this with most RDP really, but this is particularly bad, which makes no sense for something that's entirely local. I have my own reasons not to upgrade to Windows 11, and am very glad that these things are available on Windows 10 now. I was planning to make use of emacspeak in wslg as I'm a blind user, but I can't go half a second without jitter, pops and clicks, or some kind of ring modulated garbage due to buffer underruns. Even with something as simple as running espeak-ng and typing some text into it. I should note that my tests so far haven't actually spawned a GUI, but the subsystem seems to activate anyway. Using pulse audio I believe. This is Ubuntu 22.04, fresh install after the store upgrade, with systemd.

blakeduffey commented 1 year ago

Trying to play a 10MB mp3 file - stutters very couple seconds

WSL version: 1.0.3.0 Kernel version: 5.15.79.1 WSLg version: 1.0.47 MSRDC version: 1.2.3575 Direct3D version: 1.606.4 DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Windows version: 10.0.19044.2364

diekleinekuh commented 1 year ago

Same here: Windows 10, WSL2 updated to latest. GUI apps work but playing an mp3 file in vlc stutters

asayler commented 1 year ago

Seeing this same issue on a fresh install of Ubuntu 22.04 under the latest WSL. Added libpulse0 as noted in https://github.com/microsoft/WSL/issues/9192 to get audio working at all, but playing flac files via cmus leads to stuttering audio. The same setup on Ubuntu 20.04 works correctly.

Alfagun74 commented 1 year ago

Same issue.

Dai-JiaLin commented 1 year ago

Same issue. Is there any solution?

bogdan-calapod commented 1 year ago

Also encountering this with terminal audio apps (e.g. ncspot) on Windows 11, so I don't think this is strictly related to GUI

e1uone commented 1 year ago

Same issue, CMUS and VLC sound is sluttering, but mpg123 sounds perfect, don't know why

e1uone commented 1 year ago

Just did this, and now it works great sudo apt install pulseaudio pavucontrol -y pavucontrol is a GUI, so you may not need it

e1uone commented 1 year ago

Nah, problem still persist in CMUS, but VLC is acting strange, i'm getting corrupted audio for about 10 seconds, and then it "repairs" itself

AaronDinesh commented 11 months ago

I've also got this issue in WSL2 in Ubuntu. I am trying to play an audio file using the miniaudio.h c library. It manges to play fine for about 29 seconds and then the audio becomes very choppy. You only hear a little note every one or two seconds. I have replicated this issue with cmus too.

Audio clips below 29 seconds seem to work fine. Any idea what might be causing this?

I am on Windows 11

Dari4sho commented 11 months ago

Only could get it working with ffplay so far, same issue with vlc

AaronDinesh commented 10 months ago

Just did this, and now it works great sudo apt install pulseaudio pavucontrol -y pavucontrol is a GUI, so you may not need it

For me installing pavucontrol fixed the choppy issues. It would come back if I leave WSL running for a long while. But then restarting WSL fixes the issue.

NullDott commented 2 months ago

Same issue, Ubuntu 24.04, in VLC audio playback is choppy all the time, some other apps like Pyxel for example work for a bit, but then the audio starts getting out of sync, and ends with a lot of stuttering.

pavucontrol is installed, but it didn't fixed the issue, I'm in Windows 10, and I'm a game developer, I cannot test my linux builds with this problem, someone have a fix?