From: luozheng <1732036298@qq.com> Date: Mon, 21 Jul 2025 06:01:46 +0000 (+0800) Subject: 修复4GAiUI出现叠字问题,tts播放卡顿问题还需进一步测试 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=7aa745ceab580a8354048184ef35ff720661c415;p=mirrors%2FFD230.git 修复4GAiUI出现叠字问题,tts播放卡顿问题还需进一步测试 --- 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);