Video & audio not in sync problem

stevecheung249

New Member
Hi, I use USB capture card which support UVC/UAC. I created Video capture device and Audio input device in OBS. In the beginning, Video & Audio are in sync. But when it is running for a while, the audio start not in sync (Audio delay if comparing to video), The audio delay is increasing when OBS keep running. Would you please advise if special setting is required?

Thank you!
Steve
 

Lawrence_SoCal

Active Member
Don't ignore the pinned post in this forum about posting your OBS log so we can check your settings
If the out-of-sync timing is varying (not constant), that usually is either mismatched Audio refresh rates, or an under-powered computer (or both together) for the workload you are running
though there are other explanations as well
 

AaronD

Active Member
You didn't say *where* you have the audio delay. It's been a known issue for several years now, that the Monitor (physical device) does that, while the Output (stream and recording) doesn't. The reason is that the Monitor locks itself to the device's clock, while everything else stays on OBS's clock. And instead of resampling, the Monitor simply expands the buffer, ad infinitum.

Depending on what device you connect the Monitor to, you may or may not have this problem:
  • If you connect it to a virtual loopback, then you probably won't because the loopback gets its clock from the same place that OBS does.
  • If you connect it to a physical device that gets its clock from the host computer, then you probably won't for the same reason.
  • If you connect it to a physical device that has its own internal clock, then you probably will, even if the sample rates are nominally the same.
It can be hard to tell where a physical device gets its clock, so the end effect is effectively random, whether a given one will drift out of sync or not.



An effective workaround (though only a workaround, not a real solution), is to disrupt the audio to the Monitor, so that the buffer resets. Anything will do:
  • Removing and re-adding the source (usually too drastic for frequent use, but it works)
  • Changing the routing in Advanced Audio Properties to not use the Monitor, and changing it back
  • Muting/unmuting the offending source(s)
The last point can be expedited with hotkeys or a script. And since the Output doesn't have this problem, you might use some additional audio sources to avoid affecting it at all while you "blink" the Monitor copy of the same source.
 

stevecheung249

New Member
Don't ignore the pinned post in this forum about posting your OBS log so we can check your settings
If the out-of-sync timing is varying (not constant), that usually is either mismatched Audio refresh rates, or an under-powered computer (or both together) for the workload you are running
though there are other explanations as well
Thank you for your advice! Power should not be the cause since it is desktop type.
 

stevecheung249

New Member
You didn't say *where* you have the audio delay. It's been a known issue for several years now, that the Monitor (physical device) does that, while the Output (stream and recording) doesn't. The reason is that the Monitor locks itself to the device's clock, while everything else stays on OBS's clock. And instead of resampling, the Monitor simply expands the buffer, ad infinitum.

Depending on what device you connect the Monitor to, you may or may not have this problem:
  • If you connect it to a virtual loopback, then you probably won't because the loopback gets its clock from the same place that OBS does.
  • If you connect it to a physical device that gets its clock from the host computer, then you probably won't for the same reason.
  • If you connect it to a physical device that has its own internal clock, then you probably will, even if the sample rates are nominally the same.
It can be hard to tell where a physical device gets its clock, so the end effect is effectively random, whether a given one will drift out of sync or not.



An effective workaround (though only a workaround, not a real solution), is to disrupt the audio to the Monitor, so that the buffer resets. Anything will do:
  • Removing and re-adding the source (usually too drastic for frequent use, but it works)
  • Changing the routing in Advanced Audio Properties to not use the Monitor, and changing it back
  • Muting/unmuting the offending source(s)
The last point can be expedited with hotkeys or a script. And since the Output doesn't have this problem, you might use some additional audio sources to avoid affecting it at all while you "blink" the Monitor copy of the same source.
Thank you for your advice! Let me try virtual loopback. But how to set the virtual loopback for audio?
 

AaronD

Active Member
how to set the virtual loopback for audio?
You don't. For Windows, it's something you install, and it only does that. For Linux, it's already there, and you just have to google how to set it up.
I think you're getting confused between that and the Virtual Camera. The VCam is video only. No audio. There have been several requests to add audio functionality, to feed other apps like remote meetings and such without tying up the Monitor, but it's never actually happened yet.

On Windows, people seem to like VB Cable for a loopback only:
If you scroll down, you can install a few more loopbacks as well, for a total of 5 independent ones if you get all of them. As Bill Gates famously said about 640K of RAM, "That ought to be enough for anybody." :-)

And Voicemeeter for slightly more complex rigs:
Each of those adds its own virtual devices, separate from the pure-loopbacks above, so if you get the big one - Potato - and all 5 pure-loopbacks, then you can have a total of 8 independent channels with 3 of them being connected to a mixing console.

Power should not be the cause since it is desktop type.
Processing power, not electrical. A Pentium 3 is not going to stream 4K, even if you give it a modern power supply. :-)
 
Top