Page 1 of 1

Darwinia + ALSA = crash on start

Posted: Mon Dec 20, 2004 5:22 pm
by cyph
Exporting "SDL_AUDIODRIVER=alsa" causes darwinia to segfault before it starts. Darwinia segfaults after trying to initialize audio with a "No available audio device." error. blackbox.txt is empty, but bdove was able to reproduce this behavior on IRC so it seems to be relatively easy to track down.

Posted: Mon Dec 20, 2004 5:39 pm
by Dave2
I get the same but without a segfault:

Code: Select all

dave@Vigor54:~/darwinia> ./darwinia
SDL Version: Compiled against 1.2.8, running with 1.2.8
Creating ResourceManager: 0.3
 
Creating SoundSystem: 14.0
 
Creating ClientToServer: 14.0
 
Initialising SoundSystem : 15.1
 
Initialising SDL Audio
Failed to open audio output device: "No available audio device"


Replacing libSDL-1.2.so.0 with my distro's fixed it though.

same problem here...

Posted: Mon Dec 20, 2004 5:43 pm
by bdove
SDL Version: Compiled against 1.2.8, running with 1.2.8

strace output:

Code: Select all

31386 gettimeofday({1103560847, 726970}, NULL) = 0
31386 gettimeofday({1103560847, 727023}, NULL) = 0
31386 gettimeofday({1103560847, 727079}, NULL) = 0
31386 gettimeofday({1103560847, 727134}, NULL) = 0
31386 gettimeofday({1103560847, 727186}, NULL) = 0
31386 gettimeofday({1103560847, 727233}, NULL) = 0
31386 write(1, "Initialising SDL Audio\n", 23) = 23
31386 write(2, "Failed to open audio output devi"..., 64) = 64
31386 open("blackbox.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 13
31386 fstat64(13, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
31386 mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43051000
31386 open("userid.txt", O_RDONLY)      = 14
31386 fstat64(14, {st_mode=S_IFREG|0600, st_size=44, ...}) = 0
31386 mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43071000
31386 read(14, "Username: bdove\nEmail: bdove@raz"..., 131072) = 44
31386 close(14)                         = 0
31386 munmap(0x43071000, 131072)        = 0
31386 open("preferences.txt", O_RDONLY) = -1 ENOENT (No such file or directory)
31386 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
31386 open("blackbox.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 14
31386 fstat64(14, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
31386 mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x43071000
31386 open("preferences.txt", O_RDONLY) = -1 ENOENT (No such file or directory)
31386 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
31384 <... waitpid resumed> [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV], 0) = 31386
31384 fstat64(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
31384 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40145000
31384 write(2, "./darwinia: line 4: 31386 Segmen"..., 69) = 69
31384 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
31384 --- SIGCHLD (Child exited) @ 0 (0) ---
31384 waitpid(-1, 0xbfffecbc, WNOHANG)  = -1 ECHILD (No child processes)
31384 sigreturn()                       = ? (mask now [])
31384 rt_sigaction(SIGINT, {SIG_DFL}, {0x807bce0, [], 0}, 8) = 0
31384 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
31384 read(255, "", 85)                 = 0
31384 munmap(0x40145000, 4096)          = 0
31384 exit_group(139)                   = ?

( rm libSDL-1.2.so.0 ; ln -s /usr/lib/libSDL-1.2.so.0 . did the trick here also)

Posted: Mon Dec 20, 2004 5:53 pm
by John
Thanks. I've replicated the problem here, I'll see what I can do about it. In the mean time you should be able to make progress by deleting or renaming the supplied libSDL (which supports OSS only).

Posted: Tue Dec 21, 2004 11:31 am
by coolsi
I was able to fix this (by accident) by doing:

simon@super:~/darwinia$ export AUDIODEV=hw:1,0

I did this to make Darwinia use my 2nd sound card (I have 2...crazy, huh?). If you change the hw:1,0 to whatever your sound card is, it should work.

Posted: Tue Dec 21, 2004 2:40 pm
by Dave2
beta4c fixes this for me.

Posted: Tue Jul 12, 2011 11:45 pm
by cam217
Hello,

It's been 3 hours since i'm looking over internet to find a solution to get this game to work and I'm stuck with an issue similar to this topic.
When I try to launch the game, it almost launches then goes back to command line with this output:

Code: Select all

[cam@arch Darwinia]$ ./darwinia
.
SDL Version: Compiled against 1.2.9, running with 1.2.8
Initialising SDL Audio
Failed to open audio output device: "No available audio device"
sh: gdb: command not found


I tried to remove the SDL lib from darwinia path and make a symbolic link with the one of the system like in this thread but it didn't worked.
I'm running out of ideas and patience and I don't know what to do next, please help get this working.
Thanks.

Posted: Mon Jul 18, 2011 1:34 pm
by cam217
So noone knows how to deal with that ??
Not even some of the people who developped that game??

Can someone tells me where I should define the audio device? Is it in darwinia folder or in a system folder? By the way I have audio on my computer!
It seems that this is the only thing that makes me unable to run the game.

Posted: Mon Jul 18, 2011 4:41 pm
by bert_the_turtle
I don't have the Linux version for that, but the problem seems to be that the old version of SDL included with the game can't find an audio device on your current system. Solution for that: just delete the included SDL library, have the game use your system supplied one. It sounds like you tried something along those lines already, but try again.

Posted: Tue Jul 19, 2011 8:16 am
by cam217
Can't try again right now because I'm not at home but I did try to remove the SDL lib and use the system one but it wasn't working better. I don't know what I can do more about it.

I think this is not the solution, it would be better to redefine the audio device but I just need to know where it should be defined.

Posted: Sat Dec 17, 2011 12:15 pm
by cam217
Hi,

I found a way to make it run without sound, I run the game from this script:

Code: Select all

#!/bin/bash

export SDL_AUDIODRIVER=disk
export SDL_DISKAUDIOFILE=/dev/null
export SDL_PATH_DSP=/dev/snd
/home/cam/Games/darwinia/./darwinia


Of course, you need to adjust the path to the executable file.

EDIT: Found the packages to install to get the game working with sound (in that case, don't use the script above). I just needed to install a few packages:

Code: Select all

yaourt -S lib32-alsa-plugins