Archive for February, 2009

PS2Doom with proper sound, at last!

February 24, 2009

And today is the day!

Sound seems now reasonable, after adding some calls to swap between the mixer and game threads and even without any optimization over the mixer code, it seems to run well.

This is PS2Doom v.1.0.1.0 (let’s call the original Lukasz version 1.0.0.0) and features sound. Basically is the same version presented at https://ps2homebrewing.wordpress.com/2008/02/19/modified-ps2-port-of-doom/ but I first replaced the sound routines by Jason’s http://www.jasonyu.net/ps2/lsdldoom-bundle.zip hoping to get sound working. Since it didn’t worked, I removed the SDLmixer calls from Jason’s functions and injected my own mixer calls.

I developed a rather simple mixer I decided to call cosmitoMixer, or cosMix for short and I’ll present it properly soon. Currently the cosMix uses SJPCM lib (this means it will fail on some older Japanese consoles) but hopefully I’ll switch to isjpcm lib.

Binary and sources here :
http://www.4shared.com/file/89869930/2d608c18/ps2doom_v1010.html

Instructions for running and compiling included. WADs not included.

The plan is to drop the unstable lsdldoom port and apply all the features I’ve been adding to PS2Doom port.

Stay tuned for more updates.

Advertisements

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.