Hello everyone,
I've noticed an audio/video sync issue that occurs on
Mac in
Firefox. The issue appears to be tied to CPU usage.
- Open another tab and join the room. This can be on the same device or another device. This is the observer to watch for sync issues.
- Stress your CPU by pulling a 4k video on YouTube (
https://www.youtube.com/watch?v=6pxRHBw-k8M). You could also just open up 4 or 5 tabs on the video room instead of pulling a YouTube video.
- Wait a minute or two
Expected result:
- Perfect audio-video synchronization.
Actual result:
- The stream my Mac is uploading is out of sync for viewers (audio before video). Sync issues begin fairly quickly (although the exact time seems to vary). The lip-sync gets progressively worse the longer the stream goes on for. I've attached a few graphs from webrtc internals from a viewer on Chrome.
Notes and observations
The reason I'm posting this here instead of filing a Mozilla bug report is that the issue doesn't seem to occur for p2p connections. I ran a p2p test where I was stressing my machine by pulling pulling two 4k YouTube videos simultaneously and didn't experience any lip-sync issues over a twenty minute conversation.
The issue doesn't seem to show up on Chrome unless I absolutely max out the CPU on my Mac. Even then, the delay appears to correct itself when the CPU stabilizes. Firefox doesn't seem to correct itself under any circumstances.
I've tested Firefox on Linux and Windows machines and haven't gotten any lip-sync issues, although that doesn't rule them out for sure. Based on the testing I have done, this appears to be Mac-Firefox specific.
Any thoughts as to what might be causing this? For anyone using a Mac, are you able to reproduce this using the steps above?
Thanks in advance!
Dan