Question / Help 2 second audio video desync?

Yazukai

New Member
Hello! I'm fairly new to OBS Streaming, but I will post as much info as I can to help the problem solving :)

I use a dual PC setup to stream, with all of my audio and video from both PC's going into a Behringer x1204USB mixer and then back out into my streaming PC which is running OBS. Every time I stream a few of my friends tell me they hear things like audio ques happening before they see them and they will link me clips so I can see for myself.

I will attach my log file for my most recent stream, but I've google searched for days and changed anything I saw that could be the issue but still nothing has helped. The Video quality of the stream is 720p60fps but the video lags behind the audio about 1-2 seconds and sometimes I can hear double audio like its being played back from two different sources but of the same sound.

AUDIO: The sound is being played out via the 3.5mm Speakers Out jack on the back of my gaming PC into the mixer and then out of the mixer into my Microphone In jack on my streaming PC.
VIDEO: The video of course goes through the Elgato HD60 via usb straight from my video card into the HDMI IN on my streaming pc.

LOGS: https://gist.github.com/Yazukai/4e9ac36d6f86fa55ef8d6ca568c1b3c6
Clip for referance: https://clips.twitch.tv/TsundereCloudyThymeChocolateRain
 

TWStew

New Member
I'm a little confused on your video setup. The HD60 has an HDMI input, and a USB output carrying the H.264 signal. It also has an HDMI out that is typically used as a monitor output to monitor the captured material.

Are you coming out of an HDMI port on your game machine's video card into the HD60, then USB out from the HD60 to the OBS machine? In that scenario, OBS would need to decode the H.264 stream into raw frames that it can then re-encode into its program output. There is a small latency cost here that can't be gotten around. There may also be additional latency on the HD60 end during the encoding. Taking the raw frames via HDMI, encoding them, streaming them over USB2, decoding them, then encoding them again is a fairly work-intensive process. The only way to compensate for this currently, since we don't have time code to work with, is to apply a delay to your audio in OBS and make adjustments to that delay until things get better.

If you're running HDMI end to end, using the HDMI out from the HD60 into an HDMI capture device on the OBS computer, then I'm not sure what role the HD60 is actually even playing, since you could just run the HDMI cable out of one machine and into the other. So something tells me you're running USB out of the HD60 to the OBS machine.

Can you confirm your video setup? The audio echos may or may not be related but let's get a better understanding of how you're actually set up.
 

sam686

Member
The most likely problem is your Elgato HD60 USB 2.0 have this video delay, no instant game view for this model.

You can try to delay both your webcam (filters) and your audio by about 500 milliseconds (0.5 seconds)

USB 2.0 capture cards are heavily compressed to fit a slow USB 2.0 speed, and use up CPU.

Your webcam works with very minimal delay, actually lighting up your face sky blue first, then the delayed Elgato HD60 USB 2.0.
 

Yazukai

New Member
I'm a little confused on your video setup. The HD60 has an HDMI input, and a USB output carrying the H.264 signal. It also has an HDMI out that is typically used as a monitor output to monitor the captured material.

Are you coming out of an HDMI port on your game machine's video card into the HD60, then USB out from the HD60 to the OBS machine? In that scenario, OBS would need to decode the H.264 stream into raw frames that it can then re-encode into its program output. There is a small latency cost here that can't be gotten around. There may also be additional latency on the HD60 end during the encoding. Taking the raw frames via HDMI, encoding them, streaming them over USB2, decoding them, then encoding them again is a fairly work-intensive process. The only way to compensate for this currently, since we don't have time code to work with, is to apply a delay to your audio in OBS and make adjustments to that delay until things get better.

If you're running HDMI end to end, using the HDMI out from the HD60 into an HDMI capture device on the OBS computer, then I'm not sure what role the HD60 is actually even playing, since you could just run the HDMI cable out of one machine and into the other. So something tells me you're running USB out of the HD60 to the OBS machine.

Can you confirm your video setup? The audio echos may or may not be related but let's get a better understanding of how you're actually set up.

Upon further inspection, I have an HDMI OUT (from gaming PC) into my HD60, then HD OUT of my HD60 into an HDMI-to-DisplayPort adaptor that then plugs into the DisplayPort on the back of my PC. I can completely remove the HD60 from the equation and plug on computer directly into the other and get both audio and visual that way?

If so, then that would mean I don't have to send the audio from my gaming pc into my mixer and then out to my streaming PC, although it would mean I lose some overall control of my audio but at least it would be synced up?
 

TWStew

New Member
Upon further inspection, I have an HDMI OUT (from gaming PC) into my HD60, then HD OUT of my HD60 into an HDMI-to-DisplayPort adaptor that then plugs into the DisplayPort on the back of my PC. I can completely remove the HD60 from the equation and plug on computer directly into the other and get both audio and visual that way?

If so, then that would mean I don't have to send the audio from my gaming pc into my mixer and then out to my streaming PC, although it would mean I lose some overall control of my audio but at least it would be synced up?

If you're not adding any additional audio to the program other than what is being output from your game rig, the analog mixer is unnecessary. If you are using a mic plugged into your mixer to add your voice to the program for commentary, then the mixer is probably appropriate.

Video wise, what I would do is go HDMI from the game rig to the HD60, USB from that to the OBS machine, HDMI from the HD60 to your display if you need that to see your game.That is how the HD60 is designed to function, with the caveat that it seems to be intended to capture video output for recording, not necessarily for live streaming. That doesn't mean it won't work for that.

Then in OBS, apply and tweak a delay to your audio source if necessary to get it to sync with your video.

The Displayport on the back of your streaming PC is likely output only, not capture, so I think you should look more closely at how things are set up. It doesn't seem like it would work the way you describe the connections.

HDMI from game rig to HD60
USB from HD60 to OBS rig
HDMI from HD60 to monitor if needed to see game

Again, the above is how the HD60 is designed to operate. Audio wise, if all you want to send to the stream is the game audio, that should carry through the HDMI into the HD60, out the USB via the H.264 encoding, into OBS, presuming that the HD60 supports it. It should. It's part of the HDMI signal.

Your original audio routing should work as well, if you need to add additional sources to the audio such as a mic. The important thing is to use the HD60 as it was designed to be used, then troubleshoot and tweak the setup until it works.

Again, anything that encodes in H.264 and streams out is going to be a factor in latency. That stream has to be decoded in OBS and re-encoded. No way around that. You have to compensate with audio delay.
 

TWStew

New Member
Just to clarify something so I'm not just making assumptions about your setup.

If you do have a DisplayPort capture port on your OBS rig, you should be able to run HDMI out from your game rig to your HDMI-DisplayPort adapter, then into the DisplayPort capture on your OBS rig. There would be no need to use the HD60 in this case.This assumes that the DisplayPort capture works with OBS, which it should. As to whether removing the HD60 from the equation will solve the latency problem, I doubt it. I can't imagine that the HDMI out on that device is 2 seconds behind the HDMI in. Maybe it is. Only one way to find out.

For audio, both HDMI and Displayport share compatible multi-channel audio support, and the audio should survive the adapter, so you should be able to use that audio as a source in OBS as well. Having the mixer and routing analog of course has benefits, as it enables you to add other sources such as microphones, etc, and mix it all together easily. Even of you don't need it right now, it's good to have around and to know how to make it work should a need arise in the future. As for the latency problem, your lead in post says that the video is behind the audio, so it most likely isn't the analog mixer setup that is causing issues. That said, it's always good to simplify the setup wherever possible.
 

Yazukai

New Member
Just to clarify something so I'm not just making assumptions about your setup.

If you do have a DisplayPort capture port on your OBS rig, you should be able to run HDMI out from your game rig to your HDMI-DisplayPort adapter, then into the DisplayPort capture on your OBS rig. There would be no need to use the HD60 in this case.This assumes that the DisplayPort capture works with OBS, which it should. As to whether removing the HD60 from the equation will solve the latency problem, I doubt it. I can't imagine that the HDMI out on that device is 2 seconds behind the HDMI in. Maybe it is. Only one way to find out.

For audio, both HDMI and Displayport share compatible multi-channel audio support, and the audio should survive the adapter, so you should be able to use that audio as a source in OBS as well. Having the mixer and routing analog of course has benefits, as it enables you to add other sources such as microphones, etc, and mix it all together easily. Even of you don't need it right now, it's good to have around and to know how to make it work should a need arise in the future. As for the latency problem, your lead in post says that the video is behind the audio, so it most likely isn't the analog mixer setup that is causing issues. That said, it's always good to simplify the setup wherever possible.

Thank you for your help, I will switch some thing around in accordance to your replies, will post back with results in a day or two after testing the multiple options :)
 

Yazukai

New Member
Thank you for your help, I will switch some thing around in accordance to your replies, will post back with results in a day or two after testing the multiple options :)

I have uploaded a detailed audio diagram of how I have everything wired. the picture does not include my HD60 which ive wired as such:

**I HAVE DISABLED AUDIO TRANSFER THROUGH MY HD60, this is VIDEO ONLY**
Gaming PC (Duplicated Monitor)>HDMI IN>HD60>HDMI-DisplayPort Adaptor OUT>DisplayPort on Streaming PC (which OBS can detect and use as a video source)................HD60>USB> Streaming PC

I disabled audio via my hd60 because there was an issue I cant quite remember but basically, there was an issue where my audio wasn't getting detected at all and disabling it and playing it through my speakers out jack into my mixer worked fine.

Audio Wiring: https://imgur.com/tEZMlWy

I have tried going under advanced audio settings in obs and setting an sync offset for various times and none of them seemed to make any difference at all in the audio-video delay.
 

TWStew

New Member
I have uploaded a detailed audio diagram of how I have everything wired.

Oh dear.

I think what you need to focus on before you do much more latency troubleshooting is simplifying your audio setup. This is WAY too complicated and probably the reason you're hearing echoed audio.

I will assume you're running Teamspeak or something similar on the game rig, so using the aux bus here is perfect. You only want your voice going into Teamspeak, so bring up the aux send on the mic channel, leave the others down, just like you have it.

You have your game rig line out split between mixer 5/6 and the line in on the stream rig. You're monitoring both rigs via alt 3/4, while the audio from the game rig is simultaneously routing directly into the stream rig. Since your control room mix is monitoring alt3/4, the only way you can hear your mic in your headphones is by having it echo back through one or both of the computers. Is there a specific reason you chose to do this?

I would suggest that you rethink this setup, simplify it, and eliminate all of the various potentials for feedback loops that are present here.

1 Lose the splitter
2 Control Room source set to main mix
3 Game rig line out to mixer 5/6, routed to main mix
4 Stream rig line out to mixer 7/8, routed to alt 3/4 (Mute in). Should you ever need to monitor your stream rig, just temporarily switch the control room source to alt 3/4

Use the mixer for what it's there for: To mix your show. All of your show audio elements should be present on the main mix bus, and routed to the stream rig via the USB interface.The main mix is what you should be monitoring in your headphones as you're playing. This will eliminate feedback loops and ensure that what you hear in your ears is what the viewers will hear in theirs.
 

sam686

Member
If using Skype, TeamSpeak, or other voice chat program on streaming computer, you will need a mic-only sound. Otherwise others in voice chat might complain about hearing game sounds. In this case, OBS may need to capture both mic, line-in, and maybe desktop audio, to get both.

There are 2 ways to playback audio from another source without mixer.
1. Best option: Control panel, Playback, select speakers, properties, levels, some hardware including my Realtek HD audio have an option for lag-free line in to speakers out. If you are using both line out one from each computer, make sure this is in mute. If you are using line out only in streaming computer, you can unmute this and turn it up to hear gaming computer, with no audio delay.

2. Control panel, sound, recording, properties, listen, make sure each of them have "Listen to this device" turned off. This option is available to all recording devices but will add some delay. Note that capturing desktop audio will also capture any audio that is used in "Listen to this device".

You can try to go with gaming line out to streaming line in, and just plug your headphones directly to streaming computer's line out, and use playback speakers line-in levels to hear line in gaming computer without delay.

Realtek HD audio manager might offer more option, like turning off "Tie up same types of input jacks" and ability to right click front panel, "Connector retasking" to something else like line-in. Some on-board sound device like my Realtek can only record/capture up to 2 different stereo audio inputs at a time.
 

TWStew

New Member
Just to update this for others, we did a skype call and sorted things out.. some issues with various connections, but the main issue here was the h.264 stream coming from the HD60. Fixed with a delay applied to the audio. OBS has to decompress the stream and re-encode, so you just need to apply an audio delay to compensate for the time it takes to do that.
 
Top