Page 1 of 1
EE-side SPU library
Posted: Mon Dec 20, 2004 6:59 pm
by jum
I've started building a little EE lib to make sounds on the SPU for a game I'm writing, since I couldn't find any easy-to-use EE sound lib. My lib uses the IOP rom OSDSND module to control the SPU from the IOP side.
2 questions:
1. Am I "re-inventing the wheel"? (ie: does a nice easy-to-use EE lib for controlling the SPU exist?)
2. Is it possible to access the SPU registers directly from the EE, like you can apparently access the IOP memory directly? If so, do the registers work as in the PS1? How does the SPU2 "core switching" work?
I'm interested in making sound programming easier on the PS2, not in making the most efficient driver.
- Jum
PS: Anyone with a cool idea for a music or sound-related game please leave a message.
Posted: Mon Dec 20, 2004 9:07 pm
by pixel
Well, when I worked on the beats of rage re-port from Neill Corlett, I noticed he was using what sony is calling "libsdr", which seems to be the ee-remote for the LIBSD irx. Since he was only using some basic bits, I was able to replace it with some custom sjpcm code (which is some kind of "remote' for libsd). But someone should write freesdr :)
Posted: Mon Dec 20, 2004 9:46 pm
by blackdroid
lets sign up lukasz for that :)
Posted: Mon Dec 20, 2004 10:56 pm
by evilo
After discussing of sound stuff with Pixel a few weeks ago, I've started to work on a lib using the same approach than libsdr (so access libsd remotely from the EE). It's anyway still far from being finished, since I've been busy with neocd these last days, and only the EE part is only in some advanced stage (yes I started with the EE side code, don't know why), and the iop irx is still almost nowhere.
My goal, anyway, was to work on it during the xmas holiday, to get sthg functional for January and use it in the next version of neocd.
EE-side SPU lib
Posted: Tue Dec 21, 2004 8:23 pm
by jum
Thanks for the feedback dudes.
I've got a simple EE lib working, and it wouldn't be hard to get it to the level of my old PS1 SPU lib, but some more questions:
1. My code loads the rom OSDSND module on the IOP side. This has the advantage of not requiring the lib to have an "external" irx. What advantages would I get if I switched to using libsd.irx or freesd.irx?
2. Where can I get docs on the OSDSND functions? (Only got very basic doc, and I don't want to have to mess around finding out parameter and return data formats).
3. Does the SPU have any sort of "filter" function, or can this be emulated in some way?
- Jum
Posted: Wed Dec 22, 2004 3:26 am
by J.F.
1. OSDSND only allows ADPCM while libsd.irx allows you to do PCM. That means OSDSND can't use dynamic audio without wasting a great deal of time converting from PCM to ADPCM. You'll notice all player programs use libsnd.irx because of that.
2. There is example code at:
http://ps2dev.org/kb.x?T=745
3. The SPU/SPU2 have an effects function that operates on the mixed output of all sound channels, but it is not documented at all. As far as I know, Sony just provides set parameters to use for certain types of effects.
librsd
Posted: Thu Dec 23, 2004 8:07 pm
by Lukasz
A long time ago, I wrote a EE lib and IRX which is a EE interface for freesd/libsd. It supports callbacks, but all memory addresses which can be set are still on the IOP, it should be change so that EE addresses could be set. I did this lib upon request but never got to release it since I never properly tested it (i'm not a great sound coder :).
It uses Ps2lib for EE and Ps2drv for IOP, but can easily be ported over to ps2sdk.
www.lukasz.dk/files/librsd.zip (lib remote sd)
Enjoy and merry xmas :)
PS: If any one wants to get started with RPC programming, this is a very good and simple example.
Posted: Thu Dec 23, 2004 11:07 pm
by evilo
lol .... this is exactly what I'm doing !
I'll have a look to your package and see if it worth the pain for me to continue.. or to return less serious stuff :(
Posted: Sat Feb 12, 2005 11:39 pm
by gawd
Argh.
Well. I guess I started one myself. It was a good practice writing IRXs. uhm.
always read forums before writing code.
ALWAYS read forums before writing code!