[aquaria] Aquaria port for OS4 PPC

Ryan C. Gordon icculus at icculus.org
Wed Jun 16 16:00:10 EDT 2010


> If it's feasible to use SDL threads on arbitrary platforms, you could
> probably start up a decode thread for each sound played and pull PCM
> data from that.  (Assuming OpenAL has a way to retrieve audio from a
> function instead of a fixed buffer, that is.  In the worst case, you
> could always set up a PCM ringbuffer for OpenAL and push the PCM into
> there instead.)

OpenAL has a method called "buffer queueing" so you can just keep 
handing it arbitrarily-sized buffers as you decode more, and it'll 
append it to the end of what the source is currently playing. It's meant 
to stream audio like this. I just never had a chance to hook it up 
properly, since it added quite a few complications to the existing AL 
renderer. Still: the biggest technical hurdle here was probably my own 
laziness.  :)

There's also an extension (AL_EXT_vorbis) that lets you hand the AL a 
buffer of ".ogg" data instead of raw PCM samples, and it'll do the right 
thing (which, presumably, means decoding it in chunks on demand). That 
can be used without any serious code changes to Aquaria, but most AL 
builds don't support it.

> I did a Valgrind pass on Linux, and the decoded audio was by far the
> largest memory user, at about 187MB when I closed the window.

Yeah...that's definitely worth fixing, then.   :)

> PSP -- belatedly, I wonder if that needs to be signed), but defaults to
> a full int on other platforms, resulting in a 39MB structure.  Is there
> any reason it can't default to [signed/unsigned] char instead?

I presume that's a mistake (the original author's thought was probably 
along the lines of "wait, there's no built in "__int8" outside of Visual 
Studio!" and just filled something in and forgot to come back to it).

I don't see anywhere else SmallInt is used, except the grids. I'll just 
remove the typedef and make the grids into "signed char" arrays.

--ryan.



More information about the aquaria mailing list