[Solved] [0.13.20] ~1 s audio delay in Linux

This subforum contains all the issues which we already resolved.
Pablo
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Oct 22, 2016 5:19 pm
Contact:

[Solved] [0.13.20] ~1 s audio delay in Linux

Post by Pablo »

I have been experiencing an audio delay of about 1 s while playing. The solution suggested in the known issues thread didn’t work for me. However, I found an alternative workaround; I’m posting it here in case it helps others.

Instead of creating an /etc/allegro5rc file with the suggested configuration, I found out that putting audio through a Dmix device in ALSA solves the issue. This works both with ALSA or Pulseaudio as backend. For reference, this is my ALSA configuration:

Code: Select all

# /etc/asound.conf

pcm.!default {                                                                                                                                                                      
  type plug                                                                                                                                                                         
  slave.pcm "mixer"                                                                                                                                                                 
}                                                                                                                                                                                   
                                                                                                                                                                                    
ctl.!default {                                                                                                                                                                      
  type hw                                                                                                                                                                           
  card 1                                                                                                                                                                            
}                                                                                                                                                                                   
                                                                                                                                                                                    
pcm.emu0404 {                                                                                                                                                                       
  type hw                                                                                                                                                                           
  card 1                                                                                                                                                                            
  device 0                      # analog output                                                                                                                                     
}                                                                                                                                                                                   
                                                                                                                                                                                    
pcm.mixer {                                                                                                                                                                         
  type dmix                                                                                                                                                                         
  ipc_key 1024                                                                                                                                                                      
  slave {                                                                                                                                                                           
    pcm "emu0404"                                                                                                                                                                   
    format S24_3LE                                                                                                                                                                  
    rate 96000                                                                                                                                                                      
    period_time 0                                                                                                                                                                   
    period_size 1024                                                                                                                                                                
    buffer_size 8192                                                                                                                                                                
  }                                                                                                                                                                                 
  bindings {                                                                                                                                                                        
    0 0                                                                                                                                                                             
    1 1                                                                                                                                                                             
  }                                                                                                                                                                                 
  hint {                                                                                                                                                                            
    show on                                                                                                                                                                         
    description "Dmix before E-MU 0404 USB"                                                                                                                                         
  }                                                                                                                                                                                 
}      
I had this issue also with the latest experimental version (0.14.14), but haven’t tested this configuration on it.

Also of note, before applying this workaround, Factorio was the only program having sound issues on my system.

Edit: I’m running Arch Linux x86_64.

Edit: I have switched my audio configuration to rely on JACK (still exposing the Pulseaudio and ALSA frontends), and this also solves the issue.
Jwdb
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Dec 23, 2016 3:08 am
Contact:

Re: [Solved] [0.13.20] ~1 s audio delay in Linux

Post by Jwdb »

Thank you, this fixed it for me as well, for 0.14.21. :D

FYI: Slackware, x86, no Pulseaudio running, USB audio device. Also never had issues with other software.
Post Reply

Return to “Resolved Problems and Bugs”