ublue-os / bazzite

Bazzite is a custom image built upon Fedora Atomic Desktops that brings the best of Linux gaming to all of your devices - including your favorite handheld.
https://bazzite.gg
Apache License 2.0
3.5k stars 201 forks source link

Audio stuttering in many games in Gamescope w/ 6700XT #851

Open rayrayrayraydog opened 5 months ago

rayrayrayraydog commented 5 months ago

Describe the bug

I have been using bazzite since before Fedora 39 with this system, and I'm not sure when, but in the last few months the system has developed frequent audio stutters when running games. A number of users with 6700XT's have described similar issues -- in my case the audio just cuts out without any static for just a moment and does so very frequently in many games. Some games are impacted more than others. The stuttering is much more frequent when running games via Gamescope vs. launching them from the desktop. I also run the Kodi Flatpak through Steam in Gamescope and it doesn't ever have any audio stutter.

A few badly impacted games:

What did you expect to happen?

Audio stuttering should not be an issue with this hardware in these lightweight games. I am using the HDMI audio output of the GPU.
I have tried some fixes from some threads in Discord with no noticeable change:

Output of rpm-ostree status

root@gameboi:/home/rayray# rpm-ostree status
State: idle
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:22d963175ca12c3f19e5b6997f2fb7a273dc3451076d3459f950e6e4b3d54561
                  Version: 39.20240302.0 (2024-03-03T02:14:15Z)
          LayeredPackages: fstrcmp libcec libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator
                           tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:22d963175ca12c3f19e5b6997f2fb7a273dc3451076d3459f950e6e4b3d54561
                  Version: 39.20240302.0 (2024-03-03T02:14:15Z)
          LayeredPackages: fstrcmp libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml
                           x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf'

Hardware

System is a custom HTPC running bazzite-deck:

Extra information or context

No response

rayrayrayraydog commented 5 months ago

Update: I found another source online saying that AMD fTPM could be contributing to audio stutter. Tried disabling this with no change.

AmazingMrBrock commented 5 months ago

Also having audio stuttering in the games I'm playing, Dark souls remastered and death stranding.

Bazzite install is fresh on an 3600x/7600xt system.

rayrayrayraydog commented 5 months ago

I tried using a USB sound card instead of the GPU's HDMI audio, and with that there is no stuttering. https://www.amazon.com/dp/B0B9H53KD9 So definitely something going on with the GPU / snd_hda_intel module. A solution that doesn't require additional hardware is ideal so I will keep testing this as the system receives updates.

Akruidenberg commented 5 months ago

I have the same problem. With chimeraos, i dont have this issue.

Ryzen 7600 Rx 7800 xt

nayrxoc commented 5 months ago

I also have this issue under any load (games, compute) cpu: r5 3600 gpu: rx5700 ram: 32gb 3600mhz

HikariKnight commented 5 months ago

Check if it is a scheduler bug sudo systemctl disable com.system76.Scheduler.service and reboot to reset everything the scheduler has done. if you still experience stuttering please re-enable the system76-scheduler again (swap out disable with enable --now)

no matter the result though, please report back here. Thanks

Akruidenberg commented 5 months ago

@HikariKnight did some testing, but the problem still exist. The same with system76 disabled.

KyleGospo commented 5 months ago

If you're using HDMI audio, this is unfortunately a known issue with one of the various HDR patches. I suspect this will be resolved shortly with the launch of Fedora 40 and kernel 6.8 and will update this issue as builds of that come online.

Akruidenberg commented 5 months ago

I do playing over hdmi, but not HDR. I have a hdr tv, but it will flickering when enabled.

rayrayrayraydog commented 5 months ago

If you're using HDMI audio, this is unfortunately a known issue with one of the various HDR patches. I suspect this will be resolved shortly with the launch of Fedora 40 and kernel 6.8 and will update this issue as builds of that come online.

I don't play with HDR enabled. Should that matter?

HikariKnight commented 5 months ago

@HikariKnight did some testing, but the problem still exist. The same with system76 disabled.

thanks for testing, i have had some cases where the scheduler was causing some audio issues on my threadripper under some cpu loads so was worth checking :) Kyle already mentioned the cause though

nayrxoc commented 5 months ago

hey just to check back in on this, I tried doing the system76 idea to no avail and looked around the internet for this issue in pipewire what fixed it for me was increasing default.clock.min-quantum in pipewire.conf from 64 to 1024 as described in this https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PipeWire#configuration-file-pipewireconf

don't know if this is the same reason as others, but in my instance this helped :3

rayrayrayraydog commented 5 months ago

default.clock.min-quantum

I've searched through all the pipewire.conf files I can find on my system ... they all seem to set this to 1024 already. Where did you update it exactly?

nayrxoc commented 5 months ago

default.clock.min-quantum

I've searched through all the pipewire.conf files I can find on my system ... they all seem to set this to 1024 already. Where did you update it exactly?

the link I sent has instructions for where it is "The PipeWire configuration template file is located in /usr/share/pipewire/pipewire.conf. You can copy and edit the file to /etc/pipewire/ or ~/.config/pipewire/pipewire.conf" That file won't exist so you will have to make it, for me I even had to make /.config/pipewire itself

if its already 1024 for you, it may be a separate issue then though

Akruidenberg commented 5 months ago

Strange enough, i have also stutters when using a bluetooth headphone.

KyleGospo commented 5 months ago

If you could update and try again I would appreciate it. May be fixed in the latest build.

rayrayrayraydog commented 4 months ago

If you could update and try again I would appreciate it. May be fixed in the latest build.

Just gave it a whirl. There is a definite improvement now, but the issue is still there. In What the Golf the stuttering is much less frequent, enough that I had to play for a few minutes to hear it happen two or three times. In PowerWash Simulator though it still happens pretty frequently, especially when holding down the trigger and getting a lot of noise from the sprayer.

I had also tried the pipewire.conf changes earlier (copied /usr/share/pipewire/pipewire.conf to /etc/pipewire/pipewire.conf|~/.config/pipewire/pipewire.conf, and set default.clock.min-quantum on line 32 to 1024 and rebooted). I didn't notice any significant change with this one.

rayray@gameboi:~$ sudo rpm-ostree status
State: idle
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:79d763a11d2c16957bfb18cc1129bc9ec62b23909ad37f42ce94996eeacb00e9
                  Version: 39.20240323.0 (2024-03-24T06:07:55Z)
          LayeredPackages: fstrcmp libcec libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:79d763a11d2c16957bfb18cc1129bc9ec62b23909ad37f42ce94996eeacb00e9
                  Version: 39.20240323.0 (2024-03-24T06:07:55Z)
          LayeredPackages: fstrcmp libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:0a2204f5a96e9eb14affec41d09cf6035777626d190bfaabb9de48c954aca0f5
                  Version: 39.20240311.0 (2024-03-12T08:05:37Z)
          LayeredPackages: fstrcmp libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 
                   Pinned: yes
Akruidenberg commented 4 months ago

Is this fixed with version 2.5.0?

rayrayrayraydog commented 3 months ago

My machine pulled down a Fedora 40 image today so I tried this again, same result. There is still audio stuttering in the games I listed.

rayray@gameboi:~$ neofetch
                                            rayray@gameboi
     %%%%%%====%%%%%%%%%%                
   %%%%%%%%    %%%%%%%%%%%%%%             󱋩  bazzite-deck:main 
  %%%%%%%%%    %%%%%%%%%%%%%%%%           󰣛  Fedora Linux 40 (Kinoite) x86_64
  %%%%%%%%%    %%%%%%%%%%%%%%%###           Linux 6.8.7-301.fsync.fc40.x86_64
  %%%%%%%%%    %%%%%%%%%%%%%######        󰅐  4 mins
  ==                  =======######      
  ==                  =========#####      󰾰  B550M PG Riptide
  %%%%%%%%%    %%%%%%%####======#####     󰻠  AMD Ryzen 5 5600 (12) @ 4.47 GHz
  %%%%%%%%%    %%%%%#######=====#####     󰍛  AMD Radeon RX 6700 XT
  %%%%%%%%%    %%%#########=====#####       4.31 GiB / 31.26 GiB (14%)
  %%%%%%%%%    %%##########=====#####       1.02 TiB / 1.86 TiB (55%) - btrfs [Read-only]
  %%%%%%%%%====###########=====######     󰍹  3840x2160 @ 60Hz [External]
   %%%%%%%%====#########======######      󰖺  ASRock LED Controller
    %%%%%%%=====#####========######      
     %%%%###===============#######          bash 5.2.26
      %#######==========#########           /dev/pts/0
        #######################           󰏖  2661 (rpm), 54 (flatpak-system), 24 (flatpak-user)
          ###################            
              ###########                  ● ● ● ● ● ● ● ● 
rayray@gameboi:~$ 
rayray@gameboi:~$ 
rayray@gameboi:~$ sudo rpm-ostree status
State: idle
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:a08c542ed755d55ce02d062f7bc43e1cba6c7e44f16b6db05c67f2de63755af2
                  Version: main (2024-04-24T17:03:19Z)
          LayeredPackages: fstrcmp libmicrohttpd monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:f87d5dd11724f35cf8f47a1d22e38777d22160412737ad8d8a288fe23758eb1d
                  Version: 39.20240419.0 (2024-04-19T17:09:55Z)
          LayeredPackages: fstrcmp libcec libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml
                           x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:0a2204f5a96e9eb14affec41d09cf6035777626d190bfaabb9de48c954aca0f5
                  Version: 39.20240311.0 (2024-03-12T08:05:37Z)
          LayeredPackages: fstrcmp libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml
                           x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 
                   Pinned: yes
rayray@gameboi:~$ uname -a
Linux gameboi 6.8.7-301.fsync.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 23 17:32:01 UTC 2024 x86_64 GNU/Linux
Akruidenberg commented 3 months ago

@rayrayrayraydog Thanks. I will stay with chimeraos.

rayrayrayraydog commented 3 months ago

It would be great to hear from any other users that had the issue as well. It's possible that I've modified something, somewhere that is allowing this to continue happening and I've also layered several packages. I may try reinstalling from scratch to see if it continues with a fresh system.

adms-hu commented 3 months ago

I have the same issue with Red Dead Redemption 2. I also ended up using an USB soundcard (Creative sound blaster HD) which is a great workaround. I used the motherboards audio directly which also produced crackling, and my airpods pro never crackle but skips as you described. However I only tried out this game and Tomb Romb Raider 2013. TR did not have any issues but I played only 30 minutes with that. I'll try more and come back with more infos.

RDR2 also tends to stutter and crackle on Windows too.

My other issue with 6700XT is Blender not showing up HIP rendering. If you've got some time @rayrayrayraydog can you please try it out? Probably we have similar systems.

rayrayrayraydog commented 3 months ago

Tried again with today's update in Power Wash Simulator. No change yet.

rayray@gameboi:~$ rpm-ostree status
State: idle
Deployments:
● ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:c375c636bb771c9978170087e2e0b1731ac7748ea0f34a84a42ba37b1386abfc
                  Version: 40.20240501.0 (2024-05-02T07:13:49Z)
          LayeredPackages: fstrcmp libcec libmicrohttpd monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:c375c636bb771c9978170087e2e0b1731ac7748ea0f34a84a42ba37b1386abfc
                  Version: 40.20240501.0 (2024-05-02T07:13:49Z)
          LayeredPackages: fstrcmp libmicrohttpd monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 

  ostree-image-signed:docker://ghcr.io/ublue-os/bazzite-deck:latest
                   Digest: sha256:0a2204f5a96e9eb14affec41d09cf6035777626d190bfaabb9de48c954aca0f5
                  Version: 39.20240311.0 (2024-03-12T08:05:37Z)
          LayeredPackages: fstrcmp libmicrohttpd libnfs lirc-libs monitor-edid pcre-cpp perl-Switch shairplay-libs strace terminator tinyxml x2goserver
                Initramfs: '-I /etc/crypttab /etc/modprobe.d/amdgpu.conf /etc/modprobe.d/deck-blacklist.conf' 
                   Pinned: yes
adms-hu commented 3 months ago

Since I had issues with HIP rendering too so I tried out ChimeraOS as an alternative. No crackling at all. Bazzite have much more goodies pre-installed I assume one of those causing this. I don't even have Decky now, but I plan to install that later. Does HIP work for you?

lukasgierth commented 3 months ago

Wanna report the same thing with a RX6600, happened with:

@KyleGospo

If you're using HDMI audio, this is unfortunately a known issue with one of the various HDR patches. I suspect this will be resolved shortly with the launch of Fedora 40 and kernel 6.8 and will update this issue as builds of that come online.

Can you link the root issue bug/discussion for this?

Edit: And yes, this seems to be the issue for me with the HDMI audio driver. Put a Fiio E10k USB DAC between my box and the receiver: No audio problems

al12gamer commented 3 months ago

Here to report the same thing happening with a Ryzen 5 3600 and RX5700XT. In ChimeraOS this was never an issue. Every game I've played I've noticed this in: see S31bz on Steam for examples

al12gamer commented 3 months ago

Hmm Diablo IV and Risk of Rain Returns seem to suffer less

al12gamer commented 3 months ago

Update here. Diablo IV only has crackling every so often, but Rocket League, Risk of Rain Returns, Fall Guys (proton ge) and the various other games I tend to play with friends from time to time seem to still be suffering crackling. When the Diablo IV crackling happens, sometimes the audio to the sound bar will just completely stop for a few seconds and then come back. Matt H mentioned here that I should grab more logs for this, so I will the next time I run my Steam Machine that previously worked flawlessly with ChimeraOS. Anything I should look out for in the logs, specifically? @KyleGospo

jonnypanic commented 2 months ago

I have this issue too using a 6750xt, with hdmi out to my 4KTV in game mode.

Hi-Fi Rush has skipping audio, it really kills the fun. Haven't tried desktop, or my monitor, or other audio outputs, or many other games yet. Will investigate when I have time.

Edit:

Yeah, it only happens on TV with hdmi audio. In many games. Switching audio stops the stuttering.

al12gamer commented 2 months ago

Would just like to note this is still happening both on a GPD Win Mini 7840U running Bazzite as well as the following living room "Steam Machine" outputting audio over HDMI from a 5700XT: https://pcpartpicker.com/list/2x28hk

Akruidenberg commented 2 months ago

Is there a way to help get this fixed? Would love to replace Chimeraos with Bazzite, but the sound proble mens makes it unusable for me....

LuanVSO commented 1 month ago

I was was having a lot of crackling on Fedora 40, changed api.alsa.headroom to 2048 as suggested here and it got better for apps that set the quantum to ~512-1024 but it still has a lot of crackling for lower quantum apps like scrcpy (128 quantum)

Akruidenberg commented 1 month ago

Version 3.5.0 is released! Are the issues fixed?

rayrayrayraydog commented 1 month ago

Just fired up What the Golf to test it out on 3.5.0. No changes for me -- still stutters.

al12gamer commented 1 month ago

Fired up Rocket League and then Streets of Rogue on my aforementioned Steam Machine build in Bazzite 3.5.0...looks like at least those two games are running fine now?

rayrayrayraydog commented 1 month ago

For me the stuttering became a lot less frequent after an earlier bazzite update. No noticeable change with 3.5.0. Would love to hear from more users that had the issue in the past and are able to test on 3.5.0.

joeblack2k commented 1 month ago

Just installed Bazzite came from Holoiso

  1. stutters every 2min or so (Killer Instinct)
  2. AMD 6950XT
  3. All updates
LuanVSO commented 1 month ago

I finaly figured out this problem on my system,the root cause was a high irq latency caused by either the i2c bus or the rgb controller on my ram (probably the ram but not 100% sure). After disabling the support for my ram on openrgb my audio is solid no matter the uptime of my system

Specs in case anyone else is having a similar issue:

KyleGospo commented 1 month ago

I finaly figured out this problem on my system,the root cause was a high irq latency caused by either the i2c bus or the rgb controller on my ram (probably the ram but not 100% sure). After disabling the support for my ram on openrgb my audio is solid no matter the uptime of my system

Kudos to you for figuring that out, holy hell

Nadonate commented 1 month ago

I was also experiencing weird drops, or cut-outs (once every 20-30 seconds) with my 6700xt.

The issue for me ended up being the HDMI cable. After exhausting every other possible googable solution, I decided to buy a jsaux DP to HDMI cable:

https://a.co/d/98UOAvt

My previous cable was straight HDMI 2.1 cable, so im not sure if it was a bandwidth problem with the cable, or switching to a display port from the GPU.

Just thought I would drop this here as another possible solution.

My HTPC hardware:

rayrayrayraydog commented 1 month ago

If everyone feels that this comes down to cabling or BIOS config issues with individual systems, I'm fine with closing this ticket. The only odd thing is that some people here stated it didn't occur when using another distro. I did not test that myself.

lukasgierth commented 1 month ago

I am against closing this. I tried the DP-HDMI adapter route but that didnt change anything. Which makes sense since it should (?) use the same audio driver to put audio through the video card. (RX6600 in my case)

Using an USB audio card completely fixes it, which in my opinion means that its a problem with the driver which puts the audio through the video card (most likely caused by one of the still needed HDR patches) (which Bazzite uses and chimeros maybe doesnt? Am not familiar enough with that to know it for sure).

al12gamer commented 1 month ago

the driver which puts the audio through the video card (most likely caused by one of the still needed HDR patches) (which Bazzite uses and chimeros maybe doesnt? Am not familiar enough with that to know it for sure).

Yeah, I'd agree there. ChimeraOS must be using a different driver, as changing my own cable has had no results and yet ChimeraOS audio is solid while nearly half the time Bazzite still crackles and has issues

austonpramodh commented 2 weeks ago

I tried the DP-HDMI route after HDMI had crackling issues. Didn't work for me either, I tried default.clock.min-quantum thingy too, Not sure if the config file is on right path, its at ~/.config/pipewire/pipewire.conf

So not sure whats wrong, I might try Chimera soon and report back if I do.

[Update] I did test it out on Chimera OS, Seems like for me its worse. Especially after sleep and wake(No HDR). Bazzite wasn't this bad. Hope this gets fixed. Happy to test out anything if anyone has any suggestions

rlac commented 2 weeks ago

Of the games I've noticed brief audio dropouts in, the worst has been TMNT Shredder's Revenge; more demanding games are either not affected or it occurs much less frequently. Turning off the game mode frame rate limiter reduced it significantly in Shredder's Revenge, though it still happens frequently (once every 30-60 seconds or so). Hardware is RX 6600 + i3 12100f.

KyleGospo commented 2 weeks ago

Those of you on the -deck image still suffering audio issues, can you please try the latest :testing and let me know if things are any better?

austonpramodh commented 2 weeks ago

I did a quick test on Far Cry 5, Seems like it's resolved. I will test more games later on.

It happens when the PC is suspended and playing games after waking it up. This could be due to the GPU driver issue, For some reason, VRAM gets locked to 96mhz. But other than that I don't see Audio issues after normal restart. I'll keep an eye though.

Thank you, I appreciate it.

dnkmmr69420 commented 2 weeks ago

has been happening in No Mans Sky

yodatak commented 2 weeks ago

Hello maybe its linked yo this

https://www.phoronix.com/news/AMD-HDMI-Audio-Fix-Linux-6.11

dnkmmr69420 commented 1 week ago

Hello maybe its linked yo this

https://www.phoronix.com/news/AMD-HDMI-Audio-Fix-Linux-6.11

that's good to hear