You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe your issue in as much detail as possible:
Firstly the game requires a launch command in order to get audio to work under pipewire and second it has a good between 2-5 seconds delay, you see the action on screen and after that you hear the audio.
For CS GO neither of those issues were present.
Steps for reproducing this issue:
Just try to play the game using pipewire( launch command -sdlaudiodriver pipewire required otherwise game would be without audio)
Reacted by Jason Carrete, jfaz, Jonathan Vollebregt, Garrett Marconet, MajorZero, Martin Engström, André, Félix Defrance, WhitePeace36, clankfish and 47 more
I tried retest it with latest update - latency is still building up.
My method of testing:
Microphone
CS2
Audacity
Carla
Launch Audacity, set Recording Device - cs2 app. Press record in stereo. In Carla reroute your mic capture to PortAudio device - that's our Audacity. So left channel in Audacity records cs2 and right channel is my mic. I click the mouse and then hear cs2 gunshots. I measure latency between start of a click and start of sound from CS2.
Initially right after map was loaded, before mouse click and sound of a gun i had ~90-100ms (of course my system latency / recording software latency/etcetc will affect it, but i didn't change it through tests, nor restart the game / sound system / audacity, etc)
After 10-15 minutes - about 110-120ms latency
Another 10 minutes - about 140ms latency
Another 10 minutes - about 170ms, already noticeable with eyes
Another 10 - about 200ms, already unplayable
Another 15 - about 230-240ms, unplayable indeed
So latency did build up for me.
Reacted by Mathias Gigas, Szymon Marczak and Dietrich Daroch
cs2latency.zip
I exported project to .ogg file, you can try to import it in audacity. Original aup3 is 145Mb, quite big for github
Timestamps:
0s - 48s - right after loading the game
48s - 1m21s - after ~10minutes
1m22s - 2m04s - after another ~10 minutes
2m05s - 2m55s - after another ~10 minutes
2m55s - 3m33s - after another ~10 minutes
May be it's the Pipewire issue, but i definitely didn't have that desync problem with csgo and other games (osu!lazer for example, rhythm game where sound latency even +-20ms is critical)
Changing the audio device also fixes the latency issue (you have to actually change the device by selecting it from the menu, and change it back to the old one). The changes takes a few hundred ms to take effect, so binding this to a key like W or MOUSE1 won't be ok :(
Yesterday I tried the workaround with the .asoundrc, timings where on point for the time I tested it, but unfortunately my sound got stuttering and cracking after a short while so I did not test it one or two matchmaking games, just for some short deathmatches.
My console got also following output while using the .asoundrc file:
Which could indicate a too huge bitrate and a too small buffersize - might take a look this evening to check if I could lower the sample rate and maybe increase a bit the buffer size (I assume the buffer size should not be that huge, as it could also cause delay).
Some tinkering:
Game tries to use pulseaudio by default, and on my system it defaults to pipewire-pulse bridge. On pw-top i can see that game asks for 256 quantum and 48000 rate by default
Forced pipewire does not help. PULSE_LATENCY_MSEC=60 and PIPEWIRE_LATENCY=128/48000 added to launch command did not help. My thoughts was "if i set constant latency, issue will be fixed".
Also - latency increases even if game is staying in background
I left the game open for several hours at 96000 and the delay is back. I'm on pipewire 1.0.0, which was released a few days ago (but is api/abi compatible with 0.3)
has anyone had the delay bug recently? I had the game open for 3 hours and didn't notice a delay. No special launch parameters, system uses pipewire 1.0
Well played some casual matches and didnt notice the problem on 96 KHz good job devs but maybe at least you mention that you fixed the problem in patch notes ?
I just tested playing a couple of games using the default pipewire settings on my Slackware system instead of forcing it to 44100 and didn't notice any delay, so seems to be fixed for me too, either by a cs2/SDL update or pipewire 1.0.
In my case the default rate is 48000 and I confirmed that the soundcard playback rate was 48000 in the alsa info.
@MatiasPViecho bluetooth tends to have poor latency, so it's likely that and not the game causing the delay. You probably have a delay with other games as well.
@MatiasPViecho bluetooth tends to have poor latency, so it's likely that and not the game causing the delay. You probably have a delay with other games as well.
Hey! Quite late to answer but i tested it and yeah, I didn't notice the delay on other games, music and tv shows until you mentioned it, its just that in CS audio is so important that i just happened to notice it there haha
Activity
jnvsor commentedon Sep 28, 2023
I had this occur but only after playing for a few hours. It went away after a game restart but it does happen
Edit: Yeah it seems to slowly desync and get later and later from what I've seen
ZeroYamaoka commentedon Sep 28, 2023
I had same isuee i changed default sound device in game option to my Soundcard that i use and it fixed the problem for me (Well maybe it will help)
stealingudc commentedon Sep 28, 2023
This hack reduced the audio delay to up to a second for me on Debian 12 with pipewire-pulse. Even so, it's still barely playable.
JacKeTUs commentedon Sep 29, 2023
Guys, can you retest please if latency will still build up on latest update without any workarounds?
JacKeTUs commentedon Sep 29, 2023
I tried retest it with latest update - latency is still building up.
My method of testing:
Launch Audacity, set Recording Device - cs2 app. Press record in stereo. In Carla reroute your mic capture to PortAudio device - that's our Audacity. So left channel in Audacity records cs2 and right channel is my mic. I click the mouse and then hear cs2 gunshots. I measure latency between start of a click and start of sound from CS2.
Initially right after map was loaded, before mouse click and sound of a gun i had ~90-100ms (of course my system latency / recording software latency/etcetc will affect it, but i didn't change it through tests, nor restart the game / sound system / audacity, etc)
After 10-15 minutes - about 110-120ms latency
Another 10 minutes - about 140ms latency
Another 10 minutes - about 170ms, already noticeable with eyes
Another 10 - about 200ms, already unplayable
Another 15 - about 230-240ms, unplayable indeed
So latency did build up for me.
JacKeTUs commentedon Sep 29, 2023
cs2latency.zip
I exported project to .ogg file, you can try to import it in audacity. Original aup3 is 145Mb, quite big for github
Timestamps:
0s - 48s - right after loading the game
48s - 1m21s - after ~10minutes
1m22s - 2m04s - after another ~10 minutes
2m05s - 2m55s - after another ~10 minutes
2m55s - 3m33s - after another ~10 minutes
My system information: https://gist.github.com/JacKeTUs/d36b8e75a78f96160fd9c12eeccab18b
Pipewire 0.3.80, config: https://gist.github.com/JacKeTUs/abc72942af8e96a47a7eba4430fc5643
JacKeTUs commentedon Sep 29, 2023
May be it's the Pipewire issue, but i definitely didn't have that desync problem with csgo and other games (osu!lazer for example, rhythm game where sound latency even +-20ms is critical)
szmarczak commentedon Sep 29, 2023
I can confirm that the latency builds up (flatpak steam, pipewire).
szmarczak commentedon Sep 29, 2023
Changing the audio device also fixes the latency issue (you have to actually change the device by selecting it from the menu, and change it back to the old one). The changes takes a few hundred ms to take effect, so binding this to a key like
WorMOUSE1won't be ok :(NiSchie commentedon Sep 29, 2023
Can confirm latency buildup.
Operating System: Arch
XFCE Version 4.18
GTK Version: 3.24.38
Qt Version: 5.15.10
Kernel Version: 6.5.5-arch1-1
Graphics Platform: X11
Processors: AMD Ryzen 5 3600
Memory: 16 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1660 Ti
Sound server: pipewire
jpgay commentedon Sep 29, 2023
Latency buildup also occurs with PulseAudio.
System info: https://gist.github.com/jpgay/a6f3f51e590652eef96c91216b1e7e96
itouchdennis commentedon Sep 29, 2023
Having the same problem on pipewire.
Did someone test it with alsa ?
Yesterday I tried the workaround with the .asoundrc, timings where on point for the time I tested it, but unfortunately my sound got stuttering and cracking after a short while so I did not test it one or two matchmaking games, just for some short deathmatches.
My console got also following output while using the .asoundrc file:
[SoundSystemLowLevel] Audio device starved 512 samplesWhich could indicate a too huge bitrate and a too small buffersize - might take a look this evening to check if I could lower the sample rate and maybe increase a bit the buffer size (I assume the buffer size should not be that huge, as it could also cause delay).
JacKeTUs commentedon Sep 29, 2023
Some tinkering:
Game tries to use pulseaudio by default, and on my system it defaults to
pipewire-pulsebridge. Onpw-topi can see that game asks for 256 quantum and 48000 rate by defaultForced pipewire does not help.
PULSE_LATENCY_MSEC=60andPIPEWIRE_LATENCY=128/48000added to launch command did not help. My thoughts was "if i set constant latency, issue will be fixed".Also - latency increases even if game is staying in background
edit: forced pipewire tested
66 remaining items
boustrophedon commentedon Dec 2, 2023
I left the game open for several hours at 96000 and the delay is back. I'm on pipewire 1.0.0, which was released a few days ago (but is api/abi compatible with 0.3)
nadanke commentedon Dec 3, 2023
Okay with -sdlaudiodriver pipewire I still get delay, but it builds up less fast than it does without it (on 192khz)
simifor commentedon Dec 15, 2023
has anyone had the delay bug recently? I had the game open for 3 hours and didn't notice a delay. No special launch parameters, system uses pipewire 1.0
ipaqmaster commentedon Dec 15, 2023
I haven't noticed it because I forced my DAC rate to 44100 to work around this problem long ago.
What is your sample rate set to? If it's higher than 44100 then your evidence is valid.
kodatarule commentedon Dec 15, 2023
I still experience the same delay, it's just very random, sometimes it comes fast, other times it takes some time to be in-game to trigger it.
simifor commentedon Dec 15, 2023
@ipaqmaster 48KHz in my case and I used to have the issue in the past but seemingly not anymore. Though clearly there are still people affected.
rLy07 commentedon Dec 16, 2023
I just played like 5 matches and had no issue at all. I didn't use any of the workaround mentioned here.
ZeroYamaoka commentedon Dec 17, 2023
Well played some casual matches and didnt notice the problem on 96 KHz good job devs but maybe at least you mention that you fixed the problem in patch notes ?
I use pipewire with SoundBlaster Z SE card
af7567 commentedon Dec 17, 2023
I just tested playing a couple of games using the default pipewire settings on my Slackware system instead of forcing it to 44100 and didn't notice any delay, so seems to be fixed for me too, either by a cs2/SDL update or pipewire 1.0.
In my case the default rate is 48000 and I confirmed that the soundcard playback rate was 48000 in the alsa info.
kisak-valve commentedon Jan 27, 2024
Closing per the last several comments.
MatiasPViecho commentedon May 9, 2024
Just got a pair of bluetooth headphones and i'm having the same issue, doesn't seem like any of the solutions provided here works for me :(
simifor commentedon May 9, 2024
@MatiasPViecho bluetooth tends to have poor latency, so it's likely that and not the game causing the delay. You probably have a delay with other games as well.
MatiasPViecho commentedon Jun 19, 2024
Hey! Quite late to answer but i tested it and yeah, I didn't notice the delay on other games, music and tv shows until you mentioned it, its just that in CS audio is so important that i just happened to notice it there haha