From 7aa745ceab580a8354048184ef35ff720661c415 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 21 Jul 2025 14:01:46 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D4GAiUI=E5=87=BA=E7=8E=B0?= =?utf8?q?=E5=8F=A0=E5=AD=97=E9=97=AE=E9=A2=98=EF=BC=8Ctts=E6=92=AD?= =?utf8?q?=E6=94=BE=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98=E8=BF=98=E9=9C=80?= =?utf8?q?=E8=BF=9B=E4=B8=80=E6=AD=A5=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/aivoice/include/AiVoiceModel.h | 4 ++-- .../nativeui/aivoice/src/AiVoiceModel.cpp | 23 ++++++++++--------- .../nativeui/uiservice/src/ui_service.cpp | 2 +- .../ble_service/bleservice/bleService.c | 8 +++++-- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h index c6d09c61d..6f1a8d0cf 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h @@ -123,10 +123,10 @@ namespace OHOS void start_ai4g_connect_timer(uint32_t interval = 1000); void stop_ai4g_connect_timer(void); - void start_ai4g_tts_play_timer(uint32_t interval = 700); + void start_ai4g_tts_play_timer(uint32_t interval = 600); void stop_ai4g_tts_play_timer(void); - void start_update_ai_answer_timer(uint32_t interval = 200); + void start_update_ai_answer_timer(uint32_t interval = 300); void stop_update_ai_answer_timer(void); void SetSelectAiModel(int index); diff --git a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp index f151a90e8..a2a91eeed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceModel.cpp @@ -823,7 +823,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "强制发送文本: %s (长度: %zu)", segment.c_str(), segment.length()); uapi_start_tts_single_txt((char *)segment.c_str()); - LOS_Msleep(100); + // LOS_Msleep(100); // 发送后清空累积文本 accumulatedText.clear(); @@ -857,7 +857,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "按标点发送分段: %s (长度: %zu)", segment.c_str(), segment.length()); uapi_start_tts_single_txt((char *)segment.c_str()); - LOS_Msleep(100); + // LOS_Msleep(100); } // 更新累积文本 @@ -1686,15 +1686,16 @@ namespace OHOS } else { - if(!AiVoiceModel::cur_ai_4g_answer_update) - { - AiVoiceModel::cur_ai_4g_answer_update = true; - if(AiVoiceModel::GetInstance().UpdateAiAnswerStr()) - { - AiVoiceModel::cur_ai_4g_answer_update = false; - LOS_Msleep(10); - } - } + SendMsgToUIService(UI_UPDATE_AI_ANSWER_STR, 0, nullptr, 0); + // if(!AiVoiceModel::cur_ai_4g_answer_update) + // { + // AiVoiceModel::cur_ai_4g_answer_update = true; + // if(AiVoiceModel::GetInstance().UpdateAiAnswerStr()) + // { + // AiVoiceModel::cur_ai_4g_answer_update = false; + // LOS_Msleep(10); + // } + // } } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp index 49d6f8053..b284b6261 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp @@ -344,7 +344,7 @@ extern "C" TaskConfig GetServiceTaskConfig(Service *service) { (void)service; - TaskConfig config = {LEVEL_HIGH, PRI_NORMAL, DATA_DIST_STACK_SIZE, DATA_DIST_MAIL_LENGTH, SINGLE_TASK}; + TaskConfig config = {LEVEL_HIGH, PRI_BELOW_NORMAL, DATA_DIST_STACK_SIZE, DATA_DIST_MAIL_LENGTH, SINGLE_TASK}; return config; } diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c index 4ba80ef34..cae2b1906 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleService.c @@ -2451,11 +2451,15 @@ static void blesrvAi_send_service_task(void const *arg) { // osal_msg_queue_write_head_copy(g_ble_Ai_record_queue, (void *)&mail,sizeof(blesrv_custom_cmd_t), 0); int quesize = osal_msg_queue_get_msg_num(g_ble_Ai_record_queue); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"do_uart_slip_cmd quesize %d\n",quesize); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"osal_msg_queue_get_msg_num %d\n",quesize); while(quesize) { - osal_msg_queue_read_copy(g_ble_Ai_record_queue, (void *)&mail, &msgsize, + ret = osal_msg_queue_read_copy(g_ble_Ai_record_queue, (void *)&mail, &msgsize, OSAL_MSGQ_WAIT_FOREVER); + if (ret != OSAL_SUCCESS) + { + continue; + } if(mail.msg_data) { free(mail.msg_data); -- 2.17.1