forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EE-side SPU library

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
jum



Joined: 06 Apr 2004
Posts: 38
Location: Cape Town

PostPosted: Mon Dec 20, 2004 6:59 pm    Post subject: EE-side SPU library Reply with quote

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...
Back to top
View user's profile Send private message Visit poster's website
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Mon Dec 20, 2004 9:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Mon Dec 20, 2004 9:46 pm    Post subject: Reply with quote

lets sign up lukasz for that :)
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Mon Dec 20, 2004 10:56 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
jum



Joined: 06 Apr 2004
Posts: 38
Location: Cape Town

PostPosted: Tue Dec 21, 2004 8:23 pm    Post subject: EE-side SPU lib Reply with quote

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...
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Dec 22, 2004 3:26 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Thu Dec 23, 2004 8:07 pm    Post subject: librsd Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Thu Dec 23, 2004 11:07 pm    Post subject: Reply with quote

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 :(
Back to top
View user's profile Send private message Visit poster's website
gawd



Joined: 09 Feb 2005
Posts: 28
Location: Israel

PostPosted: Sat Feb 12, 2005 11:39 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group