Page 1 of 2

[0.9.* & 0.8.8] Major sound delay on Linux

Posted: Fri Feb 21, 2014 10:16 pm
by Forkk
I can't quite tell if this is a bug or a configuration issue, but Factorio seems to have major sound delay problems. I was initially running it through PulseAudio's ALSA plugin, and so I was blaming the delay on that, but I just tried it with ALSA only, and the same thing happens. This has happened in every version of Factorio I've used so far. I'm running 64-bit Arch Linux and the sound is playing through my Logitech G930 headset. Any help would be much appreciated. Thanks in advance.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue Feb 25, 2014 7:45 am
by slpwnd
We couldn't have reproduced this on our Linux machines. But it is a problem since multiple people have complained about this in the past. If someone has any idea what is wrong that would be very helpful. For now moving this to 0-1 magic.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue Feb 25, 2014 11:56 am
by SilverWarior
That headset plugs into USB port and not into sound output right?
If that is true make sure you have full USB 2.0 support set up (proper drivers, USB 2 port). Why?
It is quite posible that the wireless adapter which you plug into USB is actually the one who is processing audio (acts as soundcard). So if USB port works as USB 1 it might not alow fast enough processing for the headset.

@Developers
What is the size of sound buffer Allegro sound library is using?
If this buffer is to big it might cause delays due to slow data transfer.
If it is to small you may get intermitent sound which is usualy heard as cracks at start or sound intermitens when things get worse.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Sat Mar 29, 2014 8:18 pm
by Forkk
I apologize that it took so long to reply, but this remains an issue. I don't think it's an issue with USB, as I haven't had this problem with anything else. Furthermore, I've now tried this with both my headset and my computer's internal speakers. Both audio devices produce the same delay. I'm beginning to think it may be an issue with Allegro.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue Apr 22, 2014 7:51 pm
by Algram
Same for me here.
But I also get cracks when I am starting the game sometimes (:

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue Apr 22, 2014 8:03 pm
by Nemoder
Same problem here if pulseaudio is running. Is there a reason you use libasound instead of openal or sdl?
*Edit:
I see it uses allegro5.
I found a workaround that fixes this for me:
Create or edit /etc/allegro5rc and change the audio driver to oss:

Code: Select all

[graphics]
driver=default
[audio]
driver=oss
I tried setting my driver to pulseaudio but then the game completely fails to initilize audio and quits.
It works with the default ALSA but has the delay, OSS seems to work fine though.
Also look /usr/share/doc/liballegro5.0/examples/allegro5.cfg for more options in case anyone can find a better fix.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Fri May 02, 2014 2:49 pm
by Programmdude
I have the same issue (Ubuntu 14.04 x64), however the oss, pulseaudio and openal options all crash the game on startup, and the alsa option causes a >1 second delay.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Fri May 02, 2014 6:02 pm
by ghoti
I'm sorry that all I can do is report that this issue is manifesting itself on my linux box as well. Ubuntu 13.10

I wish I could tell you more.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Sat May 03, 2014 11:34 pm
by Programmdude
I haven't tried debugging the alsa delay yet, I can use oss with the padsp oss wrapper, pulseaudio works when I build allegro myself, therefore since it doesn't work in factorio I assume it isn't compiled in.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue May 06, 2014 2:57 pm
by Algram
Got this Problem even after trying Nemoders fix :(

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue May 06, 2014 5:20 pm
by cube
Hey guys, I'm really sorry that I can't help you, but for 0.10.0 we upgraded allegro, so there is a chance this will improve.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Sun May 11, 2014 9:59 am
by Dedas
Ok, after some testing I found a way to get the sound working correctly.

1. Follow Nemod's advice on the first page and set "oss" in the allegro5rc config file.

2. Kill pulseaudio with "pulseaudio -k" (you can restart it again with "pulseaudio --start") .

3. Start the game with "padsp ./factorio" (included in the pulsaudio-utils package that should already be installed, or install it first).

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Sat May 24, 2014 7:05 am
by Adamo
Previous post. and a few hours' research, fixed this on Fedora 19.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue May 27, 2014 7:24 am
by kurtiii
Dedas solution worked for me on Kubunutu 12.04; thanks :)

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue May 27, 2014 7:29 am
by MF-
Thanks for the confirmation (+including Distribution identification is a good idea too)

The "kill pulseaudio" step might not be necessary
To my knowledge, padsp uses pulseaudio to create an emulated OSS sound system device,
which means pulseaudio will be immediately respawned anyway.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Thu May 29, 2014 7:01 am
by dominikh
I have the same issue, that audio is massively (2-3 seconds) delayed. However I am only experiencing the problem when using my headphones (bluetooth), not when using the built-in sound card.

I am using pulseaudio, version 4.0, and using OSS + padsp works as a fix for me, at least during my short testing.

Edit: While sounds work fine, the background music has terrible sound artifacts when using padsp, but I've never had much success with padsp in the past, either… but that makes the workaround unusable for me as well.

Edit 2: Okay, I was wrong. It does in fact not depend on which audio device I am using. One out of so many times, the game actually has delay-free sound, simply by restarting the game often enough.

Edit 3: And then, after loading a game, audio starts to be delayed again… :(

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Fri May 30, 2014 12:17 am
by Gammro
dominikh wrote:Edit: While sounds work fine, the background music has terrible sound artifacts when using padsp, but I've never had much success with padsp in the past, either… but that makes the workaround unusable for me as well.
That's a known issue, the music right now is a placeholder and is terribly compressed. Doesn't matter what platform you play on.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Fri May 30, 2014 9:50 pm
by dominikh
Gammro wrote:
dominikh wrote:Edit: While sounds work fine, the background music has terrible sound artifacts when using padsp, but I've never had much success with padsp in the past, either… but that makes the workaround unusable for me as well.
That's a known issue, the music right now is a placeholder and is terribly compressed. Doesn't matter what platform you play on.
No, it doesn't sound half as bad when actually playing through ALSA. The padsp artifacts are an actual padsp problem, one I have with most applications I've tried it with.

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Tue Jun 10, 2014 1:50 pm
by Nemoder
cube wrote:Hey guys, I'm really sorry that I can't help you, but for 0.10.0 we upgraded allegro, so there is a chance this will improve.
Same problem still in 0.10.0
Setting driver=pulseaudio for allegro throws an exception on startup every time:

Code: Select all

(gdb) catch throw
Catchpoint 1 (throw)
(gdb) r
Starting program: /home/nemoder/Games/Factorio/./bin/x64/factorio 
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff2243700 (LWP 25778)]
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
Catchpoint 1 (exception thrown), 0x00007ffff678dfd0 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0  0x00007ffff678dfd0 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x000000000058e170 in ?? ()
#2  0x000000000058eb48 in ?? ()
#3  0x00000000007f322d in ?? ()
#4  0x000000000087355b in ?? ()
#5  0x00007ffff5e8db45 in __libc_start_main (main=0x870960, argc=1, 
    argv=0x7fffffffe508, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffe4f8) at libc-start.c:287
#6  0x000000000040f289 in ?? ()

Re: [0.9.* & 0.8.8] Major sound delay on Linux

Posted: Thu Jun 19, 2014 1:42 pm
by CorrettoSambuca
Same issue here. Currently on Ubuntu 14.04.
If it helps, I'm dual-booting windows 7 on this machine and the windows version runs fine.