obs-browser icon indicating copy to clipboard operation
obs-browser copied to clipboard

OBS frequently crashes due to audio-io

Open Durss opened this issue 4 years ago • 3 comments

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

27.1.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/B5SjeoQF8xQUmqcX

OBS Studio Crash Log URL

No response

Expected Behavior

Not to crash

Current Behavior

OBS crashes

Steps to Reproduce

Even after months of more or less regular crashes I still have no precise steps to reproduce. But if I stream for at least 1 or 2 hours I almost always get a crash when switching to a specific scene.

That scene is my intro/break/outro. It contains a Browser source with some graphics and optional procedural ambient sounds (MP3 playing more or less randomly). I actually have the 3 browser sources with the same HTML page but different configs and I toggle their visibility.

The code for playing those sounds is rather simple, just this :

let audio = new Audio("path/to/file.mp3");
audio.play();

I do this on lots of other browser sources with no issue, but I do one more thing on this one, I change the sound panning to hear it more on the left or the right, like this :

	private panSound(sound:HTMLAudioElement):number {
		let ctx = new AudioContext();
		let src = ctx.createMediaElementSource(sound);
		let pan = ctx.createStereoPanner();
		pan.pan.value = Math.random()-Math.random();
		src.connect(pan);
		pan.connect(ctx.destination);
	}

This causes no major issue unless I check the control audio via OBS option on the browser source. Only in this case OBS crashes at almost every stream I do. But something strange is that it crashes even if the page actually plays no sound (I can disable them via a custom OBS panel). but maybe there's a glitch when switching to that scene which make the "intro" briefly play again before actually destroying it I don't really know.

Here are my browser sources configs :

  • URL : https://localhost:3009/xxxx
  • Use custom frame rate (60) checked
  • Control audio via OBS
  • Shutdown source when not visible
  • Page perm. : Read-only access to OBS

Anything else we should know?

I've been having these crashes for a while, it's not due to a recent version of OBS specifically. I started streaming early march 2021, and I've been having these crashes since ~may 2021.

If that can help, I also have VBCables installed to get multiple audio sources so I can have a source dedicated to DMCA sensitive stuff.

I can't really send you the page that crashes OBS as it's in a very big project that manages everything on my stream which would be quite complicated for you to install and initialize. But I strongly believe the crashes reason is related to the code parts and configs I gave.

Durss avatar Nov 04 '21 00:11 Durss