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

This subforum contains all the issues which we already resolved.
Forkk
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Feb 09, 2014 2:37 am
Contact:

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

Post 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.

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

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

Post 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.

SilverWarior
Filter Inserter
Filter Inserter
Posts: 559
Joined: Mon Mar 04, 2013 9:23 am
Contact:

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

Post 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.

Forkk
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Feb 09, 2014 2:37 am
Contact:

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

Post 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.

Algram
Inserter
Inserter
Posts: 33
Joined: Sun Jan 26, 2014 10:28 am
Contact:

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

Post by Algram »

Same for me here.
But I also get cracks when I am starting the game sometimes (:

Nemoder
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Fri Feb 22, 2013 11:14 am
Contact:

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

Post 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.

Programmdude
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri May 02, 2014 2:46 pm
Contact:

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

Post 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.

ghoti
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Apr 24, 2014 5:40 pm
Contact:

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

Post 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.

Programmdude
Burner Inserter
Burner Inserter
Posts: 17
Joined: Fri May 02, 2014 2:46 pm
Contact:

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

Post 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.

Algram
Inserter
Inserter
Posts: 33
Joined: Sun Jan 26, 2014 10:28 am
Contact:

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

Post by Algram »

Got this Problem even after trying Nemoders fix :(

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

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

Post 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.
I have no idea what I'm talking about.

Dedas
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun May 11, 2014 9:55 am
Contact:

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

Post 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).

Adamo
Filter Inserter
Filter Inserter
Posts: 479
Joined: Sat May 24, 2014 7:00 am
Contact:

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

Post by Adamo »

Previous post. and a few hours' research, fixed this on Fedora 19.

kurtiii
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon May 26, 2014 11:41 am
Contact:

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

Post by kurtiii »

Dedas solution worked for me on Kubunutu 12.04; thanks :)

MF-
Smart Inserter
Smart Inserter
Posts: 1235
Joined: Sun Feb 24, 2013 12:07 am
Contact:

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

Post 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.

dominikh
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu May 29, 2014 6:58 am
Contact:

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

Post 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… :(

Gammro
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Oct 09, 2013 1:45 pm
Contact:

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

Post 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.
Ignore this

dominikh
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu May 29, 2014 6:58 am
Contact:

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

Post 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.

Nemoder
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Fri Feb 22, 2013 11:14 am
Contact:

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

Post 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 ?? ()

User avatar
CorrettoSambuca
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sun May 04, 2014 9:29 am
Contact:

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

Post 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.

Post Reply

Return to “Resolved Problems and Bugs”