![]() |
|
allegro_init() fails on a SuSE 9.1 headless machine |
Jörg Rüppel
Member #35
April 2000
|
I'm trying to make the dedicated server of Gusanos (gusanos.sf.net) run on a SuSE 9.1 root server. While doing that I found out, that Allegro can't initialize the system driver, for whatever reason. I then tried running some of the test applications in the Allegro dir, and they all fail, too. I tried stepping through allegro_init() with GDB but using a debugger on command line is pain in the a** This is what allegro_error holds after allegro_init(): VT_GETSTATE: Invalid argument This is the end of the strace output:
Allegro was compiled with "--without-x" so it should only use the Linux console driver. Can anyone intimate enough with the Linux port tell me what is causing the trouble here? |
Milan Mimica
Member #3,877
September 2003
![]() |
Of course. 2. grab the latest SVN version and allegro will init fine. The third way is to run your allegro program as root.
-- |
Jörg Rüppel
Member #35
April 2000
|
I was root. I'll try the SVN version. Edit: Ok. 4.2 branch does this:
Result from 4.3 branch:
|
BAF
Member #2,981
December 2002
![]() |
Why does your server program need Allegro? BAF.zone [baf.zone] | SantaHack! [www.santahack.net] |
GullRaDriel
Member #3,861
September 2003
![]() |
IMHO, the question is not really why do he needs it, but why it crash. "Code is like shit - it only smells if it is not yours" |
Jörg Rüppel
Member #35
April 2000
|
Allegro is needed for the timers and of course image loading/manipulation. I see that latter is possible with SYSTEM_NONE, but former is not. Also I'd like to mention that it is not MY server, I'm just trying to make it run. Gusanos is opensource and I am trying to set up a dedicated server for it. |
Milan Mimica
Member #3,877
September 2003
![]() |
Let's focus on 4.2 SVN version. First, your program tries to init a console. It means it is trying to init keyboard, graphics or something else that requires a linux console. You cannot expect it to work without root permisions from X. I don't know why it doesn't work as root. Even if it would work (and in fact, it should) you would be switched to a console. You wouldn't like it I guess. Check if it even runs from a real linux console. Are you using a framebuffer device? Anyway, if you need allegro for your server, do you need graphics and keyboard? I guess you don't. If you don't need even timer functions you can use install_allegro(SYSTEM_NONE, &errno, atexit) instead.
-- |
Jörg Rüppel
Member #35
April 2000
|
Milan Mimica
Member #3,877
September 2003
![]() |
Oh, I see. I made some wrong assumptions. [edit]
-- |
BAF
Member #2,981
December 2002
![]() |
You could use Linux timers (the way Allegro does) and ditch allegro.... Allegro really isn't meant nor needed for dedicated server programs - all they should do is process, not do that much graphics manip. BAF.zone [baf.zone] | SantaHack! [www.santahack.net] |
Milan Mimica
Member #3,877
September 2003
![]() |
There are some features that can be handy on dedicated servers: timers, config file routines, maybe fixed point number routines... Even bitmap handling functions of the games uses pixel based collision detection etc.
-- |
Jörg Rüppel
Member #35
April 2000
|
Exactly. And as I said two times now, it is not my game, and I have no intention to change anything larger than one or two lines in the code. The game has a dedicated server, and it uses Allegro. So it is either going to work with Allegro, or not at all. All strace output is from allegro_init(), and you saw that correctly, it gets stuck somewhere during allegro_init() and never returns from that function (with 4.2 branch) Edit: Oh forget what I said, I assumed allegro's mathtest program wasn't using graphics at all. As it turns out, the endless loop occurs when trying to set a gfx mode or something. Gusanos dedicated starts fine with Allegro SVN 4.2 |
GullRaDriel
Member #3,861
September 2003
![]() |
Hmm... Have you tried using install_allegro instead ? EDIT: manual said: The available system ID codes will vary from one platform to another, but you will almost always want to pass SYSTEM_AUTODETECT. Alternatively, SYSTEM_NONE installs a stripped down version of Allegro that won't even try to touch your hardware or do anything platform specific: this can be useful for situations where you only want to manipulate memory bitmaps, such as the text mode datafile tools or the Windows GDI interfacing functions.
"Code is like shit - it only smells if it is not yours" |
Milan Mimica
Member #3,877
September 2003
![]() |
GullRaDriel: he needs timers Jörg Rüppel: Hurray! However, set_gfx_mode should be fixed to return -1.
-- |
|