| View previous topic :: View next topic |
| Author |
Message |
cooleyandy
Joined: 02 Jul 2005 Posts: 41
|
Posted: Sun Jul 24, 2005 6:46 pm Post subject: any way to increase PSP_NUM_AUDIO_SAMPLES? |
|
|
The default is 1024 samples per second when using pspaudiolib. Is there any way to increase this value to be 8192 instead?
I've tried the function sceAudioSetChannelDataLen but it had no effect and the callback still asks for 1024 samples.
My guess is to use pspaudio instead, but I'm a bit clueless on how it works exactly. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Mon Jul 25, 2005 2:18 am Post subject: |
|
|
| There's sample code using pspaudio in the SDL port (src/audio/psp/SDL_pspaudio.c). Basically, once you reserve your channel(s) (you set the sample size explicitly) you call either sceAudioOutputBlocking() or sceAudioOutputPannedBlocking() to output mono or stereo sound, respectively. You need to call these in a thread that's running at a lower priority than your main() thread. If you don't have any audio to output for that frame, then call sceAudioOutput* with buffers filled with silence. |
|
| Back to top |
|
 |
cooleyandy
Joined: 02 Jul 2005 Posts: 41
|
Posted: Mon Jul 25, 2005 6:01 pm Post subject: |
|
|
ah, so pspaudiolib basically creates a thread that calls the audio callback, and then call sceAudioOutputBlocking() to output the data.
What is Main's priority number? or rather, when creating the thread, what should I use as the priority number? |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Mon Jul 25, 2005 11:09 pm Post subject: |
|
|
By default the main() thread is started with a priority of 32. You can override that by using a statement such as:
| Code: | | PSP_MAIN_THREAD_PRIORITY(100); |
All of the PSPSDK sample code creates callbacks with a priority of 17 (dunno why :). You want the callback threads to have the lowest priority, so set your audio thread somewhere above that. |
|
| Back to top |
|
 |
cooleyandy
Joined: 02 Jul 2005 Posts: 41
|
Posted: Tue Jul 26, 2005 3:22 pm Post subject: |
|
|
| thanks mrbrown for the help and pspsdk. |
|
| Back to top |
|
 |
|