fix(multimodal): harden playback and client lifecycle handling

- retry the server connection prompt after transient playback failures
- serialize multimodal client and session start-stop operations
- tag downstream responses to ignore stale packets and playback events
- complete bounded teardown and clean callbacks after partial startup
This commit is contained in:
chenjintao
2026-08-14 15:24:29 +08:00
parent c56c65462e
commit 0cfb10252c
12 changed files with 436 additions and 188 deletions
+3 -1
View File
@@ -103,6 +103,7 @@ typedef enum {
typedef struct {
domain_multimodal_downstream_playback_event_type_t type;
uint32_t playback_generation;
} domain_multimodal_downstream_playback_event_t;
typedef void (*domain_multimodal_downstream_playback_callback_t)(
@@ -228,7 +229,8 @@ esp_err_t domain_runtime_local_command_stop(int timeout_ms);
esp_err_t domain_runtime_local_command_get_snapshot(
domain_local_command_snapshot_t *out_snapshot);
esp_err_t domain_runtime_multimodal_audio_play_downstream_opus(const uint8_t *data, size_t len);
esp_err_t domain_runtime_multimodal_audio_begin_downstream_response(void);
esp_err_t domain_runtime_multimodal_audio_begin_downstream_response(
uint32_t *out_playback_generation);
esp_err_t domain_runtime_multimodal_audio_finish_downstream_response(void);
esp_err_t domain_runtime_multimodal_audio_stop_downstream_playback(void);
esp_err_t domain_runtime_multimodal_audio_register_downstream_playback_callback(