feat(control_plane): apply light standby hardware policy

This commit is contained in:
chenjintao
2026-08-21 13:55:32 +08:00
parent 6a11aca835
commit baad9dcfa0
15 changed files with 405 additions and 41 deletions
@@ -1369,6 +1369,37 @@ bool multimodal_audio_is_initialized(void)
return s_audio.initialized;
}
esp_err_t multimodal_audio_set_speaker_output_enabled(bool enabled)
{
multimodal_audio_ctx_t *ctx = &s_audio;
if (!ctx->initialized || ctx->codec_dev == NULL || ctx->gpio_if == NULL ||
ctx->gpio_if->set == NULL) {
return ESP_ERR_INVALID_STATE;
}
if (!enabled) {
esp_err_t mute_err = set_downstream_output_mute_if_needed(
ctx,
true,
"Light standby");
if (mute_err != ESP_OK) {
return mute_err;
}
}
int ret = ctx->gpio_if->set(CONFIG_MULTIMODAL_AUDIO_PA_GPIO, enabled);
if (ret != ESP_CODEC_DEV_OK) {
ESP_LOGW(TAG,
"Speaker PA power %s failed: 0x%x",
enabled ? "on" : "off",
ret);
return (esp_err_t)ret;
}
ESP_LOGI(TAG, "Speaker PA power %s", enabled ? "on" : "off");
return ESP_OK;
}
esp_err_t multimodal_audio_register_downstream_playback_callback(
multimodal_audio_downstream_playback_callback_t cb,
void *cb_ctx)