[Solved] Sound and music distortion [Linux]

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
User avatar
zvezdaburya
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 13, 2016 10:40 pm
Contact:

[Solved] Sound and music distortion [Linux]

Post by zvezdaburya »

Sound and music in game is distorted for me, and also affects teamspeak chat if I use that and factorio at the same time. I am not sure what the cause can be. Sometimes i get the same bug when playing warthunder, but it usually goes away after a few matches, and does not affect teamspeak. Very strange...
Last edited by Koub on Sat Mar 19, 2016 7:56 am, edited 1 time in total.
Reason: Added solved tag

sillyfly
Smart Inserter
Smart Inserter
Posts: 1099
Joined: Sun May 04, 2014 11:29 am
Contact:

Re: Sound and music distortion [Linux]

Post by sillyfly »

Could you try the solution (second to last topic) here?

Could be related, although when I had this delay problem there was no audible distortion.

User avatar
zvezdaburya
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 13, 2016 10:40 pm
Contact:

Re: Sound and music distortion [Linux]

Post by zvezdaburya »

sillyfly wrote:Could you try the solution (second to last topic) here?

Could be related, although when I had this delay problem there was no audible distortion.
Did not work for me, but I might have done something wrong? I created the file in /etc/ and tried launching the game from terminal with padsp but sound would not play at all, just got a error message.

Edit: just tried launching the game with spotify playing music. The instant factorio starts loading, the music gets distorted.

Edit: Playing individual files straight from the factorio directory works without problems using VLC media player.

Edit: Tried launching the game again with spotify playing, distortion started as soon as the game started loading, but stopped before reaching main menu. Loaded a save, stopped spotify, and could play without sound distortion. Will try this a few more times..

Edit: No luck, have tried multiple more times to start the game, with and without spotify playing, reboot etc.. distortion still happens.

Edit: Fixed it.

From Askubuntu.com I found this tip through a google search:
This one helped me: [Static and crackling in my HDMI audio?]: Static and crackling in my HDMI audio?

edit

/etc/pulse/default.pa

look for

load-module module-udev-detect

add tsched=0

load-module module-udev-detect tsched=0

reboot
I have no idea what the tsched=0 does, but I have tried launching Factorio multiple times now, with and without spotify, and there is no distortion anymore.

From arclinux forums:
tsched=0 disables PulseAudio's timer-based scheduling and uses the classic interrupt-driven approach. Timer-based scheduling allows for better latency management and reduced CPU usage. It puts very strict requirements on the ALSA drivers. Unfortunately, some drivers do not handle it well.
And further down that thread there was a guy mentioning this:
This is a very dirty workaround that bypasses PulseAudio's scheduling mechanisms in favor of the traditional interrupt approach. Use with caution.
But alas, now it seems to work for me. There seems to be slight delay in the playback of sound effects, but it's only by a few milliseconds and barely noticeable.

Koub
Global Moderator
Global Moderator
Posts: 7199
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: [Solved] Sound and music distortion [Linux]

Post by Koub »

Nice to hear you can play now :).
Added solved tag to your topic's title, so that people who experience the same problem can find your workaround more easily. I guess it still needs some attention from the devs, maybe is there something to do to the game to make this workaround non-mandatory..
Koub - Please consider English is not my native language.

User avatar
zvezdaburya
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 13, 2016 10:40 pm
Contact:

Re: [Solved] Sound and music distortion [Linux]

Post by zvezdaburya »

Koub wrote:Nice to hear you can play now :).
Added solved tag to your topic's title, so that people who experience the same problem can find your workaround more easily. I guess it still needs some attention from the devs, maybe is there something to do to the game to make this workaround non-mandatory..
Thanks for adding the tag, I hope this can be of help to someone :) I wanna add that i have a soundblaster sound card installed, so that might cause drivers to be a bit wonky... or something. I dunno :S

bluephoenix47
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Apr 30, 2017 7:51 pm
Contact:

Re: [Solved] Sound and music distortion [Linux]

Post by bluephoenix47 »

I ran into this same problem, and the solution in "Known issues" did not work for me. Thankfully, this solution did. Note that I also had to launch with

Code: Select all

padsp %command%
(in Steam)

portaloffreedom
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Aug 04, 2020 9:49 am
Contact:

Re: [Solved] Sound and music distortion [Linux]

Post by portaloffreedom »

I have the same problem for a while now and the `pasp %command%` fixes it mostly, but it makes the entire system crash after a while if I was hosting a multiplayer game. Very weird.

Using Archlinux

Post Reply

Return to “Technical Help”