EE-side SPU library

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
jum
Posts: 38
Joined: Tue Apr 06, 2004 9:31 pm
Location: Cape Town
Contact:

EE-side SPU library

Post 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.
8 bits is all you'll ever need...
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post 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 :)
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

lets sign up lukasz for that :)
Kung VU
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post 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.
User avatar
jum
Posts: 38
Joined: Tue Apr 06, 2004 9:31 pm
Location: Cape Town
Contact:

EE-side SPU lib

Post 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
8 bits is all you'll ever need...
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post 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.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

librsd

Post 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.
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post 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 :(
gawd
Posts: 28
Joined: Wed Feb 09, 2005 10:36 pm
Location: Israel
Contact:

Post 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!
Post Reply