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.
any way to increase PSP_NUM_AUDIO_SAMPLES?
-
- Posts: 41
- Joined: Sat Jul 02, 2005 10:12 am
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.
-
- Posts: 41
- Joined: Sat Jul 02, 2005 10:12 am
By default the main() thread is started with a priority of 32. You can override that by using a statement such as:
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.
Code: Select all
PSP_MAIN_THREAD_PRIORITY(100);
Re: any way to increase PSP_NUM_AUDIO_SAMPLES?
Hi,
I'm not really sure if the question was answered.
In 2025 I've written some live audio effects such as a flanger and bit crusher for guitar.
It's far from practical because no matter what I do, there's too much lag between the input and output audio for anything rhythmic.
I believe if this could be lowered to 512 or 256, it would increase overhead from the calls sure, but overall lag should be better.
I've tried these functions before and after audio initialisation with seemingly no result:
sceAudioOutput2ChangeLength(512);
sceAudioSetChannelDataLen(0, 512);
sceAudioSetChannelDataLen(1, 512);
I believe the input sample chunk size is easily changed, but stuck on the output.
Regards, Art.
I'm not really sure if the question was answered.
In 2025 I've written some live audio effects such as a flanger and bit crusher for guitar.
It's far from practical because no matter what I do, there's too much lag between the input and output audio for anything rhythmic.
I believe if this could be lowered to 512 or 256, it would increase overhead from the calls sure, but overall lag should be better.
I've tried these functions before and after audio initialisation with seemingly no result:
sceAudioOutput2ChangeLength(512);
sceAudioSetChannelDataLen(0, 512);
sceAudioSetChannelDataLen(1, 512);
I believe the input sample chunk size is easily changed, but stuck on the output.
Regards, Art.
If not actually, then potentially.