From: penglei <1624952103@qq.com> Date: Wed, 21 Aug 2024 02:04:56 +0000 (+0800) Subject: 降低前端mic灵敏度,改善回声 X-Git-Tag: release_V1.2.70_20241020_135402~612^2~2^2~5 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=276cc0dab0a70aaeacef52f501e57507083d64a0;p=mirrors%2FFD230.git 降低前端mic灵敏度,改善回声 --- 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;