obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

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

Open cryptofyre opened this issue 1 year ago • 5 comments

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!

cryptofyre avatar Nov 10 '23 20:11 cryptofyre

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.

Fenrirthviti avatar Nov 10 '23 22:11 Fenrirthviti

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.

cryptofyre avatar Nov 10 '23 22:11 cryptofyre

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

Fenrirthviti avatar Nov 10 '23 23:11 Fenrirthviti

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

cryptofyre avatar Nov 10 '23 23:11 cryptofyre

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

jbubik avatar Feb 01 '24 22:02 jbubik