From 6e7b0fc8823118127b3d182bbe13c43304f918b1 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 20 Apr 2021 15:52:00 -0700 Subject: SL-15072: First part of adding ability to disable the VIVOX auto VAD feature and set our own values via Debug Settings - hardcoded currently for testing but will be pulled from global settings eventually --- indra/newview/llvoicevivox.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index a8d668420e..39d6868b5c 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1883,6 +1883,13 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) notifyParticipantObservers(); notifyVoiceFontObservers(); + // disable the automatic VAD and explicitly set the VAD variables ourselves + // see SL-15072 for more details + unsigned int vad_hangover = 2001; + unsigned int vad_noise_floor = 577; + unsigned int vad_sensitivity = 44; + setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); + LLSD timeoutEvent(LLSDMap("timeout", LLSD::Boolean(true))); mIsInChannel = true; @@ -3217,6 +3224,56 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates() } } +/** + * Because of the recurring voice cutout issues (SL-15072) we are going to try + * to disable the automatic VAD (Voice Activity Detection) and set the associated + * parameters directly. We will expose them via Debug Settings and that should + * let us iterate on a collection of values that work for us. Hopefully! + * + * From the VIVOX Docs: + * + * vad_hangover: The 'Hangover time' - the time (in milliseconds) that it takes + * for the VAD to switch back to silence from speech mode after the last speech + * frame has been detected. + * + * vad_noise_floor: The 'vad noise floor' - A dimensionless value between 0 and + * 20000 (default 576) that controls the maximum level at which the noise floor + * may be set at by the VAD's noise tracking. Too low of a value will make noise + * tracking ineffective (A value of 0 disables noise tracking and the VAD then + * relies purely on the sensitivity property). Too high of a value will make + * long speech classifiable as noise. + * + * vad_sensitivity: The 'vad sensitivity' - A dimensionless value between 0 and + * 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds + * to decreasing the sensitivity of the VAD (i.e. '0' is most sensitive, + * while 100 is 'least sensitive') + */ +void LLVivoxVoiceClient::setupVADParams(unsigned int vad_hangover, + unsigned int vad_noise_floor, + unsigned int vad_sensitivity) +{ + std::ostringstream stream; + + // explicitly turn off the automatic VAD even though the + // default state is also disabled. + const unsigned int vad_auto_enabled = 0; + + // Create a request to set the VAD parameters: + LL_INFOS("Voice") << "Disabling the automatic VAD and setting the parameters explicitly." << LL_ENDL; + + stream << "" + << "" << vad_auto_enabled << "" + << "" << vad_hangover << "" + << "" << vad_hangover << "" + << "" << vad_hangover << "" + << "\n\n\n"; + + if (!stream.str().empty()) + { + writeString(stream.str()); + } +} + ///////////////////////////// // Response/Event handlers @@ -7569,6 +7626,14 @@ void LLVivoxProtocolParser::processResponse(std::string tag) { LLVivoxVoiceClient::getInstance()->accountGetTemplateFontsResponse(statusCode, statusString); } + else if (!stricmp(actionCstr, "Aux.SetVadProperties.1")) + { + std::cout << "@@@----" << std::endl; + std::cout << " Response for Aux.SetVadProperties.1 was" << std::endl; + std::cout << " statusCode: " << statusCode << std::endl; + std::cout << " statusString: " << statusString << std::endl; + std::cout << "----@@@" << std::endl; + } /* else if (!stricmp(actionCstr, "Account.ChannelGetList.1")) { -- cgit v1.2.3 From 28935a8b6435eaf41ab13605097257c9d7f5afda Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 20 Apr 2021 16:28:58 -0700 Subject: Move location where we call function to setup VAD but didn't help --- indra/newview/llvoicevivox.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 39d6868b5c..fa4504de62 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -683,7 +683,14 @@ void LLVivoxVoiceClient::voiceControlCoro() bool success = startAndConnectSession(); if (success) { - if (mTuningMode) + // disable the automatic VAD and explicitly set the VAD variables ourselves + // see SL-15072 for more details + unsigned int vad_hangover = 2001; + unsigned int vad_noise_floor = 577; + unsigned int vad_sensitivity = 44; + setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); + + if (mTuningMode) { performMicTuning(); } @@ -1883,13 +1890,6 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) notifyParticipantObservers(); notifyVoiceFontObservers(); - // disable the automatic VAD and explicitly set the VAD variables ourselves - // see SL-15072 for more details - unsigned int vad_hangover = 2001; - unsigned int vad_noise_floor = 577; - unsigned int vad_sensitivity = 44; - setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); - LLSD timeoutEvent(LLSDMap("timeout", LLSD::Boolean(true))); mIsInChannel = true; @@ -7628,11 +7628,13 @@ void LLVivoxProtocolParser::processResponse(std::string tag) } else if (!stricmp(actionCstr, "Aux.SetVadProperties.1")) { - std::cout << "@@@----" << std::endl; + // temporary for debugging- will eventually remove entirely or replace with a + // toast message to alert the user that it was set + std::cout << "@@@" << std::endl; std::cout << " Response for Aux.SetVadProperties.1 was" << std::endl; - std::cout << " statusCode: " << statusCode << std::endl; - std::cout << " statusString: " << statusString << std::endl; - std::cout << "----@@@" << std::endl; + std::cout << " statusCode: " << statusCode << std::endl; + std::cout << " statusString: " << statusString << std::endl; + std::cout << "@@@" << std::endl; } /* else if (!stricmp(actionCstr, "Account.ChannelGetList.1")) -- cgit v1.2.3 From 5ef055fe69d64917ba1b40856ab02fc20036dffc Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 21 Apr 2021 12:07:18 -0700 Subject: SL-15072 update. Values for VAD settings now stored in debug settings. Request successfully sent at startup and also, whenever a relevant debug setting is changed. Going to send this build to Brett to test --- indra/newview/llvoicevivox.cpp | 48 ++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index fa4504de62..f2115feb10 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -651,7 +651,6 @@ void LLVivoxVoiceClient::idle(void* user_data) { } - //========================================================================= // the following are methods to support the coroutine implementation of the // voice connection and processing. They should only be called in the context @@ -683,13 +682,18 @@ void LLVivoxVoiceClient::voiceControlCoro() bool success = startAndConnectSession(); if (success) { - // disable the automatic VAD and explicitly set the VAD variables ourselves - // see SL-15072 for more details - unsigned int vad_hangover = 2001; - unsigned int vad_noise_floor = 577; - unsigned int vad_sensitivity = 44; + // disable the automatic VAD and explicitly set the initial values of + // the VAD variables ourselves see SL-15072 for more details + unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover"); + unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor"); + unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity"); setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); + // watch for changes to the VAD settings via Debug Settings UI and act on them accordingly + gSavedSettings.getControl("VivoxVadHangover")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); + gSavedSettings.getControl("VivoxVadNoiseFloor")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); + gSavedSettings.getControl("VivoxVadSensitivity")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); + if (mTuningMode) { performMicTuning(); @@ -737,7 +741,6 @@ void LLVivoxVoiceClient::voiceControlCoro() LL_INFOS("Voice") << "exiting" << LL_ENDL; } - bool LLVivoxVoiceClient::startAndConnectSession() { bool ok = false; @@ -3264,8 +3267,8 @@ void LLVivoxVoiceClient::setupVADParams(unsigned int vad_hangover, stream << "" << "" << vad_auto_enabled << "" << "" << vad_hangover << "" - << "" << vad_hangover << "" - << "" << vad_hangover << "" + << "" << vad_sensitivity << "" + << "" << vad_noise_floor << "" << "\n\n\n"; if (!stream.str().empty()) @@ -3274,6 +3277,17 @@ void LLVivoxVoiceClient::setupVADParams(unsigned int vad_hangover, } } +void LLVivoxVoiceClient::onVADSettingsChange() +{ + // pick up the VAD variables (one of which was changed) + unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover"); + unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor"); + unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity"); + + // build a VAD params change request and send it to SLVoice + setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); +} + ///////////////////////////// // Response/Event handlers @@ -7628,13 +7642,15 @@ void LLVivoxProtocolParser::processResponse(std::string tag) } else if (!stricmp(actionCstr, "Aux.SetVadProperties.1")) { - // temporary for debugging- will eventually remove entirely or replace with a - // toast message to alert the user that it was set - std::cout << "@@@" << std::endl; - std::cout << " Response for Aux.SetVadProperties.1 was" << std::endl; - std::cout << " statusCode: " << statusCode << std::endl; - std::cout << " statusString: " << statusString << std::endl; - std::cout << "@@@" << std::endl; + // both values of statusCode (old and more recent) indicate valid requests + if (statusCode != 0 && statusCode != 200) + { + LL_WARNS("Voice") << "Aux.SetVadProperties.1 request failed: " + << "statusCode: " << statusCode + << " and " + << "statusString: " << statusString + << LL_ENDL; + } } /* else if (!stricmp(actionCstr, "Account.ChannelGetList.1")) -- cgit v1.2.3 From 0dd53d7b5b934ee4fdc312f26ec58530f5b45091 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 29 Apr 2021 15:59:19 -0700 Subject: Expose the flag to turn automatic VAD on and off. We will likely keep it off since that appears to be working well for us but others may want to turn in on --- indra/newview/llvoicevivox.cpp | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 96ae171eb7..0503ba3f94 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -683,14 +683,17 @@ void LLVivoxVoiceClient::voiceControlCoro() bool success = startAndConnectSession(); if (success) { - // disable the automatic VAD and explicitly set the initial values of - // the VAD variables ourselves see SL-15072 for more details + // enable/disable the automatic VAD and explicitly set the initial values of + // the VAD variables ourselves when it is off - see SL-15072 for more details + // note: we set the other parameters too even if the auto VAD is on which is ok + unsigned int vad_auto = gSavedSettings.getU32("VivoxVadAuto"); unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover"); unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor"); unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity"); - setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); + setupVADParams(vad_auto, vad_hangover, vad_noise_floor, vad_sensitivity); // watch for changes to the VAD settings via Debug Settings UI and act on them accordingly + gSavedSettings.getControl("VivoxVadAuto")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); gSavedSettings.getControl("VivoxVadHangover")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); gSavedSettings.getControl("VivoxVadNoiseFloor")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); gSavedSettings.getControl("VivoxVadSensitivity")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); @@ -3248,37 +3251,42 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates() * * From the VIVOX Docs: * - * vad_hangover: The 'Hangover time' - the time (in milliseconds) that it takes + * VadAuto: A flag indicating if the automatic VAD is enabled (1) or disabled (0) + * + * VadHangover: The time (in milliseconds) that it takes * for the VAD to switch back to silence from speech mode after the last speech * frame has been detected. * - * vad_noise_floor: The 'vad noise floor' - A dimensionless value between 0 and + * VadNoiseFloor: A dimensionless value between 0 and * 20000 (default 576) that controls the maximum level at which the noise floor * may be set at by the VAD's noise tracking. Too low of a value will make noise * tracking ineffective (A value of 0 disables noise tracking and the VAD then * relies purely on the sensitivity property). Too high of a value will make * long speech classifiable as noise. * - * vad_sensitivity: The 'vad sensitivity' - A dimensionless value between 0 and + * VadSensitivity: A dimensionless value between 0 and * 100, indicating the 'sensitivity of the VAD'. Increasing this value corresponds * to decreasing the sensitivity of the VAD (i.e. '0' is most sensitive, * while 100 is 'least sensitive') */ -void LLVivoxVoiceClient::setupVADParams(unsigned int vad_hangover, +void LLVivoxVoiceClient::setupVADParams(unsigned int vad_auto, + unsigned int vad_hangover, unsigned int vad_noise_floor, unsigned int vad_sensitivity) { std::ostringstream stream; - // explicitly turn off the automatic VAD even though the - // default state is also disabled. - const unsigned int vad_auto_enabled = 0; - - // Create a request to set the VAD parameters: - LL_INFOS("Voice") << "Disabling the automatic VAD and setting the parameters explicitly." << LL_ENDL; + LL_INFOS("Voice") << "Setting the automatic VAD to " + << (vad_auto ? "True" : "False") + << " and discrete values to" + << " VadHangover = " << vad_hangover + << ", VadSensitivity = " << vad_sensitivity + << ", VadNoiseFloor = " << vad_noise_floor + << LL_ENDL; - stream << "" - << "" << vad_auto_enabled << "" + // Create a request to set the VAD parameters: + stream << "" + << "" << vad_auto << "" << "" << vad_hangover << "" << "" << vad_sensitivity << "" << "" << vad_noise_floor << "" @@ -3293,12 +3301,13 @@ void LLVivoxVoiceClient::setupVADParams(unsigned int vad_hangover, void LLVivoxVoiceClient::onVADSettingsChange() { // pick up the VAD variables (one of which was changed) + unsigned int vad_auto = gSavedSettings.getU32("VivoxVadAuto"); unsigned int vad_hangover = gSavedSettings.getU32("VivoxVadHangover"); unsigned int vad_noise_floor = gSavedSettings.getU32("VivoxVadNoiseFloor"); unsigned int vad_sensitivity = gSavedSettings.getU32("VivoxVadSensitivity"); // build a VAD params change request and send it to SLVoice - setupVADParams(vad_hangover, vad_noise_floor, vad_sensitivity); + setupVADParams(vad_auto, vad_hangover, vad_noise_floor, vad_sensitivity); } ///////////////////////////// -- cgit v1.2.3 From 76ab0e277588d8f36e2188a8a67628b74eae50a7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 24 May 2021 23:41:17 +0300 Subject: SL-15292 waitForChannel crash --- indra/newview/llvoicevivox.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 0503ba3f94..0e78e706bd 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1339,6 +1339,11 @@ void LLVivoxVoiceClient::logoutOfVivox(bool wait) result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, LOGOUT_ATTEMPT_TIMEOUT, timeoutResult); + if (sShuttingDown) + { + break; + } + LL_DEBUGS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL; // Don't get confused by prior queued events -- note that it's // very important that mVivoxPump is an LLEventMailDrop, which @@ -1772,7 +1777,7 @@ bool LLVivoxVoiceClient::waitForChannel() if (sShuttingDown) { - logoutOfVivox(true); + logoutOfVivox(false); return false; } @@ -1864,9 +1869,9 @@ bool LLVivoxVoiceClient::waitForChannel() mIsProcessingChannels = false; - logoutOfVivox(true); + logoutOfVivox(!sShuttingDown /*bool wait*/); - if (mRelogRequested) + if (mRelogRequested && !sShuttingDown) { LL_DEBUGS("Voice") << "Relog Requested, restarting provisioning" << LL_ENDL; if (!provisionVoiceAccount()) -- cgit v1.2.3 From 9241a87b6fae9785b9a9557104e5329aefdd70b5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Jun 2021 18:32:57 +0300 Subject: SL-15292 waitForChannel crash #2 --- indra/newview/llvoicevivox.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8dd061728f..c383750f60 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1583,6 +1583,12 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession) { result = llcoro::suspendUntilEventOnWithTimeout(mVivoxPump, SESSION_JOIN_TIMEOUT, timeoutResult); + if (sShuttingDown) + { + mIsJoiningSession = false; + return false; + } + LL_INFOS("Voice") << "event=" << ll_stream_notation_sd(result) << LL_ENDL; if (result.has("session")) { @@ -1821,7 +1827,7 @@ bool LLVivoxVoiceClient::waitForChannel() // the parcel is changed, or we have no pending audio sessions, // so try to request the parcel voice info // if we have the cap, we move to the appropriate state - requestParcelVoiceInfo(); + requestParcelVoiceInfo(); //suspends for http reply } else if (sessionNeedsRelog(mNextAudioSession)) { @@ -1833,7 +1839,7 @@ bool LLVivoxVoiceClient::waitForChannel() { sessionStatePtr_t joinSession = mNextAudioSession; mNextAudioSession.reset(); - if (!runSession(joinSession)) + if (!runSession(joinSession)) //suspends { LL_DEBUGS("Voice") << "runSession returned false; leaving inner loop" << LL_ENDL; break; @@ -1848,7 +1854,7 @@ bool LLVivoxVoiceClient::waitForChannel() } } - if (!mNextAudioSession) + if (!mNextAudioSession && !sShuttingDown) { llcoro::suspendUntilTimeout(1.0); } @@ -1921,7 +1927,12 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session) while (mVoiceEnabled && isGatewayRunning() && !mSessionTerminateRequested && !mTuningMode) { - sendCaptureAndRenderDevices(); + sendCaptureAndRenderDevices(); // suspends + if (mSessionTerminateRequested) + { + break; + } + if (mAudioSession && mAudioSession->mParticipantsChanged) { mAudioSession->mParticipantsChanged = false; -- cgit v1.2.3 From 7cc5b01ded137769cd798229b72013a364264ded Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Jun 2021 19:15:32 +0300 Subject: SL-15292 waitForChannel crash #3 --- indra/newview/llvoicevivox.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index c383750f60..d63a6fb1da 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -698,7 +698,7 @@ void LLVivoxVoiceClient::voiceControlCoro() gSavedSettings.getControl("VivoxVadNoiseFloor")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); gSavedSettings.getControl("VivoxVadSensitivity")->getSignal()->connect(boost::bind(&LLVivoxVoiceClient::onVADSettingsChange, this)); - if (mTuningMode) + if (mTuningMode && !sShuttingDown) { performMicTuning(); } @@ -1272,8 +1272,11 @@ bool LLVivoxVoiceClient::loginToVivox() // tell the user there is a problem LL_WARNS("Voice") << "login " << loginresp << " will retry login in " << timeout << " seconds." << LL_ENDL; - - llcoro::suspendUntilTimeout(timeout); + + if (!sShuttingDown) + { + llcoro::suspendUntilTimeout(timeout); + } } else if (loginresp == "failed") { @@ -2159,7 +2162,7 @@ bool LLVivoxVoiceClient::performMicTuning() mIsInTuningMode = true; llcoro::suspend(); - while (mTuningMode) + while (mTuningMode && !sShuttingDown) { if (mCaptureDeviceDirty || mRenderDeviceDirty) @@ -2195,9 +2198,12 @@ bool LLVivoxVoiceClient::performMicTuning() tuningCaptureStartSendMessage(1); // 1-loop, zero, don't loop //--------------------------------------------------------------------- - llcoro::suspend(); + if (!sShuttingDown) + { + llcoro::suspend(); + } - while (mTuningMode && !mCaptureDeviceDirty && !mRenderDeviceDirty) + while (mTuningMode && !mCaptureDeviceDirty && !mRenderDeviceDirty && !sShuttingDown) { // process mic/speaker volume changes if (mTuningMicVolumeDirty || mTuningSpeakerVolumeDirty) @@ -2237,7 +2243,7 @@ bool LLVivoxVoiceClient::performMicTuning() // transition out of mic tuning tuningCaptureStopSendMessage(); - if (mCaptureDeviceDirty || mRenderDeviceDirty) + if ((mCaptureDeviceDirty || mRenderDeviceDirty) && !sShuttingDown) { llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS); } -- cgit v1.2.3 From 9451b50b2b855d6de6cc7141428575c06f46aeb0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Jun 2021 19:48:45 +0300 Subject: SL-15292 waitForChannel crash #4 --- indra/newview/llvoicevivox.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoicevivox.cpp') diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index d63a6fb1da..4d2eac8c09 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -703,7 +703,10 @@ void LLVivoxVoiceClient::voiceControlCoro() performMicTuning(); } - waitForChannel(); // this doesn't normally return unless relog is needed or shutting down + if (!sShuttingDown) + { + waitForChannel(); // this doesn't normally return unless relog is needed or shutting down + } LL_DEBUGS("Voice") << "lost channel RelogRequested=" << mRelogRequested << LL_ENDL; endAndDisconnectSession(); @@ -1045,7 +1048,14 @@ bool LLVivoxVoiceClient::provisionVoiceAccount() { F32 timeout = pow(PROVISION_RETRY_TIMEOUT, static_cast(retryCount)); LL_WARNS("Voice") << "Provision CAP 404. Retrying in " << timeout << " seconds." << LL_ENDL; - llcoro::suspendUntilTimeout(timeout); + if (sShuttingDown) + { + return false; + } + else + { + llcoro::suspendUntilTimeout(timeout); + } } else if (!status) { @@ -1275,6 +1285,8 @@ bool LLVivoxVoiceClient::loginToVivox() if (!sShuttingDown) { + // Todo: this is way to long, viewer can get stuck waiting during shutdown + // either make it listen to pump or split in smaller waits with checks for shutdown llcoro::suspendUntilTimeout(timeout); } } -- cgit v1.2.3