fix(multimodal): recover stalled downstream sessions

This commit is contained in:
chenjintao
2026-08-12 16:32:25 +08:00
parent 4e7fadde56
commit a94df9545d
9 changed files with 272 additions and 12 deletions
@@ -1774,6 +1774,11 @@ static void notify_downstream_playback_stopped(void)
notify_downstream_playback_finished(MULTIMODAL_AUDIO_DOWNSTREAM_PLAYBACK_STOPPED);
}
static void notify_downstream_playback_stalled(void)
{
notify_downstream_playback_finished(MULTIMODAL_AUDIO_DOWNSTREAM_PLAYBACK_STALLED);
}
static void abort_downstream_response_after_active_stall(multimodal_audio_ctx_t *ctx,
uint32_t idle_ms)
{
@@ -1781,7 +1786,7 @@ static void abort_downstream_response_after_active_stall(multimodal_audio_ctx_t
"Downstream protection watchdog: abort stalled response idle_ms=%u",
(unsigned)idle_ms);
(void)advance_downstream_playback_generation();
notify_downstream_playback_stopped();
notify_downstream_playback_stalled();
update_downstream_response_state(false, false);
if (audio_get_downstream_playback_task(ctx) != NULL ||
audio_get_downstream_playback_starting(ctx)) {
@@ -243,6 +243,11 @@ static void platform_multimodal_downstream_playback_bridge(
callbacks.on_stopped(callbacks.user_data);
}
break;
case MULTIMODAL_AUDIO_DOWNSTREAM_PLAYBACK_STALLED:
if (callbacks.on_stalled != NULL) {
callbacks.on_stalled(callbacks.user_data);
}
break;
default:
break;
}