From 7b9745fd7b569c94d71de0a84449185aff4923af Mon Sep 17 00:00:00 2001 From: 134******51 Date: Mon, 8 Jul 2024 12:10:34 +0000 Subject: [PATCH 1/3] update services/audio_policy/server/src/service/effect/audio_effect_manager.cpp. add voip support Signed-off-by: 134******51 --- .../server/src/service/effect/audio_effect_manager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/audio_policy/server/src/service/effect/audio_effect_manager.cpp b/services/audio_policy/server/src/service/effect/audio_effect_manager.cpp index fdc3528ae2..de5271c4ed 100644 --- a/services/audio_policy/server/src/service/effect/audio_effect_manager.cpp +++ b/services/audio_policy/server/src/service/effect/audio_effect_manager.cpp @@ -74,6 +74,7 @@ static int32_t UpdateUnsupportedScene(std::string &scene) (scene != "SCENE_VOIP_3A") && (scene != "SCENE_RECORD") && (scene != "SCENE_MEETING") && + (scene != "SCENE_VOIP") && (scene != "SCENE_OTHERS")) { AUDIO_INFO_LOG("[supportedEffectConfig LOG9]:stream-> The scene of %{public}s is unsupported, \ and this scene is deleted!", scene.c_str()); -- Gitee From a0d46a1c33b745b3dadcd7f23359c27f95c2d011 Mon Sep 17 00:00:00 2001 From: 134******51 Date: Mon, 8 Jul 2024 12:12:11 +0000 Subject: [PATCH 2/3] update interfaces/inner_api/native/audiocommon/include/audio_effect.h. add voip support Signed-off-by: 134******51 --- .../native/audiocommon/include/audio_effect.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/interfaces/inner_api/native/audiocommon/include/audio_effect.h b/interfaces/inner_api/native/audiocommon/include/audio_effect.h index 9b5caddcf1..5560bcc04b 100644 --- a/interfaces/inner_api/native/audiocommon/include/audio_effect.h +++ b/interfaces/inner_api/native/audiocommon/include/audio_effect.h @@ -149,7 +149,8 @@ enum AudioEffectScene { SCENE_MOVIE = 2, SCENE_GAME = 3, SCENE_SPEECH = 4, - SCENE_RING = 5 + SCENE_RING = 5, + SCENE_VOIP = 6 }; /** @@ -337,12 +338,13 @@ const std::unordered_map> HDI_EFFECT_LIB_MA const std::unordered_map EFFECT_CHAIN_TYPE_MAP { {"UNKNOWN", 0}, {"NONE", 1}, - {"SCENE_MUSIC", 2}, - {"SCENE_MOVIE", 3}, - {"SCENE_GAME", 4}, - {"SCENE_SPEECH", 5}, - {"SCENE_RING", 6}, - {"SCENE_OTHERS", 7} + {"SCENE_OTHERS", 2}, + {"SCENE_MUSIC", 3}, + {"SCENE_MOVIE", 4}, + {"SCENE_GAME", 5}, + {"SCENE_SPEECH", 6}, + {"SCENE_RING", 7}, + {"SCENE_VOIP", 8} } ; struct AudioRendererInfoForSpatialization { -- Gitee From e4a3d048232f44b21236d4b53de5717e28cafeeb Mon Sep 17 00:00:00 2001 From: 134******51 Date: Mon, 8 Jul 2024 12:13:04 +0000 Subject: [PATCH 3/3] update frameworks/native/pulseaudio/modules/hdi/hdi_sink.c. add voip support Signed-off-by: 134******51 --- frameworks/native/pulseaudio/modules/hdi/hdi_sink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frameworks/native/pulseaudio/modules/hdi/hdi_sink.c b/frameworks/native/pulseaudio/modules/hdi/hdi_sink.c index bc27f1351d..2026f5467d 100644 --- a/frameworks/native/pulseaudio/modules/hdi/hdi_sink.c +++ b/frameworks/native/pulseaudio/modules/hdi/hdi_sink.c @@ -68,7 +68,7 @@ #define IN_CHANNEL_NUM_MAX 16 #define OUT_CHANNEL_NUM_MAX 2 #define DEFAULT_FRAMELEN 2048 -#define SCENE_TYPE_NUM 7 +#define SCENE_TYPE_NUM 8 #define HDI_MIN_MS_MAINTAIN 30 #define OFFLOAD_HDI_CACHE1 200 // ms, should equal with val in client #define OFFLOAD_HDI_CACHE2 7000 // ms, should equal with val in client @@ -112,11 +112,11 @@ bool g_paHaveDisabled = false; time_t g_speakerPaAllStreamStartVolZeroTime = 0; bool g_speakerPaHaveClosed = false; time_t g_speakerPaClosedTime = 0; -bool g_effectAllStreamVolumeZeroMap[SCENE_TYPE_NUM] = {false, false, false, false, false, false, false}; -bool g_effectHaveDisabledMap[SCENE_TYPE_NUM] = {false, false, false, false, false, false, false}; -time_t g_effectStartVolZeroTimeMap[SCENE_TYPE_NUM] = {0, 0, 0, 0, 0, 0, 0}; +bool g_effectAllStreamVolumeZeroMap[SCENE_TYPE_NUM] = {false}; +bool g_effectHaveDisabledMap[SCENE_TYPE_NUM] = {false}; +time_t g_effectStartVolZeroTimeMap[SCENE_TYPE_NUM] = {0}; char *const SCENE_TYPE_SET[SCENE_TYPE_NUM] = {"SCENE_MUSIC", "SCENE_GAME", "SCENE_MOVIE", "SCENE_SPEECH", "SCENE_RING", - "SCENE_OTHERS", "EFFECT_NONE"}; + "SCENE_VOIP", "SCENE_OTHERS", "EFFECT_NONE"}; const int32_t COMMON_SCENE_TYPE_INDEX = 0; enum HdiInputType { HDI_INPUT_TYPE_PRIMARY, HDI_INPUT_TYPE_OFFLOAD, HDI_INPUT_TYPE_MULTICHANNEL }; -- Gitee