Newbie questions on SDL on Linux

Hi everybody.

I am new both to Linux programming and to game programming (though neither to
Linux nor to programming!). I’m writing a simple arcade game - Yet Another
R-TYPE Clone - using SDL. My development platform is Linux (RH 7.3), but I
try to compile the game on Windows (MSVC6) from time to time. On Windows (98,
2000, XP) everything is ok. But on Linux, I get really weird behavior.

1). Performance. I develop the game on Athlon 1.4 GHz + 512MB SDRAM + ATi
Radeon 64MB DDR VIVO. I fixed FPS at 50, but on “complex” (~300-500 sprites)
scenes it slows down to 35-40 FPS? Why??? My system is too slow? Or my
algorithms are too complicated? But on Windows (without double-buffer and FPS
limit) I get 500-1200 FPS! There’s certainly something wrong!

Maybe the trouble is with my video card? I have another machine - Pentium
166MMX + 32MB EDO + S3 Trio64 1 MB. I get about 20 FPS on Linux, and on
Windows about the same. So the difference on Linux is much smaller than I
could expect.

2). Sound sync. All sounds are late for one and even more seconds - on all SDL
games (including Maelstrom, etc.). Maybe I have to tune sound daemon (aRts)?

3). Framebuffer. What I need to do to make my game run on Linux framebuffer? I
guess no OpenGL and “native” (not VESA) framebuffer driver. But my game
either lockups system completely or I get weird display (no transparency,
black stripes - it seems double-buffer doesn’t work), and, say, Maelstrom
runs fine.

I started development on SDL 1.2.3 (included in RH 7.3), on Windows I used old
1.2.0. I downloaded 1.2.5 but it didn’t solve problems.

Even if these are common questions, please help or at least give some links.

– uav

Hi everybody.

I am new both to Linux programming and to game programming (though neither to
Linux nor to programming!). I’m writing a simple arcade game - Yet Another
R-TYPE Clone - using SDL. My development platform is Linux (RH 7.3), but I
try to compile the game on Windows (MSVC6) from time to time. On Windows (98,
2000, XP) everything is ok. But on Linux, I get really weird behavior.

1). Performance. I develop the game on Athlon 1.4 GHz + 512MB SDRAM + ATi
Radeon 64MB DDR VIVO. I fixed FPS at 50, but on “complex” (~300-500 sprites)
scenes it slows down to 35-40 FPS? Why??? My system is too slow? Or my
algorithms are too complicated? But on Windows (without double-buffer and FPS
limit) I get 500-1200 FPS! There’s certainly something wrong!

If you’re using hardware surfaces, that is probably the source of the
difference. You won’t be able to get a hardware surface on Linux. I
think the exception is if when using DGA, but then your game has to be
suid root, or the permissions on the system have to be very specially
configured. I would suggest building a test using software surfaces and
try that on windows, see if the performance is more in-line with your
Linux version. That would answer the question.

Maybe the trouble is with my video card? I have another machine - Pentium
166MMX + 32MB EDO + S3 Trio64 1 MB. I get about 20 FPS on Linux, and on
Windows about the same. So the difference on Linux is much smaller than I
could expect.

Query and dump the properties of the display surface. This could be
caused by the same, or similar problems to the question above.

2). Sound sync. All sounds are late for one and even more seconds - on all SDL
games (including Maelstrom, etc.). Maybe I have to tune sound daemon (aRts)?

Are you using SDL sound functions, or SDL Mixer? If you’re using
SDL_Mixer, try setting the mixing chunk size to 1024, rather then the
default 4096kb. That should reduce latency a lot.

3). Framebuffer. What I need to do to make my game run on Linux framebuffer? I
guess no OpenGL and “native” (not VESA) framebuffer driver. But my game
either lockups system completely or I get weird display (no transparency,
black stripes - it seems double-buffer doesn’t work), and, say, Maelstrom
runs fine.

Dinna have any idea, laddy.On Mon, 2003-09-01 at 21:08, uav wrote:

I started development on SDL 1.2.3 (included in RH 7.3), on Windows I used old
1.2.0. I downloaded 1.2.5 but it didn’t solve problems.

Even if these are common questions, please help or at least give some links.

– uav


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030902/71cc2259/attachment.pgp