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
58.84k stars 7.83k forks source link

Audio crackling / popping on Linux when recording gameplay for Youtube #10110

Closed Sturmlocke86 closed 7 months ago

Sturmlocke86 commented 8 months ago

Operating System Info

Other

Other OS

openSUSE Leap 15.5

OBS Studio Version

30.0.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/UXOKHBdK4h2nKc92

OBS Studio Crash Log URL

No response

Expected Behavior

I expected to record gameplay videos without the sound crackling / popping randomly every now and then. It doesn't happen often, but when it does, it is really disturbing when recording relaxing videos where the viewer is supposed to relax to the game sounds and music.

Current Behavior

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:

  1. switch from 48khz to 41khz in obs audio settings
  2. disable desktop audio and other sound sources
  3. reduce recording quality from indistinguishable to high and medium via simple settings menu
  4. change audio codec from acc to opus in obs audio settings and tried both with 48/41khz
  5. create separate scene for sound source tapping into the dedicated xonar soundcard
  6. reduce rec gameplay audio in obs to -10db
  7. turn off video preview window in obs
  8. power profile in Gnome settings is set to maximum performance
  9. nvidia powermizer settings are set to maximum performance
  10. tried with and without gamemode %command% for the games that I want to record on Steam
  11. switch the default audio plugin within the operating system from Pulseaudio (default) to pulseaudio-on-pipewire
  12. switch from nvenc h264 to nvenc h265 recording
  13. set PULSE_LATENCY_MSEC=60 %command% for affected Steam games
  14. 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)
  15. set priority of the games and obs to very high in task manager
  16. pulseaudio-pipewire priority is already set to very high in task manager by default

Plugins & filters used:

  1. Linux Vulkan/OpenGL game capture (obs-vkcapture)
  2. 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:

  1. 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?
  2. 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
  3. haven't tested with native OBS yet (using Flatpak for now)
  4. 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 - many which are using Windows with OBS. This is merely one example - but there are many 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 plus a video to showcase the issue will be attached to this post.

popping after around 3-4 seconds into the video, smallerfilesize, v1 (getrimmt).zip

obs simple settings, example4forum, v1 obs simple settings, example4forum, v2 obs simple settings, example4forum, v3 obs simple settings, example4forum, v4

2024-01-15 18-08-27.txt 2024-01-15 18-11-58.txt 2024-01-15 18-21-50.txt

Steps to Reproduce

  1. Launch OBS and game from Steam (via Proton) -> all Flatpak
  2. Try to record gameplay
  3. Record around 10-15 minutes of gameplay ideally with some game music
  4. Listen very closely to the recorded material and try to find the spots where the audio crackles or pops randomly
  5. Check the video I attached further above via .zip or check the Youtube link in the post further above for another example ...

Anything else we should know?

Forum post here: https://obsproject.com/forum/threads/audio-crackling-popping-on-linux-obs-steam-proton-gameplay-rec-for-yt.172516/

gxalpha commented 7 months ago

This issue appears to be a support request, for which we don't use GitHub Issues. Please make sure to visit the support sections on our Discord server or Forums.

Thank you!