aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJacek Antonelli2011-06-02 22:52:00 -0500
committerJacek Antonelli2011-06-02 22:52:00 -0500
commitd61c234e87f7e0c0e9690344b847ca51e5a00acd (patch)
treecf65b3cf864c1f0905e56ac79ba2a9c419e9b603
parentReplaced the labels in the web browser window with icons based on those in th... (diff)
parentfix an edge case when voice didn't kick in; fix reconnect to voice not working (diff)
downloadmeta-impy-d61c234e87f7e0c0e9690344b847ca51e5a00acd.zip
meta-impy-d61c234e87f7e0c0e9690344b847ca51e5a00acd.tar.gz
meta-impy-d61c234e87f7e0c0e9690344b847ca51e5a00acd.tar.bz2
meta-impy-d61c234e87f7e0c0e9690344b847ca51e5a00acd.tar.xz
Merge remote-tracking branch 'armin/morevoice' into next
-rw-r--r--linden/indra/newview/app_settings/logcontrol.xml4
-rw-r--r--linden/indra/newview/llvoiceclient.cpp124
-rw-r--r--linden/indra/newview/llvoiceclient.h1
3 files changed, 75 insertions, 54 deletions
diff --git a/linden/indra/newview/app_settings/logcontrol.xml b/linden/indra/newview/app_settings/logcontrol.xml
index f0db00f..92d477f 100644
--- a/linden/indra/newview/app_settings/logcontrol.xml
+++ b/linden/indra/newview/app_settings/logcontrol.xml
@@ -90,12 +90,12 @@
90 <!--<string>TextureCache</string>--> 90 <!--<string>TextureCache</string>-->
91 <!--<string>Throttle</string>--> 91 <!--<string>Throttle</string>-->
92 <!--<string>Voice</string>--> 92 <!--<string>Voice</string>-->
93 <!--<string>"VoiceCaps"</string>--> 93 <!--<string>VoiceCaps</string>-->
94 <!--<string>VoiceSession</string>--> 94 <!--<string>VoiceSession</string>-->
95 <!--<string>VoiceDaemon</string>--> 95 <!--<string>VoiceDaemon</string>-->
96 <!--<string>VoiceDevice</string>--> 96 <!--<string>VoiceDevice</string>-->
97 <!--<string>VivoxProtocolParser</string>--> 97 <!--<string>VivoxProtocolParser</string>-->
98 98 <!--<string>VivoxProtocolParserTag</string>-->
99 <!--<string>Wearable</string>--> 99 <!--<string>Wearable</string>-->
100 <!--<string>WindLight</string>--> 100 <!--<string>WindLight</string>-->
101 101
diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index 115f6e8..946b289 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -455,13 +455,13 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
455 } 455 }
456 } 456 }
457 } 457 }
458 LL_DEBUGS("VivoxProtocolParser") << tag << " (" << responseDepth << ")" << LL_ENDL; 458 LL_DEBUGS("VivoxProtocolParserTag") << tag << " (" << responseDepth << ")" << LL_ENDL;
459 } 459 }
460 else 460 else
461 { 461 {
462 if (ignoringTags) 462 if (ignoringTags)
463 { 463 {
464 LL_DEBUGS("VivoxProtocolParser") << "ignoring tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL; 464 LL_DEBUGS("VivoxProtocolParserTag") << "ignoring tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL;
465 } 465 }
466 else 466 else
467 { 467 {
@@ -474,7 +474,7 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr)
474 ignoreDepth = responseDepth; 474 ignoreDepth = responseDepth;
475 accumulateText = false; 475 accumulateText = false;
476 476
477 LL_DEBUGS("VivoxProtocolParser") << "starting ignore, ignoreDepth is " << ignoreDepth << LL_ENDL; 477 LL_DEBUGS("VivoxProtocolParserTag") << "starting ignore, ignoreDepth is " << ignoreDepth << LL_ENDL;
478 } 478 }
479 else if (!stricmp("CaptureDevices", tag)) 479 else if (!stricmp("CaptureDevices", tag))
480 { 480 {
@@ -515,18 +515,18 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
515 { 515 {
516 if (ignoreDepth == responseDepth) 516 if (ignoreDepth == responseDepth)
517 { 517 {
518 LL_DEBUGS("VivoxProtocolParser") << "end of ignore" << LL_ENDL; 518 LL_DEBUGS("VivoxProtocolParserTag") << "end of ignore" << LL_ENDL;
519 ignoringTags = false; 519 ignoringTags = false;
520 } 520 }
521 else 521 else
522 { 522 {
523 LL_DEBUGS("VivoxProtocolParser") << "ignoring tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL; 523 LL_DEBUGS("VivoxProtocolParserTag") << "ignoring tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL;
524 } 524 }
525 } 525 }
526 526
527 if (!ignoringTags) 527 if (!ignoringTags)
528 { 528 {
529 LL_DEBUGS("VivoxProtocolParser") << "processing tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL; 529 LL_DEBUGS("VivoxProtocolParserTag") << "processing tag " << tag << " (depth = " << responseDepth << ")" << LL_ENDL;
530 530
531 // Closing a tag. Finalize the text we've accumulated and reset 531 // Closing a tag. Finalize the text we've accumulated and reset
532 if (!stricmp("ReturnCode", tag)) 532 if (!stricmp("ReturnCode", tag))
@@ -1175,11 +1175,13 @@ LLVoiceClient::LLVoiceClient()
1175 // Ignoring SIGCHLD should prevent zombies from being created. Alternately, we could use wait(), but I'd rather not do that. 1175 // Ignoring SIGCHLD should prevent zombies from being created. Alternately, we could use wait(), but I'd rather not do that.
1176 signal(SIGCHLD, SIG_IGN); 1176 signal(SIGCHLD, SIG_IGN);
1177#endif 1177#endif
1178 1178 if(!gSavedSettings.getBOOL("CmdLineDisableVoice"))//no reason to lag non-voice users
1179 // set up state machine 1179 {
1180 setState(stateDisabled); 1180 // set up state machine
1181 1181 setState(stateDisabled);
1182 gIdleCallbacks.addFunction(idle, this); 1182
1183 gIdleCallbacks.addFunction(idle, this);
1184 }
1183} 1185}
1184 1186
1185//--------------------------------------------------- 1187//---------------------------------------------------
@@ -1358,16 +1360,17 @@ void LLVoiceClient::userAuthorized(const std::string& firstName, const std::stri
1358 1360
1359void LLVoiceClient::requestVoiceAccountProvision(S32 retries) 1361void LLVoiceClient::requestVoiceAccountProvision(S32 retries)
1360{ 1362{
1361 if ( gAgent.getRegion() && mVoiceEnabled ) 1363 LLViewerRegion* region = gAgent.getRegion();
1364 if ( mVoiceEnabled && region && region->capabilitiesReceived())
1362 { 1365 {
1363 std::string url = 1366 std::string url = region->getCapability("ProvisionVoiceAccountRequest");
1364 gAgent.getRegion()->getCapability(
1365 "ProvisionVoiceAccountRequest");
1366 1367
1367 if ( url.empty() ) 1368 if ( url.empty() )
1368 { 1369 {
1369 mVAPRequested = false; 1370 mVAPRequested = false;
1370 mAccountActive = false; 1371 mAccountActive = false;
1372 LL_DEBUGS("VoiceSession") << "Cancel Session: ProvisionVoiceAccountRequest capability empty."
1373 << llendl;
1371 setState(stateDisableCleanup); 1374 setState(stateDisableCleanup);
1372 } 1375 }
1373 1376
@@ -1420,6 +1423,8 @@ void LLVoiceClient::login(
1420 else if(old_scheme != new_scheme) 1423 else if(old_scheme != new_scheme)
1421 { 1424 {
1422 mAccountActive = true; 1425 mAccountActive = true;
1426 LL_DEBUGS("VoiceSession") << "Cancel Session: Protocol changed."
1427 << llendl;
1423 setState(stateDisableCleanup); 1428 setState(stateDisableCleanup);
1424 } 1429 }
1425 1430
@@ -1636,8 +1641,8 @@ void LLVoiceClient::loadDaemon(const std::string& scheme)
1636 1641
1637 // kick in 1642 // kick in
1638 1643
1639 mUpdateTimer.start();
1640 mUpdateTimer.setTimerExpirySec(CONNECT_THROTTLE_SECONDS); 1644 mUpdateTimer.setTimerExpirySec(CONNECT_THROTTLE_SECONDS);
1645 mUpdateTimer.start();
1641 1646
1642 setState(stateDaemonLaunched); 1647 setState(stateDaemonLaunched);
1643 1648
@@ -1650,6 +1655,8 @@ void LLVoiceClient::loadDaemon(const std::string& scheme)
1650 { 1655 {
1651 LL_WARNS("Voice") << exe_path << " not found." << LL_ENDL; 1656 LL_WARNS("Voice") << exe_path << " not found." << LL_ENDL;
1652 mAccountActive = false; 1657 mAccountActive = false;
1658 LL_DEBUGS("VoiceSession") << "Cancel Session: no module"
1659 << llendl;
1653 setState(stateDisableCleanup); 1660 setState(stateDisableCleanup);
1654 } 1661 }
1655 1662
@@ -1753,6 +1760,8 @@ void LLVoiceClient::setState(state inState)
1753} 1760}
1754void LLVoiceClient::close() 1761void LLVoiceClient::close()
1755{ 1762{
1763 LL_DEBUGS("VoiceSession") << "Cancel Session: LLVoiceClient::close() called."
1764 << llendl;
1756 setState(stateDisableCleanup); 1765 setState(stateDisableCleanup);
1757} 1766}
1758 1767
@@ -1796,7 +1805,9 @@ void LLVoiceClient::stateMachine()
1796 // if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill. 1805 // if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill.
1797 LL_WARNS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL; 1806 LL_WARNS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL;
1798 } 1807 }
1799 1808 LL_DEBUGS("VoiceSession") << "Cancel Session: User turned off voice or logs off."
1809 << llendl;
1810 mAccountActive = false;
1800 setState(stateDisableCleanup); 1811 setState(stateDisableCleanup);
1801 } 1812 }
1802 } 1813 }
@@ -1805,20 +1816,14 @@ void LLVoiceClient::stateMachine()
1805 if(mVoiceEnabled) 1816 if(mVoiceEnabled)
1806 { 1817 {
1807 LLViewerRegion *region = gAgent.getRegion(); 1818 LLViewerRegion *region = gAgent.getRegion();
1808 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); 1819 if(region && region->capabilitiesReceived())
1809
1810 if(region && parcel)
1811 { 1820 {
1812 S32 parcelLocalID = parcel->getLocalID(); 1821 LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1813 std::string regionName = region->getName(); 1822 if(parcel)
1814
1815
1816 // The region name starts out empty and gets filled in later.
1817 // Also, the cap gets filled in a short time after the region cross, but a little too late for our purposes.
1818 // If either is empty, wait for the next time around.
1819 if(/*getState() >= stateNoChannel &&*/ !regionName.empty())
1820 { 1823 {
1821 1824 S32 parcelLocalID = parcel->getLocalID();
1825 std::string regionName = region->getName();
1826
1822 if((parcelLocalID != mCurrentParcelLocalID) || (regionName != mCurrentRegionName)) 1827 if((parcelLocalID != mCurrentParcelLocalID) || (regionName != mCurrentRegionName))
1823 { 1828 {
1824 // We have changed parcels. Initiate a parcel channel lookup. 1829 // We have changed parcels. Initiate a parcel channel lookup.
@@ -1827,7 +1832,6 @@ void LLVoiceClient::stateMachine()
1827 1832
1828 parcelChanged(); 1833 parcelChanged();
1829 } 1834 }
1830
1831 } 1835 }
1832 } 1836 }
1833 } 1837 }
@@ -1868,11 +1872,12 @@ void LLVoiceClient::stateMachine()
1868 setState(stateStart); 1872 setState(stateStart);
1869 } 1873 }
1870 break; 1874 break;
1871 1875
1872 //MARK: stateStart 1876 //MARK: stateStart
1873 case stateStart: 1877 case stateStart:
1874 { 1878 {
1875 bool have_region = (NULL != gAgent.getRegion() ); 1879 LLViewerRegion *region = gAgent.getRegion();
1880 bool have_region = (NULL != region && region->capabilitiesReceived());
1876 if(mVoiceEnabled && !mVAPRequested && !mAccountName.empty() && have_region) 1881 if(mVoiceEnabled && !mVAPRequested && !mAccountName.empty() && have_region)
1877 { 1882 {
1878 mVAPRequested = true; 1883 mVAPRequested = true;
@@ -1889,11 +1894,11 @@ void LLVoiceClient::stateMachine()
1889 1894
1890 if(!mSocket) 1895 if(!mSocket)
1891 { 1896 {
1892 LL_DEBUGS("VoiceDaemon") << "Connecting to voice daemon. Protocol: " 1897 LL_DEBUGS("VoiceDaemon") << "Connecting to voice daemon. Protocol: "
1893 << mDaemonScheme << LL_ENDL; 1898 << mDaemonScheme << LL_ENDL;
1894 mSocket = LLSocket::create(LLSocket::STREAM_TCP); 1899 mSocket = LLSocket::create(LLSocket::STREAM_TCP);
1895 } 1900 }
1896 1901
1897 mConnected = mSocket->blockingConnect(mDaemonHost); 1902 mConnected = mSocket->blockingConnect(mDaemonHost);
1898 if(mConnected) 1903 if(mConnected)
1899 { 1904 {
@@ -1928,9 +1933,8 @@ void LLVoiceClient::stateMachine()
1928 1933
1929 setState(stateConnected); 1934 setState(stateConnected);
1930 } 1935 }
1931
1932 break; 1936 break;
1933 1937
1934 //MARK: stateConnected 1938 //MARK: stateConnected
1935 case stateConnected: 1939 case stateConnected:
1936 // Initial devices query 1940 // Initial devices query
@@ -2103,6 +2107,8 @@ void LLVoiceClient::stateMachine()
2103 if(mLoginRetryCount > MAX_LOGIN_RETRIES) 2107 if(mLoginRetryCount > MAX_LOGIN_RETRIES)
2104 { 2108 {
2105 LL_WARNS("Voice") << "too many login retries, giving up." << LL_ENDL; 2109 LL_WARNS("Voice") << "too many login retries, giving up." << LL_ENDL;
2110 LL_DEBUGS("VoiceSession") << "Cancel Session: too many login retries."
2111 << llendl;
2106 mAccountActive = false; 2112 mAccountActive = false;
2107 setState(stateDisableCleanup); 2113 setState(stateDisableCleanup);
2108 } 2114 }
@@ -2464,7 +2470,11 @@ void LLVoiceClient::stateMachine()
2464 2470
2465 //MARK: stateConnectorStopped 2471 //MARK: stateConnectorStopped
2466 case stateConnectorStopped: // connector stop received 2472 case stateConnectorStopped: // connector stop received
2473 {
2474 LL_DEBUGS("VoiceSession") << "Cancel Session: entered stateConnectorStopped."
2475 << llendl;
2467 setState(stateDisableCleanup); 2476 setState(stateDisableCleanup);
2477 }
2468 break; 2478 break;
2469 2479
2470 //MARK: stateConnectorFailed 2480 //MARK: stateConnectorFailed
@@ -2475,6 +2485,8 @@ void LLVoiceClient::stateMachine()
2475 case stateConnectorFailedWaiting: 2485 case stateConnectorFailedWaiting:
2476 if(!mVoiceEnabled) 2486 if(!mVoiceEnabled)
2477 { 2487 {
2488 LL_DEBUGS("VoiceSession") << "Cancel Session: entered stateConnectorFailedWaiting."
2489 << llendl;
2478 setState(stateDisableCleanup); 2490 setState(stateDisableCleanup);
2479 } 2491 }
2480 break; 2492 break;
@@ -2487,6 +2499,8 @@ void LLVoiceClient::stateMachine()
2487 case stateLoginFailedWaiting: 2499 case stateLoginFailedWaiting:
2488 if(!mVoiceEnabled) 2500 if(!mVoiceEnabled)
2489 { 2501 {
2502 LL_DEBUGS("VoiceSession") << "Cancel Session: entered stateLoginFailedWaiting."
2503 << llendl;
2490 setState(stateDisableCleanup); 2504 setState(stateDisableCleanup);
2491 } 2505 }
2492 break; 2506 break;
@@ -3112,12 +3126,16 @@ void LLVoiceClient::daemonDied()
3112 LL_WARNS("Voice") << "Connection to vivox daemon lost. Resetting state."<< LL_ENDL; 3126 LL_WARNS("Voice") << "Connection to vivox daemon lost. Resetting state."<< LL_ENDL;
3113 3127
3114 // Try to relaunch the daemon 3128 // Try to relaunch the daemon
3129 LL_DEBUGS("VoiceSession") << "Cancel Session: voice daemon died."
3130 << llendl;
3115 setState(stateDisableCleanup); 3131 setState(stateDisableCleanup);
3116} 3132}
3117 3133
3118void LLVoiceClient::giveUp() 3134void LLVoiceClient::giveUp()
3119{ 3135{
3120 mAccountActive = false; 3136 mAccountActive = false;
3137 LL_DEBUGS("VoiceSession") << "Cancel Session: giveUp() called."
3138 << llendl;
3121 setState(stateDisableCleanup); 3139 setState(stateDisableCleanup);
3122} 3140}
3123 3141
@@ -5133,13 +5151,15 @@ LLVoiceClient::participantState* LLVoiceClient::findParticipantByID(const LLUUID
5133 5151
5134void LLVoiceClient::parcelChanged() 5152void LLVoiceClient::parcelChanged()
5135{ 5153{
5136 if( (getState() >= stateNoChannel) && !inNonSpatialChannel() ) 5154 mAccountActive = true;
5155 LLViewerRegion* region = gAgent.getRegion();
5156 if( (getState() >= stateNoChannel) && region && region->capabilitiesReceived())
5137 { 5157 {
5138 // If the user is logged in, start a channel lookup, 5158 // If the user is logged in, start a channel lookup,
5139 // but not if already in a private call/conference. 5159 // but not if already in a private call/conference (then SL regions return an empty cap).
5140 mAccountActive = true; 5160 //
5141 5161
5142 std::string url = gAgent.getRegion()->getCapability("ParcelVoiceInfoRequest"); 5162 std::string url = region->getCapability("ParcelVoiceInfoRequest");
5143 LL_DEBUGS("VoiceCaps") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << " cap url:" << url << LL_ENDL; 5163 LL_DEBUGS("VoiceCaps") << "sending ParcelVoiceInfoRequest (" << mCurrentRegionName << ", " << mCurrentParcelLocalID << ")" << " cap url:" << url << LL_ENDL;
5144 if(! url.empty() ) 5164 if(! url.empty() )
5145 { 5165 {
@@ -5152,13 +5172,21 @@ void LLVoiceClient::parcelChanged()
5152 } 5172 }
5153 else 5173 else
5154 { 5174 {
5175
5155 mAccountActive = false; 5176 mAccountActive = false;
5177 LL_DEBUGS("VoiceSession") << "Cancel Session: ParcelVoiceInfoRequest cap empty."
5178 << llendl;
5156 setState(stateDisableCleanup); 5179 setState(stateDisableCleanup);
5157 } 5180 }
5158 } 5181 }
5182 else if (region && !region->capabilitiesReceived())
5183 {
5184 // We don't know yet where to get the cap so requesting it makes no sense
5185 mCurrentRegionName.append("retry");
5186 return;
5187 }
5159 else 5188 else
5160 { 5189 {
5161 mAccountActive = true;
5162 // The transition to stateNoChannel needs to kick this off again. 5190 // The transition to stateNoChannel needs to kick this off again.
5163 LL_DEBUGS("Voice") << "not logged in yet, deferring" << LL_ENDL; 5191 LL_DEBUGS("Voice") << "not logged in yet, deferring" << LL_ENDL;
5164 } 5192 }
@@ -5203,6 +5231,8 @@ void LLVoiceClient::switchChannel(
5203 if(old_uri_find_sip != new_uri_find_sip) 5231 if(old_uri_find_sip != new_uri_find_sip)
5204 { 5232 {
5205 mAccountActive = true; 5233 mAccountActive = true;
5234 LL_DEBUGS("VoiceSession") << "Cancel Session: Session type changed"
5235 << llendl;
5206 setState(stateDisableCleanup); 5236 setState(stateDisableCleanup);
5207 return; 5237 return;
5208 } 5238 }
@@ -5761,16 +5791,6 @@ bool LLVoiceClient::inSpatialChannel(void)
5761 5791
5762 if(mAudioSession) 5792 if(mAudioSession)
5763 result = mAudioSession->mIsSpatial; 5793 result = mAudioSession->mIsSpatial;
5764
5765 return result;
5766}
5767
5768bool LLVoiceClient::inNonSpatialChannel(void)
5769{
5770 bool result = false;
5771
5772 if(mAudioSession)
5773 result = !(mAudioSession->mIsSpatial);
5774 if(mNextAudioSession) 5794 if(mNextAudioSession)
5775 result |= !(mNextAudioSession->mIsSpatial); 5795 result |= !(mNextAudioSession->mIsSpatial);
5776 5796
@@ -5954,11 +5974,13 @@ void LLVoiceClient::setVoiceEnabled(bool enabled)
5954 mVoiceEnabled = enabled; 5974 mVoiceEnabled = enabled;
5955 if (enabled) 5975 if (enabled)
5956 { 5976 {
5977 mAccountActive = true;
5957 LLVoiceChannel::getCurrentVoiceChannel()->activate(); 5978 LLVoiceChannel::getCurrentVoiceChannel()->activate();
5958 } 5979 }
5959 else 5980 else
5960 { 5981 {
5961 // Turning voice off looses your current channel -- this makes sure the UI isn't out of sync when you re-enable it. 5982 // Turning voice off looses your current channel -- this makes sure the UI isn't out of sync when you re-enable it.
5983 mAccountActive = false;
5962 LLVoiceChannel::getCurrentVoiceChannel()->deactivate(); 5984 LLVoiceChannel::getCurrentVoiceChannel()->deactivate();
5963 } 5985 }
5964 } 5986 }
diff --git a/linden/indra/newview/llvoiceclient.h b/linden/indra/newview/llvoiceclient.h
index fb59b4e..f5c6d87 100644
--- a/linden/indra/newview/llvoiceclient.h
+++ b/linden/indra/newview/llvoiceclient.h
@@ -678,7 +678,6 @@ static std::string displayNameFromAvatar(LLVOAvatar *avatar);
678static std::string nameFromsipURI(const std::string &uri); 678static std::string nameFromsipURI(const std::string &uri);
679 679
680 bool inSpatialChannel(void); 680 bool inSpatialChannel(void);
681 bool inNonSpatialChannel(void);
682 std::string getAudioSessionURI(); 681 std::string getAudioSessionURI();
683 std::string getAudioSessionHandle(); 682 std::string getAudioSessionHandle();
684 683