summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2024-08-17 20:11:46 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-08-17 20:11:46 -0700
commit63d17b395b8b4c4ca32a09d64754a99b13abedb1 (patch)
tree8e9e41eea8f68f12983d7eb5a0fbc9139c8e5935
parent2efad2182a5f6b8404afd9ea363b3a9088de3207 (diff)
Microphone was being prematurely enabled on login for a short period.
The microphone issue was causing a short moment of sound, and was causing bluetooth headsets to switch to hands-free/one channel mode which is disruptive. Also, update webrtc to deal with issue where airpods were garbled after coming out of hands-free mode.
-rw-r--r--autobuild.xml82
-rw-r--r--indra/llwebrtc/llwebrtc.cpp40
2 files changed, 62 insertions, 60 deletions
diff --git a/autobuild.xml b/autobuild.xml
index c2d063763d..3d34c78c01 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -745,18 +745,6 @@
</map>
<key>glm</key>
<map>
- <key>canonical_repo</key>
- <string>https://github.com/secondlife/3p-glm</string>
- <key>copyright</key>
- <string>Copyright (c) 2005 - G-Truc Creation</string>
- <key>description</key>
- <string>OpenGL Mathematics</string>
- <key>license</key>
- <string>MIT</string>
- <key>license_file</key>
- <string>LICENSES/glm_license.txt</string>
- <key>name</key>
- <string>glm</string>
<key>platforms</key>
<map>
<key>common</key>
@@ -774,16 +762,28 @@
<string>common</string>
</map>
</map>
- <key>source_type</key>
- <string>git</string>
+ <key>license</key>
+ <string>MIT</string>
+ <key>license_file</key>
+ <string>LICENSES/glm_license.txt</string>
+ <key>copyright</key>
+ <string>Copyright (c) 2005 - G-Truc Creation</string>
+ <key>version</key>
+ <string>v1.0.1</string>
+ <key>name</key>
+ <string>glm</string>
<key>vcs_branch</key>
<string>refs/tags/v1.0.1-r1</string>
<key>vcs_revision</key>
<string>399cd5ba57a9267a560ce07e50a0f8c5fe3dc66f</string>
<key>vcs_url</key>
<string>git://github.com/secondlife/3p-glm.git</string>
- <key>version</key>
- <string>v1.0.1</string>
+ <key>canonical_repo</key>
+ <string>https://github.com/secondlife/3p-glm</string>
+ <key>description</key>
+ <string>OpenGL Mathematics</string>
+ <key>source_type</key>
+ <string>git</string>
</map>
<key>gstreamer</key>
<map>
@@ -1418,14 +1418,6 @@
</map>
<key>llphysicsextensions_source</key>
<map>
- <key>copyright</key>
- <string>Copyright (c) 2010, Linden Research, Inc.</string>
- <key>license</key>
- <string>internal</string>
- <key>license_file</key>
- <string>LICENSES/llphysicsextensions.txt</string>
- <key>name</key>
- <string>llphysicsextensions_source</string>
<key>platforms</key>
<map>
<key>darwin64</key>
@@ -1477,8 +1469,16 @@
<string>windows64</string>
</map>
</map>
+ <key>license</key>
+ <string>internal</string>
+ <key>license_file</key>
+ <string>LICENSES/llphysicsextensions.txt</string>
+ <key>copyright</key>
+ <string>Copyright (c) 2010, Linden Research, Inc.</string>
<key>version</key>
<string>1.0.b8b1f73</string>
+ <key>name</key>
+ <string>llphysicsextensions_source</string>
</map>
<key>llphysicsextensions_stub</key>
<map>
@@ -2008,16 +2008,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
</map>
<key>openal</key>
<map>
- <key>copyright</key>
- <string>Copyright (C) 1999-2007 by authors.</string>
- <key>description</key>
- <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string>
- <key>license</key>
- <string>LGPL2</string>
- <key>license_file</key>
- <string>LICENSES/openal-soft.txt</string>
- <key>name</key>
- <string>openal</string>
<key>platforms</key>
<map>
<key>darwin64</key>
@@ -2063,8 +2053,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<string>windows64</string>
</map>
</map>
+ <key>license</key>
+ <string>LGPL2</string>
+ <key>license_file</key>
+ <string>LICENSES/openal-soft.txt</string>
+ <key>copyright</key>
+ <string>Copyright (C) 1999-2007 by authors.</string>
<key>version</key>
<string>1.23.1</string>
+ <key>name</key>
+ <string>openal</string>
+ <key>description</key>
+ <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string>
</map>
<key>openjpeg</key>
<map>
@@ -2793,11 +2793,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
- <string>194b4f5957c9f003c46e61a434e23a7c3d1180d6</string>
+ <string>8987b409ab7254ed22dab6dfbaefa059e7ab000e</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
- <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.70-debug/webrtc-m114.5735.08.70-debug.10377605436-darwin64-10377605436.tar.zst</string>
+ <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.71-debug/webrtc-m114.5735.08.71-debug.10436964656-darwin64-10436964656.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@@ -2807,11 +2807,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
- <string>38e0c7d30b4c40eb04e60ab199440b847cc7c6cf</string>
+ <string>153a220a138f9abe0e35fd63ea7f114b1117b4d6</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
- <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.70-debug/webrtc-m114.5735.08.70-debug.10377605436-linux64-10377605436.tar.zst</string>
+ <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.71-debug/webrtc-m114.5735.08.71-debug.10436964656-linux64-10436964656.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@@ -2821,11 +2821,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
- <string>053fb5c873df9192e34cddcf2db1c5fdcff76ba1</string>
+ <string>709f23421d9de07fddd37ac4fd2cc4bb723bb4d7</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
- <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.70-debug/webrtc-m114.5735.08.70-debug.10377605436-windows64-10377605436.tar.zst</string>
+ <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.71-debug/webrtc-m114.5735.08.71-debug.10436964656-windows64-10436964656.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@@ -2838,7 +2838,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key>
<string>Copyright (c) 2011, The WebRTC project authors. All rights reserved.</string>
<key>version</key>
- <string>m114.5735.08.70-debug.10377605436</string>
+ <string>m114.5735.08.71-debug.10436964656</string>
<key>name</key>
<string>webrtc</string>
<key>vcs_branch</key>
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp
index d154bfb8eb..dd7883f973 100644
--- a/indra/llwebrtc/llwebrtc.cpp
+++ b/indra/llwebrtc/llwebrtc.cpp
@@ -206,10 +206,10 @@ void LLWebRTCImpl::init()
mTuningDeviceModule->SetAudioDeviceSink(this);
mTuningDeviceModule->InitMicrophone();
mTuningDeviceModule->InitSpeaker();
+ mTuningDeviceModule->SetStereoRecording(false);
+ mTuningDeviceModule->SetStereoPlayout(true);
mTuningDeviceModule->InitRecording();
mTuningDeviceModule->InitPlayout();
- mTuningDeviceModule->SetStereoRecording(true);
- mTuningDeviceModule->SetStereoPlayout(true);
updateDevices();
});
@@ -227,10 +227,6 @@ void LLWebRTCImpl::init()
mPeerDeviceModule->EnableBuiltInAEC(false);
mPeerDeviceModule->InitMicrophone();
mPeerDeviceModule->InitSpeaker();
- mPeerDeviceModule->InitRecording();
- mPeerDeviceModule->InitPlayout();
- mPeerDeviceModule->SetStereoRecording(true);
- mPeerDeviceModule->SetStereoPlayout(true);
});
// The custom processor allows us to retrieve audio data (and levels)
@@ -253,6 +249,8 @@ void LLWebRTCImpl::init()
apm_config.pipeline.multi_channel_render = true;
apm_config.pipeline.multi_channel_capture = false;
+ mAudioProcessingModule->ApplyConfig(apm_config);
+
webrtc::ProcessingConfig processing_config;
processing_config.input_stream().set_num_channels(2);
processing_config.input_stream().set_sample_rate_hz(48000);
@@ -263,10 +261,8 @@ void LLWebRTCImpl::init()
processing_config.reverse_output_stream().set_num_channels(2);
processing_config.reverse_output_stream().set_sample_rate_hz(48000);
- mAudioProcessingModule->ApplyConfig(apm_config);
mAudioProcessingModule->Initialize(processing_config);
-
mPeerConnectionFactory = webrtc::CreatePeerConnectionFactory(mNetworkThread.get(),
mWorkerThread.get(),
mSignalingThread.get(),
@@ -329,6 +325,8 @@ void LLWebRTCImpl::setRecording(bool recording)
{
if (recording)
{
+ mPeerDeviceModule->SetStereoRecording(false);
+ mPeerDeviceModule->InitRecording();
mPeerDeviceModule->StartRecording();
}
else
@@ -345,6 +343,8 @@ void LLWebRTCImpl::setPlayout(bool playing)
{
if (playing)
{
+ mPeerDeviceModule->SetStereoPlayout(true);
+ mPeerDeviceModule->InitPlayout();
mPeerDeviceModule->StartPlayout();
}
else
@@ -430,9 +430,9 @@ void ll_set_device_module_capture_device(rtc::scoped_refptr<webrtc::AudioDeviceM
// has it at 0
device_module->SetRecordingDevice(device + 1);
#endif
+ device_module->SetStereoRecording(false);
device_module->InitMicrophone();
device_module->InitRecording();
- device_module->SetStereoRecording(false);
}
void LLWebRTCImpl::setCaptureDevice(const std::string &id)
@@ -494,9 +494,9 @@ void ll_set_device_module_render_device(rtc::scoped_refptr<webrtc::AudioDeviceMo
#else
device_module->SetPlayoutDevice(device + 1);
#endif
+ device_module->SetStereoPlayout(true);
device_module->InitSpeaker();
device_module->InitPlayout();
- device_module->SetStereoPlayout(true);
}
void LLWebRTCImpl::setRenderDevice(const std::string &id)
@@ -626,6 +626,8 @@ void LLWebRTCImpl::setTuningMode(bool enable)
//mTuningDeviceModule->StopPlayout();
ll_set_device_module_render_device(mPeerDeviceModule, mPlayoutDevice);
ll_set_device_module_capture_device(mPeerDeviceModule, mRecordingDevice);
+ mPeerDeviceModule->SetStereoPlayout(true);
+ mPeerDeviceModule->SetStereoRecording(false);
mPeerDeviceModule->InitPlayout();
mPeerDeviceModule->InitRecording();
mPeerDeviceModule->StartPlayout();
@@ -667,13 +669,13 @@ LLWebRTCPeerConnectionInterface *LLWebRTCImpl::newPeerConnection()
rtc::scoped_refptr<LLWebRTCPeerConnectionImpl> peerConnection = rtc::scoped_refptr<LLWebRTCPeerConnectionImpl>(new rtc::RefCountedObject<LLWebRTCPeerConnectionImpl>());
peerConnection->init(this);
+ mPeerConnections.emplace_back(peerConnection);
+ peerConnection->enableSenderTracks(!mMute);
if (mPeerConnections.empty())
{
setRecording(true);
setPlayout(true);
}
- mPeerConnections.emplace_back(peerConnection);
- peerConnection->enableSenderTracks(!mMute);
return peerConnection.get();
}
@@ -702,7 +704,7 @@ void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_conn
LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() :
mWebRTCImpl(nullptr),
mPeerConnection(nullptr),
- mMute(false),
+ mMute(true),
mAnswerReceived(false)
{
}
@@ -724,8 +726,8 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl)
}
void LLWebRTCPeerConnectionImpl::terminate()
{
- mWebRTCImpl->PostSignalingTask(
- [=]()
+ mWebRTCImpl->SignalingBlockingCall(
+ [this]()
{
if (mPeerConnection)
{
@@ -847,7 +849,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti
codecparam.clock_rate = 48000;
codecparam.num_channels = 2;
codecparam.parameters["stereo"] = "1";
- codecparam.parameters["sprop-stereo"] = "1";
+ codecparam.parameters["sprop-stereo"] = "0";
params.codecs.push_back(codecparam);
sender->SetParameters(params);
}
@@ -862,7 +864,7 @@ bool LLWebRTCPeerConnectionImpl::initializeConnection(const LLWebRTCPeerConnecti
codecparam.clock_rate = 48000;
codecparam.num_channels = 2;
codecparam.parameters["stereo"] = "1";
- codecparam.parameters["sprop-stereo"] = "1";
+ codecparam.parameters["sprop-stereo"] = "0";
params.codecs.push_back(codecparam);
receiver->SetParameters(params);
}
@@ -1009,7 +1011,7 @@ void LLWebRTCPeerConnectionImpl::OnAddTrack(rtc::scoped_refptr<webrtc::RtpReceiv
codecparam.clock_rate = 48000;
codecparam.num_channels = 2;
codecparam.parameters["stereo"] = "1";
- codecparam.parameters["sprop-stereo"] = "1";
+ codecparam.parameters["sprop-stereo"] = "0";
params.codecs.push_back(codecparam);
receiver->SetParameters(params);
}
@@ -1200,7 +1202,7 @@ void LLWebRTCPeerConnectionImpl::OnSuccess(webrtc::SessionDescriptionInterface *
else if (sdp_line.find("a=fmtp:" + opus_payload) == 0)
{
sdp_mangled_stream << sdp_line << "a=fmtp:" << opus_payload
- << " minptime=10;useinbandfec=1;stereo=1;sprop-stereo=1;maxplaybackrate=48000;sprop-maxplaybackrate=48000;sprop-maxcapturerate=48000\n";
+ << " minptime=10;useinbandfec=1;stereo=1;sprop-stereo=0;maxplaybackrate=48000;sprop-maxplaybackrate=48000;sprop-maxcapturerate=48000\n";
}
else
{