Skip to content

Build failure on Linux when PulseAudio is disabled - missing devices_match symbol #12810

@melynx

Description

@melynx

Operating System Info

Other

Other OS

Gentoo Linux

OBS Studio Version

Git

OBS Studio Version (Other)

32.0.2-11-geb4161e72-modified

OBS Studio Log URL

NA

OBS Studio Crash Log URL

No response

Expected Behavior

The build should complete successfully when PulseAudio is disabled, as it did in version 32.0.2.

Current Behavior

The build fails with a linker error when PulseAudio support is disabled:

/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: libobs/libobs.so.30: undefined reference to devices_match'
collect2: error: ld returned 1 exit status`

Steps to Reproduce

  1. Clone the master branch
  2. Configure build with PulseAudio disabled: cmake -DENABLE_PULSEAUDIO=OFF ..
  3. Run make or ninja
  4. Observe linker failure due to missing devices_match symbol1.

Anything else we should know?

Root cause analysis:

Line 50: extern bool devices_match(const char *id1, const char *id2); - The function is declared as an external symbol unconditionally

Lines 71 and 78: The devices_match() function is called unconditionally in check_audio_output_source_is_monitoring_device():

Missing implementation: On Linux, the devices_match() function is only defined in pulseaudio-wrapper.c, which is only compiled when ENABLE_PULSEAUDIO=ON

Build failure: When PulseAudio is disabled (-DENABLE_PULSEAUDIO=OFF), the linker cannot find the devices_match symbol, causing the build to fail.

Looking at the old code versus the current code, I can see the key difference that's causing the build failure. The old code used a simple strcmp comparison, while the new code introduced the devices_match() function call which is only available when PulseAudio is enabled.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions