CD audio with SDL

Hello,

I?ve implemented SDL cd-audio support in my game.
It works basicly but everytime I start, the game hangs until the CDROM spins
up and starts playing the track.
Replaying or skipping between the tracks during gameplay freezes the game
for ~ 1 second.

I?ve tried “SDL_CreateThread” but this doesn?t really help.

Is there any solution for that.

Dieter–
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

Hi,

Make sure that SDL_CDStatus() is called only once in your program, and
before
playing any of the tracks. That function seems to read the TOC from
the cd and does slow down the system.

Does the cd your playing start with data track? if so SDL takes a while to
seek to the next audio track, this could be why your game hangs at
startup.

Nehal> ----- Original Message -----

From: mummenschanz@gmx.net (Dieter Mummenschanz)
Subject: [SDL] CD audio with SDL
To: sdl at libsdl.org

Hello,

I?ve implemented SDL cd-audio support in my game.
It works basicly but everytime I start, the game hangs until the CDROM spins
up and starts playing the track.
Replaying or skipping between the tracks during gameplay freezes the game
for ~ 1 second.

I?ve tried “SDL_CreateThread” but this doesn?t really help.

Is there any solution for that.

Dieter


GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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

Hi,

Make sure that SDL_CDStatus() is called only once in your program, and
before
playing any of the tracks. That function seems to read the TOC from
the cd and does slow down the system.

SDL_CDStatus() is called more than once before playing music.
Once to see if there is a CD in the drive if there is more than one CDROM is
hosted.
During the game to see if the track has stopped to start playing again.
And before trying to play a track.

Is this the Problem???

But I need to do this checks 8(

Does the cd your playing start with data track? if so SDL takes a while to
seek to the next audio track, this could be why your game hangs at
startup.

I have NO data tracks on the CDs. Only CDaudio.

Btw: Is there a way to control the CDaudio volume with SDL(_mixer)?

Dieter–
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

Hi,

Make sure that SDL_CDStatus() is called only once in your program, and
before
playing any of the tracks. That function seems to read the TOC from
the cd and does slow down the system.

SDL_CDStatus() is called more than once before playing music.
Once to see if there is a CD in the drive if there is more than one CDROM
is
hosted.
During the game to see if the track has stopped to start playing again.
And before trying to play a track.

Is this the Problem???

But I need to do this checks 8(

Why do you need to run it before playing each track? running it to check
if the track has stopped is fine, but you don’t need to run it before
playing
a track. If you take it out before playing each track, the freezing during
track changes should go away.

SDL cd support isn’t the best, SDL_CDStatus() does a
bunch of other things that you probably don’t need, if your game supports
windows and run SDL_CDStatus() it slows down the system even more than
in linux.
An alternate solution is to use another cd library, such as libcda, which
can
check if the CD has stopped without hogging down your system.

Does the cd your playing start with data track? if so SDL takes a while
to

seek to the next audio track, this could be why your game hangs at
startup.

I have NO data tracks on the CDs. Only CDaudio.

Btw: Is there a way to control the CDaudio volume with SDL(_mixer)?

Not too sure about that.

Dieter


GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


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

----- Original Message -----
From: mummenschanz@gmx.net (Dieter Mummenschanz)
To:
Sent: Thursday, March 21, 2002 1:23 PM
Subject: Re: [SDL] CD audio with SDL