SPU2
-
- Posts: 19
- Joined: Thu Jun 09, 2005 3:18 am
SPU2
I was just wondering what would be the best way to obtain technical information on the PS2's SPU2. I never got a chance to order a linux dev kit, so would it be there or are there other docs out there? thanks.
There isn't much info about the SPU2 floating around unfortuantly.
However in essence it's two PlayStation1 SPUs stuck together with some core selection logic and capable of 48KHz output (and some other stuff).
Programming the SPU2 is pretty much the same as programming a PlayStation1 SPU.
I wrote the ps2snd module/library in ps2sdk (some day I'll update freesd so ps2snd works with it, I swear!) which should give an EE program access to all the interesting SPU2 features, and an easy way to stream stereo ADPCM music.
If you want I can whip up a few examples on how to use libps2snd for uploading samples, playing voices and doing some basic effects on the output.
Oh, and the PS2 Linux kit didn't include any documentation about the SPU2.
Hope this helps
However in essence it's two PlayStation1 SPUs stuck together with some core selection logic and capable of 48KHz output (and some other stuff).
Programming the SPU2 is pretty much the same as programming a PlayStation1 SPU.
I wrote the ps2snd module/library in ps2sdk (some day I'll update freesd so ps2snd works with it, I swear!) which should give an EE program access to all the interesting SPU2 features, and an easy way to stream stereo ADPCM music.
If you want I can whip up a few examples on how to use libps2snd for uploading samples, playing voices and doing some basic effects on the output.
Oh, and the PS2 Linux kit didn't include any documentation about the SPU2.
Hope this helps
Okay, over the weekend I'll write some sample code for using ps2snd (libsd) for doing sound effects and stuff using voices while streaming ADPCM music from somewhere.
I'll also write some basic docs about how libSD does stuff, since it may not be completly obvious in some cases.
Keep in mind that ps2snd requries a relativly recent SCE libSD at the moment, since freeSD and old libSD's have problems with interrupts amungst other things, and I havn't got round to finding and fixing exactly what's up yet.
I'll also write some basic docs about how libSD does stuff, since it may not be completly obvious in some cases.
Keep in mind that ps2snd requries a relativly recent SCE libSD at the moment, since freeSD and old libSD's have problems with interrupts amungst other things, and I havn't got round to finding and fixing exactly what's up yet.
-
- Posts: 19
- Joined: Thu Jun 09, 2005 3:18 am
Thanks jbit, I can't thank you enough :)jbit wrote:Okay, over the weekend I'll write some sample code for using ps2snd (libsd) for doing sound effects and stuff using voices while streaming ADPCM music from somewhere.
I'll also write some basic docs about how libSD does stuff, since it may not be completly obvious in some cases.
Keep in mind that ps2snd requries a relativly recent SCE libSD at the moment, since freeSD and old libSD's have problems with interrupts amungst other things, and I havn't got round to finding and fixing exactly what's up yet.
@shogun: i remember from a LONG time ago I came across a ps1 SPU library with nice code and a technical doc. A bit of googling and I found this:
http://www.geocities.com/james7780/PSX/psxprog.html
I'm pretty sure it's the same lib that I remember, but can't see the doc in there. It should be easy to find anyway if you search for old ps1 spu info.
cheers,
Tony
http://www.geocities.com/james7780/PSX/psxprog.html
I'm pretty sure it's the same lib that I remember, but can't see the doc in there. It should be easy to find anyway if you search for old ps1 spu info.
cheers,
Tony
Yep! Just noticed. :) Jbit had offered info on using libsd to take advantage of the more technical aspects of the SPU2. While a few people could use technical info on the SPU2, more people could use info on libsd. Plus, like I said, the SPU isn't exactly a SPU2, so it would still take more work to go from SPU info to working directly on the SPU2.
-
- Posts: 19
- Joined: Thu Jun 09, 2005 3:18 am
@dreamtime: first of all, thanks for your great ps2dev tutorials. second of all, thanks for the link. this is a start to understanding how the SPU2 works :)
so far, all I was able to find on SPU2 was a set of registers. These were copied and pasted from the PS2E plugin SPU2null 0.4 by the pcsx2 team:
#define REG_VP_VOLL 0x1F900000
#define REG_VP_VOLR 0x1F900002
#define REG_VP_PITCH 0x1F900004
#define REG_VP_ADSR1 0x1F900006
#define REG_VP_ADSR2 0x1F900008
#define REG_VP_ENVX 0x1F90000A
#define REG_VP_VOLXL 0x1F90000C
#define REG_VP_VOLXR 0x1F90000E
#define REG_S_PMON 0x1F900180
#define REG_S_NON 0x1F900184
#define REG_S_VMIXL 0x1F900188
#define REG_S_VMIXEL 0x1F90018C
#define REG_S_VMIXR 0x1F900190
#define REG_S_VMIXER 0x1F900194
#define REG_P_MMIX 0x1F900198
#define CORE0_ATTR 0x1F90019A
#define REG_A_IRQA 0x1F90019C
#define REG_S_KON 0x1F9001A0
#define REG_S_KOFF 0x1F9001A4
#define REG_A_TSA 0x1F9001A8
#define REG__1AC 0x1F9001AC
#define REG__1AE 0x1F9001AE
#define REG__1B0 0x1F9001B0
#define REG_VA_SSA 0x1F9001C0
#define REG_VA_LSAX 0x1F9001C4
#define REG_VA_NAX 0x1F9001C8
#define REG_A_ESA 0x1F9002E0
#define REG_A_EEA 0x1F90033C
#define REG_S_ENDX 0x1F900340
#define SPU2_STATX_WRDY_M 0x1F900344 //not sure!
#define CORE1_ATTR 0x1F90059A
#define REG__5B0 0x1F9001B0
#define SPU2_STATX_DREQ 0x1F900744 //not sure!
#define REG_P_MVOLL 0x1F900760
#define REG_P_MVOLR 0x1F900762
#define REG_P_EVOLL 0x1F900764
#define REG_P_EVOLR 0x1F900766
#define REG_P_AVOLL 0x1F900768
#define REG_P_AVOLR 0x1F90076A
#define REG_P_BVOLL 0x1F90076C
#define REG_P_BVOLR 0x1F90076E
#define REG_P_MVOLXL 0x1F900770
#define REG_P_MVOLXR 0x1F900772
#define SPDIF_OUT 0x1F9007C0
#define IRQINFO 0x1F9007C2
#define SPDIF_MODE 0x1F9007C6
#define SPDIF_MEDIA 0x1F9007C8
No idea what they do or how they work yet. I tried to do a google search on the registers, but no results :(
so far, all I was able to find on SPU2 was a set of registers. These were copied and pasted from the PS2E plugin SPU2null 0.4 by the pcsx2 team:
#define REG_VP_VOLL 0x1F900000
#define REG_VP_VOLR 0x1F900002
#define REG_VP_PITCH 0x1F900004
#define REG_VP_ADSR1 0x1F900006
#define REG_VP_ADSR2 0x1F900008
#define REG_VP_ENVX 0x1F90000A
#define REG_VP_VOLXL 0x1F90000C
#define REG_VP_VOLXR 0x1F90000E
#define REG_S_PMON 0x1F900180
#define REG_S_NON 0x1F900184
#define REG_S_VMIXL 0x1F900188
#define REG_S_VMIXEL 0x1F90018C
#define REG_S_VMIXR 0x1F900190
#define REG_S_VMIXER 0x1F900194
#define REG_P_MMIX 0x1F900198
#define CORE0_ATTR 0x1F90019A
#define REG_A_IRQA 0x1F90019C
#define REG_S_KON 0x1F9001A0
#define REG_S_KOFF 0x1F9001A4
#define REG_A_TSA 0x1F9001A8
#define REG__1AC 0x1F9001AC
#define REG__1AE 0x1F9001AE
#define REG__1B0 0x1F9001B0
#define REG_VA_SSA 0x1F9001C0
#define REG_VA_LSAX 0x1F9001C4
#define REG_VA_NAX 0x1F9001C8
#define REG_A_ESA 0x1F9002E0
#define REG_A_EEA 0x1F90033C
#define REG_S_ENDX 0x1F900340
#define SPU2_STATX_WRDY_M 0x1F900344 //not sure!
#define CORE1_ATTR 0x1F90059A
#define REG__5B0 0x1F9001B0
#define SPU2_STATX_DREQ 0x1F900744 //not sure!
#define REG_P_MVOLL 0x1F900760
#define REG_P_MVOLR 0x1F900762
#define REG_P_EVOLL 0x1F900764
#define REG_P_EVOLR 0x1F900766
#define REG_P_AVOLL 0x1F900768
#define REG_P_AVOLR 0x1F90076A
#define REG_P_BVOLL 0x1F90076C
#define REG_P_BVOLR 0x1F90076E
#define REG_P_MVOLXL 0x1F900770
#define REG_P_MVOLXR 0x1F900772
#define SPDIF_OUT 0x1F9007C0
#define IRQINFO 0x1F9007C2
#define SPDIF_MODE 0x1F9007C6
#define SPDIF_MEDIA 0x1F9007C8
No idea what they do or how they work yet. I tried to do a google search on the registers, but no results :(
Check out SPU.TXT at http://psx.rules.org/psxrul2.shtml
It should help explain some of the registers...
It should help explain some of the registers...
Just a reminder... some of us would still be interested in this. :)jbit wrote:Okay, over the weekend I'll write some sample code for using ps2snd (libsd) for doing sound effects and stuff using voices while streaming ADPCM music from somewhere.
I'll also write some basic docs about how libSD does stuff, since it may not be completly obvious in some cases.
Keep in mind that ps2snd requries a relativly recent SCE libSD at the moment, since freeSD and old libSD's have problems with interrupts amungst other things, and I havn't got round to finding and fixing exactly what's up yet.
Cool! I'll check it out right away.EEUG wrote:@J.F.: check the latest SMS sources out. There're working S/PDIF passthrough thingy there...
EDIT: one quick note - you have a problem with an include file.
Code: Select all
ee-gcc -DVB_SYNC -D_EE -O2 -G8192 -mgpopt -Wall -mno-check-zero-division -Iinclude/ -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/ps2dev/ps2sdk/common/include -I/usr/local/ps2dev/ps2sdk/sbv/include -c src/SMS_PlayerMenu.c -o obj/SMS_PlayerMenu.o
src/SMS_PlayerMenu.c:19:25: SMS_GUICons.h: No such file or directory
It's easy to miss those as Windows isn't case sensitive by default, although you can set it to be if you want. I'm using linux Fedora Core 4 as my PS2 dev system, so it's case sensitive by default.
I checked a few things... I have to say, the player is REALLY nice. As long as it's avi, mpeg4 video, and mp3 or ac3 audio, it plays nice. Now if I can ever make the time to add some support for other containers... :)
I switched on the SPDIF pass-through in the settings. With regular stereo audio, it's the same as when it's not switched to SPDIF (which you would expect since the PS2 echos normal stereo out to the SPDIF by default as I understand it). The difference now came with AC3 - my digital stereo switched to surround and I got nice Dolby 5.1 surround. I need to find some more samples to try, but so far it appears the SPDIF pass-through with AC3 is a success. Great work there!
I checked a few things... I have to say, the player is REALLY nice. As long as it's avi, mpeg4 video, and mp3 or ac3 audio, it plays nice. Now if I can ever make the time to add some support for other containers... :)
I switched on the SPDIF pass-through in the settings. With regular stereo audio, it's the same as when it's not switched to SPDIF (which you would expect since the PS2 echos normal stereo out to the SPDIF by default as I understand it). The difference now came with AC3 - my digital stereo switched to surround and I got nice Dolby 5.1 surround. I need to find some more samples to try, but so far it appears the SPDIF pass-through with AC3 is a success. Great work there!
-
- Posts: 47
- Joined: Wed Dec 15, 2004 4:23 am