Merge #746 into sdk602patch0626 from refs/changes/746/head
author彭磊 <1624952103@qq.com>
Wed, 21 Aug 2024 03:08:30 +0000 (03:08 +0000)
committersnickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Wed, 21 Aug 2024 03:08:30 +0000 (03:08 +0000)
Code review from 彭磊

* refs/changes/746/head: (2 commits squashed)

  - 降低前端mic灵敏度,改善回声

  - 音频参数改动,改善音质,去回声

Signed-off-by: aliyun6865282430 <1624952103@qq.com>
Reviewed-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
Merged-by: snickersun@163.com <accounts_62b90f7fcf51ade33b6f628e@mail.teambition.com>
link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/746
code/sdk/middleware/chips/brandy/nv/nv_config/cfg/eng/acore/app.json
code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c

index 00e520f..98dab5b 100644 (file)
             "key_status": "alive",
             "structure_type": "audio_vqe_param_t",
             "attributions": 1,
-            "value": [48, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000,
-                1024, 100, 0, 0, 16842753, 257, 257, 256,
-                16778116, 16844032, 4, 0, 458824, 11796580, 327946, 1310720005,
-                65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, 654734439,
-                1, 0, 0, 0, 0, 0, 5308380, 655336,
+            "value": [48, [0, 0, 0, 0, 16843009, 33620225, 16000, 16000, 
+                1024, 100, 1985229328, 1985229328, 16842753, 257, 257, 512, 
+                33555332, 16844032, 4, 0, 458824, 11796580, 327946, 1310720005, 
+                65576964, 1000, 21499085, 67108874, 327680, 655367, 2126009683, 654734439, 
+                1, 0, 0, 0, 0, 0, 5308396, 655336, 
                 4286447619, 64536, 500, 16384, 3277, 0, 66049, 0]]
         },
         "audio_vqe_kws_param":{
index d560c86..9504e1e 100755 (executable)
@@ -185,7 +185,13 @@ static int32_t AIDevOpen(td_handle *aiHandle, enum AudioCategory audioCategory)
             MediaHalMutexUnLock(g_subPortTrackInLock);
             return ret;
         }
+        uapi_ai_gain gain = {};
+        MEDIA_HAL_DOFUNC_TIME(ret = uapi_ai_get_volume(*aiHandle, &gain));
+        CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "uapi_ai_get_volume failed");
 
+        gain.integer = gain.integer - 6; // 前端mic灵敏度不同可通过此处调增,增加4db增益  默认gain.integer = gain.integer+4
+        MEDIA_HAL_DOFUNC_TIME(ret = uapi_ai_set_volume(*aiHandle, &gain));
+        CHK_FAILED_RETURN(ret, MEDIA_HAL_OK, ret, "uapi_ai_set_volume failed");
         g_subPortTrackInOpened = true;
     }
     MediaHalMutexUnLock(g_subPortTrackInLock);
@@ -672,7 +678,15 @@ static int32_t SetSeaParam(AudioHandle trackHandle, char *value, uint32_t valueL
     if (ret != MEDIA_HAL_OK) {
         return ret;
     }
+    uint32_t *printparam = (uint32_t *)param;
     ret = uapi_sea_set_param(portTrackInCtx->seaHandle, UAPI_SEA_AFE_SEE, (const td_void *)param, paramLen);
+    MEDIA_HAL_LOGE(MODULE_NAME, "set_param");
+    for(int i = 0;i < 6;i++){
+        MEDIA_HAL_LOGE(MODULE_NAME, "%u,%u,%u,%u,%u,%u,%u,%u", *(printparam), *(printparam), *(printparam + 1), *(printparam + 2), \
+        *(printparam + 3), *(printparam + 4), *(printparam + 5), *(printparam + 6), *(printparam + 7));
+        printparam += 8;
+    }
+
     if (ret != MEDIA_HAL_OK) {
         MEDIA_HAL_LOGE(MODULE_NAME, "set aef param failed! ret = %d", ret);
         return ret;