Skip to content

Report missing essential modules to the frontend#1737

Closed
summeroff wants to merge 1 commit into
ndi-error-handlingfrom
fix_essential_plugin_check
Closed

Report missing essential modules to the frontend#1737
summeroff wants to merge 1 commit into
ndi-error-handlingfrom
fix_essential_plugin_check

Conversation

@summeroff

Copy link
Copy Markdown
Contributor

Draft / do not merge until #1733 lands in staging.
Built on top of #1733 (ndi-error-handling); base will retarget to staging once #1733 merges. Depends on libobs 31.1.2ndi1 (obs-studio #741).

Description

Adds a positive capability check after module load that verifies the OBS plugins we depend on are actually registered, and surfaces any gaps through the structured moduleLoadFailures list introduced in #1733 (read by OBS_API_getModuleLoadFailures).

Motivation

#1733 / obs-studio #741 expose structured module load failures, but libobs only records a failure for MODULE_ERROR, MODULE_INCOMPATIBLE_VER, and modules that load-but-decline. The two states that actually break us are skipped silently:

  • MODULE_FILE_NOT_FOUND — the plugin DLL is missing on disk (e.g. obs-ffmpeg.dll)
  • MODULE_MISSING_EXPORTS — the DLL fails to expose its OBS exports

In both cases load_all_callback just return;s, so the module never appears in mfi.failures. A frontend reading only the failure list therefore sees nothing — even though a core encoder is gone.

This is the condition behind a class of startup crashes: with obs-ffmpeg.dll absent, the ffmpeg_aac encoder isn't registered, and recording-audio-encoder setup dereferenced the null codec (strlen(NULL) AV in OBS_API_initAPI). The crash itself is fixed separately in #1736; this PR makes the underlying missing-plugin condition visible to the frontend.

What it does

After obs_post_load_modules(), reportMissingEssentialModules() checks registration of:

Capability Check Owning plugin
ffmpeg_aac obs_get_encoder_codec obs-ffmpeg
obs_x264 obs_get_encoder_codec obs-x264
rtmp_output obs_get_output_flags obs-outputs
rtmp_common obs_enum_service_types rtmp-services

Any missing one is logged and appended to moduleLoadFailures with code ESSENTIAL_MODULE_MISSING (deduped against entries libobs already reported). Init is not aborted.

How Has This Been Tested?

  • obs-studio-server-lib (Release, VS 2022) compiles cleanly against the Update libobs to v25.20.20 #741 obs_module_failure_info (verified locally by adding the struct to the prebuilt header; the build tree's cached libobs is 31.1.2sl6, so CI on the 31.1.2ndi1 package is authoritative).
  • clang-format 18.1.3 --dry-run -Werror on the added lines: clean.

Types of changes

  • New feature (non-breaking change which adds functionality)

🤖 Generated with Claude Code

libobs silently skips a module whose file is missing or that fails to expose
its OBS exports (MODULE_FILE_NOT_FOUND / MODULE_MISSING_EXPORTS), so such
modules never appear in obs_module_failure_info::failures. The structured
load-failure list therefore does not reflect a missing core plugin (e.g.
obs-ffmpeg, which provides ffmpeg_aac) — the condition behind the startup
crashes when the recording audio encoder was absent.

Add a positive capability check after module load that verifies the
encoders/output/service we depend on are actually registered (ffmpeg_aac,
obs_x264, rtmp_output, rtmp_common) and surfaces any gaps through the same
moduleLoadFailures list exposed by OBS_API_getModuleLoadFailures, so the
frontend can react.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@summeroff

Copy link
Copy Markdown
Contributor Author

Superseded by streamlabs/obs-studio#743. Detecting missing/skipped plugins belongs in libobs (where the load decision is made) rather than reconstructing it in OSN with a positive capability check. #743 records the silent skip paths (MODULE_NOT_OBS_PLUGIN / MODULE_MISSING_EXPORTS / MODULE_FILE_NOT_FOUND) as structured failures, which then flow to the frontend through the existing OBS_API_getModuleLoadFailures (#1733) with no OSN-side change. The startup crash guard remains in #1736.

@summeroff summeroff closed this Jun 24, 2026
@summeroff summeroff deleted the fix_essential_plugin_check branch June 24, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant