Archive for the ‘announcements’ Category

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.

Sources of “Natal 2007” available

January 18, 2009

Almost one year ago I did a small production (see here), a sort of “powerpoint” slideshow with music (but with good music!) were Christmas  was the theme and I sended to some of my friends as a (late) gift.

It evolved from the sources of a oggplayer released by a dude nicked CarelessWhisper which I then added synchronized image display. I really should released the source earlier but my intent was to comment on it, serving as a tutorial for what I did and for things that should be done better, but for me time is scarce as always and also since then, so I can only show you the sources…

I hope to comment on it briefly soon, but any question, leave at the comments zone.

Currently the sources won’t compile out of the box, due to recent gsKit changes but it’s really not complicated to fix it for yourself (but be assured that I’ll do it…)

You can get it from the Assembla public repo

until I find a better free hosting subversion service (does anyone knows alternatives to google code?) since I feel cheated by and I simply don’t want to keep using their public services in the near future. I even fear from the longevity of their services since they pissed off many people with their recent change of service rules… I guess google will be around for many years and I really hate broken links.

So enjoy and learn with it (at least learn how to do better 🙂 since today I would to it better)

PS2Doom – Time for updates

December 29, 2008

Both Lukasz and Janson’s ports of Doom uses SDL for graphics and sound. And I realised that the PS2 port of SDL (at least the SDL_mixer) is buggy. An example of this is clear if you look at the sources of PS2Pang: Before any call to SDL_mixer’s Mix_PlayChannel() function which actuallys pumps the samples to the mixer there is a misterious ‘printf(“”)’ which seems to do a lot more than nothing – without it, there is only silence, so no sound is ever played… (I suspect it could be a thread issue).

So, actually, it’s quite normal to have silence in this PS2 ports of Doom instead of any sound.

So, lets all go home and live happy with a silent Doom and I’m going to start working over another project.


Just kidding.


So, I could take two paths:

  1 – debug SDL_mixer
  2 – forget about SDL_mixer and use an alternative for sound

Sincerely, option 1 is not appealing to me, without any decent debugging tools. I’ll take path 2 instead.

Currently I’m exploring the well known and tested sjPCM library. It’s a low-level lib (well, it’s more a middle-level actually) so I’ve been looking at other projects that uses it like PGEN emulator to see how it works. I should also need to make a sound mixer by myself, since sjPCM only pumps sound samples to the PS2 dual SPU cores. I never did any sound mixer before, but it seems quite easy (i’ll probabily post a sketch of it later).
The question is: Where to do the mixing? At the IOP or at the EE? Doing in the IOP would be optimal since it would be synchronized with the sound pumping (I would only need to do the mixing just before the pumping to the SPU core) but I wonder if that’s too much work for the 36Mhz IOP… Doing the mixer on the EE may not be much simple since I would need to call it periodically and as you may know, the PS2 only have cooperative multitasking. Anyway, this all should be doable.
I’ve also chatting with jbit (helpful dude, he is) since his ps2snd library is able to send sound samples to the PS2 hardware as long as those are previously ADPCM encoded. This makes a lot of sense, since the PS2 already does sound mixing as long the audio streams are ADPCM encoded (the Doom sounds are the usual PCM signed words but there are examples on the ps2sdk for ADPCM encoding). He gave me some snippets of his yet unrealised ps2kit library regarding audio and I’m still messing with it (sucessful compiling but yet unsucessful playing).

I might also try to see why the heck the implanted Jason’s audio functions doesn’t work over Lukasz port… Those should work (I wonder how Jason’s was able to use sucessfully SDL_mixer considering the odd behaviour of it…) just because the time Jason must had over these.

PS2Doom – The Quest for Sound

October 4, 2008

If you’ve been paying attention to the source repository

then you’ll now that I proceed with the quest for giving Lukasz‘s PS2Doom port sound capabilities, imported from latest prboom+ sources (read my previous post here).

Well, after replacing the original sound routines from prboom+ I have still some bugs to hunt. I managed to get some chopping sound but it’s rather strange since it’s the result of messing with the sample rate and doing a printf to the console! It doesn’t make sense 🙂 I guess it needs more debugging work.

My new nick

August 3, 2008

I’m now using cosmito as a less stupid nick than ptek 😛

Some updates

August 3, 2008

Well, progress has being slow as usual. Allways busy at work, as you know.

In the meantime, I’ve been developing a sort of sprite displaying system (fancy name goes here), that is, a system that allows to load and display bitmaps from filesystem, supporting for basic animation and transparency, as required for sprite display.

There is still some technical difficulties, but you can get a preview here :
lowrestransparent7 romfs.rar

(no I’m not coding a web browser ;))

Regarding previous projects, yesterday I finally decided what to do to overcome the sdldoom sound crash problem. I no longer suspect of inherent bugs in audio driver and USB file loading in parallel, since similar issues I was experiencing in another project was just bad usage from my side :S

So, it looks like somewhere in the current port of sdldoom, some function is behaving badly, probabily corrupting memory that is shared by the audio driver and/or doom audio routines… The bug could also be intself in the audio routines of the port. But these are only guesses and unfortunably will remain as they are, since due to lack of decent free time and debugging support for the ps2sdk finding the offending function would be a nightmare…

So, the future? Replacing the audio routines in this port doesn’t seem to wisest thing to do, although this could be the solution if the bug lives there – If the bug is somewhere in the rest of the port, then replacing the audio would be wasted hours. The right thing to do is to start porting a more mature doom port, like proboom+ 🙂 But since it’s a somewhat large project, I’ll only port its audio routines and put them in the initial Lukasz doom port.

And this almost right thing started to happen yesterday 🙂

I’m keeping the sources in the assembla free svn repository :

so, keep an eye on the progress by looking at the WIP-sound.txt file on the trunk.


I also start looking for some existent ports of ZX Spectrum emulators. Yes, I pretend to bring one to the PS2!

I tried the Windows and Linux version of zx4all but the sound is crappy, so it’s out of question. Fuse seems very nice, and there is also a nice PSP port, which could be a starting point.

Keep tuned 🙂

Public sources

April 5, 2008

I’ve set up a svn repository for my public sources. At the moment, only the sources for lsdldom are there.

Use your favourite SVN client to get those from :

From now then, it’s the only way you’ll get the lsdldoom PS2 port sources I’m improving.

If you’re new to SVN, I recommend this client if you use Windows :