Merge #2835 into sdk650pathc0423 from refs/changes/2835/head 2836/target/1
author胡传军 <1224667075@qq.com>
Mon, 1 Dec 2025 07:45:02 +0000 (07:45 +0000)
committeraliyun3243248791 <accounts_67aaf52ad497cd558d73ac32@mail.teambition.com>
Mon, 1 Dec 2025 07:45:02 +0000 (07:45 +0000)
Code review from 胡传军

* refs/changes/2835/head: (12 commits squashed)

  - 屏蔽VAD认证

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - 增加文件保存测试开关

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - 修改ai宏开关不生效的问题

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - cat1升级启动换位置

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - Merge branch &#39;sdk650pathc0423&#39; of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk650pathc0423

  - vad参数调整

Signed-off-by: aliyun8003852482 <1224667075@qq.com>
Merged-by: 薛文强 <accounts_67aaf52ad497cd558d73ac32@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/2835
code/sdk/zhihui/4g/cat1Service/Service/cat1_server.c
code/sdk/zhihui/4g/cat1Service/include/cat1_tcpServer.h
code/sdk/zhihui/imsl/src/vad_server.c
code/sdk/zhihui/leiniao/imsl_ln/ln_api_websocket.c

index c1b8192..2b6d21f 100644 (file)
@@ -1109,6 +1109,21 @@ int cat1_handle_version_msg(char *msg)
         // OHOS::ConfigModel::GetInstance()->SetpyVer(cat1_api_runtime_get_cat1_pyver());
         // OHOS::ConfigModel::GetInstance()->SetmoderVer(cat1_api_runtime_get_cat1_modemver());
         // cat1_msg_event_sendmsg_toUI("verupdate"); 
+
+        uint8_t need_ota=0;
+        FILE *fp= fopen(CAT1_PY_IS_NEED_UPDATA_PATH,"rb+");
+        if(fp)
+        {
+            fread(&need_ota,sizeof(uint8_t),1,fp);
+            fclose(fp);
+            remove(CAT1_PY_IS_NEED_UPDATA_PATH);
+            if(need_ota>g_py_ver)
+            {
+                cat1_start_tcp_ota_init();
+                cat1_tcp_server_init();
+            }
+        
+        }
            
     }
     
@@ -1763,20 +1778,7 @@ errcode_t cat1_server_init(void)
     //第一次启动,要确保去除已经添加过的cat1 Vote
     restart_sleep_cat1_timer();
 #endif
-    uint8_t need_ota=0;
-    FILE *fp= fopen(CAT1_PY_IS_NEED_UDP_PATH,"rb+");
-    if(fp)
-    {
-        fread(&need_ota,sizeof(uint8_t),1,fp);
-        fclose(fp);
-        remove(CAT1_PY_IS_NEED_UDP_PATH);
-        if(need_ota>g_py_ver)
-        {
-            cat1_start_tcp_ota_init();
-            cat1_tcp_server_init();
-        }
-       
-    }
+   
 
 
     return ERRCODE_SUCC;
index ef0e7e9..ceb53f0 100644 (file)
@@ -84,6 +84,8 @@ uint8_t Get_Cat1_OTA_Flag(void);
 #define CAT1_PY_IS_NEED_UDP_PATH "/system/cat1otaudp/is_need_updata.txt" //存放需要升级的py文件路径
 #endif
 
+#define CAT1_PY_IS_NEED_UPDATA_PATH "/user/system/is_need_updata.txt" //存放需要升级的py文件路径
+
 
 #ifdef __cplusplus
 #if __cplusplus
index 6b1f9f7..f684714 100644 (file)
@@ -424,7 +424,7 @@ errcode_t vad_server_init(vad_status_callback_t callback)
     struct VadConfig vad_config = {
         .vad_log_level = 1,                   /* INFO 日志 */
         .sil_threshold = 63,                  /* 静音阈值 */
-        .energy_threshold = 50000,            /* 能量阈值 */
+        .energy_threshold = 40000,            /* 能量阈值 */
         .min_speech_length = 240,             /* 最短语音长度 (ms) */
         .silence_detect_length = 300,         /* 静音检测长度 (ms) */
         .rule1_min_tailing_silence = 480,     /* 规则1静音时间 (ms) */
index a17e9a2..41a1680 100644 (file)
@@ -197,7 +197,7 @@ static uint32_t g_audio_timeout_ticks = 1500; // 音频超时tick数(默认1.5
 static uint32_t g_last_binary_data_tick = 0;  // 最后一次接收二进制数据的tick
 
 // 音频数据最近缓存(环形缓冲区,仅保留最近数据)
-#define AUDIO_CACHE_BUFFER_SIZE  (1024+512)  // 8KB缓存
+#define AUDIO_CACHE_BUFFER_SIZE  (1024*3)  // 8KB缓存
 static uint8_t g_audio_cache_buffer[AUDIO_CACHE_BUFFER_SIZE];
 static uint32_t g_audio_cache_pos = 0;  // 当前写入位置
 static uint32_t g_audio_cache_total = 0;  // 总写入数据量