From a9f4bd6d036b66ee6c641d3a33f32d2bb7144dab Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BD=AD=E7=A3=8A?= <1624952103@qq.com> Date: Wed, 21 Aug 2024 03:08:30 +0000 Subject: [PATCH] Merge #746 into sdk602patch0626 from refs/changes/746/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 彭磊 * refs/changes/746/head: (2 commits squashed) - 降低前端mic灵敏度,改善回声 - 音频参数改动,改善音质,去回声 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/746 --- .../brandy/nv/nv_config/cfg/eng/acore/app.json | 10 +++++----- .../plugins/brandy/primary/primary_sub_port_in.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/eng/acore/app.json b/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/eng/acore/app.json index 00e520f62..98dab5b11 100644 --- a/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/eng/acore/app.json +++ b/code/sdk/middleware/chips/brandy/nv/nv_config/cfg/eng/acore/app.json @@ -69,11 +69,11 @@ "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":{ diff --git a/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c b/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c index d560c86b1..9504e1e59 100755 --- a/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c +++ b/code/sdk/middleware/services/media/hal/audio/plugins/brandy/primary/primary_sub_port_in.c @@ -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; -- 2.17.1