Bug Report Weird glitchy audio from Browser Source when using "Control Audio via OBS"

Ive been noticing an odd glitch in a Browse Sources output when using the "Control Audio via OBS" option. Its almost like the very start of the sound, maybe the first 10 - 50ms worth) is repeating itself for a short period of time before playing the audio. I first encountered this when the option was made available in OBS. When I disabled the option the glitches went away. I figured it was possibly something with my install, but since then I noticed it on one of my Twitch team members channels.

I am currently building a soundboard app (run on my tablet) and a "speaker" browser source, which communicates with eachother via socket.io. Enabling "Control Audio via OBS", once again, has the glitches at the start of the audio (and disabling it makes the glitch go away as well).

What is weird is that the glitch only seems to happen after a period of time after a sound has already played, and seems to get longer (the glitchy part specifically) the longer the browser source has been running with Control via OBS enabled, once i heard it get to almost 3 whole seconds before it continued to play the audio.

- I click a button on my soundboard webapp, the audio plays via the browser source "soundboard speaker" script. This first play has the glitchy start to the sound.
- Clicking the button a second time within a few seconds, or even in rapid succession, and the sound plays with no glitches at all.
- If i wait, say, 30 seconds, and press the button, the sound plays WITH the glitch again.

The soundboard app and the widget are nothing special, just standard HTML pages and Javascript using VueJS/VueCLI as the build process. All audio clips are pre-loaded as standard WebAudio API Audio() constructors in the Speaker app and are played via the normal audiosource.play() method. although I HAVE tested and found the glitch also happens if the audio clips are loaded at the time of the button press on the tablet webapp then discarded after it plays.


As I mentioned above, i am not the only one who has run into this odd glitch, as a member of my team also has thing glitch crop up, and they too are using Control Audio via OBS option.

Has anyone else run into this issue or noticed it but were not sure what it was? Including the log file, though I am not too sure how much it will help.
 

Attachments

  • 2020-03-17 22-17-28.txt
    57.3 KB · Views: 168
So I left OBS running all night, came back to it to test the "glitch gets longer as the browser source remains running". Sure enough, the glitchy audio has indeed gotten worse.

( https://drive.google.com/file/d/1c7cYC1YIE422Jm2uANi9RQhl8T52zo_I/view?usp=sharing )

Here is a link to a WAV recording of one of the sound clips. First I trigger the audio (a goomba sound from Mario), then I rapidly trigger it and it sounds normal again. I wait a bit, trigger it, its fine. I wait longer, trigger it and it glitches again.

Use a waveform viewing audio app like audacity to see the delay between triggers. I also normalized the audio to -5db.

Restarting the browser source fixes the glitch temporarily, but as long as "Control Audio via OBS" is enabled, the glitch returns. Disabling that option fixes everything, but I lose the finer control over the sources audio.

I have attached an updated log taken just now with a brief bandwidth test broadcast (using the test option in OBS settings). This is the same method I used last night, and I have not rebooted OBS since last night's log post.

I notice a lot of "effect_setval_inline: invalid data" errors, but I am not sure what they are in reference to, nor if they are related to this Browser Source audio issue, since the issue goes away and does NOT happen if "Control Audio via OBS" is disabled.
 

Attachments

  • 2020-03-17 22-17-28.txt
    137.9 KB · Views: 73

lafiosca

New Member
I think I'm running into a similar issue along these lines. In my case, I built a an overlay system in React which I load from a browser source. When certain events occur, it autoplays video clips. When enabling "Control Audio via OBS", the audio is sometimes glitchy and stuttered, and the video can become extremely delayed. It's like the browser engine inside of OBS is struggling to run the web app while doing everything else at the same time. This behavior becomes much more pronounced when I am recording video.

I am running on a late 2014 Mac Mini with a 2.6 GHz Intel Core i5, so I was just assuming my computer was not beefy enough to handle everything I'm throwing at it, until I read this post. Still I'm curious if this would perform better on a new machine.

My workaround for now is to do what I was doing before the browser source audio control feature was added. I have set up custom system audio devices so that I can monitor my line-in sources and just capture the combined system audio (including the browser source sounds) in OBS. Operating this way is inconvenient, but it does not seem to cause any of the stuttering or delays.
 

marcmagus

New Member
Has any progress been made on this? I am experiencing the same issue on Linux, and just confirmed that it's still happening in 26.0.2.

Browser source control audio is a huge help for being able to maintain proper audio levels, as with it off browser sources grab the level of the most recent browser source (or Chrome window playing audio) whatever it is due to how CEF registers with PulseAudio.
 

CreeChamp

New Member
I have the same issue. Win 10, powerful PC and a gigabit connection - that's if, perhaps, it might be attributed to the PC processing power or something. Experiencing the issue exactly as described by the OP, like the first few milliseconds of the alert loop/lag when using the browser source audio. Playing it multiple times in a row causes only the first one to glitch, the rest play OK. After a short cooldown, it glitches again on the first alert. No issue of that sort at all when playing alerts normally through the desktop audio. Seems like there's some sort of a resource-saving/sleep issue going on where the first alert has to wake up the audio route and that causes it to lag.
 

DUBttv_

New Member
I'm amazed nobody's gotten a straight answer on this yet... I'm running v26.1.1 on Pop!_OS 20.10 (Ubuntu), and I'm using the Streamlabs Alerts URL as a browser source in OBS. The only way to grab the audio without a third-party audio tool is to "Control Audio via OBS", but I get the same issue as described above. I even had the issue in Windows working with Streamlabs OBS. I tried to let OBS control the audio so I could turn the volume of the alerts down (they get a little loud), and the same issue occurs, but only when live. I've had alerts fire while offline with OBS open, and no lag. It's only when stream is active?
I found a setting for "Alert delay" in the Streamlabs dashboard, set it from 5 seconds to 0, will see if that helps.
 

Nikoheart

New Member
I'm going to try a possible solution to this, but set the frame rate of the browser source.
I've set mine to 60 as per my canvas and I've had no audio issues so far
What I also do is whilst ticking Control audio via OBS, I mute it in OBS and use Exeldro's Audio Monitor plugin as a filter on the browser source
 

CerebralTag

New Member
I have been hitting my head against the wall with this exact issue! I'm so glad I found this post, I was starting to feel like it was just me. I think I notice that is different is that I also get the glitch on the first sound played. Everything else is the same, sounds in rapid sucession are fine, after a period of time without sound the glitch returns. Did changing the frame rate resolve it long term? Anyone else make any progress?
 

Foutz

New Member
+1 to this, same issue. I've tried every fix I can find so far. Checking Sample Rates, Manually setting framerate, changing OBS settings. The issue is easily replicated. If I enable "Control audio via OBS" the issue occurs and goes away accordingly. No fix?
 

Pigmess

New Member
Setting framerate to that of the stream didn't fix it for me, however after further testing it seems (at least in the cases I tested) that the glitch is only audible in the monitor - not the output. While a tad annoying, as long as it isn't impacting the output I can live with it.
 

Pigmess

New Member
I haven't tested extensively, but I seem to have gotten around the issue by sending the monitored audio (in OBS Settings > Audio) to a virtual audio cable, which is then listened to by my headphones (rather than sending the monitored audio directly to the headphones).
 

AdamLobo

New Member
I've been experiencing the same issue. Glad to find it's not just me.
I can confirm the above workaround seems to work for me - Setting my monitoring device to something different than my default output device has sorted it.

So seems to be a bug with the monitoring device being the same as the default output for browser audio.
 

Tomb_of_ash

New Member
Exact same issue here. My only workaround so far was to open the sound alerts in an actual browser. I will see if disabling obs audio control for it fixes it. My output is different to the default device too so no clue why all this is happening. Glad I'm not the only one with this issue! I had it on xsplit first, I then switched to sobs and it started happening there after an update. Then I switched to obs and after a few weeks I started getting it on it too. Very annoying. I tried on two pcs also (one is i9 and another one is dual xeon).
 

Ratiocinator

New Member
Hello all,

I have been having similar issues as to what's been described by many of you. While I have not found a foolproof solution, through my tests I did find a "fix" that helps alleviate the amount/refequency of glitchy/crackling audio heard when a Browser Source audio first plays.

To preface: My issue is linking my StreamLabs alerts to my stream via the Browser Source feature in OBS. Whenever the first sound notification plays, it is accompanied with awful glitch/static noises that persist for several seconds. If other alerts play soon after, there are no issues. But if there's then a momentary break between alerts, the crackling will happen again when the first fresh/new sound plays.

To help mitigate this problem I added at least 0.5s of silence to the very beginning of all my audio alerts that immediately start playing with audio. I realize, depending on what your sound notifications are, this might not be feasible. But it's at least some type of "solution."

Through my tests, the audio no longer has static/glitch noises at the start of it playing, but it may still happen a few seconds in of it playing. If it does happen a few seconds in, it only persists for a half a second at most, usually. The chances of it happening midway through the alert seem to be roughly 50/50 now. Still not perfect, but at least it's been better for me.

This is not a legitimate fix for the issue. The issue does seem to stem with OBS itself. It feels like this issue is common enough to warrant more investigation by the OBS Team. At least, I would hope so. I have spent more hours than I care to admit Google searching other people experiencing audio crackling during the first few seconds of an audio event occurring in hopes of finding a bonafide, surefire solution, but alas, that doesn't seem to be the case.
 

nk_nikolay

New Member
I've been experiencing the same issue. I get the problem after there is a high load on the CPU. For example, launching a game (I tested on games and on the AIDA64 stress test). After that, the problem is solved only by restarting the OBS or disabling the Control Audio via OBS checkbox. If you switch the checkbox "Control Audio via OBS" then the problem appears and disappears accordingly. Just updated to the latest version (27.1.3). problem still exists. I'm really looking forward to solving the problem, since the function is necessary for me, and there is no desire to write my own interface for managing audio in my widgets. Thanks!
 

Maestro

New Member
I have same issue but not with every OBS browser source. I think it depends on codec or something. mp3 files are playing just fine, maybe it's a problem with ogg.
 

Kxrma

New Member
Hello, I may be a bit late but I found something that does work for me and hopefully it works for you too. If you go to the properties of the browser source and scroll down till you find "Refresh browser when scene becomes active" Turn that on and try testing the audio it should be better, Hope this helps.
 

ppumkin

New Member
I have been running in to this problem randomly on our streams

I have used an ogg file because I thought that would be the best format to use in terms of compatibly.

But after reading all the above I have created an mp3 file now and added some silence to the start. I will let you know if that resolves the issue

Before I found this post, I tried these things.
1. Fetch the audio file and wait on the promise to resolve (this caches the file in the browser) because the first notifications never played the tune
2. added preload="auto" - now would have thought the "custom canvas" in OBS would have this set to yes
3. I can't refresh the source every time because it will reset the state of the web app

<audio controls autoplay preload="auto"> <source src="../../assets/sounds/dingdong.ogg" type="audio/ogg"> </audio>

And while it was always playing the clip.. sometimes it sounded distorted. like I mean does not even resemble the original sound
 
Top