Quake3

Hello,

Recently purchased and installed Quake3 from Loki. Runs pretty good on
my linux box with voodoo3 card.
Does anyone know if SDL was used anywhere in the Quake3 code? I know
it’s probably mostly OpenGL-based, but
I was just curious. How 'bout MythII? Is Loki using SDL in these types
of commercial-quality games?

Take it easy.–
James Caple

Quake3 does not use SDL. I’m not sure about Myth II, but I know at least
the latest version of heretic II does use SDL.–
Brian

On Thu, 13 Jul 2000, James Caple wrote:

Hello,

Recently purchased and installed Quake3 from Loki. Runs pretty good on
my linux box with voodoo3 card.
Does anyone know if SDL was used anywhere in the Quake3 code? I know
it’s probably mostly OpenGL-based, but
I was just curious. How 'bout MythII? Is Loki using SDL in these types
of commercial-quality games?

Take it easy.

James Caple

James Caple wrote:

Hello,

Recently purchased and installed Quake3 from Loki. Runs pretty good on
my linux box with voodoo3 card.
Does anyone know if SDL was used anywhere in the Quake3 code? I know
it’s probably mostly OpenGL-based, but
I was just curious. How 'bout MythII? Is Loki using SDL in these types
of commercial-quality games?

Take it easy.

James Caple

SDL isn’t currently used (AFAIK), but there was some talk of replacing
its “interesting” approach to sound IO (mmap and DMA) with OpenAL or
SDL. This would make it get along more cleanly with ESD and ALSA. I
don’t know if anyone actually intends to do that, though.

-John

“John R. Hall” wrote:

SDL isn’t currently used (AFAIK), but there was some talk of replacing
its “interesting” approach to sound IO (mmap and DMA) with OpenAL or
SDL. This would make it get along more cleanly with ESD and ALSA. I
don’t know if anyone actually intends to do that, though.

What’s wrong with Quake3 sound? Quadra works the same! :wink:

Actually, it’s non-threaded like Quake, but we don’t use the mmap. Thank
you ddt! :slight_smile:

Has anyone compared ESD with regular OSS on something like a AMD
K6-2/350 using XMMS for example? It sucks. Skips at the slightest
provocation. Quake with ESD would probably be a severe pain in the ass.

Is there any intention of having the SDL sound be non-threaded one of
these days? I might even use it… :wink:

(I agree that a level of indirection, like OpenAL or SDL, abstracting
stuff like ESD, OSS and ALSA, is good)–
“You can have my Unix system when you pry it from my cold, dead
fingers.”
– Cal Keegan

James Caple writes:

I was just curious. How 'bout MythII? Is Loki using SDL in these types
of commercial-quality games?

Loki uses SDL, or at least parts of SDL, for most of their
products. Quake 3 isn’t made by Loki and thus doesn’t, as already
said, not use SDL.–
[ Below is a random fortune, which is unrelated to the above message. ]
“If you don’t want your dog to have bad breath, do what I do: Pour a little
Lavoris in the toilet.”
– Jay Leno

David Hedbor writes:

products. Quake 3 isn’t made by Loki and thus doesn’t, as already
said, not use SDL.

Uh. One not to many!–
[ Below is a random fortune, which is unrelated to the above message. ]
There is more to life than increasing its speed.
– Mahatma Gandhi

Pierre Phaneuf writes:

“John R. Hall” wrote:

Sdl isn’t currently used (AFAIK), but there was some talk of replacing
its “interesting” approach to sound IO (mmap and DMA) with OpenAL or
SDL. This would make it get along more cleanly with ESD and ALSA. I
don’t know if anyone actually intends to do that, though.

What’s wrong with Quake3 sound? Quadra works the same! :wink:

Actually, it’s non-threaded like Quake, but we don’t use the mmap. Thank
you ddt! :slight_smile:

Has anyone compared ESD with regular OSS on something like a AMD
K6-2/350 using XMMS for example? It sucks. Skips at the slightest
provocation. Quake with ESD would probably be a severe pain in the ass.

I can’t but agree more. ESD is not suitable for games, at least not
action games. If you don’t want it to skip, you need to buffer. If you
buffer you get latency. Even if you don’t buffer, esd has noticeable
latency.

Is there any intention of having the SDL sound be non-threaded one of
these days? I might even use it… :wink:

As in using non-blocking io? Although, what’s wrong with threaded
audio? :slight_smile:

(I agree that a level of indirection, like OpenAL or SDL, abstracting
stuff like ESD, OSS and ALSA, is good)

Definitely.–
[ Below is a random fortune, which is unrelated to the above message. ]
Q: What is purple and commutes?
A: An Abelian grape.

David Hedbor wrote:

Has anyone compared ESD with regular OSS on something like a AMD
K6-2/350 using XMMS for example? It sucks. Skips at the slightest
provocation. Quake with ESD would probably be a severe pain in the ass.

I can’t but agree more. ESD is not suitable for games, at least not
action games. If you don’t want it to skip, you need to buffer. If you
buffer you get latency. Even if you don’t buffer, esd has noticeable
latency.

Yeah, I didn’t even get into the latency of ESD. The time between the
click on the play button and the moment it starts playing is incredibly
long. I am not sure, but I think ddt started the “sound server in
another process through a pipe” thing, and he told me that he regrets
doing so. He likes his Quake1 design (which I think lives on in Quake2
and Quake3 with improvements) much better.

Is there any intention of having the SDL sound be non-threaded one of
these days? I might even use it… :wink:

As in using non-blocking io? Although, what’s wrong with threaded
audio? :slight_smile:

The audio device is always non-blocking, there is absolutely no
difference between using the O_NONBLOCK flag or not. I would think of
this as a bug, but thinking of it, having the write() call unblock only
when the buffer is finished playing would yield horrible output.

What wrong with threaded audio? Go into gdb and tell me! :wink:

No, it’s not really that bad, but I just feel it is so easy to make the
sound system based on the fd/handle or something, and putting a helper
function that starts a thread for the sound (for compatibility with
current apps).

I am thinking of something along the lines of the ConnectionNumber()
macro in Xlib. You can just use the Xlib event functions, or you can ask
for the ConnectionNumber() and use it in a select/poll. You have the
choice. Most people take the easy way with the Xlib functions, but
more advanced applications have the ConnectionNumber() available to play
with.

(I agree that a level of indirection, like OpenAL or SDL, abstracting
stuff like ESD, OSS and ALSA, is good)

Definitely.

I didn’t look much at the OpenAL API, does its design imply threaded
audio or could it be used in a non-threaded way? Thank God Quake is
non-threaded, so that if it switches to OpenAL, drivers will HAVE to
support the non-threaded code path correctly… :-)–
“There are two major products that come out of Berkeley: LSD and Unix.
We don’t believe this to be a coincidence.” – Jeremy S. Anderson

I didn’t look much at the OpenAL API, does its design imply threaded
audio or could it be used in a non-threaded way? Thank God Quake is

Either, although I don’t think anyone ever uses the non-threading.

non-threaded, so that if it switches to OpenAL, drivers will HAVE to
support the non-threaded code path correctly… :slight_smile:

You wish :). The threading would be used. It’s the Right Way to do
audio.

m.On Fri, Jul 14, 2000 at 09:46:22AM -0400, Pierre Phaneuf wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

Michael Vance wrote:

I didn’t look much at the OpenAL API, does its design imply threaded
audio or could it be used in a non-threaded way? Thank God Quake is

Either, although I don’t think anyone ever uses the non-threading.

Good, at least its there, and since it is open source, if it is broken,
I can fix it up. :slight_smile:

non-threaded, so that if it switches to OpenAL, drivers will HAVE to
support the non-threaded code path correctly… :slight_smile:

You wish :). The threading would be used. It’s the Right Way to do
audio.

Blargh. I have libpthread.so right there in the same directory as
libdevil.so and libbillgates.so. :wink:

I hate context switches with my guts. I have a knack for decompositing
problems into state machines and doing event-based programming (opposite
to most people who have an easier time doing an algorithm to its end,
thus the usual preference for threads), so non-blocking I/O is right on
with me (and fastest on most platforms).–
“How should I know if it works? That’s what beta testers are for.
I only coded it.” – Linus Torvalds

thus the usual preference for threads), so non-blocking I/O is right on
with me (and fastest on most platforms).

Eek. Startup a game like Quake3 on a card with non-optimized
glTexSubImage2D, and listen to the audio stammer because it’s non
threaded. Then load up Heretic2 on that same box and listen to the
audio smoothly playback because it’s threaded.

In our test, I think performance difference has been just about zero,
and it’s much easier to program it to avoid underflows.

But I’m sure Joe will love having you look at the non-threaded audio
in OpenAL :slight_smile:

m.On Fri, Jul 14, 2000 at 01:02:07PM -0400, Pierre Phaneuf wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

In article <Pine.LNX.4.10.10007131505320.19442-100000 at lotus.slothmud.org>,
writes:

Quake3 does not use SDL. I’m not sure about Myth II, but I know at least
the latest version of heretic II does use SDL.

Myth II uses SDL, always has, always will… ;-)–
Stephane Peter
Programmer
Loki Entertainment Software

“Microsoft has done to computers what McDonald’s has done to gastronomy”

Michael Vance writes:

In our test, I think performance difference has been just about zero,
and it’s much easier to program it to avoid underflows.

From what I have seen, disabling SDL sound has just about no effect on
framerates in SoF. Maybe 1-2% (this is on a single CPU box). I don’t
know what the difference is in Quake 3 though. :-)–
[ Below is a random fortune, which is unrelated to the above message. ]
I remember when legal used to mean lawful, now it means some
kind of loophole.
– Leo Kessler

From what I have seen, disabling SDL sound has just about no effect on
framerates in SoF. Maybe 1-2% (this is on a single CPU box). I don’t
know what the difference is in Quake 3 though. :slight_smile:

Yeah, but we were talking about threaded vs. non-threaded
performance. I beliefe Pierre thinks the context switches are cramping
his style.

You can thank Joe for the extremely good performance characteristics
of OpenAL (as long as you don’t --enable-fft :slight_smile: ).

m.On Fri, Jul 14, 2000 at 12:11:52PM -0700, David Hedbor wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

Michael Vance wrote:

thus the usual preference for threads), so non-blocking I/O is right on
with me (and fastest on most platforms).

Eek. Startup a game like Quake3 on a card with non-optimized
glTexSubImage2D, and listen to the audio stammer because it’s non
threaded. Then load up Heretic2 on that same box and listen to the
audio smoothly playback because it’s threaded.

Tsk tsk. Non threaded doesn’t mean synchronous. Hmm, I got to try
SIGIO-driven sound soon… :slight_smile:

Does Heretic2 use the same glTexSubImage2D to do its cinematics? Is that
OpenGL function optimized on Voodoo3? I have a Voodoo2 and I know it
isn’t with this one, but for V3?

In our test, I think performance difference has been just about zero,
and it’s much easier to program it to avoid underflows.

I can’t deny it is easier to program. A simple decoding loop is so much
easier to do than a complicated event driven decoder. But I sure love it
anyway. Threads are in the “over my dead body” department here, we have
enough with the X server being in a separate process…

But I’m sure Joe will love having you look at the non-threaded audio
in OpenAL :slight_smile:

Joe? Who’s Joe? I might look very soon… :-)–
“The only ‘intuitive’ interface is the nipple. After that, it’s
all learned.” – bediger at teal.csn.org (on user interfaces)

It’s really time that Joe gets interviewed :-)On Fri, Jul 14, 2000 at 05:29:03PM -0400, Pierre Phaneuf wrote:

But I’m sure Joe will love having you look at the non-threaded audio
in OpenAL :slight_smile:

Joe? Who’s Joe? I might look very soon… :slight_smile:


Daniel Vogel
Programmer
Loki Entertainment Software

Tsk tsk. Non threaded doesn’t mean synchronous. Hmm, I got to try
SIGIO-driven sound soon… :slight_smile:

Aigh! /me runs :slight_smile:

Does Heretic2 use the same glTexSubImage2D to do its cinematics? Is that

Yep.

OpenGL function optimized on Voodoo3? I have a Voodoo2 and I know it

Yes, it’s pretty fast on a Voodoo3.

I can’t deny it is easier to program. A simple decoding loop is so much
easier to do than a complicated event driven decoder. But I sure love it
anyway. Threads are in the “over my dead body” department here, we have

Ha ha. I know I’ve been called a purist, but really :slight_smile:

Joe? Who’s Joe? I might look very soon… :slight_smile:

Joe Valenzuela, mighty OpenAL programmer. I think he’s received two
patches ever :slight_smile:

m.On Fri, Jul 14, 2000 at 05:29:03PM -0400, Pierre Phaneuf wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

But I’m sure Joe will love having you look at the non-threaded audio
in OpenAL :slight_smile:

Joe? Who’s Joe? I might look very soon… :slight_smile:

Check out the AL_SYNC flag for openal context creation. No threads are
created and nothing gets updated until alcUpdateContext(context_id) is
called. The application is responsible for updating in a timely manner.

Audio writes are still blocking, however, so some work would need to
be done to either write a dma backend or what-have-you. This is among
those things less well tested than others, so consider yourself warned.

Of course, patches cheerfully accepted.On Fri, Jul 14, 2000 at 05:29:03PM -0400, Pierre Phaneuf wrote:


J. Valenzuela – tsaotsao at lokigames.com

Yes, and those came from his wife and were meant for his trousers ;-)On Fri, Jul 14, 2000 at 03:13:27PM -0700, Michael Vance wrote:

Joe? Who’s Joe? I might look very soon… :slight_smile:

Joe Valenzuela, mighty OpenAL programmer. I think he’s received two
patches ever :slight_smile:


Daniel Vogel
Programmer
Loki Entertainment Software

Tsk tsk. Non threaded doesn’t mean synchronous. Hmm, I got to try
SIGIO-driven sound soon… :slight_smile:

Lots of sound card drivers have bugs with this one. :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software