StreetJelly BLOG: Community News, Video Streaming, Online Busking, and more…
Home » Posts tagged "issues"

Fighting WebRTC Audio Sync Issues

Fighting WebRTC Audio Sync Issues
Subtitle:  Mainly with Chrome

Audio Sync issues are when the audio and video get out of “lip-sync.”  The sound does not line up with what you see.  Many folks call it a “lag.”  (We also have heard people call it a “latency” problem, but that is an incorrect description.)  This problem can happen with any broadcasting software, but it appears to happen more often on Chrome streaming with WebRTC.  This does not mean, “Firefox is better than Chrome,” or any one browser is superior.  We are only saying this one specific problem happens to a few broadcasters while on Chrome.

The guts of how WebRTC streams, also known as the encoder, processes the audio and video separately. They are streamed separately, they travel across the internet separately, and it is your computer at home that has to put it back together in-sync.  When a moment in time of the audio and video are sent across the internet too far apart from one another, the result is audio that does not match video.  That’s just the way it works!

Processing audio is easy from a computer’s point of view, there is less data to manage.  Video, on the other hand, takes massive amount of data and processing to produce a video signal.  The CPU (central processing unit) of the computer, a.k.a. the brain, can only handle so many calculations at one time.  When there is too much data to process when streaming, it is generally the video that gets processed slower than the audio.

The result: the audio is encoded first, and the video lags behind.  Look closely at a sync problem broadcast – you will almost always hear the sound / voice first, then witness the video catch up.

How to fix this problem?  Start by understanding that anything that can free up your computer’s CPU from tasks, or reduce the amount of video data to process, will help:

  • Make sure your browser is running the latest version. We will say this a 1,000 times… it’s very important with WebRTC to be on the latest version because the browser makers release significant changes with each new release.  To check / update Firefox or Chrome, go to Help >> About.
  • Turn off any software running on your computer you do not need for streaming.  Anything to free up your CPU will help.  Close multiple browser windows and tabs, close music recording software, close any games and video intensive software, and so on.  And close dang Facebook!
  • Choose 4:3 SD (standard def) streaming on StreetJelly.  Obviously, 720p HD takes way more CPU cycles to stream.
  • Adjust your webcam to the lowest decent quality.  Your webcam may be set at very high HD settings. The encoder then has to convert that video to lower quality for streaming.  That takes a lot of CPU power to do that.  In the hardware settings for your camera (not on StreetJelly):
    • Match the screen size of the webcam to the screen size chosen for broadcasting on StreetJelly.  For example: 640 x 480
    • Set the frame rate (if available) to 15fps, frames per second.  The WebRTC encoder defaults to 15fps, so it will get converted anyway.
    • Set quality (if available) to medium, or somewhere around 80%.  Different webcam vendors approach this setting differently, but the key is to dial it off the very top, but don’t go all the way to the bottom.
  • Remove any webcam effects from your broadcast.  This includes extra graphics embedded into the video (snowflakes, alien heads, swirly do-dahs, etc). All these require massive CPU processing to generate.
  • Remove any lighting effects in your home studio.  Yes, we mean swirly lights in your room in the real world.  This affects compression. The more areas within your video frame that do not change over time, the more your video gets compressed into smaller data chunks.  This reduces the amount of bandwidth needed to stream and process.
  • In your computer’s video settings (at the hardware level):  make sure any “hardware acceleration” settings are turned on.  I’m sure that sounds vague, but there are far too many video card drivers, manufacturers, scenarios, etc. to write about in a single blog.  The key here is to maximize the CPU and GPU (graphics processing unit) settings.
  • Get a faster computer! 🙂

UPDATE APRIL 19th, 2017

So we know Chrome can be a CPU hog, and these issues can get the audio out of sync.  One thing to try – and definitely check – is the Chrome “use hardware acceleration” setting.  Hardware Acceleration is a feature on most computers to use the GPU (graphics processing unit) for video processing. In Chrome, this can be controlled with an Advanced Setting called:  “Use hardware acceleration when available.”

Normally, this setting should be checked.  Check it now with these instructions:  http://www.pcadvisor.co.uk/how-to/internet/how-turn-off-gpu-hardware-acceleration-in-google-chrome-3605455/

For some with audio sync issues, UNCHECKING this setting may help.  It’s not a guarantee, but worth a try.  Sometimes a computer’s video card drivers could be out of whack (I literally had that problem with an old Lenevo laptop).  Using software to process the video software can possibly fix (or avoid) a hardware issue.

For a bit more detail about Chrome and Hardware Acceleration, here’s another nice article:  https://www.lifewire.com/hardware-acceleration-in-chrome-4125122

Flash 17.0.0.169 Issues

UPDATE: May 12th, 2015

Adobe releases Flash version 17.0.0.188 with fixes to this problem. Go to Adobe’s website to get the latest version.

UPDATE: April 16th, 2015

We applied a patch on our side to prevent the issues of garbled sound. Essentially, we turned off the automatic sample-rate checking for audio. Apparently, Adobe has recognized this issue and has put in a bug-report for the Flash Player. Currently, our patch is working and users should not have to rollback their Flash versions (latest version 17.0.0.169 should work!). Let us know if you still continue with problems.

April 15th, 2015

We have had numerous reports, and confirmed it with our own computers, that the latest version of Flash released yesterday, version 17.0.0.169, is causing problems for some playing back streaming video. Symptoms include garbled sound; digital distortion; and/or video speeds up and slows down, then stops and restarts. We have witnessed this problem on Windows 7 and 8, Firefox and Chrome.  However, there are reports to us that this has happened on Safari, Opera (Linux), etc.

If you think you are experiencing these problems, and everything worked on your computer a few days ago; first let’s check what version of Flash have.  Click this link: What Version of Flash do I have?

How to fix the problem?  The current “fix” is to uninstall the latest version of Flash and reinstall the prior one, 17.0.0.134. This is not our favorite approach, but as of today (4/15) this is the only option.  We continue to investigate a better solution.

The full instructions are here from Adobe: Install a Previous Version of Flash

We understand its tricky and appreciate your patience.  Here are our simplified instructions.

  1. First, download and execute the Flash Uninstaller.
    1. Windows  Scroll down to “1. Download the uninstaller for Flash Player” and click on the bullet “uninstaller” link and follow instructions.
    2. Mac  Scroll down to “2. Run the uninstaller applicable to your Mac OS version” and click on the link for your appropriate Mac version.  Follow uninstall instructions.
  2. Install previous version of Flash. Last good version was 17.0.0.134
    1. Click here Archived Flash Player versions
    2. Scroll down to the Flash Player Archives section
    3. Choose the link to Flash Player 17.0.0.134 (235.98 MB)
    4. This will download a compressed zip file to your computer.  Use any unzip program on your computer to decompress to a local folder.
    5. There will be a file to install version 17.0.0.134 for both Windows and Mac in the list.
      1. Windows: execute (double-click) on flashplayer17_0r0_134_win.msi  for Firefox/Chrome plugins, or flashplayer17_0r0_134_winax.msi for IE. Follow instructions.
      2. Mac: install the DMG file as you would normally install any application in Mac O/S.  flashplayer17_0r0_134_mac.dmg or flashplayer17_0r0_134_mac_pkg.dmg to extract a PKG package (double-click PKG to install)
  3. For Chrome users, you have one more step. Chrome uses its own embedded version of Flash. You have to turn off that “plugin” and tell Chrome to use the one you just installed.
    1. In Chrome, type “chrome://plugins” into the address bar.  This will bring up the Plugins configuration page on your computer.
    2. Click on “+Details” in the upper right corner to expand plugin details.
    3. Scroll down until you see the “Adobe Flash Player” (Shockwave Flash) in the list. You should see two files. “Disable” the one pointing to location “…\pepflashplayer.dll”
    4. “Enable” the one pointing to location “…\NPSWF32_xxxx.dll”
    5. Close and restart Chrome.

Some notes: uninstalling and reinstalling will require you to close down all your browsers and restart them.

Please contact us for any assistance.  support@streetjelly.com