You are not logged in.

#1 2024-04-05 11:18:22

thunderphenol
Member
Registered: 2024-03-31
Posts: 4

Audio issues when playing games (Popping and crackling)

Background:
Having been a windows user for a very long time, I got fed up with it and installed arch (No regrets). There were a few other factors in the decision too but I did have a bit of experience using linux (Which is why I was sure I wanted to switch). I have had pretty much no trouble getting things to work properly and configuring stuff to my liking. However, I have been unable to resolve this issue that pops up after a game has been running for 2-3 minutes and makes it hard to hear much.

Symptoms:
- Issue happens after 2-3 minutes of gameplay, where the first 2-3 minutes are perfect but then game audio starts to devolve into a mess with popping and crackling.
- Issue transfers over to over applications that are also playing sounds such as VLC or Discord. This can happen to the point where VLC will stop playing for about a second or audio will be distorted. Issue is present regardless of VLC and Discord however.
- In pw-top, ALSA audio_output.pci shows ERR 15 while crackling is present. Other applications such as VLC or game audio do not display such errors.

Here is pw-top with crackling actively present: https://imgur.com/W51MABC
pw-top with crackling minimal (though the game is still running): https://imgur.com/u4bzluQ

Audio configuration:
I believe I am running pipewire-pulse with wireplumber. Previously I was using pipewire-media-session, but issue started there. So I upgraded to wireplumber.
This is proof that these are running:

$ systemctl --user | grep pipewire 
pipewire-pulse.service              loaded active running   PipeWire PulseAudio
pipewire.service                   loaded active running   PipeWire Multimedia Service 
pipewire-pulse.socket               loaded active running   PipeWire PulseAudio
pipewire.socket                    loaded active running   PipeWire Multimedia System Sockets 

When inspecting the status of pipewire and pipewire-pulse, it says that both .service locations are disabled but that presets are enabled and the services are active (Audio for the most part also works perfectly).
All versions are up to date on version 1.0.4-4.

$ systemctl --user | grep wireplumber 
 wireplumber.service                  loaded active running   Multimedia Service Session Manager 

Version is up to date on 0.5.1-1.

Here is also a picture of the audio section of inxi -F: https://imgur.com/AxseX0q

Stuff I have tried already:
Here: https://bbs.archlinux.org/viewtopic.php?id=283324. Configured PAM limits by installing rtkit (active and running on version: 0.13-2) and adding my user to the realtime group.
Here: https://wiki.archlinux.org/title/Profes … figuration. Only the configuring RTC interrupt frequency. Tried to also setup a custom service for this so it would run on boot but failed in doing so. The other options seemed to have an increased likelihood to break other applications.
The temporary solution described here: https://gitlab.freedesktop.org/pipewire … ssues/3198. Which describes limiting pipewire quantum limits to 2048, though that had no effect on me.
Here: https://wiki.archlinux.org/title/PipeWi … g_playback. Creating a new configuration file to overwrite the current one in wireplumber.
Here: https://bbs.archlinux.org/viewtopic.php?id=120162. Installed pavucontrol but issue still persists.

I also tried to recreate sound breaking down under load by running an all core exercise on the cpu via sysbench however, audio worked perfectly fine though.

Suspicions:
It could probably be the incompatibility/fault with the sound card. But wouldn't this occur consistently regardless of load?
It could be a problem with ALSA, but again, why under load?

Thanks for taking the time to read this. It seems to me that I have ran out of options and the only ones that are left is to reinstall pipewire or switch to JACK or pulseaudio. Though I am quite cautious about doing that, as I have managed to break gui once already and I would rather not have a repeat of that XD (Was an easy fix though).

Last edited by thunderphenol (2024-04-05 12:45:22)

Offline

#2 2024-04-05 14:04:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: Audio issues when playing games (Popping and crackling)

Does the game matter? Is this limited to something specific (which game)? Try launching the game in question with e.g.

PULSE_LATENCY_MSEC=30 %command%

write this as is if using steam launch options, replace %command% with the actual executable name if not via steam.

Offline

#3 2024-04-05 15:12:45

thunderphenol
Member
Registered: 2024-03-31
Posts: 4

Re: Audio issues when playing games (Popping and crackling)

Yes the game matters, here is a list ill update as I test more games
Games that run with no sound issue:
Counter Strike 2
Lethal Company

Games with the issue:
War Thunder (native client)
Content Warning
Crab Champions
Team Fortress 2 (inconsistent)

As for the command, I pasted it into steam launch options and it was able to make the issue appear around 1-2 mins later. So it alleviates some of the symptoms but the root cause still remains unsolved.
What does the command itself do in relation to the audio? Does it change the latency settings on the PulseAudio server that sits on top of Pipewire? If so, would setting the pulse.properties settings to a higher amount fix it?
I went ahead and tried it with 60 aswell, it does not seemed to have changed much though unfortunately.

Thanks for the help!

Edit: I just did a reboot and all sound is completely gone now. Did a last pw-top before reboot, ALSA.pci_output had about 183 ERRs. Now instead of ALSA.pci_output, there is auto_null (Image: kIHusuY.png.
ALSA seems to be completely dead.

 [thunderphenol@arch ~]$ systemctl status alsa-state
○ alsa-state.service - Manage Sound Card State (restore and store)
     Loaded: loaded (/usr/lib/systemd/system/alsa-state.service; static)
     Active: inactive (dead)
[thunderphenol@arch ~]$ systemctl status alsa-restore
○ alsa-restore.service - Save/Restore Sound Card State
     Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static)
     Active: inactive (dead)

Last edited by thunderphenol (2024-04-06 13:12:34)

Offline

#4 2024-04-05 16:37:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,754

Re: Audio issues when playing games (Popping and crackling)

These two services are somewhat irrelevant for the majority of cases especially concerning pipewire, and only concern themselves with how the volumes are handled on an ALSA level (which pipewire will override itself again anyway)

What do you get from

sudo fuser -v /dev/snd/*
systemctl --user status pipewire{,-pulse} wireplumber

Offline

#5 2024-04-05 16:51:35

thunderphenol
Member
Registered: 2024-03-31
Posts: 4

Re: Audio issues when playing games (Popping and crackling)

V1del wrote:

What do you get from

sudo fuser -v /dev/snd/* 

output (with alsa running as before):

$ sudo fuser -v /dev/snd/*
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  thunderphenol   1526 F.... wireplumber
/dev/snd/controlC1:  thunderphenol   1525 F.... pipewire
                     thunderphenol   1526 F.... wireplumber
/dev/snd/pcmC1D0p:   thunderphenol   1525 F...m pipewire
/dev/snd/seq:        thunderphenol   1525 F.... pipewire
V1del wrote:
 systemctl --user status pipewire{,-pulse} wireplumber

output (with alsa running as before):

$ systemctl --user status pipewire{,-pulse} wireplumber
● pipewire.service - PipeWire Multimedia Service
     Loaded: loaded (/usr/lib/systemd/user/pipewire.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-04-06 04:31:29 UTC; 1h 38min ago
TriggeredBy: ● pipewire.socket
   Main PID: 1525 (pipewire)
      Tasks: 2 (limit: 38027)
     Memory: 11.1M (peak: 12.5M)
        CPU: 17.020s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire.service
             └─1525 /usr/bin/pipewire

Apr 06 04:31:29 arch systemd[1513]: Started PipeWire Multimedia Service.

● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/usr/lib/systemd/user/pipewire-pulse.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-04-06 04:31:29 UTC; 1h 38min ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 1528 (pipewire-pulse)
      Tasks: 2 (limit: 38027)
     Memory: 21.7M (peak: 22.7M)
        CPU: 26.362s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─1528 /usr/bin/pipewire-pulse

Apr 06 04:31:29 arch systemd[1513]: Started PipeWire PulseAudio.

● wireplumber.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/wireplumber.service; enabled; preset: enabled)
     Active: active (running) since Sat 2024-04-06 04:31:29 UTC; 1h 38min ago
   Main PID: 1526 (wireplumber)
      Tasks: 6 (limit: 38027)
     Memory: 7.5M (peak: 9.4M)
        CPU: 588ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/wireplumber.service
             └─1526 /usr/bin/wireplumber

Apr 06 04:31:29 arch systemd[1513]: Started Multimedia Service Session Manager.
Apr 06 04:31:29 arch wireplumber[1526]: g_strrstr_len: assertion 'haystack != NULL' failed
Apr 06 04:31:29 arch wireplumber[1526]: 0x570636a4a8d0: no modules loaded from context.modules
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.829556606] [1526] ERROR IPAModule ipa_module.cpp:172 Symbol ipaModuleInfo not found
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.829565204] [1526] ERROR IPAModule ipa_module.cpp:292 v4l2-compat.so: IPA module has no valid info
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.829577293] [1526]  INFO Camera camera_manager.cpp:284 libcamera v0.2.0
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.830468531] [1551] ERROR MediaDevice media_device.cpp:483 /dev/media0[]: Failed to open media device at /dev/media0: Permission denied
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.830485739] [1551]  INFO DeviceEnumerator device_enumerator.cpp:224 Unable to populate media device /dev/media0 (Permission denied), skipping
Apr 06 04:31:29 arch wireplumber[1526]: [0:01:16.830491249] [1551]  WARN DeviceEnumerator device_enumerator_udev.cpp:174 Failed to add device for '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/media0', skipping
Apr 06 04:31:31 arch wireplumber[1526]: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner

Last edited by thunderphenol (2024-04-06 06:27:19)

Offline

#6 2024-04-05 19:09:30

thunderphenol
Member
Registered: 2024-03-31
Posts: 4

Re: Audio issues when playing games (Popping and crackling)

The ALSA sound card issue seems to be unrelated to the original issue sorry. I was trying this earlier https://bbs.archlinux.org/viewtopic.php?id=274306 in an attempt to get rid of static noise after playback. While it did work, seems like I messed up the audio driver.

Apr 05 18:22:30 arch kernel: snd_hda_intel: `' invalid for parameter `power_save'
Apr 05 18:22:30 arch kernel: snd_hda_intel: unknown parameter '=' ignored
Apr 05 18:22:30 arch kernel: snd_hda_intel: unknown parameter '0' ignored 

Edit: I fixed alsa not booting

Temporary solution: as I was on a laptop, I did not take into account thermal management. Normally at these temps windows used to work fine but here at around 70-80C the audio starts to produce crackling and popping (Gathered via psensor). Thankfully I am on an asus laptop, so installing asusctl (rog-control-center for GUI) and configuring fan curves to be steeper helped cool everything down considerably and I rarely get popping and crackling now and even then, its significantly lower in severity.

Last edited by thunderphenol (2024-04-09 12:11:20)

Offline

Board footer

Powered by FluxBB