From efa09b9e379dbac97e927a9228d633f45e9e2c85 Mon Sep 17 00:00:00 2001 From: owenCreeper Date: Sat, 30 Aug 2025 14:29:40 +0800 Subject: [PATCH 1/2] add initialize Signed-off-by: owenCreeper --- services/audio_engine/manager/include/hpae_renderer_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/audio_engine/manager/include/hpae_renderer_manager.h b/services/audio_engine/manager/include/hpae_renderer_manager.h index 55b180f44c..bb76a21669 100644 --- a/services/audio_engine/manager/include/hpae_renderer_manager.h +++ b/services/audio_engine/manager/include/hpae_renderer_manager.h @@ -157,7 +157,7 @@ private: std::vector appsUid_; std::shared_ptr hpaeCoBufferNode_; bool isCollaborationEnabled_ = false; - int64_t noneStreamTime_; // if no stream, 3s time out to stop rendersink + int64_t noneStreamTime_ = 0; // if no stream, 3s time out to stop rendersink }; } // namespace HPAE } // namespace AudioStandard -- Gitee From 1f71dd17c1eade62cb6374809818f3edc8118e0f Mon Sep 17 00:00:00 2001 From: owenCreeper Date: Mon, 1 Sep 2025 09:51:44 +0800 Subject: [PATCH 2/2] commercial logs Signed-off-by: owenCreeper --- .../manager/src/hpae_capturer_manager.cpp | 4 +- .../src/hpae_inner_capturer_manager.cpp | 4 +- .../audio_engine/manager/src/hpae_manager.cpp | 37 +++++++++---------- .../src/hpae_offload_renderer_manager.cpp | 4 +- .../manager/src/hpae_renderer_manager.cpp | 4 +- .../node/src/hpae_offload_sinkoutput_node.cpp | 2 +- .../node/src/hpae_remote_sink_output_node.cpp | 2 +- .../node/src/hpae_sink_input_node.cpp | 2 +- .../node/src/hpae_sink_output_node.cpp | 2 +- .../node/src/hpae_source_input_node.cpp | 2 +- .../node/src/hpae_source_output_node.cpp | 2 +- 11 files changed, 32 insertions(+), 33 deletions(-) diff --git a/services/audio_engine/manager/src/hpae_capturer_manager.cpp b/services/audio_engine/manager/src/hpae_capturer_manager.cpp index 4aa8d2f230..0289cb212b 100644 --- a/services/audio_engine/manager/src/hpae_capturer_manager.cpp +++ b/services/audio_engine/manager/src/hpae_capturer_manager.cpp @@ -852,7 +852,7 @@ int32_t HpaeCapturerManager::AddNodeToSource(const HpaeCaptureMoveInfo &moveInfo void HpaeCapturerManager::AddSingleNodeToSource(const HpaeCaptureMoveInfo &moveInfo, bool isConnect) { uint32_t sessionId = moveInfo.sessionId; - AUDIO_INFO_LOG("[FinishMove] session :%{public}u to source:[%{public}s].", + HILOG_COMM_INFO("[FinishMove] session :%{public}u to source:[%{public}s].", sessionId, sourceInfo_.sourceName.c_str()); CHECK_AND_RETURN_LOG(moveInfo.sourceOutputNode != nullptr, "move fail, sourceoutputnode is null"); HpaeNodeInfo nodeInfo = moveInfo.sourceOutputNode->GetNodeInfo(); @@ -916,7 +916,7 @@ void HpaeCapturerManager::MoveAllStreamToNewSource(const std::string &sourceName for (const auto &it : moveInfos) { DeleteOutputSession(it.sessionId); } - AUDIO_INFO_LOG("[StartMove] session:%{public}s to source name:%{public}s, move type:%{public}d", + HILOG_COMM_INFO("[StartMove] session:%{public}s to source name:%{public}s, move type:%{public}d", idStr.c_str(), name.c_str(), moveType); if (moveType == MOVE_ALL) { TriggerSyncCallback(MOVE_ALL_SOURCE_OUTPUT, moveInfos, name); diff --git a/services/audio_engine/manager/src/hpae_inner_capturer_manager.cpp b/services/audio_engine/manager/src/hpae_inner_capturer_manager.cpp index 8188d99650..c90ac6aecb 100644 --- a/services/audio_engine/manager/src/hpae_inner_capturer_manager.cpp +++ b/services/audio_engine/manager/src/hpae_inner_capturer_manager.cpp @@ -76,7 +76,7 @@ void HpaeInnerCapturerManager::AddSingleNodeToSinkInner(const std::shared_ptrGetState() == HPAE_SESSION_RUNNING) { - AUDIO_INFO_LOG("[FinishMove] session:%{public}u connect to sink:%{public}s", + HILOG_COMM_INFO("[FinishMove] session:%{public}u connect to sink:%{public}s", sessionId, sinkInfo_.deviceClass.c_str()); ConnectRendererInputSessionInner(sessionId); } @@ -118,7 +118,7 @@ void HpaeInnerCapturerManager::MoveAllStreamToNewSinkInner(const std::string &si for (const auto &it : sessionIds) { DeleteRendererInputSessionInner(it); } - AUDIO_INFO_LOG("[StartMove] session:%{public}s to sink name:%{public}s, move type:%{public}d", + HILOG_COMM_INFO("[StartMove] session:%{public}s to sink name:%{public}s, move type:%{public}d", idStr.c_str(), name.c_str(), moveType); if (moveType == MOVE_ALL) { TriggerSyncCallback(MOVE_ALL_SINK_INPUT, sinkInputs, name, moveType); diff --git a/services/audio_engine/manager/src/hpae_manager.cpp b/services/audio_engine/manager/src/hpae_manager.cpp index af46cffa32..c0af502aa9 100644 --- a/services/audio_engine/manager/src/hpae_manager.cpp +++ b/services/audio_engine/manager/src/hpae_manager.cpp @@ -738,7 +738,7 @@ void HpaeManager::MoveToPreferSink(const std::string &name, std::shared_ptrOnOpenAudioPortCb(sinkNameSinkIdMap_[name]); @@ -778,8 +778,7 @@ int32_t HpaeManager::MoveSourceOutputByIndexOrName( } std::string name = capturerIdSourceNameMap_[sourceOutputId]; if (sourceName == name) { - AUDIO_INFO_LOG("move session:%{public}u,source:%{public}s is the same, no need move", - sourceOutputId, sourceName.c_str()); + HILOG_COMM_INFO("source:%{public}s is the same, no need move", sourceName.c_str()); if (auto serviceCallback = serviceCallback_.lock()) { serviceCallback->OnMoveSourceOutputByIndexOrNameCb(SUCCESS); } @@ -798,7 +797,7 @@ int32_t HpaeManager::MoveSourceOutputByIndexOrName( bool HpaeManager::CheckMoveSourceOutput(uint32_t sourceOutputId, const std::string &sourceName) { if (capturerIdStreamInfoMap_.find(sourceOutputId) == capturerIdStreamInfoMap_.end()) { - AUDIO_ERR_LOG("move session:%{public}u failed,can not find session.", sourceOutputId); + HILOG_COMM_INFO("move session:%{public}u failed,can not find session.", sourceOutputId); HpaeStreamMoveMonitor::ReportStreamMoveException(0, sourceOutputId, HPAE_STREAM_CLASS_TYPE_RECORD, "", sourceName, "can not find session"); return false; @@ -806,27 +805,27 @@ bool HpaeManager::CheckMoveSourceOutput(uint32_t sourceOutputId, const std::stri std::shared_ptr oldCaptureManager = GetCapturerManagerById(sourceOutputId); HpaeStreamInfo stream = capturerIdStreamInfoMap_[sourceOutputId].streamInfo; if (oldCaptureManager == nullptr) { - AUDIO_ERR_LOG("move session:%{public}u failed,can not find source.", sourceOutputId); + HILOG_COMM_INFO("move session:%{public}u failed,can not find source.", sourceOutputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sourceOutputId, HPAE_STREAM_CLASS_TYPE_RECORD, "", sourceName, "can not find source"); return false; } if (sourceName.empty()) { - AUDIO_ERR_LOG("move session:%{public}u failed,source name is empty.", sourceOutputId); + HILOG_COMM_INFO("move session:%{public}u failed,source name is empty.", sourceOutputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sourceOutputId, HPAE_STREAM_CLASS_TYPE_RECORD, capturerIdSourceNameMap_[sourceOutputId], "", "source name is empty"); return false; } std::shared_ptr captureManager = GetCapturerManagerByName(sourceName); if (captureManager == nullptr || !captureManager->IsInit()) { - AUDIO_ERR_LOG("move session:%{public}u failed, can not find source:%{public}s or source is not open.", + HILOG_COMM_INFO("move session:%{public}u failed, can not find source:%{public}s or source is not open.", sourceOutputId, sourceName.c_str()); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sourceOutputId, HPAE_STREAM_CLASS_TYPE_RECORD, capturerIdSourceNameMap_[sourceOutputId], sourceName, "source is not open"); return false; } if (!capturerIdStreamInfoMap_[sourceOutputId].streamInfo.isMoveAble) { - AUDIO_ERR_LOG("move session:%{public}u failed,session is not moveable.", sourceOutputId); + HILOG_COMM_INFO("move session:%{public}u failed,session is not moveable.", sourceOutputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sourceOutputId, HPAE_STREAM_CLASS_TYPE_RECORD, capturerIdSourceNameMap_[sourceOutputId], sourceName, "session is not moveable"); return false; @@ -837,7 +836,7 @@ bool HpaeManager::CheckMoveSourceOutput(uint32_t sourceOutputId, const std::stri bool HpaeManager::CheckMoveSinkInput(uint32_t sinkInputId, const std::string &sinkName) { if (rendererIdStreamInfoMap_.find(sinkInputId) == rendererIdStreamInfoMap_.end()) { - AUDIO_ERR_LOG("move session:%{public}u failed,can not find session", sinkInputId); + HILOG_COMM_INFO("move session:%{public}u failed,can not find session", sinkInputId); HpaeStreamMoveMonitor::ReportStreamMoveException(0, sinkInputId, HPAE_STREAM_CLASS_TYPE_PLAY, "", sinkName, "can not find session"); return false; @@ -845,27 +844,27 @@ bool HpaeManager::CheckMoveSinkInput(uint32_t sinkInputId, const std::string &si std::shared_ptr oldRendererManager = GetRendererManagerById(sinkInputId); HpaeStreamInfo stream = rendererIdStreamInfoMap_[sinkInputId].streamInfo; if (oldRendererManager == nullptr) { - AUDIO_ERR_LOG("move session:%{public}u failed,can not find sink", sinkInputId); + HILOG_COMM_INFO("move session:%{public}u failed,can not find sink", sinkInputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sinkInputId, HPAE_STREAM_CLASS_TYPE_PLAY, "", sinkName, "src sink is not find"); return false; } if (sinkName.empty()) { - AUDIO_ERR_LOG("move session:%{public}u failed,sink name is empty.", sinkInputId); + HILOG_COMM_INFO("move session:%{public}u failed,sink name is empty.", sinkInputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sinkInputId, HPAE_STREAM_CLASS_TYPE_PLAY, rendererIdSinkNameMap_[sinkInputId], sinkName, "sink name is empty"); return false; } std::shared_ptr rendererManager = GetRendererManagerByName(sinkName); if (rendererManager == nullptr || !rendererManager->IsInit()) { - AUDIO_ERR_LOG("move session:%{public}u failed, can not find sink:%{public}s or sink is not open.", + HILOG_COMM_INFO("move session:%{public}u failed, can not find sink:%{public}s or sink is not open.", sinkInputId, sinkName.c_str()); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sinkInputId, HPAE_STREAM_CLASS_TYPE_PLAY, rendererIdSinkNameMap_[sinkInputId], sinkName, "dest sink is not open"); return false; } if (!rendererIdStreamInfoMap_[sinkInputId].streamInfo.isMoveAble) { - AUDIO_ERR_LOG("move session:%{public}u failed,session is not moveable.", sinkInputId); + HILOG_COMM_INFO("move session:%{public}u failed,session is not moveable.", sinkInputId); HpaeStreamMoveMonitor::ReportStreamMoveException(stream.uid, sinkInputId, HPAE_STREAM_CLASS_TYPE_PLAY, rendererIdSinkNameMap_[sinkInputId], sinkName, "session is not moveable"); return false; @@ -885,7 +884,7 @@ int32_t HpaeManager::MoveSinkInputByIndexOrName(uint32_t sinkInputId, uint32_t s std::string name = rendererIdSinkNameMap_[sinkInputId]; if (sinkName == name) { - AUDIO_INFO_LOG("sink:%{public}s is the same, no need move session:%{public}u", sinkName.c_str(), + HILOG_COMM_INFO("sink:%{public}s is the same, no need move session:%{public}u", sinkName.c_str(), sinkInputId); if (auto serviceCallback = serviceCallback_.lock()) { serviceCallback->OnMoveSinkInputByIndexOrNameCb(SUCCESS); @@ -1216,7 +1215,7 @@ void HpaeManager::HandleDumpSourceInfo(std::string deviceName, std::string dumpS void HpaeManager::HandleReloadDeviceResult(std::string deviceName, int32_t result) { - AUDIO_INFO_LOG("deviceName:%{public}s result:%{public}d ", deviceName.c_str(), result); + HILOG_COMM_INFO("deviceName:%{public}s result:%{public}d", deviceName.c_str(), result); auto serviceCallback = serviceCallback_.lock(); if (serviceCallback && result == SUCCESS) { if (sinkNameSinkIdMap_.find(deviceName) != sinkNameSinkIdMap_.end()) { @@ -2357,7 +2356,7 @@ void HpaeManager::NotifyAccountsChanged() } std::string value = HpaePolicyManager::GetInstance().GetAudioParameter("primary", AudioParamKey::PARAM_KEY_STATE, "source_type_live_aec_supported"); - AUDIO_INFO_LOG("live_aec_supported: %{public}s", value.c_str()); + HILOG_COMM_INFO("live_aec_supported: %{public}s", value.c_str()); if (value == "true") { return true; } @@ -2369,7 +2368,7 @@ void HpaeManager::LoadEffectLive() AudioSettingProvider &settingProvider = AudioSettingProvider::GetInstance(AUDIO_POLICY_SERVICE_ID); ErrCode ret = ERROR; if (!settingProvider.CheckOsAccountReady()) { - AUDIO_ERR_LOG("OS account not ready"); + HILOG_COMM_INFO("OS account not ready"); } else { std::string configValue; ret = settingProvider.GetStringValue("live_effect_enable", configValue, "system"); @@ -2380,7 +2379,7 @@ void HpaeManager::LoadEffectLive() } std::string state = HpaePolicyManager::GetInstance().GetAudioParameter( "primary", AudioParamKey::PARAM_KEY_STATE, "live_effect_supported"); - AUDIO_INFO_LOG("EffectLive %{public}s", effectLiveState_.c_str()); + HILOG_COMM_INFO("EffectLive %{public}s", effectLiveState_.c_str()); if (state != "true") { effectLiveState_ = "NoSupport"; return; @@ -2415,7 +2414,7 @@ bool HpaeManager::SetEffectLiveParameter(const std::vectorSetNodeInfo(nodeInfo); uint32_t sessionId = nodeInfo.sessionId; - AUDIO_INFO_LOG("[FinishMove] session:%{public}u to sink:offload", sessionId); + HILOG_COMM_INFO("[FinishMove] session:%{public}u to sink:offload", sessionId); sinkInputNode_ = node; sessionInfo_.state = node->GetState(); @@ -294,7 +294,7 @@ void HpaeOffloadRendererManager::MoveAllStreamToNewSink(const std::string &sinkN if (moveType == MOVE_ALL || std::find(moveIds.begin(), moveIds.end(), sessionId) != moveIds.end()) { sinkInputs.emplace_back(sinkInputNode_); DeleteInputSession(); - AUDIO_INFO_LOG("[StartMove] session: %{public}u,sink [offload] --> [%{public}s]", + HILOG_COMM_INFO("[StartMove] session: %{public}u,sink [offload] --> [%{public}s]", sessionId, sinkName.c_str()); } } diff --git a/services/audio_engine/manager/src/hpae_renderer_manager.cpp b/services/audio_engine/manager/src/hpae_renderer_manager.cpp index d47d5a968d..0cfa424c6c 100644 --- a/services/audio_engine/manager/src/hpae_renderer_manager.cpp +++ b/services/audio_engine/manager/src/hpae_renderer_manager.cpp @@ -120,7 +120,7 @@ void HpaeRendererManager::AddSingleNodeToSink(const std::shared_ptrGetState()); sessionNodeMap_[sessionId].sceneType = nodeInfo.sceneType; - AUDIO_INFO_LOG("[FinishMove] session :%{public}u to sink:%{public}s, sceneType is %{public}d", + HILOG_COMM_INFO("[FinishMove] session :%{public}u to sink:%{public}s, sceneType is %{public}d", sessionId, sinkInfo_.deviceClass.c_str(), nodeInfo.sceneType); CreateEffectAndConnect(nodeInfo, isConnect); } @@ -544,7 +544,7 @@ void HpaeRendererManager::MoveAllStreamToNewSink(const std::string &sinkName, for (const auto &it : sessionIds) { DeleteInputSessionForMove(it); } - AUDIO_INFO_LOG("[StartMove] session:%{public}s to sink name:%{public}s, move type:%{public}d", + HILOG_COMM_INFO("[StartMove] session:%{public}s to sink name:%{public}s, move type:%{public}d", idStr.c_str(), name.c_str(), moveType); if (moveType == MOVE_ALL) { TriggerSyncCallback(MOVE_ALL_SINK_INPUT, sinkInputs, name, moveType); diff --git a/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp b/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp index b4b93fcfda..8a93b08a9e 100644 --- a/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp +++ b/services/audio_engine/node/src/hpae_offload_sinkoutput_node.cpp @@ -341,7 +341,7 @@ StreamManagerState HpaeOffloadSinkOutputNode::GetSinkState(void) int32_t HpaeOffloadSinkOutputNode::SetSinkState(StreamManagerState sinkState) { - AUDIO_INFO_LOG("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), ConvertStreamManagerState2Str(state_).c_str(), ConvertStreamManagerState2Str(sinkState).c_str()); state_ = sinkState; diff --git a/services/audio_engine/node/src/hpae_remote_sink_output_node.cpp b/services/audio_engine/node/src/hpae_remote_sink_output_node.cpp index 46bc753141..50a4f00c39 100644 --- a/services/audio_engine/node/src/hpae_remote_sink_output_node.cpp +++ b/services/audio_engine/node/src/hpae_remote_sink_output_node.cpp @@ -364,7 +364,7 @@ StreamManagerState HpaeRemoteSinkOutputNode::GetSinkState(void) int32_t HpaeRemoteSinkOutputNode::SetSinkState(StreamManagerState sinkState) { - AUDIO_INFO_LOG("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), ConvertStreamManagerState2Str(state_).c_str(), ConvertStreamManagerState2Str(sinkState).c_str()); state_ = sinkState; diff --git a/services/audio_engine/node/src/hpae_sink_input_node.cpp b/services/audio_engine/node/src/hpae_sink_input_node.cpp index fa7b86c1ba..002f0dd001 100644 --- a/services/audio_engine/node/src/hpae_sink_input_node.cpp +++ b/services/audio_engine/node/src/hpae_sink_input_node.cpp @@ -259,7 +259,7 @@ bool HpaeSinkInputNode::Drain() int32_t HpaeSinkInputNode::SetState(HpaeSessionState renderState) { - AUDIO_INFO_LOG("Sink[%{public}s]->Session[%{public}u - %{public}d] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO("Sink[%{public}s]->Session[%{public}u - %{public}d] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), GetSessionId(), GetStreamType(), ConvertSessionState2Str(state_).c_str(), ConvertSessionState2Str(renderState).c_str()); state_ = renderState; diff --git a/services/audio_engine/node/src/hpae_sink_output_node.cpp b/services/audio_engine/node/src/hpae_sink_output_node.cpp index f71c7878c7..ec62eee05e 100644 --- a/services/audio_engine/node/src/hpae_sink_output_node.cpp +++ b/services/audio_engine/node/src/hpae_sink_output_node.cpp @@ -335,7 +335,7 @@ StreamManagerState HpaeSinkOutputNode::GetSinkState(void) int32_t HpaeSinkOutputNode::SetSinkState(StreamManagerState sinkState) { - AUDIO_INFO_LOG("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO("Sink[%{public}s] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), ConvertStreamManagerState2Str(state_).c_str(), ConvertStreamManagerState2Str(sinkState).c_str()); state_ = sinkState; diff --git a/services/audio_engine/node/src/hpae_source_input_node.cpp b/services/audio_engine/node/src/hpae_source_input_node.cpp index c62db3b9aa..e51dc74397 100644 --- a/services/audio_engine/node/src/hpae_source_input_node.cpp +++ b/services/audio_engine/node/src/hpae_source_input_node.cpp @@ -475,7 +475,7 @@ StreamManagerState HpaeSourceInputNode::GetSourceState(void) int32_t HpaeSourceInputNode::SetSourceState(StreamManagerState sourceState) { - AUDIO_INFO_LOG("Source[%{public}s] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO("Source[%{public}s] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), ConvertStreamManagerState2Str(state_).c_str(), ConvertStreamManagerState2Str(sourceState).c_str()); state_ = sourceState; diff --git a/services/audio_engine/node/src/hpae_source_output_node.cpp b/services/audio_engine/node/src/hpae_source_output_node.cpp index 083001ed0f..073bddfe28 100644 --- a/services/audio_engine/node/src/hpae_source_output_node.cpp +++ b/services/audio_engine/node/src/hpae_source_output_node.cpp @@ -184,7 +184,7 @@ void HpaeSourceOutputNode::DisConnectWithInfo(const std::shared_ptrSession[%{public}u - %{public}d] state change:[%{public}s]-->[%{public}s]", + HILOG_COMM_INFO(" Capturer[%{public}s]->Session[%{public}u - %{public}d] state change:[%{public}s]-->[%{public}s]", GetDeviceClass().c_str(), GetSessionId(), GetStreamType(), ConvertSessionState2Str(state_).c_str(), ConvertSessionState2Str(captureState).c_str()); state_ = captureState; -- Gitee