LIBRSPU v0.90 beta released!
I thought that it was unusual that some of those legendary PS2 hackers/developers had claimed that OSDSND could only handle ADPCM data.
I was a little disappointed that the older consoles lacked rom0:LIBSD, but had rom0:OSDSND like all consoles did.
Since all consoles have rom0:OSDSND, it's probably be a wonderful thing if it could be used by homebrew software.
Hence, I dug up Icewatus's "PS2 Sound Test", did some experiments, fixed some bugs and found that:
- OSDSND is a full RSPU driver.
- The "RSPU driver" seems to be the predecessor to the newer sound drivers that come and interact with rom0:LIBSD.
- The RSPU driver seems to be a combined version of the Playstation LIBSPU and LIBSND libraries, but with some extra functions to harness the new features of the SPU2.
- Since the RSPu driver contains functions from LIBSPU and LIBSND, we can use the present functions to play Sony's SEQ, VAB and VAG files.
- On the contrary to what was written in the threads forums.ps2dev.org :: View topic - EE-side SPU library and forums.ps2dev.org :: View topic - Talk to me about sound
*OSDSND plays sounds at 48KHz (Oh wait, it depends on your console's BIOS version, and hence the version of OSDSND!).
*OSDSND supports 2 cores, and hence the SPU2 is operating in it's normal mode (Not Playstation mode).
*OSDSND can indeed handle and play PCM data like the original Playstation LIBSPU and the LIBSD driver from the modern Sony Playstation 2 SDKs.
- All functions are exactly the same as their ancestors in LIBSND and LIBSPU.
- All functions are mapped onto the EE via the SIF RPC. There are no IOP library exports.
- However, the memory buffers are expected to be in IOP memory, so you have to transfer your sound data to the IOP first.
- Sounds are expected to be played back at 48KHz (48000Hz), so you have to upsample them yourself.
- The good point about the AUTODMA functionality is that BGM can be played back with little interaction with the EE, especially if the BGM already has a sample rate of 48KHz.
- It seems like the OSDSND module that comes bundled with earlier consoles have the SPU running at 48KHz, and newer versions run the SPU at a different rate (44.1KHz?!).
The BIOS version that I have noticed that comes with a version of OSDSND that runs at 48KHz is my SCPH-10000's BIOS (v1.01).
Maybe this abnormaly only occurs within PCSX2, so I'll try to perform some tests on the real hardware someday.
- Audio data has to be interleaved, every 512 bytes. (Hence, in a block, there is 512 bytes of left-channel audio data, followed by 512 bytes of right-channel audio data).
For those who don't know much about the LIBSPU and LIBSND libraries: SEQ is MIDI-like data, so OSDSND might be useful.
I don't know what RSPU stands for anyway. But Sony seems to refer to the older sound driver as the "RSPU driver" (Sometimes even as "RSPU2 driver").
As for offloading the additional load caused by the need to upsample sound data, the upsampling can be done on the IOP.
I wanted to do that, but couldn't get that done right. :/
LIBRSPU v0.90 beta + examples: LIBRSPU_v090.7z
Let me know what you guys think. :D