obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
59.15k stars 7.86k forks source link

Application Audio Capture Captures All Device Output #7922

Open velocity7 opened 1 year ago

velocity7 commented 1 year ago

Operating System Info

Windows 10

Other OS

No response

OBS Studio Version

28.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior

Please see current behavior

Current Behavior

Currently, when using Application Audio Capture, I can record the output of just that application while filtering out other applications. However, for applications that output to multiple audio devices at once, this can cause problems.

Genshin Impact, DEATH STRANDING, and Call of Duty: Modern Warfare 2 are three such examples, as they can output haptic feedback to the DualSense controller via the Wireless Controller audio channel. The Application Audio Capture plugin is picking this up at the same time as the games themselves.

The plugin needs another property to decide which device outputs to capture audio from for a specific application, not just mix all of them at once.

The current workaround is to output the game to a different audio device and only capture that audio via the Audio Output Capture plugin, but that defeats the purpose of using the Application Audio Capture plugin.

P.S. I've also tried capturing the Wireless Controller via Audio Output Capture and inverting its polarity to try to negate the issue... sadly didn't work. :(

Application Capture sample: https://www.youtube.com/watch?v=gyLG78-vWz4

Desktop Audio Capture sample: https://www.youtube.com/watch?v=MvX3TcHjgjQ

Steps to Reproduce

  1. Add Application Audio Capture plugin
  2. Select the application in question that is capable of outputting to multiple audio devices

Anything else we should know?

No response

d0x360 commented 1 year ago

You could fix that by using a app called virtual audio cable to mix the 2 audio streams together then pick that as your audio source.... At least until OBS fixes this or more accurately adds this as it's kind of new and only PlayStation games do it.

Virtual audio cable is a godsend, it can make the "impossible" happen. It's free, easy to use and they make a couple helpful apps for audio too. I highly recommend it.

Fenrirthviti commented 1 year ago

No log file provided, and you mention the third-party audio capture plugin, which means this is unsupported by us and would need to be reported to the plugin developer.

As a log was not provided, we cannot investigate further. Please provide a log file if this is the internal application audio feature, and not the third-party plugin, and we can take a closer look.

velocity7 commented 1 year ago

I've included a log file, and this time I'm using the beta audio plugin that is included with OBS Studio 29.0.2, deleted and reinstalled to make sure. Look for when the plugin targets GenshinImpact.exe.

2023-03-29 15-50-20.txt

Fenrirthviti commented 1 year ago

Reopening. I am still unsure if this is something we can control on our end, but I will leave that to people more familiar with the API itself.

ObjectInSpace commented 4 months ago

I'm also experiencing this with The Last Of Us. I imagine Cyberpunk would also have this but haven't tested it yet.

https://clips.twitch.tv/GiantMoistSalamanderTTours-d3kp2KM_0lMNUMSS

ryantheleach commented 2 weeks ago

I'm also experiencing this with Chrome, and steveseguin/Vingester https://github.com/rse/vingester/pull/80

My understanding, is that it's getting the parent process id, when it matches against the window, and windows is helpfully building a sound graph with all children inside it.

https://learn.microsoft.com/en-us/samples/microsoft/windows-classic-samples/applicationloopbackaudio-sample/

With the new structure, only audio from the specified process, and its children, will be captured.

Emphasis mine.

So the path forward seems murky, it would involve finding all the child processes, somehow identifying the processes that create sound in a repeatable fashion (knowing full well that it may be silent at the time of setup), naming them something that makes sense to the user, and that's all assuming windows will allow you to specify a child process, instead of it's parent.

I'd love it if someone informed could at least think on this some, and reply with some context.