#(Linux) Choppy Audio on Hyprland / PipeWire

1 messages · Page 1 of 1 (latest)

spice ore
#

Hello everyone,
I just made the full switch from Windows to Arch Linux, and I went with Hyprland for my window manager, because it's trendy and flashy and all that. I've been getting up and running with my usual games and apps, and with YARG I've been experiencing audio that seems to lag and stutter. The game seems to be running at full speed otherwise. I've run the game with and without Gamescope (if that matters for anything) via the AppImage and from the AUR and the issue persists. Does anyone know what might be going on? I can post a list of relevant installed packages and any logs if need be. Thanks!

#

I was previously having no sound at all, but I was reading through some issues on the github repo and someone said that installing pipewire-alsa fixes that, and it did, but like I said, it's not the same as it was on windows. Everything else I've tried so far seems to be working, though.

#

I've also just learned that it does not transmit audio through a discord screen share, while everything else I've tried does.

spice ore
#

I've done a little bit more digging. seems like it might be something to do with the sample rate / alsa. YARG likes to run at 44.1khz, whereas my headphones are 48khz, but I haven't found a good way to force either alsa or YARG to run at 48khz or for YARG to just not use ALSA altogether
sooo I'm still not totally sure how to fix this lol

spice ore
#

Still having the same problem. I think I was able to change the “quant” amount through either alsa or wireplumber (can’t remember rn) and that would change the rate of the choppiness, but I couldn’t change the sample rate. I also tried removing pipewire-alsa outright but that just broke the audio entirely

spice ore
#

experienced something very fascinating just a moment ago. had the game running and copied my songs from one drive to another, thinking something about the file system of the drive with the game and the one with the songs being different was causing the issues. I don't think that was the problem, but as I was copying them over, the audio smoothed out to the point where I couldn't tell if it was stuttering anymore. it went back to being bad after the copy ended, but still, an interesting finding.

manic saffron
#

Hey ! Just wanted to see if you ever resolved this as I think I'm having the same issue 🙃

spice ore
#

I’d still love to hear an actual fix / explanation but for the time being the game is playable. I’m still 99% sure it’s something to do with the game using pulseaudio vs pipewire, but I’m not an expert in Linux audio lol

manic saffron
spice ore
#

Just make sure you don’t use the launcher, because that doesn’t work with wine / proton rn

manic saffron
#

Yeah, I'm pretty confident about that too since I couldn't get any audio to run until I installed pulse

spice ore
#

But yeah. It picked up both a Wii guitar and a CRKD guitar just fine

spice ore
#

Or whatever it’s called

manic saffron
#

That's been the easiest bit thh! I was expecting it to be a pita to get any peripherals working bc I can't even get Linux to see a Webcam, but no my instruments plug and play just fine!

manic saffron
# spice ore Pipewire-pulse, right?

You'd think but no! Even with all the pulse-pipewire stuff set up (afaik) correctly yarg would have none of it until I installed original pulse instead

#

Once it had worked once I could get it working again using pipewire, but just with the jankiness from misaligned buffering or whatever it is

spice ore
#

libpulse or the main pulseaudio package? Not that I’m entirely sure it matters

manic saffron
#

The main pulse audio package, libpulse didn't help

#

Yeah I don't think it's gonna help us trouble shoot it any, but maybe it will help if anyone decides to update the game to work natively on Linux in future

#

Can I dm you later if I get work out how to get yarg running through wine/pulse without launcher by myself?

spice ore
#

Sorry for the late reply

timid bear
#

i was having similar issues with Ubuntu, and other minor things , i ended up giving up on my yarg linux build 🙁

manic saffron
chrome mountain
#

The audio library YARG uses uses ALSA, so it should work with anything that has ALSA compatibility

manic saffron
spice ore
#

likewise. there are probably other programs on my computer using alsa in the backend, but the only one I've run into audio issues with is yarg (sadly). if there's like diagnostic info or something that would be helpful to have let me know

manic saffron
#

Update, even running through through proton l still have the sound issues so I don't even know anymore 🙃🙃🙃

chrome mountain
#

I don't think it was mentioned in this thread, so I'll relay that it could be a sample rate thing. YARG always uses 44.1KHz and apparently sometimes OS/sound server resampling doesn't go well if your output device is running at 48KHz or whatever...

manic saffron
#

Hmmm, do you know what to do about that?

chrome mountain
#

some audio devices allow different output sample rates, so if you can switch it to 44.1KHz it might help..as for how to do that I've no idea, I quit using desktop linux around the time pulseaudio was first becoming a thing lol

manic saffron
#

I'll see how that goes, thanks

manic saffron
silent cipher
#

This might be fixed in latest nightly

serene dragon
silent cipher
#

@serene dragon can you run these commands and tell me the output:

pw-metadata -n settings

and

find ~/.config/pipewire/ /etc/pipewire/ -type f 2>/dev/null
serene dragon
# silent cipher <@937002168374927390> can you run these commands and tell me the output: ``` pw...
update: id:0 key:'log.level' value:'2' type:''
update: id:0 key:'clock.rate' value:'48000' type:''
update: id:0 key:'clock.allowed-rates' value:'[ 48000 ]' type:''
update: id:0 key:'clock.quantum' value:'1024' type:''
update: id:0 key:'clock.min-quantum' value:'32' type:''
update: id:0 key:'clock.max-quantum' value:'2048' type:''
update: id:0 key:'clock.force-quantum' value:'0' type:''
update: id:0 key:'clock.force-rate' value:'0' type:''```

And no output on the second
silent cipher
#

ok well your settings look like defaults, same as mine so I guess that's not the issue HyperThinkRotate

serene dragon
#

I had already assumed so, but just to be sure i tested latest stable as well, but same choppy audio issue there. At least proton works just fine for now

silent cipher
#

Thank you for testing! Are you on cachyOS?

#

I'll probably have to install and arch distro and see if I can reproduce the issue

serene dragon
#

Its a regular arch install, not cachy. Although if i would ever do a reinstall, i would probably chose cachy over custom lol

silent cipher
#

do you get choppy audio + the audio is played like 50% speed? or just choppy audio at normal speed running on arch (no proton)

#

@serene dragon when you get a chance can you run pacman -Qs "-alsa" for me?

I'm running cachyOS and able to repro the choppiness, I think I might be onto a solution

serene dragon
#

Full speed, just choppy. That command doesnt work, says unknown option -- a, however pacman -Qs alsa gives me

    Low-latency audio/video router and processor - ALSA card profiles
local/alsa-lib 1.2.15.3-2
    An alternative implementation of Linux sound support
local/alsa-plugins 1:1.2.12-5
    Additional ALSA plugins
local/alsa-topology-conf 1.2.5.1-4
    ALSA topology configuration files
local/alsa-ucm-conf 1.2.15.3-1
    ALSA Use Case Manager configuration (and topologies)
local/alsa-utils 1.2.15.2-2
    Advanced Linux Sound Architecture - Utilities
local/lib32-alsa-lib 1.2.15.3-1
    An alternative implementation of Linux sound support (32 bit)
local/lib32-alsa-plugins 1.2.12-1
    Additional ALSA plugins (32-bit)
local/pipewire-alsa 1:1.6.5-1
    Low-latency audio/video router and processor - ALSA configuration
local/vlc-plugin-alsa 3.0.22-4
    Free and open source cross-platform multimedia player and framework - ALSA plugins``` if that helps
silent cipher
#

how choppy is it, like super choppy (helicopter sound) or occasional blips? I really appreciate you helping debug

serene dragon
#

occasional blips. Like, not ear hurting choppy, but definitely not nice. And for sure, no problem. Least i can do for how much enjoyment yarg gave me :D

#

basically a minor cut out every second or so? Hard to explain

silent cipher
#

have you tried turning on audio buffering? in sound settings may need press blue for advanced settings

Could start with 200 and see if that fixes it

serene dragon
#

interestingly enough, turning the audio playback buffer off seems to have fixed it

#

but 200 also works

silent cipher
#

interesting, ok! I had to set mine to 30 to get clean sound, 20 didn't do it Shrug

#

I think in general linux users will need to use pipewire instead of pulseaudio (you already had it) and then adjust buffer settings

#

if it works with buffer off, that is the best case, leave it. If you get choppiness, turn on audio buffer, find the lowest value for playback buffer length that works

serene dragon
silent cipher
#

so turning it off still works for you? or no

serene dragon
#

Only when i also adjust the buffer length to 200 anyway, if its at the default 15, i get choppy audio

silent cipher
#

ok so to be clear:

toggle on + buffer length 15 = choppy
toggle off = no choppy?

serene dragon
#

No, buffer length 15 choppy, buffer length 200 (or 30 also works) not choppy, and the toggle doesnt change that at all

#

no matter what the toggle is set to

silent cipher
#

oh... ok that's interesting

#

super helpful thank you

serene dragon
#

np!

#

if theres anything i can do in the future, just ping me. Otherwise setting that to 30 seems to fix it for now.

silent cipher
#

30 also worked for me, though with the toggle off it shouldn't do anything think so that's something for me to look at

#

btw use the lowest value buffer length that works, so 30 probably. 200 will be okay but will cause audible delay and sometimes song sync weirdness because it's quite high