summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelvoicedevicesettings.cpp18
-rw-r--r--indra/newview/llvoiceclient.h15
-rw-r--r--indra/newview/llvoicevivox.cpp74
-rw-r--r--indra/newview/llvoicevivox.h4
4 files changed, 77 insertions, 34 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 07f8045546..28631e2b7b 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -39,7 +39,6 @@
// Library includes (after viewer)
#include "lluictrlfactory.h"
-
static LLPanelInjector<LLPanelVoiceDeviceSettings> t_panel_group_general("panel_voice_device_settings");
static const std::string DEFAULT_DEVICE("Default");
@@ -233,18 +232,18 @@ void LLPanelVoiceDeviceSettings::refresh()
}
else if (LLVoiceClient::getInstance()->deviceSettingsUpdated())
{
- LLVoiceDeviceList::const_iterator iter;
+ LLVoiceDeviceList::const_iterator device;
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
mCtrlInputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM);
- for(iter=LLVoiceClient::getInstance()->getCaptureDevices().begin();
- iter != LLVoiceClient::getInstance()->getCaptureDevices().end();
- iter++)
+ for(device=LLVoiceClient::getInstance()->getCaptureDevices().begin();
+ device != LLVoiceClient::getInstance()->getCaptureDevices().end();
+ device++)
{
- mCtrlInputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
+ mCtrlInputDevices->add(getLocalizedDeviceName(device->display_name), device->full_name, ADD_BOTTOM);
}
// Fix invalid input audio device preference.
@@ -261,10 +260,11 @@ void LLPanelVoiceDeviceSettings::refresh()
mCtrlOutputDevices->removeall();
mCtrlOutputDevices->add(getLocalizedDeviceName(DEFAULT_DEVICE), DEFAULT_DEVICE, ADD_BOTTOM);
- for(iter= LLVoiceClient::getInstance()->getRenderDevices().begin();
- iter != LLVoiceClient::getInstance()->getRenderDevices().end(); iter++)
+ for(device = LLVoiceClient::getInstance()->getRenderDevices().begin();
+ device != LLVoiceClient::getInstance()->getRenderDevices().end();
+ device++)
{
- mCtrlOutputDevices->add(getLocalizedDeviceName(*iter), *iter, ADD_BOTTOM);
+ mCtrlOutputDevices->add(getLocalizedDeviceName(device->display_name), device->full_name, ADD_BOTTOM);
}
// Fix invalid output audio device preference.
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index 32637dcf42..337f01f3e5 100644
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -40,8 +40,19 @@ class LLVOAvatar;
// devices
-typedef std::vector<std::string> LLVoiceDeviceList;
-
+class LLVoiceDevice
+{
+ public:
+ std::string display_name; // friendly value for the user
+ std::string full_name; // internal value for selection
+
+ LLVoiceDevice(const std::string& display_name, const std::string& full_name)
+ :display_name(display_name)
+ ,full_name(full_name)
+ {
+ };
+};
+typedef std::vector<LLVoiceDevice> LLVoiceDeviceList;
class LLVoiceClientParticipantObserver
{
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 838de48308..7aac0ff0ed 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -283,7 +283,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mDevicesListUpdated(false),
mAreaVoiceDisabled(false),
- mAudioSession(),
+ mAudioSession(), // TBD - should be NULL
mAudioSessionChanged(false),
mNextAudioSession(),
@@ -719,8 +719,10 @@ bool LLVivoxVoiceClient::endAndDisconnectSession()
bool LLVivoxVoiceClient::callbackEndDaemon(const LLSD& data)
{
+ LL_DEBUGS("Voice") << LL_ENDL;
if (!LLAppViewer::isExiting())
{
+ LL_DEBUGS("Voice") << "callbackEndDaemon terminating audio session" << LL_ENDL;
terminateAudioSession(false);
closeSocket();
cleanUp();
@@ -737,6 +739,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
if (!voiceEnabled())
{
// Voice is locked out, we must not launch the vivox daemon.
+ LL_WARNS("Voice") << "voice disabled; not starting daemon" << LL_ENDL;
return false;
}
@@ -893,9 +896,11 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
bool LLVivoxVoiceClient::provisionVoiceAccount()
{
LL_INFOS("Voice") << "Provisioning voice account." << LL_ENDL;
+ LL_DEBUGS("Voice") << "no region for voice provisioning; waiting " << LL_ENDL;
while (!gAgent.getRegion() || !gAgent.getRegion()->capabilitiesReceived())
{
+ LL_DEBUGS("Voice") << "no capabilities for voice provisioning; waiting " << LL_ENDL;
// *TODO* Pump a message for wake up.
llcoro::suspend();
}
@@ -1256,6 +1261,10 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo()
// state. If the cap request is still pending,
// the responder will check to see if we've moved
// to a new session and won't change any state.
+ LL_DEBUGS("Voice") << "terminate requested " << mSessionTerminateRequested
+ << " enabled " << mVoiceEnabled
+ << " initialized " << mIsInitialized
+ << LL_ENDL;
terminateAudioSession(true);
return false;
}
@@ -1280,17 +1289,30 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo()
LLSD voice_credentials = result["voice_credentials"];
if (voice_credentials.has("channel_uri"))
{
+ LL_DEBUGS("Voice") << "got voice channel uri" << LL_ENDL;
uri = voice_credentials["channel_uri"].asString();
}
+ else
+ {
+ LL_WARNS("Voice") << "No voice channel uri" << LL_ENDL;
+ }
+
if (voice_credentials.has("channel_credentials"))
{
+ LL_DEBUGS("Voice") << "got voice channel credentials" << LL_ENDL;
credentials =
voice_credentials["channel_credentials"].asString();
}
- }
+ else
+ {
+ LL_WARNS("Voice") << "No voice channel credentials" << LL_ENDL;
- if (!uri.empty())
- LL_INFOS("Voice") << "Voice URI is " << uri << LL_ENDL;
+ }
+ }
+ else
+ {
+ LL_WARNS("Voice") << "No voice credentials" << LL_ENDL;
+ }
// set the spatial channel. If no voice credentials or uri are
// available, then we simply drop out of voice spatially.
@@ -1353,7 +1375,10 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
if (!mVoiceEnabled && mIsInitialized)
{
- LL_DEBUGS("Voice") << "Voice no longer enabled. Exiting." << LL_ENDL;
+ LL_DEBUGS("Voice") << "Voice no longer enabled. Exiting"
+ << " enabled " << mVoiceEnabled
+ << " initialized " << mIsInitialized
+ << LL_ENDL;
mIsJoiningSession = false;
// User bailed out during connect -- jump straight to teardown.
terminateAudioSession(true);
@@ -1476,7 +1501,7 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
if (mAudioSession)
{
- LL_INFOS("Voice") << "Terminating current voice session " << mAudioSession->mHandle << LL_ENDL;
+ LL_INFOS("Voice") << "terminateAudioSession(" << wait << ") Terminating current voice session " << mAudioSession->mHandle << LL_ENDL;
if (mIsLoggedIn)
{
@@ -1550,7 +1575,7 @@ bool LLVivoxVoiceClient::terminateAudioSession(bool wait)
}
else
{
- LL_WARNS("Voice") << "stateSessionTerminated with NULL mAudioSession" << LL_ENDL;
+ LL_WARNS("Voice") << "terminateAudioSession(" << wait << ") with NULL mAudioSession" << LL_ENDL;
}
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL);
@@ -1642,8 +1667,10 @@ bool LLVivoxVoiceClient::waitForChannel()
if (mRelogRequested)
{
+ LL_DEBUGS("Voice") << "Relog Requested, restarting provisioning" << LL_ENDL;
if (!provisionVoiceAccount())
{
+ LL_WARNS("Voice") << "provisioning voice failed; giving up" << LL_ENDL;
giveUp();
return false;
}
@@ -1663,6 +1690,7 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
if (mSessionTerminateRequested)
{
+ LL_DEBUGS("Voice") << "runSession terminate requested " << LL_ENDL;
terminateAudioSession(true);
}
// if a relog has been requested then addAndJoineSession
@@ -1770,6 +1798,7 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
}
mIsInChannel = false;
+ LL_DEBUGS("Voice") << "terminating at end of runSession" << LL_ENDL;
terminateAudioSession(true);
return true;
@@ -1965,6 +1994,7 @@ bool LLVivoxVoiceClient::performMicTuning()
if (mTuningSpeakerVolumeDirty)
{
+ LL_INFOS("Voice") << "setting tuning speaker level to " << mTuningSpeakerVolume << LL_ENDL;
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Aux.SetSpeakerLevel.1\">"
<< "<Level>" << mTuningSpeakerVolume << "</Level>"
@@ -2322,11 +2352,10 @@ void LLVivoxVoiceClient::clearCaptureDevices()
mCaptureDevices.clear();
}
-void LLVivoxVoiceClient::addCaptureDevice(const std::string& name)
+void LLVivoxVoiceClient::addCaptureDevice(const LLVoiceDevice& device)
{
- LL_DEBUGS("Voice") << name << LL_ENDL;
-
- mCaptureDevices.push_back(name);
+ LL_DEBUGS("Voice") << "display: '" << device.display_name << "' device: '" << device.full_name << "'" << LL_ENDL;
+ mCaptureDevices.push_back(device);
}
LLVoiceDeviceList& LLVivoxVoiceClient::getCaptureDevices()
@@ -2364,10 +2393,10 @@ void LLVivoxVoiceClient::clearRenderDevices()
mRenderDevices.clear();
}
-void LLVivoxVoiceClient::addRenderDevice(const std::string& name)
+void LLVivoxVoiceClient::addRenderDevice(const LLVoiceDevice& device)
{
- LL_DEBUGS("Voice") << name << LL_ENDL;
- mRenderDevices.push_back(name);
+ LL_DEBUGS("Voice") << "display: '" << device.display_name << "' device: '" << device.full_name << "'" << LL_ENDL;
+ mRenderDevices.push_back(device);
}
LLVoiceDeviceList& LLVivoxVoiceClient::getRenderDevices()
@@ -2515,13 +2544,13 @@ bool LLVivoxVoiceClient::deviceSettingsAvailable()
}
bool LLVivoxVoiceClient::deviceSettingsUpdated()
{
+ bool updated = mDevicesListUpdated;
if (mDevicesListUpdated)
{
// a hot swap event or a polling of the audio devices has been parsed since the last redraw of the input and output device panel.
- mDevicesListUpdated = !mDevicesListUpdated; // toggle the setting
- return true;
+ mDevicesListUpdated = false; // toggle the setting
}
- return false;
+ return updated;
}
void LLVivoxVoiceClient::refreshDeviceLists(bool clearCurrentList)
@@ -2902,7 +2931,6 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
}
}
- //sendLocalAudioUpdates(); obsolete, used to send volume setting on position updates
std::string update(stream.str());
if(!update.empty())
{
@@ -4023,7 +4051,7 @@ void LLVivoxVoiceClient::sessionNotificationEvent(std::string &sessionHandle, st
void LLVivoxVoiceClient::auxAudioPropertiesEvent(F32 energy)
{
- LL_DEBUGS("Voice") << "got energy " << energy << LL_ENDL;
+ LL_DEBUGS("VoiceEnergy") << "got energy " << energy << LL_ENDL;
mTuningEnergy = energy;
}
@@ -7007,16 +7035,20 @@ void LLVivoxProtocolParser::EndTag(const char *tag)
else if (!stricmp("Presence", tag))
statusString = string;
else if (!stricmp("CaptureDevices", tag))
+ {
LLVivoxVoiceClient::getInstance()->setDevicesListUpdated(true);
+ }
else if (!stricmp("RenderDevices", tag))
+ {
LLVivoxVoiceClient::getInstance()->setDevicesListUpdated(true);
+ }
else if (!stricmp("CaptureDevice", tag))
{
- LLVivoxVoiceClient::getInstance()->addCaptureDevice(deviceString);
+ LLVivoxVoiceClient::getInstance()->addCaptureDevice(LLVoiceDevice(displayNameString, deviceString));
}
else if (!stricmp("RenderDevice", tag))
{
- LLVivoxVoiceClient::getInstance()->addRenderDevice(deviceString);
+ LLVivoxVoiceClient::getInstance()->addRenderDevice(LLVoiceDevice(displayNameString, deviceString));
}
else if (!stricmp("BlockMask", tag))
blockMask = string;
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 9d4af85c8c..50862cea1e 100644
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -432,10 +432,10 @@ protected:
//----------------------------------
// devices
void clearCaptureDevices();
- void addCaptureDevice(const std::string& name);
+ void addCaptureDevice(const LLVoiceDevice& device);
void clearRenderDevices();
void setDevicesListUpdated(bool state);
- void addRenderDevice(const std::string& name);
+ void addRenderDevice(const LLVoiceDevice& device);
void buildSetAudioDevices(std::ostringstream &stream);
void getCaptureDevicesSendMessage();