Page 1 of 1

[2.1.9] Linux audio sometimes chooses non-default audio device

Posted: Fri Jul 10, 2026 12:01 am
by gridstop
I'm sure this will be an odd/difficult one to track down.

I'm running Arch w/ KDE Plasma, everything updated. Both 2.0.77 and 2.1.x select PulseAudio as the preferred driver. 2.0.77 consistently chooses my system's default sound device (my Razer headphones), I've never had it ever choose a different device. But for some reason 2.1.x will sometimes randomly seem to choose a different device, in this case the HDMI output on my video card, which is connected to nothing. I can just go into the sound settings and select a different device and it switches right back and works.

Any idea what system configuration or call it's making to get the default device that could be going wrong now? I could try to check and see if my system is occasionally returning something weird. Otherwise I'm not sure what to go on. Every other application in my system (other games, Firefox, VLC, etc...) always 100% consistently choose my headphones, and that's the device set as default in the system configuration as far as I can determine.

Re: [2.1.9] Linux audio sometimes chooses non-default audio device

Posted: Fri Jul 10, 2026 12:54 am
by eugenekay
gridstop wrote: Fri Jul 10, 2026 12:01 amAny idea what system configuration or call it's making to get the default device that could be going wrong now? I could try to check and see if my system is occasionally returning something weird. Otherwise I'm not sure what to go on. Every other application in my system (other games, Firefox, VLC, etc...) always 100% consistently choose my headphones, and that's the device set as default in the system configuration as far as I can determine.
Version 2.1 updated from using SDL2 to SDL3. It seems like SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK is now recommended. Previously, a developer would call SDL_OpenAudioDevice with a null device value to get "default" behaviour.

How/where are you setting the "Default Audio Device" for your system? HDMI audio out seems like it may be the first device detected at boot.

Re: [2.1.9] Linux audio sometimes chooses non-default audio device

Posted: Fri Jul 10, 2026 2:09 am
by gridstop
Just through KDE's System Settings, the Sound window. The device listed at the top and with the checkbox selected is my headphones, and everything else seems to default to it just fine.

I have noticed from the command line if I run something like alsamixer, the 'Card' and 'Chip' are both PipeWire, but if I select sound card (F6), that list puts HDA ATI HDMI above my headphones. No clue if that list is relevant, what drives that list, or how I could re-prioritize it though.

Looking through some logs, it's clear to see sometimes it chooses one or the other:
0.186 [Audio] Driver:pulseaudio, Device:Starship/Matisse HD Audio Controller Digital Stereo (IEC958), Depth:32, Channels:2, Frequency:44100
or
0.178 [Audio] Driver:pulseaudio, Device:Razer BlackShark V2 HS 2.4 Analog Stereo, Depth:32, Channels:2, Frequency:44100

But it doesn't print like a list of what devices it sees or what order. This is one of those things that's not really Factorio's fault, I'm sure it's just asking for the default however SDL wants them to, but there's so many layers or varieties of sound systems these days it's just a pain in the butt sometimes to even know how your distro is configuring things. Kind of like the distros that were by default swallowing the factoriopedia hotkey and it was sometimes quite hard to find the setting to fix. Presumably I can reorder these... somehow.

Re: [2.1.9] Linux audio sometimes chooses non-default audio device

Posted: Mon Jul 13, 2026 9:55 am
by Donion
Hello,
as was correctly guessed, when initializing audio we ask SDL for the default playback device. So it will come down to SDL driver calls and what it gets from the system.

You can try changing the preferred driver in Sound settings to pipewire (requires Factorio restart) to see if it behaves any better.

Edit: since this is a driver issue I'm moving this to technical help