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 

any way to increase PSP_NUM_AUDIO_SAMPLES?

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



Joined: 02 Jul 2005
Posts: 41

PostPosted: Sun Jul 24, 2005 6:46 pm    Post subject: any way to increase PSP_NUM_AUDIO_SAMPLES? Reply with quote

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
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Jul 25, 2005 2:18 am    Post subject: Reply with quote

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
View user's profile Send private message
cooleyandy



Joined: 02 Jul 2005
Posts: 41

PostPosted: Mon Jul 25, 2005 6:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Jul 25, 2005 11:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
cooleyandy



Joined: 02 Jul 2005
Posts: 41

PostPosted: Tue Jul 26, 2005 3:22 pm    Post subject: Reply with quote

thanks mrbrown for the help and pspsdk.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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