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
57.27k stars 7.72k forks source link

Subprocess nature of WebView2 based application prevents Application Audio Capture from accessing audio source. #9838

Open cryptofyre opened 8 months ago

cryptofyre commented 8 months ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

29.1.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/bnZtR8NSDSELFllS

OBS Studio Crash Log URL

No response

Expected Behavior

Audio should be effectively captured from the Application chosen in the window picker like it does with the generic Desktop Audio source.

Current Behavior

The application audio is not properly captured due to WebView2 being an underlying subprocess of the application(Cider), the audio source comes from WebView2 instead of Cider which in this case causes the Application Audio Capture source to not function properly.

Steps to Reproduce

  1. Download Cider (Alternatively, find another WebView2 based application that has audio playback)
  2. Attempt to use the Application Audio Capture in OBS to capture the 'Cider' window.
  3. No audio is captured.

Anything else we should know?

This is a known issue with WebView2 currently, but technically you could mitigate this for now by allowing OBS to see WebView2 sources. https://github.com/MicrosoftEdge/WebView2Feedback/issues/2236

image image

as for testing, if you need to acquire Cider for testing feel free to reach out to me and I'd happily set you up with a debugging copy you can use for testing.

Appreciate the hard work put into OBS, and I hope this bug report allows for more people to use both of our apps effectively soon!

Fenrirthviti commented 8 months ago

This affects more than just webview2, as any application using a subprocess for audio output is affected. I thought we had a duplicate of this already, but this isn't technically a bug as we don't capture subprocess audio right now by design.

cryptofyre commented 8 months ago

Hmm, alright.

Maybe WebView2 could be whitelisted a source as it's a common core dependency, least until Microsoft does something about the audio source naming.

Fenrirthviti commented 8 months ago

Unfortunately, it's not that simple. We already tried the method provided as part of the API to capture subprocesses, but it's kinda hit or miss, and outside our control right now as I understand it:

https://github.com/obsproject/obs-studio/blob/40562ff47e4404a494be83973c90ebe554efdcd6/plugins/win-wasapi/win-wasapi.cpp#L745

cryptofyre commented 8 months ago

Ah bummer, I wish the audio layer got more attention from Microsoft's end. It's just so primitive right now.

jbubik commented 5 months ago

Same problem for the new MS Teams app. Based on WebView2 too.