From d163d9032314335825b6f713e388342dde9174e7 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 28 Jul 2024 16:17:23 +0200 Subject: Fix callbacks for PBR region terrain panel not getting wired up properly --- indra/newview/llfloaterregioninfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 8807509a2e..3ef44bf74a 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -852,8 +852,9 @@ void LLPanelRegionInfo::initCtrl(const std::string& name) template void LLPanelRegionInfo::initAndSetCtrl(CTRL*& ctrl, const std::string& name) { - initCtrl(name); ctrl = findChild(name); + if (ctrl) + ctrl->setCommitCallback(boost::bind(&LLPanelRegionInfo::onChangeAnything, this)); } void LLPanelRegionInfo::onClickManageTelehub() -- cgit v1.2.3 From 7b119c01e0c179bac3dfe8b8c8ee05016099c9aa Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Jul 2024 13:01:13 +0300 Subject: viewer-private#255 p2p outgoing calls did not work correctly Issue: P2P was catching STATUS_LEFT_CHANNEL meant for nearby chat and adopting channel info for itself Solution: - Moved one of notifyStatusObservers calls so that it would have uri data instead of firing with no channel info - Made p2p sessions init with uri data, like it was before webrtc. Which is used to distinguish observer notifications. - Removed mAudioSessionChanged. It was unused yet confusing. --- indra/newview/llvoicechannel.cpp | 13 ++++++++++++- indra/newview/llvoicevivox.cpp | 14 +++++--------- indra/newview/llvoicevivox.h | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 8681411a98..29817ab03a 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -122,7 +122,13 @@ void LLVoiceChannel::onChange(EStatusType type, const LLSD& channelInfo, bool pr { LL_DEBUGS("Voice") << "Incoming channel info: " << channelInfo << LL_ENDL; LL_DEBUGS("Voice") << "Current channel info: " << mChannelInfo << LL_ENDL; - if (mChannelInfo.isUndefined() || (mChannelInfo.isMap() && mChannelInfo.size() == 0)) + if (mChannelInfo.has("channel_uri") + && (!channelInfo.has("channel_uri") || mChannelInfo["channel_uri"] != channelInfo["channel_uri"])) + { + return; + } + if (mChannelInfo.isUndefined() + || (mChannelInfo.isMap() && mChannelInfo.size() <= 1)) // p2p will have uri beforehand { mChannelInfo = channelInfo; } @@ -768,6 +774,11 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID &session_id, mReceivedCall(FALSE), mOutgoingCallInterface(outgoing_call_interface) { + std::string sip_uri = LLVoiceClient::getInstance()->sipURIFromID(other_user_id); + if (!sip_uri.empty()) + { + mChannelInfo["channel_uri"] = sip_uri; + } } void LLVoiceChannelP2P::handleStatusChange(EStatusType type) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 4694ea92bb..9215160202 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -296,7 +296,6 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mDevicesListUpdated(false), mAudioSession(), // TBD - should be NULL - mAudioSessionChanged(false), mNextAudioSession(), mCurrentParcelLocalID(0), @@ -1641,7 +1640,6 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession) LL_INFOS("Voice") << "Adding or joining voice session " << nextSession->mHandle << LL_ENDL; mAudioSession = nextSession; - mAudioSessionChanged = true; if (!mAudioSession || !mAudioSession->mReconnect) { mNextAudioSession.reset(); @@ -1898,9 +1896,8 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait) sessionStatePtr_t oldSession = mAudioSession; + notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); // needs mAudioSession for uri mAudioSession.reset(); - // We just notified status observers about this change. Don't do it again. - mAudioSessionChanged = false; // The old session may now need to be deleted. reapSession(oldSession); @@ -1908,9 +1905,9 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait) else { LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL; + notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); } - notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL); // Always reset the terminate request flag when we get here. // Some slower PCs have a race condition where they can switch to an incoming P2P call faster than the state machine leaves @@ -3832,7 +3829,6 @@ void LLVivoxVoiceClient::joinedAudioSession(const sessionStatePtr_t &session) sessionStatePtr_t oldSession = mAudioSession; mAudioSession = session; - mAudioSessionChanged = true; // The old session may now need to be deleted. reapSession(oldSession); @@ -6147,7 +6143,6 @@ void LLVivoxVoiceClient::deleteSession(const sessionStatePtr_t &session) if(mAudioSession == session) { mAudioSession.reset(); - mAudioSessionChanged = true; } // ditto for the next audio session @@ -6256,9 +6251,10 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta } } + LLSD channel_info = getAudioSessionChannelInfo(); LL_DEBUGS("Voice") << " " << LLVoiceClientStatusObserver::status2string(status) - << ", session channelInfo " << getAudioSessionChannelInfo() + << ", session channelInfo " << channel_info << ", proximal is " << inSpatialChannel() << LL_ENDL; @@ -6273,7 +6269,7 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta ) { LLVoiceClientStatusObserver* observer = *it; - observer->onChange(status, getAudioSessionChannelInfo(), inSpatialChannel()); + observer->onChange(status, channel_info, inSpatialChannel()); // In case onError() deleted an entry. it = mStatusObservers.upper_bound(observer); } diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 55c1fb50d0..12e3d11eef 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -706,7 +706,6 @@ private: std::string mChannelName; // Name of the channel to be looked up sessionStatePtr_t mAudioSession; // Session state for the current audio session - bool mAudioSessionChanged; // set to true when the above pointer gets changed, so observers can be notified. sessionStatePtr_t mNextAudioSession; // Session state for the audio session we're trying to join -- cgit v1.2.3 From f75735d7416b8217a93ffd3ed95c6289f5ff0c68 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 26 Jul 2024 19:28:40 +0300 Subject: viewer-private#255 p2p outgoing calls did not work correctly #2 --- indra/newview/llvoicechannel.cpp | 14 ++------------ indra/newview/llvoiceclient.cpp | 18 +++++++++++++++++- indra/newview/llvoiceclient.h | 6 ++++-- indra/newview/llvoicevivox.cpp | 12 ++++++++++-- indra/newview/llvoicevivox.h | 5 +++-- indra/newview/llvoicewebrtc.cpp | 7 ++++++- indra/newview/llvoicewebrtc.h | 4 +++- 7 files changed, 45 insertions(+), 21 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 29817ab03a..5a9c0d103f 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -122,13 +122,7 @@ void LLVoiceChannel::onChange(EStatusType type, const LLSD& channelInfo, bool pr { LL_DEBUGS("Voice") << "Incoming channel info: " << channelInfo << LL_ENDL; LL_DEBUGS("Voice") << "Current channel info: " << mChannelInfo << LL_ENDL; - if (mChannelInfo.has("channel_uri") - && (!channelInfo.has("channel_uri") || mChannelInfo["channel_uri"] != channelInfo["channel_uri"])) - { - return; - } - if (mChannelInfo.isUndefined() - || (mChannelInfo.isMap() && mChannelInfo.size() <= 1)) // p2p will have uri beforehand + if (mChannelInfo.isUndefined() || (mChannelInfo.isMap() && mChannelInfo.size() == 0)) { mChannelInfo = channelInfo; } @@ -774,11 +768,7 @@ LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID &session_id, mReceivedCall(FALSE), mOutgoingCallInterface(outgoing_call_interface) { - std::string sip_uri = LLVoiceClient::getInstance()->sipURIFromID(other_user_id); - if (!sip_uri.empty()) - { - mChannelInfo["channel_uri"] = sip_uri; - } + mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(other_user_id); } void LLVoiceChannelP2P::handleStatusChange(EStatusType type) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index c20a5ec749..0cf4a64c3d 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -826,7 +826,7 @@ void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer) LLWebRTCVoiceClient::getInstance()->removeObserver(observer); } -std::string LLVoiceClient::sipURIFromID(const LLUUID &id) +std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const { if (mNonSpatialVoiceModule) { @@ -842,6 +842,22 @@ std::string LLVoiceClient::sipURIFromID(const LLUUID &id) } } +LLSD LLVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const +{ + if (mNonSpatialVoiceModule) + { + return mNonSpatialVoiceModule->getP2PChannelInfoTemplate(id); + } + else if (mSpatialVoiceModule) + { + return mSpatialVoiceModule->getP2PChannelInfoTemplate(id); + } + else + { + return LLSD(); + } +} + LLVoiceEffectInterface* LLVoiceClient::getVoiceEffectInterface() const { return NULL; diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index d603125759..c8a65378c6 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -281,7 +281,8 @@ public: virtual void removeObserver(LLVoiceClientParticipantObserver* observer)=0; //@} - virtual std::string sipURIFromID(const LLUUID &id)=0; + virtual std::string sipURIFromID(const LLUUID &id) const=0; + virtual LLSD getP2PChannelInfoTemplate(const LLUUID& id) const=0; //@} }; @@ -488,7 +489,8 @@ public: void addObserver(LLVoiceClientParticipantObserver* observer); void removeObserver(LLVoiceClientParticipantObserver* observer); - std::string sipURIFromID(const LLUUID &id); + std::string sipURIFromID(const LLUUID &id) const; + LLSD getP2PChannelInfoTemplate(const LLUUID& id) const; ////////////////////////// /// @name Voice effects diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9215160202..3392e4de86 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5138,7 +5138,7 @@ bool LLVivoxVoiceClient::inProximalChannel() return result; } -std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) +std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) const { std::string result; result = "sip:"; @@ -5149,6 +5149,14 @@ std::string LLVivoxVoiceClient::sipURIFromID(const LLUUID &id) return result; } +LLSD LLVivoxVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const +{ + LLSD result; + result["channel_uri"] = sipURIFromID(id); + result["voice_server_type"] = VIVOX_VOICE_SERVER_TYPE; + return result; +} + std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar) { std::string result; @@ -5163,7 +5171,7 @@ std::string LLVivoxVoiceClient::sipURIFromAvatar(LLVOAvatar *avatar) return result; } -std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) +std::string LLVivoxVoiceClient::nameFromID(const LLUUID &uuid) const { std::string result; diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 12e3d11eef..64c2c87db6 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -221,7 +221,8 @@ public: void removeObserver(LLVoiceClientParticipantObserver* observer) override; //@} - std::string sipURIFromID(const LLUUID &id) override; + std::string sipURIFromID(const LLUUID &id) const override; + LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override; //@} /// @name LLVoiceEffectInterface virtual implementations @@ -747,7 +748,7 @@ private: bool switchChannel(std::string uri = std::string(), bool spatial = true, bool no_reconnect = false, bool is_p2p = false, std::string hash = ""); void joinSession(const sessionStatePtr_t &session); - std::string nameFromID(const LLUUID &id); + std::string nameFromID(const LLUUID &id) const; bool IDFromName(const std::string name, LLUUID &uuid); std::string sipURIFromAvatar(LLVOAvatar *avatar); std::string sipURIFromName(std::string &name); diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 36e998af89..c6cc2a053a 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2066,11 +2066,16 @@ void LLWebRTCVoiceClient::avatarNameResolved(const LLUUID &id, const std::string } // Leftover from vivox PTSN -std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id) +std::string LLWebRTCVoiceClient::sipURIFromID(const LLUUID& id) const { return id.asString(); } +LLSD LLWebRTCVoiceClient::getP2PChannelInfoTemplate(const LLUUID& id) const +{ + return LLSD(); +} + ///////////////////////////// // LLVoiceWebRTCConnection diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 7042bbae00..624b1b9bd2 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -84,7 +84,9 @@ public: // Returns true if WebRTC has successfully logged in and is not in error state bool isVoiceWorking() const override; - std::string sipURIFromID(const LLUUID &id) override; + std::string sipURIFromID(const LLUUID &id) const override; + LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override; + ///////////////////// /// @name Tuning -- cgit v1.2.3 From a7177cc4b679c58fef7959668fc674a48952659a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 30 Jul 2024 13:31:40 +0300 Subject: viewer#2121 Don't update Audio visualizer if voice is blocked --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b9a30446a1..b2da992b7c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2771,7 +2771,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled, const LLVector3 & // Notice the calls to "gAwayTimer.reset()". This resets the timer that determines how long the avatar has been // "away", so that the avatar doesn't lapse into away-mode (and slump over) while the user is still talking. //----------------------------------------------------------------------------------------------------------------- - if (LLVoiceClient::getInstance()->getIsSpeaking( mID )) + if (LLVoiceClient::getInstance()->getIsSpeaking( mID ) && (!isInMuteList() || isSelf())) { if (!mVoiceVisualizer->getCurrentlySpeaking()) { -- cgit v1.2.3 From b9c222dfaeb4531f91f6e0bb02bb4b0da599d08b Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 31 Jul 2024 21:23:30 -0600 Subject: Implement a Logging Sink for WebRTC WebRTC logs now pass out of the webrtc library into a logging sink, which converts them into SecondLife.log compatable logging calls. This includes fatal errors and asserts, which are now logged into SecondLife.log, and should be available in the crash logger. --- indra/newview/llvoicewebrtc.cpp | 25 ++++++++++++++++++++++++- indra/newview/llvoicewebrtc.h | 9 ++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index c6cc2a053a..3164886494 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -250,7 +250,7 @@ LLWebRTCVoiceClient::~LLWebRTCVoiceClient() void LLWebRTCVoiceClient::init(LLPumpIO* pump) { // constructor will set up LLVoiceClient::getInstance() - llwebrtc::init(); + llwebrtc::init(this); mWebRTCDeviceInterface = llwebrtc::getDeviceInterface(); mWebRTCDeviceInterface->setDevicesObserver(this); @@ -281,6 +281,29 @@ void LLWebRTCVoiceClient::cleanUp() LL_DEBUGS("Voice") << "Exiting" << LL_ENDL; } +void LLWebRTCVoiceClient::LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message) +{ + switch (level) + { + case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_VERBOSE: + LL_DEBUGS("Voice") << message << LL_ENDL; + break; + case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_INFO: + LL_INFOS("Voice") << message << LL_ENDL; + break; + case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_WARNING: + LL_WARNS("Voice") << message << LL_ENDL; + break; + case llwebrtc::LLWebRTCLogCallback::LOG_LEVEL_ERROR: + // use WARN so that we don't crash on a webrtc error. + // webrtc will force a crash on a fatal error. + LL_WARNS("Voice") << message << LL_ENDL; + break; + default: + break; + } +} + // -------------------------------------------------- const LLVoiceVersionInfo& LLWebRTCVoiceClient::getVersion() diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 624b1b9bd2..8a65ef667c 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -62,7 +62,8 @@ extern const std::string WEBRTC_VOICE_SERVER_TYPE; class LLWebRTCVoiceClient : public LLSingleton, virtual public LLVoiceModuleInterface, public llwebrtc::LLWebRTCDevicesObserver, - public LLMuteListObserver + public LLMuteListObserver, + public llwebrtc::LLWebRTCLogCallback { LLSINGLETON_C11(LLWebRTCVoiceClient); LOG_CLASS(LLWebRTCVoiceClient); @@ -88,6 +89,12 @@ public: LLSD getP2PChannelInfoTemplate(const LLUUID& id) const override; + /////////////////// + /// @name Logging + /// @{ + void LogMessage(llwebrtc::LLWebRTCLogCallback::LogLevel level, const std::string& message) override; + //@} + ///////////////////// /// @name Tuning //@{ -- cgit v1.2.3