[1.0.0] Can't initialize audio [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
Goury
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Oct 03, 2015 11:06 pm
Contact:

[1.0.0] Can't initialize audio [Linux]

Post by Goury »

Can't initialize audio, oh yeah.
But when I

Code: Select all

$ padsp factorio
it now just getting stuck at loading sounds.
Official system requirements state that pulseaudio is required.
So I have pulseaudio 12.2-2.

Come on!
This bug was known since the very first version of factorio and it's still present.

There's your log, it doesn't have anything useful because you forgot to log this part:

Code: Select all

   0.000 2020-08-16 10:49:20; Factorio 1.0.0 (build 54889, linux64, steam)
   0.094 Operating system: Linux (Ubuntu 18.04)
   0.094 Program arguments: "/home/goury/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio" 
   0.094 Read data path: /home/goury/.local/share/Steam/steamapps/common/Factorio/data
   0.094 Write data path: /home/goury/.factorio [178543/1968490MB]
   0.094 Binaries path: /home/goury/.local/share/Steam/steamapps/common/Factorio/bin
   0.143 System info: [CPU: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz, 4 cores, RAM: 19948 MB]
   0.143 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=unity XDG_SESSION_DESKTOP=unity XDG_CURRENT_DESKTOP=Unity:Unity7:ubuntu __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.143 Display options: [FullScreen: 1] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.459 Available displays: 1
   0.459  [0]: ROG PG278QR 27" - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.677 Initialised OpenGL:[0] GeForce GTX 960/PCIe/SSE2; driver: 3.3.0 NVIDIA 440.100
   0.677   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes
   0.677   [Version] 3.3
   0.677 Graphics settings preset: very-high
   0.677   Dedicated video memory size 4096 MB
   0.918 Graphics options: [Graphics quality: high] [Video memory usage: high] [Light scale: 100%] [DXT: high-quality] [Color: 32bit]
   0.918                   [Max threads (load/render): 32/4] [Max texture size: 0] [Tex.Stream.: 1] [Rotation quality: normal] [Other: STDCWT] [B:0,C:0,S:100]
   0.935 [Audio] Backend:default; Depth:16, Channel:2, Frequency:44100; MixerQuality:linear
   1.891 Loading mod core 0.0.0 (data.lua)
   2.187 Loading mod base 1.0.0 (data.lua)
   4.177 Loading mod base 1.0.0 (data-updates.lua)
   4.326 Checksum for core: 2630831588
   4.326 Checksum of base: 3509992273
   5.020 Prototype list checksum: 3301461508
   5.058 Loading sounds...
  11.705 Info PlayerData.cpp:70: Local player-data.json unavailable
  11.705 Info PlayerData.cpp:73: Cloud player-data.json available, timestamp 1597564116
  12.182 Initial atlas bitmap size is 16384
  12.217 Created atlas bitmap 16384x16384 [none]
  12.217 Created atlas bitmap 16384x4256 [none]
  12.217 Created atlas bitmap 8192x4208 [decal]
  12.218 Created atlas bitmap 16384x5600 [low-object, linear-minification]
  12.218 Created atlas bitmap 8192x3760 [mipmap, linear-minification, linear-magnification, linear-mip-level]
  12.219 Created atlas bitmap 16384x5920 [terrain, mipmap, linear-minification, linear-mip-level]
  12.219 Created atlas bitmap 4096x3216 [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
  12.219 Created atlas bitmap 4096x1856 [smoke, mipmap, linear-minification, linear-magnification]
  12.219 Created atlas bitmap 4096x3088 [mipmap]
  12.219 Created atlas bitmap 4096x2336 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
  12.220 Created atlas bitmap 2048x224 [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
  12.220 Created atlas bitmap 8192x1428 [alpha-mask]
  12.223 Created atlas bitmap 16384x14880 [shadow, linear-magnification, alpha-mask]
  12.223 Created atlas bitmap 8192x2336 [shadow, mipmap, linear-magnification, alpha-mask]
  12.314 Created virtual atlas pages 4096x4096x10
  12.324 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
  50.537 Parallel Sprite Loader initialized (threads: 3)
  70.400 Sprites loaded
  70.501 Generated mipmaps (4) for atlas [3] of size 16384x5600   
  70.505 Generated mipmaps (3) for atlas [4] of size 8192x3760   
  70.663 Generated mipmaps (3) for atlas [5] of size 16384x5920   
  70.682 Generated mipmaps (3) for atlas [6] of size 4096x3216   
  70.694 Generated mipmaps (3) for atlas [7] of size 4096x1856   
  70.727 Generated mipmaps (3) for atlas [8] of size 4096x3088   
  70.743 Generated mipmaps (5) for atlas [9] of size 4096x2336   
  70.747 Generated mipmaps (3) for atlas [13] of size 8192x2336   
  70.763 Custom mipmaps uploaded.
  71.058 Generated mipmaps for virtual atlas of size 16384x12288
Factorio crashed. Generating symbolized stacktrace, please wait ...
Raw stacktrace: 0xcbd047, 0xe9aced, 0xd13d75, 0xd1418d, 0xd141e9, 0x3efd0, 0, 0xb, 0xa, 0xa, 0x3ec7a, 0x4176b, 0x41b09, 0x4238f, 0xa, 0xa, 0xa, 0x32429, 0x523f8, 0x76db, 0
Factorio crashed. Generating symbolized stacktrace, please wait ...
Here's the part you forgot to log:

Code: Select all

Assertion 'pa_atomic_load(&(b)->_ref) > 0' failed at pulsecore/memblock.c:682, function pa_memblock_unref(). Aborting.
Assertion 'pa_atomic_load(&(b)->_ref) > 0' failed at pulsecore/memblock.c:682, function pa_memblock_unref(). Aborting.
Assertion '!m->thread || !pa_thread_is_running(m->thread) || !in_worker(m)' failed at pulse/thread-mainloop.c:178, function pa_threaded_mainloop_lock(). Aborting.
I paid full price six years ago for your promise to support my OS.
Now I can't even play 1.0.
I feel very much cheated.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.0.0] Can't initialize audio

Post by Rseding91 »

You'll have to wait for one of the linux developers to look into this. But I don't know of any issues either of them have audio wise so what ever is going wrong - it's most likely going to be a configuration issue on your end.
If you want to get ahold of me I'm almost always on Discord.

blahfasel2000
Inserter
Inserter
Posts: 49
Joined: Sat Mar 28, 2020 2:10 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by blahfasel2000 »

Goury wrote:
Sun Aug 16, 2020 8:07 am
But when I

Code: Select all

$ padsp factorio
it now just getting stuck at loading sounds.
The padsp wrapper is for old software that still uses the old OSS /dev/dsp sound interface. Using it with anything that uses pulseaudio directly likely leads to breakage.
Goury wrote:
Sun Aug 16, 2020 8:07 am
Here's the part you forgot to log:
Those are messages from your crashing pulseaudio daemon. Factorio couldn't log them even if it tried, as they happen outside of Factorio.

Your pulseaudio is broken.

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by movax20h »

You don't need to use padsp. Factorio uses PulseAudio natively. If something is stuck, that probably means your ALSA or PA setup is broken. Killing pulseaudio or rebooting computer sometimes helps.

I never had issues with Factorio audio on Linux. (using for 6 years).

Goury
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Oct 03, 2015 11:06 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by Goury »

Here's a thing, when I run it without padsp it does this:

Code: Select all

   0.000 2020-08-17 22:00:10; Factorio 1.0.0 (build 54889, linux64, alpha)
   0.038 Operating system: Linux (Ubuntu 18.04)
   0.038 Program arguments: "./factorio" 
   0.038 Read data path: /home/goury/_superfast/f/factorio_alpha_x64_1.0.0/factorio/data
   0.038 Write data path: /home/goury/_superfast/f/factorio_alpha_x64_1.0.0/factorio [119841/388014MB]
   0.038 Binaries path: /home/goury/_superfast/f/factorio_alpha_x64_1.0.0/factorio/bin
   0.044 System info: [CPU: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz, 4 cores, RAM: 19948 MB]
   0.044 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=unity XDG_SESSION_DESKTOP=unity XDG_CURRENT_DESKTOP=Unity:Unity7:ubuntu __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.044 Display options: [FullScreen: 1] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.149 Available displays: 1
   0.149  [0]: ROG PG278QR 27" - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.276 Initialised OpenGL:[0] GeForce GTX 960/PCIe/SSE2; driver: 3.3.0 NVIDIA 440.100
   0.276   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes
   0.276   [Version] 3.3
   0.276 Graphics settings preset: very-high
   0.276   Dedicated video memory size 4096 MB
   0.372 Graphics options: [Graphics quality: high] [Video memory usage: all] [Light scale: 25%] [DXT: high-quality] [Color: 32bit]
   0.372                   [Max threads (load/render): 32/4] [Max texture size: 0] [Tex.Stream.: 0] [Rotation quality: normal] [Other: STDCWT] [B:0,C:0,S:100]
   0.374 No '/dev/dsp' device available in your system.

   0.374 Perhaps Open Sound System is not installed or running.

   0.374 Failed to init OSS.

   0.374 Warning GlobalContext.cpp:1042: Installing audio failed (backend:default, depth:0, freq:0) retrying...
   0.874 No '/dev/dsp' device available in your system.

   0.874 Perhaps Open Sound System is not installed or running.

   0.874 Failed to init OSS.

   0.874 Warning GlobalContext.cpp:1042: Installing audio failed (backend:default, depth:0, freq:0) retrying...
   1.374 No '/dev/dsp' device available in your system.

   1.374 Perhaps Open Sound System is not installed or running.

   1.374 Failed to init OSS.

   1.374 Warning GlobalContext.cpp:1042: Installing audio failed (backend:default, depth:0, freq:0) retrying...
   1.874 No '/dev/dsp' device available in your system.

   1.875 Perhaps Open Sound System is not installed or running.

   1.875 Failed to init OSS.

   1.875 Warning GlobalContext.cpp:1042: Installing audio failed (backend:default, depth:0, freq:0) retrying...
   2.375 No '/dev/dsp' device available in your system.

   2.375 Perhaps Open Sound System is not installed or running.

   2.375 Failed to init OSS.

   2.375 Warning GlobalContext.cpp:1042: Installing audio failed (backend:default, depth:0, freq:0)
   3.050 Loading mod core 0.0.0 (data.lua)
   3.122 Loading mod base 1.0.0 (data.lua)
   3.379 Loading mod base 1.0.0 (data-updates.lua)
   3.503 Checksum for core: 2630831588
   3.503 Checksum of base: 3509992273
   3.714 Prototype list checksum: 3301461508
   3.767 Info PlayerData.cpp:70: Local player-data.json unavailable
   3.767 Info PlayerData.cpp:75: Cloud player-data.json unavailable
   3.890 Initial atlas bitmap size is 16384
   3.929 Created atlas bitmap 16384x16384 [none]
   3.933 Created atlas bitmap 16384x13176 [none]
   3.933 Created atlas bitmap 8192x4208 [decal]
   3.934 Created atlas bitmap 16384x5600 [low-object, linear-minification]
   3.934 Created atlas bitmap 8192x3760 [mipmap, linear-minification, linear-magnification, linear-mip-level]
   3.934 Created atlas bitmap 16384x5920 [terrain, mipmap, linear-minification, linear-mip-level]
   3.935 Created atlas bitmap 4096x3216 [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
   3.935 Created atlas bitmap 4096x1856 [smoke, mipmap, linear-minification, linear-magnification]
   3.935 Created atlas bitmap 4096x3088 [mipmap]
   3.935 Created atlas bitmap 4096x2336 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
   3.935 Created atlas bitmap 2048x224 [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
   3.935 Created atlas bitmap 8192x1428 [alpha-mask]
   3.940 Created atlas bitmap 16384x14880 [shadow, linear-magnification, alpha-mask]
   3.940 Created atlas bitmap 8192x2336 [shadow, mipmap, linear-magnification, alpha-mask]
   3.951 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
   5.844 Parallel Sprite Loader initialized (threads: 3)
  19.933 Sprites loaded
  19.965 Generated mipmaps (4) for atlas [3] of size 16384x5600   
  19.968 Generated mipmaps (3) for atlas [4] of size 8192x3760   
  20.126 Generated mipmaps (3) for atlas [5] of size 16384x5920   
  20.146 Generated mipmaps (3) for atlas [6] of size 4096x3216   
  20.158 Generated mipmaps (3) for atlas [7] of size 4096x1856   
  20.184 Generated mipmaps (3) for atlas [8] of size 4096x3088   
  20.199 Generated mipmaps (5) for atlas [9] of size 4096x2336   
  20.201 Generated mipmaps (3) for atlas [13] of size 8192x2336   
  20.214 Custom mipmaps uploaded.
  20.400 Factorio initialised
  46.114 Quitting: user-quit.
  46.253 Goodbye
But with padsp it plays sound just fine, it just hangs in the very end of its loading.
So doesn't fail to play sounds during loading but somehow (due to pulse crash) fails to load.
movax20h wrote:
Mon Aug 17, 2020 4:52 pm
Factorio uses PulseAudio natively.
Judging by the log, it seems to be a lie to me.
Or give me a version of Factorio that actually uses pulse.
Killing pulseaudio or rebooting
Been there, done that.

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by movax20h »

Factorio uses SDL to access audio devices, it is build to support pulseaudio ("pulse"), alsa, oss ("dsp"), and does try these "drivers" in this order.

On my system it defaults to pulseaudio:

Code: Select all

...
   0.534 [Audio] Backend:default; Depth:16, Channel:2, Frequency:44100; MixerQuality:linear
...

Code: Select all

$ pactl list

...

Client #122
	Driver: protocol-native.c
	Owner Module: 11
	Properties:
		application.name = "factorio"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "33"
		application.process.id = "928088"
		application.process.user = "user"
		application.process.host = "debian"
		application.process.binary = "factorio"
		application.language = "C"
		window.x11.display = ":0"
		application.process.machine_id = "73a831785d944c7babfd908a876f12fd"
		application.process.session_id = "3"




Try:

Code: Select all

SDL_AUDIODRIVER=alsa ./factorio
or

Code: Select all

SDL_AUDIODRIVER=pulse ./factorio

I guess you have something borked with paths or permissions in your setup.

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by movax20h »

Actually it looks SDL might be trying things in the wrong order, dsp, then alsa, then pulse.


So, forcing it to use pulse might help.

Also, maybe you have snd-pcm-oss kernel module loaded? Try blacklisting it...

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: [1.0.0] Can't initialize audio

Post by movax20h »

I looked a bit deeper and tried this myself, and it looks the SDL version factorio uses, doesn't actually support SDL_AUDIODRIVER . It looks factorio is not using SDL for audio. Instead it is using Allegro library for audio, music decoding and some other things (like mouse, keyboard and controller support).


Unfortunately I can't really find much about possible environment variables to tweaks just by looking at Allegro documentation.

Try ALLEGRO_AUDIO_DRIVER=PulseAudio

or ALLEGRO_AUDIO_DRIVER=ALSA


this is based on some quick check in allegro source code and inspecting strings in factorio binary.

You can also try ALLEGRO_AUDIO_DRIVER=SDL SDL_AUDIODRIVER=pulse , but I am not sure if support for this is included in the build. Similarly ALLEGRO_AUDIO_DRIVER=OpenAL , It will probably not work either.


There is also ALLEGRO_TRACE=allegro.log , but that is only available in debug builds, not release builds.

User avatar
bormand
Fast Inserter
Fast Inserter
Posts: 201
Joined: Fri Jun 05, 2020 9:59 am
Contact:

Re: [1.0.0] Can't initialize audio

Post by bormand »

Ubuntu 18.04
I had no problems on 18.04 and 20.04. Neither on older versions four years ago.

Factorio happily connects to the PA server. And if I kill PA, it falls back to ALSA aka /dev/snd/*.

Do you remember what you did with your sound system? I.e. changed permissions or settings, installed or removed some sound libraries etc.

You may want to install clean OS in dual boot and check whether factorio works or not.

Post Reply

Return to “Technical Help”