Repository navigation
Replies: 2 comments
|
One more piece for this, from the shutdown work (#3739, #4065): when OBS knows which plugin caused the last crash or hang, it can offer to start without that plugin at the next start. Today the user has Safe Mode, which turns off all third-party plugins, scripts and obs-websocket at the same time. What OBS does today
Idea
Questions
|
|
flame graphs flame graphs are amazing how do we get chrome style dev tools flame graphs |
Uh oh!
There was an error while loading. Please reload this page.
Problem
Most OBS installs load third-party plugins. When OBS stutters, uses too much CPU or memory, drops frames, or does not quit, the user cannot see which plugin causes it. Today they have these tools:
--safe-mode). It turns off all third-party plugins at the same time. It tells the user "a plugin causes it", but not which plugin.#3739 is an example. OBS did not quit after shutdown. We followed several wrong leads: the recording muxer, Source Record, an NDI camera that was not reachable, and the CEF version. After some days, a debugger on a test machine with the plugin set of the reporter showed the cause: a library that a sub-plugin of Advanced Scene Switcher loads waited for a thread that never stopped. No OBS code was on the stack. The exit watchdog (#4065) now ends the process, but the log still does not name the plugin.
The same is true for problems while OBS runs. The log tells the user that frames were skipped because rendering was late. It does not tell them which source or filter was slow, or which plugin that source comes from.
Goal
A user who sees a problem can find the plugin that causes it from OBS itself or from one log file, without a debugger and without many restarts. A user who sends a bug report attaches that information, so we can send them to the correct project on the first reply.
Constraint
Existing plugin binaries must work with no change. Plugins are shared libraries in the OBS process, and this fork keeps the libobs C API and ABI. So OBS measures at the points where libobs calls the plugin and where the plugin calls libobs, and with operating system data. A plugin does not have to do anything.
What the user would see
1. A per-plugin view in the Plugin Manager
One row for each loaded plugin, with values that update while OBS runs:
bmalloc)Values that a plugin can change by itself, out of view of libobs (memory from its own allocator, CPU on its own threads), are marked as estimates or are not shown. Section 4 has the options.
2. Warnings in the log that name the plugin
Examples:
Source 'Camera 2' (plugin: distroav) took 41 ms in video_render (limit 16 ms)Plugin 'example-plugin': 312 MB GPU memory in 1,204 textures, +40 MB in the last 10 minutesShutdown: 'advanced-scene-switcher' (midi.so, libremidi.so) still has 2 threads after unloadExit did not finish in 10 s: blocked in libremidi.so, loaded by advanced-scene-switcherThe last example is the second step of #4065. The exit watchdog writes the line, and this proposal adds the name of the plugin.
3. A summary at the end of the log
Each plugin's totals for the session, in one block, next to the existing memory leak line. Because a user attaches the log to a bug report, the report then shows the plugin data without a question from us.
How OBS can measure this without a change to plugins
video_render,video_tick,filter_video,filter_audio,update, encoder and output callbacks). libobs knows which plugin registered each source, filter, encoder and output. It can time each call and add the time to that plugin. The cost is some tens of nanoseconds for each call. libobs already has a profiler (profile_start/profile_end). This adds a total per plugin.bmalloccan find the plugin from the caller's address and count the bytes for each plugin. This does not count memory frommalloc,newor the Rust allocator.What this proposal does not do
Suggested order
Questions
All reactions