FIRE-19663; Linux only: Introduce a debug setting which will allow the viewer to use SLVoice via Wine, so the 32 bit Windows executable will be used rather than the native Linux one which uses a very old Vivox SDK version.

master
Nicky 2016-07-18 13:01:11 +02:00
parent 97b421ad7f
commit 299ca5068f
5 changed files with 84 additions and 27 deletions

View File

@ -2231,9 +2231,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>06c3a9b1005249f0c94a8b9f3775f3d3</string>
<string>6e7b0961d6489a1b3c3090eccfd6e80e</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/vivox_3p-slvoice/rev/302004/arch/Linux/installer/slvoice-3.2.0002.10426.302004-linux-302004.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/slvoice-3.2.0002.10426.298329-linux-20160717.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>

View File

@ -24020,6 +24020,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSLinuxEnableWin32VoiceProxy</key>
<map>
<key>Comment</key>
<string>Use Win32 SLVoice.exe for voice. Needs wine (https://www.winehq.org/) installed, as SLVoice.exe is started inside wine.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -395,6 +395,26 @@ bool LLVivoxVoiceClient::writeString(const std::string &str)
return result;
}
// <FS:ND> On Linux the viewer can run SLVoice.exe through wine (https://www.winehq.org/)
// Vivox does not support Linux anymore and the SDK SLVoice for Linux uses is old and according to LL
// will stop working 'soon' (as of 2016-07-17). See also FIRE-19663
bool viewerUsesWineForVoice()
{
#ifndef LL_LINUX
return false;
#else
static LLCachedControl<bool> sEnableVoiceChat(gSavedSettings, "FSLinuxEnableWin32VoiceProxy" );
return sEnableVoiceChat;
#endif
}
bool viewerChoosesConnectionHandles()
{
return viewerUsesWineForVoice();
}
// </FS:ND>
/////////////////////////////
// session control messages
@ -425,15 +445,19 @@ void LLVivoxVoiceClient::connectorCreate()
loglevel = savedLogLevel;
// </FS:Ansariel>
}
// <FS:ND> Check if using the old SLVoice for Linux. the SDK in that version is too old to handle the extra args
std::string strConnectorHandle;
if( viewerChoosesConnectionHandles() )
strConnectorHandle = "<ConnectorHandle>" + LLVivoxSecurity::getInstance()->connectorHandle() + "</ConnectorHandle>";
// </FS:ND>
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Connector.Create.1\">"
<< "<ClientName>V2 SDK</ClientName>"
<< "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>"
<< "<Mode>Normal</Mode>"
#ifndef LL_LINUX // <FS:Ansariel> FIRE-19556: Linux voice fix
<< "<ConnectorHandle>" << LLVivoxSecurity::getInstance()->connectorHandle() << "</ConnectorHandle>"
#endif // </FS:Ansariel>
<< strConnectorHandle
// <FS:Ansariel> Voice in multiple instances; by Latif Khalifa
<< (gSavedSettings.getBOOL("VoiceMultiInstance") ? "<MinimumPort>30000</MinimumPort><MaximumPort>50000</MaximumPort>" : "")
// </FS:Ansariel>
@ -654,7 +678,13 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
#elif LL_DARWIN
exe_path += "../Resources/SLVoice";
#else
exe_path += "SLVoice";
// <FS:ND> On Linux the viewer can run SLVoice.exe through wine (https://www.winehq.org/)
// exe_path += "SLVoice";
if( !viewerUsesWineForVoice() )
exe_path += "SLVoice"; // native version
else
exe_path += "win32/SLVoice.exe"; // use bundled win32 version
// </FS:ND>
#endif
// See if the vivox executable exists
llstat s;
@ -662,8 +692,19 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
{
// vivox executable exists. Build the command line and launch the daemon.
LLProcess::Params params;
// <FS:ND> On Linux the viewer can run SLVoice.exe through wine (https://www.winehq.org/)
params.executable = exe_path;
if( !viewerUsesWineForVoice() )
params.executable = exe_path;
else
{
params.executable = "wine";
params.args.add( exe_path );
}
//</FS:ND>
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout");
if (loglevel.empty())
@ -713,7 +754,8 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
params.cwd = gDirUtilp->getAppRODataDir();
#ifndef LL_LINUX // <FS:Ansariel> FIRE-19556: Linux voice fix
// <FS:ND> Check if using the old SLVoice for Linux. the SDK in that version is too old to handle the extra args
if( viewerChoosesConnectionHandles() ) { // </FS:ND>
# ifdef VIVOX_HANDLE_ARGS
params.args.add("-ah");
params.args.add(LLVivoxSecurity::getInstance()->accountHandle());
@ -721,7 +763,7 @@ bool LLVivoxVoiceClient::startAndLaunchDaemon()
params.args.add("-ch");
params.args.add(LLVivoxSecurity::getInstance()->connectorHandle());
# endif // VIVOX_HANDLE_ARGS
#endif // </FS:Ansariel>
} // <FS:ND/>
sGatewayPtr = LLProcess::create(params);
@ -1885,14 +1927,18 @@ void LLVivoxVoiceClient::loginSendMessage()
bool autoPostCrashDumps = gSavedSettings.getBOOL("VivoxAutoPostCrashDumps");
// <FS:ND> Check if using the old SLVoice for Linux. the SDK in that version is too old to handle the extra args
std::string strAccountHandle;
if( viewerChoosesConnectionHandles() )
strAccountHandle = "<AccountHandle>" + LLVivoxSecurity::getInstance()->accountHandle() + "</AccountHandle>";
// </FS:ND>
stream
<< "<Request requestId=\"" << mCommandCookie++ << "\" action=\"Account.Login.1\">"
<< "<ConnectorHandle>" << LLVivoxSecurity::getInstance()->connectorHandle() << "</ConnectorHandle>"
<< "<AccountName>" << mAccountName << "</AccountName>"
<< "<AccountPassword>" << mAccountPassword << "</AccountPassword>"
#ifndef LL_LINUX // <FS:Ansariel> FIRE-19556: Linux voice fix
<< "<AccountHandle>" << LLVivoxSecurity::getInstance()->accountHandle() << "</AccountHandle>"
#endif // </FS:Ansariel>
<< strAccountHandle
<< "<AudioSessionAnswerMode>VerifyAnswer</AudioSessionAnswerMode>"
<< "<EnableBuddiesAndPresence>false</EnableBuddiesAndPresence>"
<< "<EnablePresencePersistence>0</EnablePresencePersistence>"
@ -2913,7 +2959,8 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
else
{
// Connector created, move forward.
#ifndef LL_LINUX // <FS:Ansariel> FIRE-19556: Linux voice fix
// <FS:ND> Check if using the old SLVoice for Linux. the SDK in that version is too old to handle the extra args
if( viewerChoosesConnectionHandles() ) { // </FS:ND>
if (connectorHandle == LLVivoxSecurity::getInstance()->connectorHandle())
{
LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << " connector handle " << connectorHandle << LL_ENDL;
@ -2931,8 +2978,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
<< LL_ENDL;
result["connector"] = LLSD::Boolean(false);
}
// <FS:Ansariel> FIRE-19556: Linux voice fix
#else
} else { // <FS:ND/> For old Linux Voice
LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL;
mVoiceVersion.serverVersion = versionID;
LLVivoxSecurity::getInstance()->setConnectorHandle(connectorHandle);
@ -2940,8 +2986,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
mTerminateDaemon = false;
result["connector"] = LLSD::Boolean(true);
#endif
// </FS:Ansariel>
} // <FS:ND/> For old Linux voice
}
LLEventPumps::instance().post("vivoxClientPump", result);
@ -2969,9 +3014,11 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString
else
{
// Login succeeded, move forward.
#ifdef LL_LINUX // <FS:Ansariel> FIRE-19556: Linux voice fix
LLVivoxSecurity::getInstance()->setAccountHandle(accountHandle);
#endif // </FS:Ansariel>
// <FS:ND> Check if using the old SLVoice for Linux.
if( !viewerChoosesConnectionHandles() )
LLVivoxSecurity::getInstance()->setAccountHandle(accountHandle);
// </FS:ND>
mAccountLoggedIn = true;
mNumberOfAliases = numberOfAliases;
result["login"] = LLSD::String("response_ok");

View File

@ -1050,13 +1050,11 @@ class LLVivoxSecurity : public LLSingleton<LLVivoxSecurity>
std::string connectorHandle() { return mConnectorHandle; };
std::string accountHandle() { return mAccountHandle; };
// <FS:Ansariel> FIRE-19556: Linux voice fix
#ifdef LL_LINUX
void setConnectorHandle(const std::string& handle) { mConnectorHandle = handle; }
void setAccountHandle(const std::string& handle) { mAccountHandle = handle; }
#endif
// </FS:Ansariel>
// <FS:ND> For the old Vivox SDK used on Linux
void setConnectorHandle(const std::string& handle) { mConnectorHandle = handle; }
void setAccountHandle(const std::string& handle) { mAccountHandle = handle; }
// </FS:ND>
private:
std::string mConnectorHandle;
std::string mAccountHandle;

View File

@ -1489,6 +1489,7 @@ class LinuxManifest(ViewerManifest):
# Currentelly, the 32-bit ones will work with a 64-bit client.
if self.prefix(src="../packages/lib/release", dst="bin"):
self.path("SLVoice")
self.path("win32")
self.end_prefix()
if self.prefix(src="../packages/lib/release", dst="lib"):
self.path("libortp.so")
@ -1554,7 +1555,7 @@ class LinuxManifest(ViewerManifest):
def strip_binaries(self):
if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name update_install \! -name *.pak \! -name *.dat \! -name *.bin \! -name core | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name update_install \! -name *.pak \! -name *.dat \! -name *.bin \! -name core \! -path '*win32*' | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
class Linux_i686_Manifest(LinuxManifest):
def construct(self):