diff --git a/audio/pulse.c b/audio/pulse.c index 69b90f9811..011bcee772 100644 --- a/audio/pulse.c +++ b/audio/pulse.c @@ -115,8 +115,9 @@ static void stream_latency_update_cb(pa_stream *s, void *data) static void underrun_update_cb(pa_stream *s, void *data) { (void)s; - (void)data; - RARCH_LOG("[PulseAudio]: Underrun!\n"); + pa_t *pa = (pa_t*)data; + RARCH_LOG("[PulseAudio]: Underrun (Buffer is %.2f %% full).\n", + 100.0f * (float)(pa->buffer_size - pa_stream_writable_size(pa->stream)) / pa->buffer_size); } static void *pulse_init(const char *device, unsigned rate, unsigned latency) diff --git a/frontend/frontend.c b/frontend/frontend.c index b80607364d..fc5625166c 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -89,8 +89,20 @@ int main(int argc, char *argv[]) g_extern.lifecycle_mode_state |= 1ULL << MODE_MENU_PREINIT; // Menu should always run with vsync on. video_set_nonblock_state_func(false); + + if (driver.audio_data) + audio_stop_func(); + while (menu_iterate()); + driver_set_nonblock_state(driver.nonblock_state); + + if (driver.audio_data && !audio_start_func()) + { + RARCH_ERR("Failed to resume audio driver. Will continue without audio.\n"); + g_extern.audio_active = false; + } + g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU); } else