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

REQ: Allow multiple apps to be captured from Application Audio Capture (PipeWire) #24

Closed
flexiondotorg opened this issue Sep 7, 2022 · 33 comments

Comments

@flexiondotorg
Copy link

flexiondotorg commented Sep 7, 2022

Thank you very much for obs-pipewire-audio-capture 🙇 It has resolved several audio-related issues in my OBS Studio setup and helped simplify my scene/source composition.

Feature Request

When adding an Application Audio Capture (PipeWire) source, include the capability to Capture all apps but exclude multiple apps.

Rationale

With this capability added it would be possible to:

  • Add an Application Audio Capture (PipeWire) and exclude Spotify and Discord.
  • Spotify and Discord can then be added as discrete Application Audio Capture (PipeWire) sources and managed via OBS independently of all other audio output.
@flexiondotorg flexiondotorg changed the title REQ: Allow multiple apps to be excludes from Audio Output Capture (PipeWire) REQ: Allow multiple apps to be excluded from Audio Output Capture (PipeWire) Sep 11, 2022
@dimtpap
Copy link
Owner

dimtpap commented Sep 14, 2022

Audio Input/Output captures stream directly from the devices. What you really want is the App Capture to be able to exclude multiple apps

@flexiondotorg flexiondotorg changed the title REQ: Allow multiple apps to be excluded from Audio Output Capture (PipeWire) REQ: Allow multiple apps to be excluded from App Capture (PipeWire) Sep 23, 2022
@flexiondotorg flexiondotorg changed the title REQ: Allow multiple apps to be excluded from App Capture (PipeWire) REQ: Allow multiple apps to be excluded from Application Audio Capture (PipeWire) Sep 23, 2022
@flexiondotorg
Copy link
Author

I've updated the issue accordingly.

@dimtpap
Copy link
Owner

dimtpap commented Dec 25, 2022

Turns out OBS's API doesn't allow for an easy way to create a nice interface for this. I've pushed what I've come up with so far on the multiple-apps-per-source branch.

⚠️ Before proceeding, please backup your scenes/sources, existing app captures may break

You can do this in OBS Studio by going on Scene Collection, then Export
image
Use Import to restore your backup.

Here's a build for you to try out

@flexiondotorg
Copy link
Author

Thank you for working on this 🙇

I've updated PipeWire to 0.3.63 on Ubuntu 22.04.1 because I read #17

I run my own from source OBS Studio, so I've built 29.0.0 and built your plugin from the multiple-apps-per-source branch.

I created a simple scene based on my original feature request.

  • Audio Input Capture (PipeWire) - Mic
  • Audio Application Capture - Capture all applications except for spotify and Discord
  • Audio Application Capture - Target spotify
  • Audio Application Capture - Target Discord
  • Camera

I've tested local recordings only and just for a few minutes, and it works perfectly ⭐ Each audio source can be manipulated independently and I haven't encountered any audio distortion/corruption. I'll update my usual streaming setup and test it for real in the next few days and report back.

But thank you, this is ace!

@flexiondotorg
Copy link
Author

No issues during a 2-hour live stream using multiple instances of Audio Application Capture without and with exceptions applied.

@flexiondotorg
Copy link
Author

I've streamed several times now, and sadly, this branch of the plugin is introducing audio distortion that manifests as clicks and stutters. I'm aware of the expander/limiter bug in upstream OBS 29 and applied the patches; it is not that.

I am using a build of this plugin from the tip of the main branch 32889fc, and I haven't encountered any audio distortion.

@dimtpap
Copy link
Owner

dimtpap commented Feb 1, 2023

That's interesting, no audio related changes were made. Do you have a clip where the distortions occur?

@flexiondotorg
Copy link
Author

@dimtpap It might be PipeWire itself, as I do hear the clicks in the regular version of the PipeWire Plugin too. Using PulseAudio Input Capture for my Mic in OBS seems to clear things up.

I'm at conferences for the next several days, but I will do some thorough testing and report back.

@dimtpap
Copy link
Owner

dimtpap commented Feb 3, 2023

The feature branch was actually created after I made some audio related changes to the plugin. I'd assume either ff03b02 or 91b71f1 is responsible for the sound glitches but I cannot reproduce them. If you find that the plugin is indeed responsible for the glitches open another issue and as a workaround use the latest (1.0.5) release as it was published before the audio changes.

@VladimirMrzv
Copy link

@dimtpap can you add option to see all application in list for chooseing source, some games disable sound when switching to obs for configuration. And maybe multiple list for apps with more 2 sound streams or for other apps.

@ezracelli
Copy link

I'd love to try this out, but I need some features from 1.1.0 — can the feature branch be rebased?

@dimtpap
Copy link
Owner

dimtpap commented Jun 11, 2023

Rebased
linux-pipewire-audio-b59f1d5.zip

@VladimirMrzv
Copy link

@dimtpap excellent build. It is works for me. I can add application by his execute name and more than one.

@flexiondotorg
Copy link
Author

flexiondotorg commented Sep 18, 2023

@dimtpap Sorry for the long delay in getting back to you on this. It has been a few months since I've been not streaming to prioritise work and home life.

  • This feature works great. Thank you! 🙇
    • I've tested obs-pipewire-audio-capture v1.1.1 with OBS 29.1.3 and 30.0.0-beta on Pipewire 0.3.71
  • The audio distortion/clicks I reported are not related to obs-pipewire-audio-capture
    • After tweaking Pipewire quantum clocks, audio glitches are cleared up.

Thank you for working on this feature and for your patience in waiting for my feedback.

@VladimirMrzv
Copy link

VladimirMrzv commented Oct 30, 2023

@dimtpap

Rebased linux-pipewire-audio-b59f1d5.zip

can you update this build with new feature for showing paused sources or merge builds with option for extended config

@dimtpap
Copy link
Owner

dimtpap commented Nov 1, 2023

can you update this build with new feature for showing paused sources

linux-pipewire-audio-71fdfdd.zip

I don't know if enough people need this to justify making the workflow harder for those that only capture single apps

@dimtpap dimtpap pinned this issue Nov 1, 2023
@VladimirMrzv
Copy link

@dimtpap please update again this build, this is very comfortable for me

@dimtpap
Copy link
Owner

dimtpap commented Mar 1, 2024

linux-pipewire-audio-c35fb3c.tar.gz

You can also find builds for any new commit here, under the "Artifacts" section of any entry.

@3urobeat
Copy link

3urobeat commented Apr 2, 2024

Hey, the multiple-apps-per-source branch is amazing!
Sadly the associated program names are not saved for me when I quit OBS, otherwise it's working great!
I've installed the latest artifact version on OBS 30.1.0-1.

Are there any significant drawbacks to the "normal" version, which is why you don't want to merge it into the base branch yet?
I don't see any reason anybody would want less freedom for routing audio and I don't find the UI more complicated at all

Using this branch of the plugin I can separate Browser, Discord & Spotify into different channels and lump everything else (any arbitrary game and whatever is left) together, while also bypassing my EasyEffects EQ (capturing desktop audio was otherwise full of artifacts).

I couldn't do that without this branch of the plugin and it has been quite the gamechanger for me.

@dimtpap
Copy link
Owner

dimtpap commented Apr 3, 2024

Sadly the associated program names are not saved for me when I quit OBS

I'll look into that

Are there any significant drawbacks to the "normal" version, which is why you don't want to merge it into the base branch yet? I don't see any reason anybody would want less freedom for routing audio and I don't find the UI more complicated at all

I think finding the app in the list, clicking on it, then clicking a button is more complicated than just finding and clicking the app in the list, especially when most users want to capture a single app (just a guess). Here is my comparison

Single app:

  • Less clutter in the source properties
  • Per-app audio control (per-source filters and mixer entries) - Why I think the single app mode is better and more widely used

Multiple apps:

  • Less PipeWire nodes - Probably less stress put on PipeWire, but not enough for this point to be that good.
  • Ability to exclude multiple applications (what the original issue was made for) - This is probably the best reason to consider supporting multiple apps as a main feature, but makes it useless to have multiple sources in the same scene, unless you're using them to switch between sets of applications to exclude I guess

So the obvious way forward is to provide a mode drop-down, so that users can choose what trade-offs they'd rather make. I'll work on this and see how it goes (scared of complexity and feature creep)

@3urobeat
Copy link

3urobeat commented Apr 4, 2024

Thanks for the response! Yeah, I guess three clicks is more than two :'D
A setting to have both options would be better of course and would allow you to have one code base instead of two.

I get the fear of feature creep, I have experienced the same in multiple projects but I think selecting multiple sources is quite a fundamental and powerful feature and is worth it to implement.

Btw one thing I noticed - the plugin saves the last selected item in the dropdown menu, it just does not save what I put into the list.

@EmersonBiggons
Copy link

EmersonBiggons commented Apr 8, 2024

I can second the need for it, it makes recording universal audio and removing music and discord MUCH nicer. The alternative would be making 50 billion unnecessary audio captures for everything I want audio for and that would be absurdly annoying. Before this branch I was genuinely considering never listening to music while playing games again just to get around the issue.

@alexklann
Copy link

Thanks for the response! Yeah, I guess three clicks is more than two :'D A setting to have both options would be better of course and would allow you to have one code base instead of two.

I get the fear of feature creep, I have experienced the same in multiple projects but I think selecting multiple sources is quite a fundamental and powerful feature and is worth it to implement.

Btw one thing I noticed - the plugin saves the last selected item in the dropdown menu, it just does not save what I put into the list.

Big issue right now.
Any updates on this? 🙏

@CodionCA
Copy link

CodionCA commented Jul 16, 2024

This branch is critical for my workflow, would love to see updates on this. Only thing that isn't working for me is my selections are not saving between obs restarts.

Edit:
Sorry, I meant they are not saving when I use the drop down. Typing them in manually seems to be a workaround.

@dimtpap
Copy link
Owner

dimtpap commented Jul 16, 2024

Branch was rebased and built for OBS 30.2 as well to work with Flatpak.

I want to apologize for no progress on making this a main feature. I'll take a look into making this a main feature again but I can't say an ETA yet, thanks for understanding.

@dimtpap dimtpap reopened this Jul 16, 2024
@dimtpap
Copy link
Owner

dimtpap commented Jul 16, 2024

Posting artifacts from this CI run because they expire

linux-pipewire-audio-add302b-28.0.0.tar.gz

linux-pipewire-audio-add302b-30.2.0.tar.gz

@EmersonBiggons

This comment has been minimized.

@dimtpap

This comment has been minimized.

@EmersonBiggons

This comment has been minimized.

@Seuma
Copy link

Seuma commented Jul 27, 2024

Hey, so I installed the plugin from the branch with multiple app support. I am able to add more than one application to the list but have the problem, that the settings aren't persistent. If I close OBS and start it again, the settings previously made are gone and I have to redo all bindings it's the same issue @3urobeat also mentioned.

Also wanted to show that this branch is, at least also for me, very useful since I have multiple apps which are used for example for Music and I can bundle them in one audio stream. And I'm really thankful for this plugin. If you need any logs or such I will gladly try to provide them.

@3urobeat
Copy link

I have found that the tip from CodionCA worked for me as well.
Selecting the applications from the dropdown does not persist, however typing the names manually in does.

@Seuma
Copy link

Seuma commented Jul 27, 2024

I have found that the tip from CodionCA worked for me as well. Selecting the applications from the dropdown does not persist, however typing the names manually in does.

Indeed it does. Haven't read that. Thank you for pointing it out for me!

@dimtpap dimtpap changed the title REQ: Allow multiple apps to be excluded from Application Audio Capture (PipeWire) REQ: Allow multiple apps to be captured from Application Audio Capture (PipeWire) Jul 28, 2024
@dimtpap
Copy link
Owner

dimtpap commented Aug 26, 2024

Merged to main. App capture sources now have an option to choose between capturing one or multiple apps.
Selected apps will be kept if you update, but you'll have to change the Capture Mode option in your sources after updating.

I'd appreciate any feedback before I can release this properly, thanks.

Builds from https://github.com/dimtpap/obs-pipewire-audio-capture/actions/runs/10558411473

linux-pipewire-audio-3817682-28.0.0.tar.gz
linux-pipewire-audio-3817682-30.2.0.tar.gz

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

No branches or pull requests

9 participants