bozbez / win-capture-audio

An OBS plugin that allows capture of independant application audio streams on Windows, in a similar fashion to OBS's game capture and Discord's application streaming.
GNU General Public License v2.0
3.8k stars 209 forks source link

Multiple instances (assigned to exes not currently running) in one scene collection leads to OBS freezing and crashing #36

Closed PoliteTimesplitter closed 3 years ago

PoliteTimesplitter commented 3 years ago

First off I should say that I understand if the plugin isn't meant for something like this. My use-case / setup is a scene collection of a number of games that I hop between; each of them have their own scene, just consisting of a Game Capture (for that specific app; I play everything borderless windowed so default game capture usually doesn't work) and Application Audio Capture. I get that this might not be a 'typical' usage.

When this scene collection is loaded, every 2 seconds it's trying to hook 12 Application Audio Captures to games that aren't running (or, naturally, 11 if I am running one of those games). This adds a lot to the log, which I wouldn't mind but it also seems to eventually crash OBS. This has taken anywhere between 40 minutes and 80 minutes to happen.

On this scene collection, the OBS UI slowly becomes less and less responsive - the mixer levels hitch and hang and the menu buttons take a while to light up when moused over. This starts out imperceptible and gradually gets worse and worse. The video preview, however, is fine, and recordings are also fine. I can provide a video of this if desired.

However, after a period of time, it causes OBS to become unresponsive completely. It freezes and I have to hit the X to quit out, and go through a windows prompt. It does not generate a crash log. The run log ends with whatever it was doing last - in these cases, just repeated checks for applications:

23:24:44.384: [audio-capture: 'SlayTheS...'] (set_update_timer) setting timer for 2000 millis23:24:44.384: [audio-capture: 'Overwatc...'] (set_update_timer) setting timer for 2000 millis

23:24:44.971: [audio-capture: 'Control ...'] (set_update_timer) setting timer for 2000 millis
23:24:44.971: [audio-capture: 'Before W...'] (set_update_timer) setting timer for 2000 millis
23:24:45.286: [audio-capture: 'Yakuza L...'] (set_update_timer) setting timer for 2000 millis
23:24:45.322: [audio-capture: 'TonightW...'] (set_update_timer) setting timer for 2000 millis
23:24:45.322: [audio-capture: 'Minecraf...'] (set_update_timer) setting timer for 2000 millis

For what it's worth, each log that OBS crashed in is over 1000kb in size, ranging from 1001 to 1313.

It does however create an entry in reliability history, for audio-capture-helper.exe at the same time as an OBS crash. Here are the details for audio-capture-helper.exe:

Description
Faulting Application Path:  C:\Program Files\obs-studio\data\obs-plugins\win-capture-audio\audio-capture-helper.exe

Problem signature
Problem Event Name: APPCRASH
Application Name:   audio-capture-helper.exe
Application Version:    0.0.0.0
Application Timestamp:  6130c84c
Fault Module Name:  audio-capture-helper.exe
Fault Module Version:   0.0.0.0
Fault Module Timestamp: 6130c84c
Exception Code: c0000005
Exception Offset:   00000000000018c9
OS Version: 10.0.19043.2.0.0.768.101
Locale ID:  6153
Additional Information 1:   0497
Additional Information 2:   04972d7d7c13bf028cce66b0fb84661d
Additional Information 3:   dc0c
Additional Information 4:   dc0c95a8bfbfd8c3a46d2abdc9a0c10c

Extra information about the problem
Bucket ID:  0da8bbe6a031a2e956aadc01b332459b (1633359714734720411)

This information is consistent between entries.

However, this does not seem to happen on a scene collection with only one instance of an Application Audio Capture Source that is searching for a program that isn't running; I left OBS open on that scene collection for five hours and though there was a tiny hitch every 2 seconds (presumably from the AACS looking for its app) it was fine.

Is there anything that can be done or is there nothing for it beyond 'stop using a scene collection this way'?

I have attached a log but given it just infinitely searches for its applications for 40 minutes then crashes, with no crash message, I doubt it will be useful.

EDIT: some formatting to denote error messages

2021-09-07 22-42-16.txt

PoliteTimesplitter commented 3 years ago

Coming back a day later to correct myself and close the issue: this isn't a problem with the plugin itself, just how it puts so much in the log and the new OBS log viewer in-app. If you open the log viewer in the OBS app even once, when you close it it still keeps updating in real-time. When paired with a plugin that can write a lot (like this one), it can overload the main CPU thread, eventually locking OBS up.

The solution is just to never open the in-app log viewer. Mea culpa for not having tried this before.

bozbez commented 3 years ago

f6293c78c95cec19a75c5887d46b72150717d5ea removes the update timer debug log, should help with this.