mirror of
https://github.com/FirestormViewer/phoenix-firestorm.git
synced 2026-08-14 00:48:30 +00:00
Reduced the time_mutx lock to 1 second from 3 seconds
Originally setup with 3 second as a was not sure how long it would take to recover, but 1 second should be good to recover and enumerate devices.
This commit is contained in:
@@ -134,8 +134,8 @@ static FMOD_RESULT F_CALL systemCallback(FMOD_SYSTEM *system, FMOD_SYSTEM_CALLBA
|
||||
if (sys && audio_engine)
|
||||
{
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
@@ -429,8 +429,8 @@ void LLAudioEngine_FMODSTUDIO::setDevice(const LLUUID& device_uuid)
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
|
||||
@@ -477,8 +477,8 @@ void LLWebRTCImpl::workerDeployDevices()
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
@@ -660,8 +660,8 @@ void LLWebRTCImpl::updateDevices()
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
@@ -855,8 +855,8 @@ void LLWebRTCImpl::intSetMute(bool mute, int delay_ms)
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is
|
||||
// invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
@@ -916,8 +916,8 @@ void LLWebRTCImpl::intSetMute(bool mute, int delay_ms)
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is
|
||||
// invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
|
||||
@@ -2419,8 +2419,8 @@ void LLVivoxVoiceClient::sendCaptureAndRenderDevices()
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
|
||||
@@ -763,8 +763,8 @@ void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDevi
|
||||
// <FS:minerjr> [FIRE-36022] - Removing my USB headset crashes entire viewer
|
||||
try // Try catch needed for uniquie lock as will throw an exception if a second lock is attempted or the mutex is invalid
|
||||
{
|
||||
// Attempt to lock the access to the audio device, wait up to 3 seconds for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 3s);
|
||||
// Attempt to lock the access to the audio device, wait up to 1 second for other threads to unlock.
|
||||
std::unique_lock lock(gAudioDeviceMutex, 1s);
|
||||
// If the lock could not be accessed, return as we don't have hardware access and will need to try again another pass.
|
||||
// Prevents threads from interacting with the hardware at the same time as other audio/voice threads.
|
||||
if (!lock.owns_lock())
|
||||
|
||||
Reference in New Issue
Block a user