Posts Tagged ‘mixer’

Sound in PS2Doom closer than ever

February 22, 2009

Sound support for Lukasz’s Doom port is closer than ever!

I decided to drop the use of  SDL for audio. I took the sources of ps2doom and injected my own sound mixing engine, which is still being developed and improved.

Actually, I started from Lukasz sources and adapted Jason’s sound functions from his own port, which makes use of SDLmixer. However, for some unknown reason, this didn’t worked.

Jason’s functions seemed better than the other present at Lukasz sources so I started from this Lukasz/Jason combined work and replaced SDLmixer call to my own mixer functions.

Sound is currently shitty. It needs proper tunning of the cooperative multitask of the sound mixer thread.

Just for a tease, I leave you two alpha previews:

doom_alpha1.elf
does minimal task switching, just to get some time slice for the sound mixing but not enough to avoid the run out of the sound buffers. So the laggy “echo” effect.

doom_alpha2.elf
has perfect sound yet performance drags. It does excessive task switching for every ‘while’ loop over the source code. So basically shows that there are some critical loops over the game code shouldn’t be interrupted by the sound mixing routines. A wise selection must be made. The optimal is therefore between the two versions.

Volume and panning isn’t impremented yet, so the sound comes at full volume, even if the sound sources are far away.

How to try it?

Just copy it to a USB pen along with doom1.wad or doom.wad (not included) and run it with uLaunchELF. It only loads the first wad it finds, so put doom1.wad or doom.wad into the pen drive, not the both at once.

Currently, doom2.wad isn’t working.

Get it from the rapid share link before it expires 😉
http://rapidshare.com/files/201360031/ps2doom_alpha_plus_sources.zip.html

Good news regarding the mixer

February 7, 2009

I’ve been working on a sound mixer done from scratch although taking advantage of existent libs for sound playing, like SjPCM and I was able to mix and play two samples perfectly using threads. This means “play and forget” for the main program, since all the mixing and playing work is done by the mixer thread.

So, the basics of the mixer are done and now it’s a matter of finishing it. The primary goal is to use with the PS2 Doom ports in order to replace SDLMixer which seems to not be fully working along with the current ps2sdk.

BTW: I’m wondering if you, the reader, could suggest a nice name for the mixer. The current candidate name is “cosmitoMixer” but I would like to name it with something better… Fell free to post your suggestions please.