You are not logged in.

#1 2025-04-13 22:22:15

hjk321
Member
Registered: 2025-02-21
Posts: 8

A lag spike in any wine game creates a perpetual audio lag/stutter

I use proton on my arch linux install. What I notice is if there is a lag spike in a game, it permanently screws up the audio. Here's a recent video I posted where you can notice the audio is fine until a lag spike at the loading zone (16:40) and there is crackly audio for the rest of the play session. It only goes away when you restart the game. And this is a MINOR case of what I've been experiencing. On demanding 3D games (Kerbal Space Program, Hitman WOA, etc) a lag spikes can be 200ms+ causing *really* choppy audio. I've seen the whole PULSE_LATENCY_MSEC suggestion online, but my symptoms don't really match what those people are talking about, and I don't think it would address the underlying problem because all that does is increase the buffer a lag spike can consume before the problem becomes evident. In a game with the bigger lag spikes I was talking about, increasing the buffer would only delay the issue for a few extra minutes of playtime. Plus, this issue affects every game to some extent, not just specific games that need tinkering. I bet none-game wine applications would experience the same too if they somehow managed to lag on my rig.

What *should* be happening is the buffer resets or something after a lag spike or adds empty space to the audio buffer if the underlying wine application isn't providing audio. Any ideas?

> pactl info

Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 11303
Tile Size: 65472
User Name: hiram
Host Name: hiram-laptop
Server Name: PulseAudio (on PipeWire 1.4.1)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink
Default Source: alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source
Cookie: e56c:d921

Last edited by hjk321 (2025-04-13 22:23:25)

Offline

#2 2025-04-15 09:10:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,379

Re: A lag spike in any wine game creates a perpetual audio lag/stutter

In general, verify wine is actually running on pulse in the first place, when having "lag spike" what do you get from

pactl list sink-inputs
pw-top

if your wine applications is actually using [alsa-plugin] or so, make sure lib32-libpulse and lib32-libpipewire are installed.

Offline

#3 2025-04-30 04:43:16

hjk321
Member
Registered: 2025-02-21
Posts: 8

Re: A lag spike in any wine game creates a perpetual audio lag/stutter

Sorry for the late response, it took me a while to experience it again.

Sink Input #24876
        Driver: PipeWire
        Owner Module: n/a
        Client: 24875
        Sink: 24773
        Sample Specification: s16le 2ch 48000Hz
        Channel Map: front-left,front-right
        Format: pcm, format.sample_format = "\"s16le\""  format.rate = "48000"  format.channels = "2"  format.channel_map = "\"front-left,front-right\""
        Corked: no
        Mute: no
        Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        Buffer Latency: 0 usec
        Sink Latency: 0 usec
        Resample method: PipeWire
        Properties:
                client.api = "pipewire-pulse"
                pulse.server.type = "unix"
                application.name = "Just Cause 2"
                application.process.id = "323250"
                application.process.user = "hiram"
                application.process.host = "hiram-laptop"
                application.process.binary = "wine-preloader"
                application.language = "en_US.UTF-8"
                window.x11.display = ":1"
                application.process.machine_id = "0bdb797368384d68aeae37a0ffd7ccc6"
                application.process.session_id = "2"
                media.name = "audio stream #1"
                pulse.corked = "false"
                node.rate = "1/48000"
                node.latency = "240/48000"
                stream.is-live = "true"
                node.name = "Just Cause 2"
                node.want-driver = "true"
                node.autoconnect = "true"
                media.class = "Stream/Output/Audio"
                port.group = "stream.0"
                adapt.follower.spa-node = ""
                object.register = "false"
                factory.id = "7"
                clock.quantum-limit = "8192"
                node.loop.name = "data-loop.0"
                library.name = "audioconvert/libspa-audioconvert"
                client.id = "125"
                object.id = "109"
                object.serial = "24876"
                pulse.attr.maxlength = "7680"
                pulse.attr.tlength = "4800"
                pulse.attr.prebuf = "4"
                pulse.attr.minreq = "1920"
                node.driver-id = "44"
                module-stream-restore.id = "sink-input-by-application-name:Just Cause 2"

                
S   29      0      0    ---     ---   ---   ---     0                  Dummy-Driver
S   30      0      0    ---     ---   ---   ---     0                  Freewheel-Driver
S   47      0      0    ---     ---   ---   ---     0                  Midi-Bridge
S   70      0      0    ---     ---   ---   ---     0                  bluez_midi.server
S   77      0      0    ---     ---   ---   ---     0                  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI3__sink
S   53      0      0    ---     ---   ---   ---     0                  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI2__sink
S   55      0      0    ---     ---   ---   ---     0                  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__HDMI1__sink
R   44    128  48000 183.0us   3.3us  0.07  0.00  819    S32LE 2 48000 alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Speaker__sink
R  109    240  48000 126.6us   9.0us  0.05  0.00  1746    S16LE 2 48000  + Just Cause 2
S   51      0      0    ---     ---   ---   ---     0                  alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic2__source
S   64      0      0    ---     ---   ---   ---     0                  alsa_input.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__Mic1__source
S   78      0      0    ---     ---   ---   ---     0                  v4l2_input.pci-0000_00_14.0-usb-0_7_1.0
S   67      0      0    ---     ---   ---   ---     0                  v4l2_input.pci-0000_00_14.0-usb-0_7_1.2

I have those lib32 packages you mentioned installed already. The most information I can glean from here is that the ERR column in pw-top is constantly rising. Some reddit searches shows this is called the "xrun issue" but there's no clear way to fixing it.

Last edited by hjk321 (2025-04-30 15:51:12)

Offline

#4 2025-05-02 15:28:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,379

Re: A lag spike in any wine game creates a perpetual audio lag/stutter

Can you try adding PULSE_LATENCY_MSEC=60 to the corresponding wine invocation and does that help?

Offline

Board footer

Powered by FluxBB