summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimview.cpp5
-rw-r--r--indra/newview/llvoicechannel.cpp5
-rw-r--r--indra/newview/llvoiceclient.cpp4
-rw-r--r--indra/newview/llvoicewebrtc.cpp41
-rw-r--r--indra/newview/llvoicewebrtc.h6
5 files changed, 47 insertions, 14 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 921e757b58..215cc4103b 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -87,7 +87,10 @@ const S32 XL8_PADDING = 3; // XL8_START_TAG.size() + XL8_END_TAG.size()
/** Timeout of outgoing session initialization (in seconds) */
const static U32 SESSION_INITIALIZATION_TIMEOUT = 30;
-
+// This enum corresponds to the sim's and adds P2P_CHAT_SESSION,
+// as webrtc uses the multiagent chat mechanism for p2p calls,
+// instead of relying on vivox calling.
+// Don't change this without consulting a server developer.
enum EMultiAgentChatSessionType
{
GROUP_CHAT_SESSION = 0,
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 28e895584b..f6658bbaab 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -418,7 +418,7 @@ void LLVoiceChannelGroup::activate()
{
// we have the channel info, just need to use it now
LLVoiceClient::getInstance()->setNonSpatialChannel(mChannelInfo,
- mCallDirection == OUTGOING_CALL,
+ mIsP2P && (mCallDirection == OUTGOING_CALL),
mIsP2P);
if (mIsP2P)
@@ -732,7 +732,7 @@ void LLVoiceChannelProximal::handleError(EStatusType status)
LLNotificationsUtil::add(notify, mNotifyArgs);
}
- LLVoiceChannel::handleError(status);
+ // proximal voice remains up and the provider will try to reconnect.
}
void LLVoiceChannelProximal::deactivate()
@@ -741,6 +741,7 @@ void LLVoiceChannelProximal::deactivate()
{
setState(STATE_HUNG_UP);
}
+
LLVoiceClient::getInstance()->activateSpatialChannel(false);
}
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index b9b8742c41..9dbf469ca8 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -382,14 +382,14 @@ void LLVoiceClient::refreshDeviceLists(bool clearCurrentList)
void LLVoiceClient::setCaptureDevice(const std::string& name)
{
+ LLVivoxVoiceClient::getInstance()->setCaptureDevice(name);
LLWebRTCVoiceClient::getInstance()->setCaptureDevice(name);
- LLVivoxVoiceClient::getInstance()->setCaptureDevice(name);
}
void LLVoiceClient::setRenderDevice(const std::string& name)
{
+ LLVivoxVoiceClient::getInstance()->setRenderDevice(name);
LLWebRTCVoiceClient::getInstance()->setRenderDevice(name);
- LLVivoxVoiceClient::getInstance()->setRenderDevice(name);
}
const LLVoiceDeviceList& LLVoiceClient::getCaptureDevices()
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 2bb16cb336..7be02c1e21 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -92,6 +92,7 @@ namespace {
// Don't send positional updates more frequently than this:
const F32 UPDATE_THROTTLE_SECONDS = 0.1f;
+ const F32 MAX_RETRY_WAIT_SECONDS = 10.0f;
// Cosine of a "trivially" small angle
const F32 FOUR_DEGREES = 4.0f * (F_PI / 180.0f);
@@ -590,14 +591,15 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi
std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice");
std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice");
+ LL_DEBUGS("Voice") << "Setting devices to-input: '" << inputDevice << "' output: '" << outputDevice << "'" << LL_ENDL;
clearRenderDevices();
bool renderDeviceSet = false;
for (auto &device : render_devices)
{
addRenderDevice(LLVoiceDevice(device.mDisplayName, device.mID));
- if (device.mCurrent && outputDevice == device.mID)
+ LL_DEBUGS("Voice") << "Checking render device" << "'" << device.mID << "'" << LL_ENDL;
+ if (outputDevice == device.mID)
{
- setRenderDevice(outputDevice);
renderDeviceSet = true;
}
}
@@ -610,10 +612,11 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi
bool captureDeviceSet = false;
for (auto &device : capture_devices)
{
+ LL_DEBUGS("Voice") << "Checking capture device:'" << device.mID << "'" << LL_ENDL;
+
addCaptureDevice(LLVoiceDevice(device.mDisplayName, device.mID));
- if (device.mCurrent && inputDevice == device.mID)
+ if (inputDevice == device.mID)
{
- setCaptureDevice(outputDevice);
captureDeviceSet = true;
}
}
@@ -1988,8 +1991,13 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID &regionID, const s
mMicGain(0.0),
mOutstandingRequests(0),
mChannelID(channelID),
- mRegionID(regionID)
+ mRegionID(regionID),
+ mRetryWaitPeriod(0)
{
+ // retries wait a short period...randomize it so
+ // all clients don't try to reconnect at once.
+ mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5;
+
mWebRTCPeerConnectionInterface = llwebrtc::newPeerConnection();
mWebRTCPeerConnectionInterface->setSignalingObserver(this);
}
@@ -2404,7 +2412,7 @@ bool LLVoiceWebRTCSpatialConnection::requestVoiceConnection()
{
body["parcel_local_id"] = mParcelLocalID;
}
-
+ body["channel_type"] = "local";
body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE;
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(
@@ -2567,6 +2575,9 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
case VOICE_STATE_SESSION_UP:
{
+ mRetryWaitPeriod = 0;
+ mRetryWaitSecs = ((F32) rand() / (RAND_MAX)) + 0.5;
+
// we'll stay here as long as the session remains up.
if (mShutDown)
{
@@ -2576,9 +2587,21 @@ bool LLVoiceWebRTCConnection::connectionStateMachine()
}
case VOICE_STATE_SESSION_RETRY:
- // something went wrong, so notify that the connection has failed.
- LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID);
- setVoiceConnectionState(VOICE_STATE_DISCONNECT);
+ // only retry ever 'n' seconds
+ if (mRetryWaitPeriod++ * UPDATE_THROTTLE_SECONDS > mRetryWaitSecs)
+ {
+ // something went wrong, so notify that the connection has failed.
+ LLWebRTCVoiceClient::getInstance()->OnConnectionFailure(mChannelID, mRegionID);
+ setVoiceConnectionState(VOICE_STATE_DISCONNECT);
+ mRetryWaitPeriod = 0;
+ if (mRetryWaitSecs < MAX_RETRY_WAIT_SECONDS)
+ {
+ // back off the retry period, and do it by a small random
+ // bit so all clients don't reconnect at once.
+ mRetryWaitSecs += ((F32) rand() / (RAND_MAX)) + 0.5;
+ mRetryWaitPeriod = 0;
+ }
+ }
break;
case VOICE_STATE_DISCONNECT:
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index 03bbe00162..b26bea27ce 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -694,6 +694,12 @@ class LLVoiceWebRTCConnection :
bool mShutDown;
S32 mOutstandingRequests;
+ S32 mRetryWaitPeriod; // number of UPDATE_THROTTLE_SECONDS we've
+ // waited since our last attempt to connect.
+ F32 mRetryWaitSecs; // number of seconds to wait before next retry
+
+
+
std::vector<llwebrtc::LLWebRTCIceCandidate> mIceCandidates;
bool mIceCompleted;
bool mTrickling;