win-capture-audio icon indicating copy to clipboard operation
win-capture-audio copied to clipboard

Audio crackling/popping stutter under load

Open ChloeDawn opened this issue 3 years ago • 28 comments

Plugin version: v2.0.0-beta

When the captured application is under load (for example a game experiencing lag), the captured audio will crackle and pop, sometimes cutting out and back in depending on the severity of the lag. This happens with both a direct capture and an indirect capture ("Include process tree" unchecked and targeting another application). These audio issues do not occur when using a standard audio source capturing the audio device that the application is outputting to. The threshold of this crackling seems to be quite low, with even a slight dip below my v-sync causing problems, so I suspect some sort of bottlenecking?

I'm unsure if this kind of issue is resolvable, but I felt it was worth reporting regardless

ChloeDawn avatar Sep 01 '21 17:09 ChloeDawn

Interesting that it is only happening under load for you, but otherwise very similar to #21 and #22. This might be fixed by increasing the buffer size we are requesting from the IAudioClient, will try that in the next release to see if it solves someones problem.

bozbez avatar Sep 01 '21 23:09 bozbez

Try v2.0.0-beta.2, the buffer size is increased and the packet handling in general should be improved.

bozbez avatar Sep 02 '21 13:09 bozbez

That fixed it! Thank you so much ❤️ This is such an amazing plugin 😁

ChloeDawn avatar Sep 02 '21 18:09 ChloeDawn

On a triple check, there is still popping when loading environments, but it is a lot less frequent. Previously it was non-stop popping, stuttering, and cutting out when the game experienced any kind of lag.

I have attached a recording below to better show the popping. ❤️

https://user-images.githubusercontent.com/9869940/131903762-0f317762-fb44-4d46-a143-4a9cb6f042ec.mp4

The encoder settings, if relevant (CPU is i7 4790K):

obs64_02-09-2021_20-25-21

ChloeDawn avatar Sep 02 '21 19:09 ChloeDawn

Do you have OBS set to be above average priority and are you running as admin?

BuyMyMojo avatar Sep 03 '21 05:09 BuyMyMojo

In recent versions they released a fix that had high CPU and GPU loads breaking stuff in OBS but for it to work you needed to be running it as admin

BuyMyMojo avatar Sep 03 '21 05:09 BuyMyMojo

I'm running as admin with high CPU priority ^^

ChloeDawn avatar Sep 03 '21 14:09 ChloeDawn

I'm trying to recreate this but not luck yet GPU encoding: https://streamable.com/m1jw42 CPU encoding: https://streamable.com/h07glw

BuyMyMojo avatar Sep 04 '21 07:09 BuyMyMojo

I might have something similar but I'm not sure... At random points I seem to be getting issues that are resolved by hiding and un-hiding sources. I'm not entirely confident its the plugin but thought I'd post it here in case I can check any logs or anything for you.

Edit: Just for completeness, its the version behind the most recent (updating tonight) and OBS is being run as admin.

https://www.twitch.tv/videos/1154850776

IonicEcko avatar Sep 21 '21 05:09 IonicEcko

If anyone encounters this could they post the OBS log of their session?

bozbez avatar Sep 21 '21 08:09 bozbez

I noticed this the first day I tried it so I stopped using the plugin but still check this for updates. Decided to stream with it again so I could get you a log in hopes that it'll help. It's pretty unusable for me currently as this is too common. I'll be looking forward to updates <3. https://obsproject.com/logs/JpT8cH7zsKe52F2e https://clips.twitch.tv/FurryPrettiestTurnipKippa-AiZ7PE0OPynoY4uQ

Soloplayersama avatar Sep 28 '21 09:09 Soloplayersama

Could you see if it happens if you send your audio directly to your headphones or speakers without using the VB-cables?

bozbez avatar Sep 28 '21 10:09 bozbez

I wasnt using VB during that stream, anything labeled as it was just left over from when I was reconfiguring / testing other set ups. Currently all VB cables are disabled and all my audio runs through my PCI sound card. I can run more streams/tests tomorrow(later today as its 5am here)and double check my sound set up in case I've made a mistake. If you have any other suggestions or things you would like me to try please let me know.

Soloplayersama avatar Sep 28 '21 10:09 Soloplayersama

So the setup today was with a completely fresh OBS install with only this plugin added back in, all fresh settings, certain that I had all audio going through my default speakers. Exact same issue happens sporadically although infrequent. The majority of the stream audio is great over the course of a few hours but this did show up once or twice.

https://obsproject.com/logs/QmZA6o3QuDt0hRhP https://clips.twitch.tv/RenownedFrigidJuicePoooound-8BXT1C0eea_fRAu5

Soloplayersama avatar Sep 29 '21 03:09 Soloplayersama

could be related to using x264 slow. even on a 5950x that's not entirely recommended on a one PC setup? try doing medium for a while and report back please

...
[x264 encoder: 'streaming_h264'] preset: slow
...

BuyMyMojo avatar Sep 29 '21 04:09 BuyMyMojo

Like I see only 216 frames dropped but could be causing an issue with the audio capture?

BuyMyMojo avatar Sep 29 '21 04:09 BuyMyMojo

or if you keep using slow set the audio-capture-helper.exe process to have higher cpu priority higher then OBS?

BuyMyMojo avatar Sep 29 '21 04:09 BuyMyMojo

Like I see only 216 frames dropped but could be causing an issue with the audio capture?

That's mostly from me alt tabbing in and out of fullscreen - typically I do get a few render (0 encoder drops) frame drops throughout a stream with my current settings but it's not the amount that is visible on stream. I'll drop my custom commands and use slow but change the priority of the exe and see what happens.

Soloplayersama avatar Sep 29 '21 05:09 Soloplayersama

Could anyone suffering from this try this build: win-capture-audio-2.1.0-beta-setup.zip

Changes a bunch of things but primarily switches to use an MMCSS registered audio capture work queue which has higher CPU priority, and runs the capture in-process.

bozbez avatar Sep 29 '21 22:09 bozbez

Could anyone suffering from this try this build: win-capture-audio-2.1.0-beta-setup.zip

Changes a bunch of things but primarily switches to use an MMCSS registered audio capture work queue which has higher CPU priority, and runs the capture in-process.

I'll try this out tomorrow and get back to you, I do have a VOD I need to check for audio stutters from tonight that I talked about changing my settings for, just havent scrubbed through it yet.

-EDIT- https://clips.twitch.tv/CautiousFairFriesTTours-_n3YHAJ1bcLGld3O https://obsproject.com/logs/XQkNEXjmSSH5NK8t - ignore the render stalls as that was all gained when I alt-tabbed out of the game to shut down the stream. This clip was only about 5~ minutes into stream and the audio distortion lasts about a minute (EDIT- the next audio clipping/distortion was 1hr45mins later which also was about 1min duration, again in passive low load gameplay), this was with me setting the audio-capture.exe to high priority prior to playing. my GPU sits about 50-70% used in general and particularly it's low load during the point where it happens in the clip.

Soloplayersama avatar Sep 30 '21 02:09 Soloplayersama

I tried 2.1.0beta this morning, same issue. https://clips.twitch.tv/ProductiveDelightfulWhaleStoneLightning-zOJr7w9dsgdjylZt

Soloplayersama avatar Sep 30 '21 21:09 Soloplayersama

Log of the session? Look in AppData\Roaming\obs-studio\logs for all the recorded logs.

bozbez avatar Sep 30 '21 21:09 bozbez

Log of the session? Look in AppData\Roaming\obs-studio\logs for all the recorded logs.

https://obsproject.com/logs/f-AuJ38X8zOf9CWs

Soloplayersama avatar Sep 30 '21 21:09 Soloplayersama

Alright here's my last test for now - tried one stream on medium just for you. https://obsproject.com/logs/y8Y8vJRViFUS3nVG https://clips.twitch.tv/PluckyCheerfulKumquatDoritosChip-FcSa69p99f3p2ptO

Soloplayersama avatar Oct 03 '21 04:10 Soloplayersama

would you say that happened about 5 minutes in?

BuyMyMojo avatar Oct 03 '21 06:10 BuyMyMojo

would you say that happened about 5 minutes in?

No, that was much later in the stream overall, also happened multiple times.

Soloplayersama avatar Oct 03 '21 10:10 Soloplayersama

After Reading through the comments I can confirm this is happening to me as well. Just capturing Spotify as the source and this happens a random amount of time that OBS is open. I had it happen to me without even streaming/recording. Just all of the sudden cracks and pops start happening in the Spotify music and gets progressively worse. Closing Spotify and reopening it completely resolves the issue.

LinkzVR avatar Nov 17 '21 19:11 LinkzVR

was there a fix found for this eventually? im using the newest version and still encounter it, but someone else might have discovered something :)

Marvin10193 avatar Apr 28 '23 19:04 Marvin10193