From fdd3771aa63adbaea5c2a24da21a9dcba80312d2 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 29 Mar 2023 14:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Daiui=20tts=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dep/zlinuxcomponents | 2 +- src/service/main_control_service.cpp | 30 ++++++------ webapp/debug/index.html | 88 ------------------------------------ 3 files changed, 16 insertions(+), 104 deletions(-) delete mode 100644 webapp/debug/index.html diff --git a/dep/zlinuxcomponents b/dep/zlinuxcomponents index 8085579..3e93650 160000 --- a/dep/zlinuxcomponents +++ b/dep/zlinuxcomponents @@ -1 +1 @@ -Subproject commit 8085579161497e78502e7b50ffe5639ea0bb9183 +Subproject commit 3e936505866b63292729a41c56cd493435dea0ed diff --git a/src/service/main_control_service.cpp b/src/service/main_control_service.cpp index 76a2be3..2da7ea6 100644 --- a/src/service/main_control_service.cpp +++ b/src/service/main_control_service.cpp @@ -88,9 +88,7 @@ void MainControlService::initializeVoiceProcess() { }); m_aiuiService->onMessage.connect([&](const json& rxjson) { - lock_guard lock(m_voiceprocessmutex); - Trace trace(logger, "m_aiuiService->onMessage"); - json msg = rxjson; + json msg = rxjson; m_workQueue->enQueue([this, msg]() { try { processasrResult(msg); @@ -106,8 +104,13 @@ void MainControlService::initializeVoiceProcess() { void MainControlService::triggerProcessConversationSession() { m_smartSoundboxPlayer->playConversationTTS(m_conversationSession->getAsrTTSLocalURL(), nullptr); json nlpResult = m_conversationSession->getNlpResult(); - if (nlpResult["data"]["intent"]["shouldEndSession"] == "true") { - logger->info("endSession"); + if (nlpResult["data"]["intent"].find("shouldEndSession") == nlpResult["data"]["intent"].end()) { + logger->info("conversationSession normal end"); + if (m_endsessionTimer->isRunning()) m_endsessionTimer->stop(); + endSession(); + return; + } else if (nlpResult["data"]["intent"]["shouldEndSession"] == "true") { + logger->info("conversationSession normal end"); if (m_endsessionTimer->isRunning()) m_endsessionTimer->stop(); endSession(); return; @@ -135,7 +138,7 @@ void MainControlService::processasrResult_tts(json& rxjson) { } void MainControlService::processasrResult(json rxjson) { - Trace trace(logger, "processasrResult"); + // Trace trace(logger, "processasrResult"); lock_guard lock(m_voiceprocessmutex); string action = rxjson["action"]; @@ -179,7 +182,7 @@ void MainControlService::constructSession() { * 5. 启动定时器,如果10s内无人应答,则结束session */ lock_guard lock(m_voiceprocessmutex); - Trace trace(logger, "constructSession"); + // Trace trace(logger, "constructSession"); /** * @brief * TODO: @@ -192,6 +195,7 @@ void MainControlService::constructSession() { m_smartSoundboxPlayer->triggerWakeup(); if (m_conversationSession) { if (m_endsessionTimer->isRunning()) m_endsessionTimer->stop(); + logger->info("trigger double wakeup,end session"); endSession(); } @@ -213,19 +217,15 @@ void MainControlService::constructSession() { void MainControlService::endSession() { lock_guard lock(m_voiceprocessmutex); - Trace trace(logger, "endSession"); - logger->info("{}", __LINE__); + // Trace trace(logger, "endSession"); if (m_conversationSession) { + logger->info("endsession {}", m_conversationSession->getSessionId()); m_conversationSession = nullptr; - logger->info("{}", __LINE__); - int ret = m_aiuiService->aiuiFinished(); - logger->info("{} {}", __LINE__, ret); + m_aiuiService->aiuiFinished(); + ThisThread().sleepForMs(100); m_aiuiService->aiuiDestroy(); - logger->info("{}", __LINE__); } - logger->info("{}", __LINE__); m_audioLoggingService->endwakeup(); - logger->info("{}", __LINE__); } void MainControlService::initialize() { diff --git a/webapp/debug/index.html b/webapp/debug/index.html deleted file mode 100644 index 42f5a6e..0000000 --- a/webapp/debug/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - 日志配置 - - - - - - -
- - - -
- - - - - - \ No newline at end of file