bozbez / win-capture-audio

An OBS plugin that allows capture of independant application audio streams on Windows, in a similar fashion to OBS's game capture and Discord's application streaming.
GNU General Public License v2.0
3.81k stars 208 forks source link

Multiple instances as source seems to mix together #21

Closed Ballantin closed 3 years ago

Ballantin commented 3 years ago

If I add, for example one instance as a source and capture FFXIV, and another instance as a source to capture Discord, the audio of the game goes to the Discord source output too.

BuyMyMojo commented 3 years ago

I tried to recreate it and was unable to? Video: https://streamable.com/00n3j7 (excuse the weeb, I'm watching it with someone so it was the perfect chance to test) Timeline: Resolve_vID8VKGBj3

bozbez commented 3 years ago

I am also unable to recreate (although I don't have FFXIV to test).

  1. What build of Windows are you using?
  2. Does this happen with other applications like Spotify and Discord together?
BuyMyMojo commented 3 years ago

I'll try again but on FFXIV and discord soon!

BuyMyMojo commented 3 years ago

can confirm the bug now for some reason specifically FF14 gets audio from the discord source?

bozbez commented 3 years ago

That is pretty odd. To clarify if you capture FF14 on its own you don't get the Discord audio included?

BuyMyMojo commented 3 years ago

no, only grabs the audio from other application output captures?

BuyMyMojo commented 3 years ago

grabs audio from other apps too, like spottily. so you can test too there is a free trial for the game that doesn't have a time limit so: https://freetrial.finalfantasyxiv.com

Scrxtchy commented 3 years ago

The benchmark will be less hassle to work with if it's required https://na.finalfantasyxiv.com/benchmark/download/

BuyMyMojo commented 3 years ago

can confirm the bug works on the benchmark too

BuyMyMojo commented 3 years ago

scratch that, it had the issue for a couple moment but I cannot reproduce it again using the benchmark consistently

Scrxtchy commented 3 years ago

What I've found is that audio from mute applications produce fragmented audio samples from the game https://user-images.githubusercontent.com/12771982/130956477-e89d5427-5cf7-4118-86cc-65710fb25f50.mp4

there's only a few logs in here for termination issues

21:14:24.735: Windows Version: 10.0 Build 19041 (release: 2004; revision: 1110; 64-bit)
21:14:25.708: OBS 27.0.0 (64-bit, windows)

21:35:26.077: [audio-capture: 'Applicat...'] (start_capture) failed to open target process, can't detect termination
21:35:29.590: [audio-capture: 'Applicat...'] (start_capture) failed to open target process, can't detect termination
21:35:32.422: [audio-capture: 'Applicat...'] (start_capture) failed to open target process, can't detect termination
21:35:47.098: [audio-capture: 'Applicat...'] (start_capture) failed to open target process, can't detect termination

all on v2.0.0-beta machine runs at 32bit 48kHz sound format

bozbez commented 3 years ago

Could you check that this is still happening (and post logs if it does) with this version: win-capture-audio-2.0.0-format-test-setup.zip

Scrxtchy commented 3 years ago
12:28:12.295: [audio-capture: 'FFXIV Au...'] (audio_capture_worker_thread) tag is: 61812_13832
12:28:12.297: [audio-capture: 'FFXIV Au...'] (audio_capture_worker_update) resolved window: "FINAL FANTASY XIV" "FFXIVGAME" "ffxiv_dx11.exe" to PID 55936
12:28:12.297: [audio-capture: 'FFXIV Au...'] (start_capture) launching helper with command line: "../../data/obs-plugins/win-capture-audio/audio-capture-helper.exe" 55936 include 61812_13832

12:28:14.194: [audio-capture: 'FB2K Aud...'] (audio_capture_worker_thread) tag is: 61812_35340
12:28:14.194: [audio-capture: 'Discord ...'] (audio_capture_worker_thread) tag is: 61812_44640
12:28:14.227: [audio-capture: 'Discord ...'] (audio_capture_worker_update) resolved window: "b - Discord" "Chrome_WidgetWin_1" "DiscordCanary.exe" to PID 58000
12:28:14.228: [audio-capture: 'Discord ...'] (start_capture) launching helper with command line: "../../data/obs-plugins/win-capture-audio/audio-capture-helper.exe" 58000 include 61812_44640

12:28:53.818: [audio-capture: 'Applicat...'] (audio_capture_worker_thread) tag is: 61812_47688
12:30:24.979: [audio-capture: 'Applicat...'] (start_capture) launching helper with command line: "../../data/obs-plugins/win-capture-audio/audio-capture-helper.exe" 37432 include 61812_47688
12:31:14.818: [audio-capture: 'Applicat...'] (audio_capture_worker_update) resolved window: "Sublime Text (UNREGISTERED)" "PX_WINDOW_CLASS" "sublime_text.exe" to PID 53812
12:31:14.823: [audio-capture: 'Applicat...'] (start_capture) launching helper with command line: "../../data/obs-plugins/win-capture-audio/audio-capture-helper.exe" 53812 include 61812_47688
12:31:16.427: [audio-capture: 'Applicat...'] (audio_capture_worker_update) resolved window: "21-08-17_12-39-06-FINAL_FANTASY_XIV.png - JPEGView" "#32770" "JPEGView.exe" to PID 37432

This was interesting, when capturing audio from Sublime Text, it had samples from my Discord audio source, when I changed it to JPEGView, it took audio from my FF14 source.

BuyMyMojo commented 3 years ago

interesting.

I can also confirm that in the process of testing apex to see if it worked it grabbed other source audio too but it happened later after I alt tabbed out of the game and it kicked me from the firing range map? maybe during an alt tab and some other events the packet size could change?

BuyMyMojo commented 3 years ago

Starting up subnautica sub zero to test for the person who asked in my compatibility thread and for the first time ever I have had the opposite effect... it was pushing it's audio to my firefox audio capture after I selected subnautica

BuyMyMojo commented 3 years ago

yeah this issues seems to be a lot wider then I thought, happens with a lot of games and apps. seems to be an issues that isnt just affected by specific software

m0m0herde commented 3 years ago

Can confirm that! Tried using Spotify and GTA Vice City at the same time and each Track had sound bits of each other in them.

bozbez commented 3 years ago

Struggling to reproduce... if you have encountered this problem could you post your Windows version/build numbers and your audio output setup?

I've reviewed the capture code a few times and as far as I can tell it follows the (limited) documentation pretty much exactly, so this might be a bug on Microsoft's side (not an officially supported API until Windows 11 releases...).

m0m0herde commented 3 years ago

Windows Version 20H2 (OS Build 19042.1165) Audio Setup (nothing fancy): Windows Output - HyperX Cloud Flight Wireless Headset and Spotify and GTA went both straight to this Headphones. Then i made a fresh scene in OBS and just added 2 Application Audio Output Sources. One for Spotify and one for GTA. Those were also the only Audio Sources in my OBS Audio Mixer.

BuyMyMojo commented 3 years ago

I'll grab my windows version in a sec but as for reproducing it; It was never consistent for me, some times it'd happen right away when set the one of the audio sources to a program and some times it took me some time to keep deselecting and reselecting the programs and alt tabbing to make it occur.

I'll also try to setup and windows 11 VM and see of I can reproduce the error there

BuyMyMojo commented 3 years ago

image

BuyMyMojo commented 3 years ago

image testing to see if it's a windows 10 issue soon

BuyMyMojo commented 3 years ago

image Virtual box doesnt let you open OBS so here we go again because I know HyperV works

BuyMyMojo commented 3 years ago

image so it might just be a windows 10 isses, I havn't make the issues happen in windows 11 yet so you might need to have a toggle between both hooking methods. windows 11 mode marked as experimental on windows 10??

BuyMyMojo commented 3 years ago

nope issue happens on windows 11 :( that toggle still could be useful tho obs-win11

bozbez commented 3 years ago

v2.0.0-beta.2 might help with this.

BuyMyMojo commented 3 years ago

Current testing with v2.0.0-beta.2 shows no sign of the bug, will keep testing before closing

Firehawke commented 3 years ago

I'm going to concur that it seems to be fixed after one night of testing. I, too, would prefer to go a bit longer before declaring it fixed, but things are definitely looking up.

BuyMyMojo commented 3 years ago

it's looking good so far. I have been doing on and off testing through the day and still got nothing but I'll do more in-depth testing soon