Skip to content

Conversation

pkviet
Copy link
Member

@pkviet pkviet commented Sep 26, 2025

Description

This fixes several bugs reported in audio-support and dev channels of our Discord server.

  1. Monitoring deduplication must be applied only to tracks for which the monitored source and the 'Audio Output Capture' (AOC) source are both enabled. This adds such checks.
  2. On linux, pulse device ids can have a '.monitor' suffix, so we need to take that into account.
  3. When the Desktop Audio has its fader to minimum, we should not deduplicate anymore.

Motivation and Context

Fixes 3 bugs.
Bugs reported by @Penwy & @prgmitchell
Bug 1 fix:
If the AOC has, say, tracks 1 2 3 enabled but not 4 5 6, and the monitored source has tracks 2 & 5 enabled,
the duplication occurs only on track 2.
So the silencing should occur on track 2 but not the others (track 5 in the example).
The bug fix checks then which tracks are common to AOC and monitored source and silences only them.

Bug 2 fix:
we allow for a looser device id match on linux by strncmp in addition to strcmp.

Bug3 fix:
we add a fader_muted member of obs_source; it is set to false unless the fader cur_db is below min_db.
The deduplication logic is now bypassed whenever the Desktop Audio is either user_muted or fader_muted.

How Has This Been Tested?

Bug 1: Checked by breakpointing that the silencing did not occur any more for tracks which are not common to both AOC
and monitored source.
Bug 2 : not checked. Waiting for linux testers.
Bug 3: Checked by making a recording. The monitored source set to monitoriand_and_output was still heard in the recording even though the desktop audio fader was at minimum.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@pkviet pkviet added Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI labels Sep 26, 2025
@pkviet pkviet added this to the OBS Studio 32.0 milestone Sep 26, 2025
Monitoring deduplication must be applied only to tracks for which the
monitored source and the 'Audio Output Capture' source are both enabled.
This adds such checks.

Signed-off-by: pkv <pkv@obsproject.com>
@Penwy
Copy link
Contributor

Penwy commented Sep 27, 2025

I can confirm this fixes the bug I reported.
I have not noticed any additional issues introduced by it.

Pulse audio may append .monitor to device id; this commit adds this case
to the deduplication trigger.

Signed-off-by: pkv <pkv@obsproject.com>
When a user pushes down the fader to minimum, this tags the source as
fader_muted to be used alongside the muted and user_muted members.
To narrow the use of this member, we keep it distinct from muted and
user_muted.
This will be used by audio deduplication logic.

Signed-off-by: pkv <pkv@obsproject.com>
When the 'Audio Output Capture' source (usually Desktop Audio) has its
fader at minimum, we should disable the deduplication logic.
This is done by checking against the obs_source fader_muted member.

Signed-off-by: pkv <pkv@obsproject.com>
@pkviet pkviet changed the title libobs: Check tracks for monitoring deduplication libobs: Various fixes for monitoring deduplication Sep 27, 2025
@pkviet
Copy link
Member Author

pkviet commented Sep 27, 2025

Update
Fixes two other deduplication issues reported in our support channels on our Discord server.
See top post for details (deduplication not triggering on linux, deduplication triggering even if the Desktop Audio fader is at minimum [so muted in practice]).

@Penwy
Copy link
Contributor

Penwy commented Sep 27, 2025

Confirming the two additional issues listed are fixed by this on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants