Audio crackling / popping on Linux + OBS + Steam Proton (gameplay rec for YT)

Sturmlocke

New Member
Hello,

I've been struggeling with this issue for a couple of months now. So far I have been removing the audio crackle / popping post recording to the best of my current ability, but since this is a super time consuming workaround, I am now seeking help from ya'll because I have ran out of ideas and I lack the time to further troubleshoot this problem.

The issue: Recording gameplay for my channel on Youtube sometimes produces a little audio hiccup / glitch in sound that you can hear as a short crackling or popping sound every now and then. As far as I can tell it occures randomly, usually after recording 4-6 minutes of gameplay footage.

System specs:
  • Dell Inc. OptiPlex 7050
  • Intel® Core™ i7-7700 CPU @ 3.60GHz × 8
  • NVIDIA RTX A2000/PCIe/SSE2
  • openSUSE Leap 15.5
  • 64-bit
  • Gnome 41.8
  • X11
  • Nvidia driver version: 545
  • Soundcard: Asus Xonar SE internal
  • Soundcard specs: 192kHz/24-Bit, 5.1-channel und 300-Ohm-Headset enhancement
  • System and recording drive: M2 NVME SSD + 2 x SSD in RAID 0 mode
  • OBS version (Flatpak): 30.0.2

Also tested on its smaller brother:
  • Dell Inc. Optiplex 3040
  • Intel Core i7-6700 CPU x8
  • Nvidia T600
  • openSUSE Leap 15.5
  • 64-bit
  • Gnome 41.8
  • X11
  • Nvidia driver version 545
  • onboard audio
  • System and recording drive: M2 NVME SSD
  • OBS version (Flatpak): 30.0.2

In both cases: No microphone connected to the pc, no other audio devices connected to the pc. Bluetooth dongle connected to the pc for mouse / keyboard combo and PS4 wireless controller.

Please note: I also tested on openSUSE Tumbleweed with both machines. The issue can be reproduced on both systems and on both Leap and Tumbleweed (the latter with a newer kernel 6+). The Optiplex 7050 is using a dedicated soundcard now, but initially it was using the onboard IntelHD audio chipset. After experiencing the sound issues, I decided to purchase a dedicated soundcard in order to rule out any conflicting issues with the onboard audio of the mainboard. Sadly, this didn't resolve the issue. The Optiplex 3040 computer is still running the onboard audio though. This happens in several games on Steam with Proton (Flatpak in both cases): Everquest 2, DC Universe Online, Anarchy Online and more. The sound glitches can not be heard during the live recording of these games, meaning that it is only noticable post record during video playback and inspection of the recorded material.

What I have tried thus far:
  • switch from 48khz to 41khz in obs audio settings
  • disable desktop audio and other sound sources
  • reduce recording quality from indistinguishable to high and medium via simple settings menu
  • change audio codec from acc to opus in obs audio settings and tried both with 48/41khz
  • create separate scene for sound source tapping into the dedicated xonar soundcard
  • reduce rec gameplay audio in obs to -10db
  • turn off video preview window in obs
  • power profile in Gnome settings is set to maximum performance
  • nvidia powermizer settings are set to maximum performance
  • tried with and without gamemode %command% for the games that I want to record on Steam
  • switch the default audio plugin within the operating system from Pulseaudio (default) to pulseaudio-on-pipewire
  • switch from nvenc h264 to nvenc h265 recording
  • set PULSE_LATENCY_MSEC=60 %command% for affected Steam games
  • turn off PS4 controller in order to rule out audio issues since the PS4 controller has its own "speaker" that can be seen in openSUSE's Gnome audio settings (it's an audio source)
  • set priority of the games and obs to very high in task manager
  • pulseaudio-pipewire priority is already set to very high in task manager by default

Plugins & filters used:
  • Linux Vulkan/OpenGL game capture (obs-vkcapture)
  • added filter to "scenes" in obs: sharpening filter and color correction filter (now that I think of it, might be better to add the filters to the "game recording" source instead of applying it the the entire scene which includes the audio source

Untested as of this writing:
  • I should try to record a different audio source like a video in VLC or on YT and compare the results with gameplay recordings. Does it happen when recording anything else outside of gaming gameplay?
  • at least one person has suggested to switch over to a low latency Linux kernel, not sure if I want to do this on my computers since these are stable production machines and I rely on the default vanilla lts kernel coming from Suse
  • haven't tested with native OBS yet (using Flatpak for now)
  • haven't tested with native Steam and Proton yet (using Flatpak for now)

Fun fact: I have also noticed the exact same audio crackling and sound popping sounds on other popular gameplay videos on Youtube. This is merely one example - but there are more. Most ppl don't actually notice this at all, but I can hear it every single time it occures. Here it is at around minute 13:30 - 13:36: https://youtube.com/clip/Ugkx5CDcjfdXlQwdGrRhXNmkOtpjhzIepAfK?si=SC9ywS0ZSkU-iMBg

OBS global settings (screenshots) and last three OBS logs attached to this post. Example here after 13-15 seconds into the video. It can get louder / more quiet depending on the situation / scene.

Open for any form of feedback and suggestions! Thank you.

Cheers
 

Attachments

  • 2024-01-15 18-08-27.txt
    12 KB · Views: 16
  • obs simple settings, example4forum, v4.png
    obs simple settings, example4forum, v4.png
    149.2 KB · Views: 24
  • obs simple settings, example4forum, v3.png
    obs simple settings, example4forum, v3.png
    130.9 KB · Views: 21
  • obs simple settings, example4forum, v2.png
    obs simple settings, example4forum, v2.png
    218 KB · Views: 20
  • obs simple settings, example4forum, v1.png
    obs simple settings, example4forum, v1.png
    246.1 KB · Views: 22
  • 2024-01-15 18-21-50.txt
    6.7 KB · Views: 12
  • 2024-01-15 18-11-58.txt
    12 KB · Views: 12
Last edited:

Sturmlocke

New Member
Update: The video file is too big to attach. I'll try to make it smaller and give it another go, but for now you can tune into the Youtube link that I posted further above to hear an example of what I too am experiencing.
 
Last edited:

Sturmlocke

New Member
Update: I made the video smaller by reducing its video quality. Let's see if it goes through. Will try to attach it to this post right now.
 

Attachments

  • popping after around 3-4 seconds into the video, smallerfilesize, v1 (getrimmt).zip
    320 KB · Views: 18

Sturmlocke

New Member
crackle-sound-obs-visualdipinsoundwave, v1.png

You can actually see the dip in the audio wave when inspecting the audio

I recorded another video where you hear it again in between second 00:05-00:09.

Digging around I found these topics:


The second link (Shotcut) has a video from a person who is experiencing the same thing, but in his case it only happens when he exports the video after editing it in Shotcut. In my case the raw / original video recorded by OBS is where the crackling / popping happens, so it doesn't have anything to do with Shotcut, but could their discussion be of any help in my case? Specifically this part:

"I record at 60fps and use the default frame rate mode which is VFR(variable frame rate)"
"This is almost certainly causing your problem. I suggest to change the frame rate mode to “constant” or “fixed” if that is an option."

Could VFR versus CFR be of relevance here? Does anyone have experience with this in OBS?
 

Attachments

  • crackle inbetween 5-9 seconds, shotcut-supersmall, V3.7z
    791.6 KB · Views: 13
Last edited:

Tuna

Member
First thing i would try to determine whether this happens during capturing or encoding. I don't think variable frame rate or bitrate should affect this. But OBS audio code may still try to resync audio to something. That audio portion in OBS has been culprit of a few things in the past..
 

Sturmlocke

New Member
Hello there Tuna and R@de, sorry for the late reply, some things came in between, and thank you for taking the time! The clicking can't be heard during recording / gameplay and it is only heard afterwards post recording in the original and unmodified video file created by OBS. Also, I gave GPU Screen Recorder a go (https://flathub.org/apps/com.dec05eba.gpu_screen_recorder), and with that app I have absolutely no issues whatsoever when recording using the maximum quality settings. With GPU Screen Recorder audio is top notch and I can actually record in 4k60 at highest quality now, something that I couldn't do with the default OBS settings (simple view) because of constant encoder overload issues (I had to drastically reduce the bitrate etc. manually via advanced view for 4k60 in OBS).

All of this me to believe that it must be something that OBS does differently that is causing the issue. I'll try native OBS this weekend and report back asap. Not sure if I'm remembering this correctly, but I think that I actually already tried this on my previous attempt at fixing this, but I'll give it another shot just to be sure. What baffles me is that I can hear it in other ppls OBS stream and Youtube videos and those guys are all using Windows instead of Linux, so it seems to happen on both systems for some odd reason.
 

Slushee-a

New Member
I was having horrid crackling and delay issues with audio when recording rhythm games, making them unplayable.

I was able to fix this by using Helvum:
I used this routing, where the audio output from the game is fed directly to OBS:
1708870156086.png



Instead of using the default routing, which goes through the audio card first:
1708870098868.png
 
Top