mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-17 13:00:25 +02:00
Give Android audio callback more scheduling headroom
(cherry picked from commit f158218aa6daf8c2cb71852ca1f82e36a4a5ee11)
This commit is contained in:
1 parent
65a6bb7edd
commit
423677a14b
1 file changed
+7
@@ -1158,7 +1158,14 @@ static void audio_start(void)
|
||||
spec.format = SDL_AUDIO_F32;
|
||||
spec.channels = OUTPUT_CHANNELS;
|
||||
spec.freq = OUTPUT_RATE;
|
||||
#ifdef HALO_ANDROID
|
||||
/* The Android audio callback crosses to a guest-capable worker thread.
|
||||
1024 frames gave enough scheduler headroom to eliminate the observed
|
||||
menu/music underruns without changing the mixer or exposing a new setting. */
|
||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES, "1024");
|
||||
#else
|
||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES, "512");
|
||||
#endif
|
||||
audio_stream = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, audio_callback, NULL);
|
||||
if (audio_stream)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user