Bug Report Audio lag in OBS-redux Linux

Lain

Forum Admin
Lain
Forum Moderator
Developer
We're still trying to figure out how to reliably replicate. I'll probably just install linux on my terrible POS laptop where it's probably guaranteed to occur and see if I can debug it or something. It doesn't seem to really happen on my desktop (yet). Perhaps it depends on the game as well.

Do you think you could list the games you have this happen with?
 

NoXPhasma

Member
It is not limited to games, it happens also when I grab the screen and only use the speaker test.

But some games we tried were Fistful of Frags, Electronic Super Joy and Hammerwatch.
 

ramma

New Member
Do you think you could list the games you have this happen with?

I've streamed a good 200-300 hours with this issue, and what I've noticed is more graphically intensive games are desync faster. For instance, Dota 2 will get to almost 1 second desync after just an hour, while Prison architect desyncs by just a few hundred milliseconds after multiple hours.

As for some games I know desync quickly, here's a short list.
  • Dota 2
  • Rust
  • Counter Strike - Global Offensive
  • Euro Truck Simulator 2
  • Goat Simulator
  • Tropico 5
  • Guns of Icarus online
 

ramma

New Member
I just wanted to add an example video of the audio lag. Here's a link to a 16 second highlight from one of my previous streams where you can easily see how desynced the gunshot sound is in CS:GO.
 

Nisengo

New Member
It's not just a streaming thing either, the same thing happens when recording and the audio can lag behind as much as 3 seconds! Unfortunately for me it's not possible yet to save mic audio and bg audio to separate tracks so i'm sometimes stuck with unusable sound tracks.
Setting a scene-specific audio source also doesn't help in this case. There is significant lag there regardless of where the sound input is defined.
 

Maltahl

New Member
So when i livestream or record locally i get this wierd audio desync from Osu! when i rewatch my recording or if someone watches the livestream.

Local recording example: http://www.fileoven.com/f/Ba05pXIv70eNbSDCe8UTKg

Twitch Example (note it may not last a long time): http://www.twitch.tv/maltahlgaming/b/573508595

OBS Logs for both recording and livestream: https://gist.github.com/a84bbdfe603053c33f92

same results with manually adding pulseaudio to sources: http://www.fileoven.com/f/R2xdCPIJkkSih9yPDtTfXQ

Thanks for the help in advance!
 
we have people posting here on the forums as well as in the mantis bug tracker. i'm not sure which area is viewed more but i would think the mantis bug tracker is the best place but i can't say for sure since i'm not a developer of obs-studio. I posted to the mantis bug tracker last night after streaming to both twitch and hitbox. there's horrible audio desync even when I used the latest build compiled from git. here's an example of the stream.
https://www.youtube.com/watch?v=C3q3NutCyu4&list=UUXoYbl7LgxT-_fDuofsNsEQ
here's the log if that's useful but it doesn't look to be.
https://gist.github.com/anonymous/2bcc613dee409cb105f4
 

ramma

New Member
@ubuntuaddicted , I believe the mantis bug tracker is meant to be reserved for comments related closely to bugs, where as here serves for more open conversations.

The audio desync bug is also still affecting me on the latest build. I'm not having desync with my microhpone like you mentioned on the bug tracker though. The audio desync also seems less severe now for me, only off by around half a second or less now, but still very noticeable.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Hm, the set latency is supposed to be in bytes but it appears that a microsecond value was entered by mistake, causing the set latency to be hundreds of milliseconds. I'll have to check this out later when I get time again and fix the code.
 

Retroleum

New Member
Hm, the set latency is supposed to be in bytes but it appears that a microsecond value was entered by mistake, causing the set latency to be hundreds of milliseconds. I'll have to check this out later when I get time again and fix the code.

any ETA on when the fix (hopefully the one that finally fixes it) will be out?
 
i compiled from git tonight and am running 0.5.1-125-g9183c82 (linux) and there's still about a 2 second delay according to my viewers. I tried using 2 loopbacks into a null-sink like i do with ssr and stream the null-sink BUT that still has audio delay. I don't get it. very sad!! seems like this is so close to working i can taste it. hopefully there's a solution to the rewind buffer issue,
here's the log: https://gist.github.com/544c4f479fc66558d8d3
i also noticed that keyinit is set to 250 which is should be 60 for 30FPS gameplay, i think that's why i'm getting the black screen issue with hitbox.
 
Last edited:
still experiencing really bad audio desync'ing, it's actually gotten worse my viewers have stated. it's to the point where it's just not viable to stream with obs-studio currently. i've tried using the default audio recording (monitor of internal audio and monitor of my webcam mic) as well as tried using loopbacks and a null sink but no matter what the audio is way out of sync, like 2 seconds or more and it's weird because the audio will be played first and then the video, how in the world the audio happens before the video is beyond me. i love the software for windows and can't wait to use it with linux.

i went back to ssr and experience no desync'ing what-so-ever. i will definitely miss the "scene" functionality as well as the overlay. using ssr, 2 pulse loopbacks, 1 nullsink, guvcview (with window decorations removed) and playing my game in a window gets the job done and the audio is awesome per my viewers.

I really wish the dev's here could just incorporate a syncronizer like ssr has. (PS i'm sure i'm oversimplifying it and realize this is a tough task)
 

bazukas

Developer
i compiled from git tonight and am running 0.5.1-125-g9183c82 (linux) and there's still about a 2 second delay according to my viewers. I tried using 2 loopbacks into a null-sink like i do with ssr and stream the null-sink BUT that still has audio delay. I don't get it. very sad!! seems like this is so close to working i can taste it. hopefully there's a solution to the rewind buffer issue,
here's the log: https://gist.github.com/544c4f479fc66558d8d3
i also noticed that keyinit is set to 250 which is should be 60 for 30FPS gameplay, i think that's why i'm getting the black screen issue with hitbox.

I noticed in your log that you're doing multiple recordings per session. I noticed that when I try to do that, each consecutive recording starts with bigger audio offset. Your issue seems awfully similar to that. So the workaround is to restart obs each time you record to new file.

Edit: that issue seems to be resolved for me in the latest version, so I don't know.
 
Last edited:
i see what you're saying and now that you say that I can see why it was really bad that night as far as how far the desync was. i read about the bug a little bit and it turns out that any action like pause/play, volume change, or connecting another audio client causes a buffer rewind. Then the recorded audio hangs for approx 200ms or even more. On soft volume changes, there are many many rewinds done, and so we get the audio desync bug.

Are you saying you have no desync issues at all? what is your setup like, can you post a log for me to see please.

one thing I haven't tested yet is according to the bug creator as long as pavucontrol is running... skipping then works without hiccups and fading volume only causes a little bit of rasping. I will try that tonight when I stream and I'll leave pavucontrol open.
 

bazukas

Developer
i see what you're saying and now that you say that I can see why it was really bad that night as far as how far the desync was. i read about the bug a little bit and it turns out that any action like pause/play, volume change, or connecting another audio client causes a buffer rewind. Then the recorded audio hangs for approx 200ms or even more. On soft volume changes, there are many many rewinds done, and so we get the audio desync bug.

Are you saying you have no desync issues at all? what is your setup like, can you post a log for me to see please.

one thing I haven't tested yet is according to the bug creator as long as pavucontrol is running... skipping then works without hiccups and fading volume only causes a little bit of rasping. I will try that tonight when I stream and I'll leave pavucontrol open.

I can't reproduce audio desync anymore after recent changes. Changing the volume only causes small distortions in audio, but no more synchronization issues. Nothing special with setup, pulseaudio output and input capture.
 
I can't reproduce audio desync anymore after recent changes. Changing the volume only causes small distortions in audio, but no more synchronization issues. Nothing special with setup, pulseaudio output and input capture.
can you please post a log files so i can check out your settings? also, what distro are you using? are you compiled from GIT or using the ubuntu ppa?

Jim mentioned back on 10/9/14: "Hm, the set latency is supposed to be in bytes but it appears that a microsecond value was entered by mistake, causing the set latency to be hundreds of milliseconds. I'll have to check this out later when I get time again and fix the code."
and I have viewed the commits since that date and don't see any commit that would've fixed it so I am very curious how you don't experience this desync bug.
 
ok, tried again with a freshly compiled OBS 0.6.1-3-g3dc1b7f (linux) and this is the result
http://www.hitbox.tv/video/286399
and here's the log http://pastebin.com/Xv0PkvFg
not only is it out of sync in the livestream but i also checked the local recording and it's the same, out of sink.
here's the local recording unlisted: https://www.youtube.com/watch?v=4r1jrPuWoTM&feature=youtu.be
It's gotten better since I changed my /etc/pulse/daemon.conf default-sample-rate from 44100 to 48000 and ensured that I had 48000 chosen within obs-studio but it's still a noticeable difference. i even tried using 2 loopbacks and 1 nullsink but there's just no syncronizer in obs-studio like there is ssr.

and here's an example using ssr (which is perfect using 2 loopbacks and 1 nullsink)
http://www.hitbox.tv/video/286397
 
Last edited:
Top