Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs: Mix audio of each source in a scene only once #10537

Merged
merged 2 commits into from
May 18, 2024

Conversation

derrod
Copy link
Member

@derrod derrod commented Apr 14, 2024

Description

Only mix audio of each unique source in a scene once.

Motivation and Context

Fixes a common pitfall as the constructive interference due to multiple scene items using the same source is not visible anywhere.

Based on discussions this should not happen.

How Has This Been Tested?

Pure sine wave media source and ffmpeg volumedetect to make sure recordings after this fix have the same volume as a recording with only one scene item.

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.

@derrod derrod added Bug Fix Non-breaking change which fixes an issue Enhancement Improvement to existing functionality labels Apr 14, 2024
@derrod derrod requested a review from Warchamp7 April 14, 2024 12:01
@derrod derrod force-pushed the fix-scene-audio-mixing branch 6 times, most recently from daadc4c to 72de1f3 Compare April 14, 2024 14:03
@derrod derrod changed the title libobs: Mix each scene item source's audio only once libobs: Mix audio of each source in a scene only once Apr 14, 2024
@tt2468 tt2468 added the Seeking Testers Build artifacts on CI label Apr 14, 2024
@derrod derrod force-pushed the fix-scene-audio-mixing branch 2 times, most recently from f41c758 to 0caa64d Compare April 14, 2024 22:44
@derrod derrod requested a review from Lain-B April 19, 2024 12:06
@Warchamp7 Warchamp7 added the UI/UX Anything to do with changes or additions to UI/UX elements. label Apr 22, 2024
@Warchamp7
Copy link
Member

This solves duplicated scene items causing multiplied audio and LGTM.

Outside of this PR, we still need to solve scene items inside nested scenes causing the same issue.

Copy link
Member

@Warchamp7 Warchamp7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had concerns about half fixing this issue if nested scenes and groups still exhibited this issue. Rodney has now updated this PR to handle sources nested inside subscenes or groups.

The only edge case not handled now is Show/Hide transitions on the Subscene or Group itself.

Fixing that would require a much larger overhaul of the audio subsystem and I believe it is uncommon enough to be acceptable.

libobs/obs-scene.c Outdated Show resolved Hide resolved
libobs/obs-scene.c Outdated Show resolved Hide resolved
libobs/obs-scene.c Show resolved Hide resolved
@Lain-B Lain-B merged commit 72924ac into obsproject:master May 18, 2024
15 checks passed
@RytoEX RytoEX added this to the OBS Studio (Next Version) milestone May 18, 2024
@derrod derrod deleted the fix-scene-audio-mixing branch May 19, 2024 00:01
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 Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI UI/UX Anything to do with changes or additions to UI/UX elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants