libobs: Fix monitoring deduplication for 'default' devices #12777
+87
−24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Also modifies win-wasapi, linux-pulseaudio, mac-capture.
This adds comparison to default devices to the monitoring deduplication.
When a user picks a default device, the device_id setting is 'default', which prevents any comparison if the monitoring_id is not 'default'.
On macOS, there is the additional difficulty that 'default' is not the same for 'Desktop Audio' and for 'monitoring';
indeed the coreaudio API admits no pure audio output capture (audio is paired with video in SCK or through virtual audio devices like Blackhole or the antique Soundflower). The devices list therefore differ for 'monitoring' and 'Desktop Audio'.
We fix this by using the libobs/audio_monitoring devices_match function which already cover the case of 'default' devices.
For macOS, we use a newly introduced get_desktop_default_id function, which allows to resolve the 'default' device to
a regular id and to use the devices_match function.
Motivation and Context
Fix a bug uncovered by @Warchamp7 .
Later on, this monitoring deduplication will allow the addition of a headphone button in the mixer UI since there will not be any level variation when the user turns on and off 'monitoring'.
How Has This Been Tested?
Checked the monitoring deduplication is triggered even with 'default' devices for either 'Desktop Audio' or 'monitoring' on the platforms : windows 11 pro 25H2, macOS 26.0, ubuntu 24.04.
On macOS, BlackHole 2ch was used as desktop audio.
Types of changes
Checklist: