From 026ef1935dbdb21ab79159d38fb78e126dd6ac95 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 8 May 2023 12:07:31 -0400 Subject: SL-19690: Follow up on Rye Mutt's fix for shutdown crashes. Rather than continuing to propagate try/catch (Closed) (aka LLThreadSafeQueueInterrupt) constructs through the code base, make WorkQueueBase::post() return bool indicating success (i.e. ! isClosed()). This obviates postIfOpen(), which no one was using anyway. In effect, postIfOpen() is renamed post(), bypassing the exception when isClosed(). Review existing try/catch blocks of that sort, changing to test for post() returning false. --- indra/llaudio/llaudiodecodemgr.cpp | 61 ++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 38a6b41afe..190c5290cb 100755 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -607,40 +607,37 @@ void LLAudioDecodeMgr::Impl::startMoreDecodes() // Kick off a decode mDecodes[decode_id] = LLPointer(NULL); - try - { - main_queue->postTo( - general_queue, - [decode_id]() // Work done on general queue - { - LLPointer decode_state = beginDecodingAndWritingAudio(decode_id); - - if (!decode_state) - { - // Audio decode has errored - return decode_state; - } + bool posted = main_queue->postTo( + general_queue, + [decode_id]() // Work done on general queue + { + LLPointer decode_state = beginDecodingAndWritingAudio(decode_id); - // Disk write of decoded audio is now in progress off-thread + if (!decode_state) + { + // Audio decode has errored return decode_state; - }, - [decode_id, this](LLPointer decode_state) // Callback to main thread - mutable { - if (!gAudiop) - { - // There is no LLAudioEngine anymore. This might happen if - // an audio decode is enqueued just before shutdown. - return; - } - - // At this point, we can be certain that the pointer to "this" - // is valid because the lifetime of "this" is dependent upon - // the lifetime of gAudiop. - - enqueueFinishAudio(decode_id, decode_state); - }); - } - catch (const LLThreadSafeQueueInterrupt&) + } + + // Disk write of decoded audio is now in progress off-thread + return decode_state; + }, + [decode_id, this](LLPointer decode_state) // Callback to main thread + mutable { + if (!gAudiop) + { + // There is no LLAudioEngine anymore. This might happen if + // an audio decode is enqueued just before shutdown. + return; + } + + // At this point, we can be certain that the pointer to "this" + // is valid because the lifetime of "this" is dependent upon + // the lifetime of gAudiop. + + enqueueFinishAudio(decode_id, decode_state); + }); + if (! posted) { // Shutdown // Consider making processQueue() do a cleanup instead -- cgit v1.2.3 From 524f3b2af08c4e2a856a70d4505391c6f56d76df Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 5 Jun 2023 10:43:16 -0400 Subject: SL-18837: #include in several sources that need it. It seems we're no longer implicitly inheriting from some other [set of] header file[s]. Where we use std::array, bring it in explicitly. --- indra/llaudio/llaudioengine.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h index 0fe8b3d756..cf694cfaf4 100755 --- a/indra/llaudio/llaudioengine.h +++ b/indra/llaudio/llaudioengine.h @@ -30,6 +30,7 @@ #include #include +#include #include "v3math.h" #include "v3dmath.h" -- cgit v1.2.3 From 6cb906c44908a304af26e3ea95de88ff34ef46f7 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 10:35:10 -0400 Subject: SL-18837: Add OpenAL::createDefaultStreamingAudioImpl(). LLAudioEngine added a new abstract virtual method that wasn't yet implemented for LLStreamingAudio_OpenAL. --- indra/llaudio/llaudioengine_openal.cpp | 5 +++++ indra/llaudio/llaudioengine_openal.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 0a79614424..e6c62caae9 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -119,6 +119,11 @@ std::string LLAudioEngine_OpenAL::getDriverName(bool verbose) return version.str(); } +LLStreamingAudioInterface *LLAudioEngine_OpenAL::createDefaultStreamingAudioImpl() const +{ + return new LLStreamingAudio_OpenAL(); +} + // virtual void LLAudioEngine_OpenAL::allocateListener() { diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index a3cab97cd2..cd55261813 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -40,8 +40,9 @@ class LLAudioEngine_OpenAL : public LLAudioEngine LLAudioEngine_OpenAL(); virtual ~LLAudioEngine_OpenAL(); - virtual bool init(void *user_data, const std::string &app_title); - virtual std::string getDriverName(bool verbose); + virtual bool init(void *user_data, const std::string &app_title); + virtual std::string getDriverName(bool verbose); + virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const; virtual void allocateListener(); virtual void shutdown(); -- cgit v1.2.3 From 46bd102e80178abb094b5dac6fe9c476e044eaed Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 11:00:16 -0400 Subject: SL-18837: Typo for LLAudioEngine_OpenAL --- indra/llaudio/llaudioengine_openal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index e6c62caae9..d2a66c8c0f 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -121,7 +121,7 @@ std::string LLAudioEngine_OpenAL::getDriverName(bool verbose) LLStreamingAudioInterface *LLAudioEngine_OpenAL::createDefaultStreamingAudioImpl() const { - return new LLStreamingAudio_OpenAL(); + return new LLAudioEngine_OpenAL(); } // virtual -- cgit v1.2.3 From 7e655d8c828829bd45ca0ea8c47e3ce5619b23c1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 12:40:37 -0400 Subject: SL-18837: Revert "Typo for LLAudioEngine_OpenAL" This reverts commit 46bd102e80178abb094b5dac6fe9c476e044eaed. --- indra/llaudio/llaudioengine_openal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index d2a66c8c0f..e6c62caae9 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -121,7 +121,7 @@ std::string LLAudioEngine_OpenAL::getDriverName(bool verbose) LLStreamingAudioInterface *LLAudioEngine_OpenAL::createDefaultStreamingAudioImpl() const { - return new LLAudioEngine_OpenAL(); + return new LLStreamingAudio_OpenAL(); } // virtual -- cgit v1.2.3 From 44181628d587f9c87cae9cdbfd57de69078000d2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 8 Sep 2023 12:41:04 -0400 Subject: SL-18837: Revert "Add OpenAL::createDefaultStreamingAudioImpl()." This reverts commit 6cb906c44908a304af26e3ea95de88ff34ef46f7. --- indra/llaudio/llaudioengine_openal.cpp | 5 ----- indra/llaudio/llaudioengine_openal.h | 5 ++--- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index e6c62caae9..0a79614424 100644 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -119,11 +119,6 @@ std::string LLAudioEngine_OpenAL::getDriverName(bool verbose) return version.str(); } -LLStreamingAudioInterface *LLAudioEngine_OpenAL::createDefaultStreamingAudioImpl() const -{ - return new LLStreamingAudio_OpenAL(); -} - // virtual void LLAudioEngine_OpenAL::allocateListener() { diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index cd55261813..a3cab97cd2 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -40,9 +40,8 @@ class LLAudioEngine_OpenAL : public LLAudioEngine LLAudioEngine_OpenAL(); virtual ~LLAudioEngine_OpenAL(); - virtual bool init(void *user_data, const std::string &app_title); - virtual std::string getDriverName(bool verbose); - virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const; + virtual bool init(void *user_data, const std::string &app_title); + virtual std::string getDriverName(bool verbose); virtual void allocateListener(); virtual void shutdown(); -- cgit v1.2.3 From d459b3a1ca317c6927dffacda3aac3b580c0dfb1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 26 Aug 2023 21:04:05 +0200 Subject: Fix builds using OpenAL (cherry picked from commit fd73b6e5cf6341d606628646b73a0d05223b74bc) --- indra/llaudio/llaudioengine_openal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine_openal.h b/indra/llaudio/llaudioengine_openal.h index a3cab97cd2..562c96c794 100644 --- a/indra/llaudio/llaudioengine_openal.h +++ b/indra/llaudio/llaudioengine_openal.h @@ -42,6 +42,7 @@ class LLAudioEngine_OpenAL : public LLAudioEngine virtual bool init(void *user_data, const std::string &app_title); virtual std::string getDriverName(bool verbose); + virtual LLStreamingAudioInterface* createDefaultStreamingAudioImpl() const { return nullptr; } virtual void allocateListener(); virtual void shutdown(); @@ -56,7 +57,6 @@ class LLAudioEngine_OpenAL : public LLAudioEngine /*virtual*/ void updateWind(LLVector3 direction, F32 camera_altitude); private: - void * windDSP(void *newbuffer, int length); typedef S16 WIND_SAMPLE_T; LLWindGen *mWindGen; S16 *mWindBuf; -- cgit v1.2.3 From a069a21d318abd4eded46556c3252fec08eea84c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 7 Dec 2023 13:59:22 +0200 Subject: SL-20696 FIXED llLoopSoundSlave producing no sound since viewer update --- indra/llaudio/llaudioengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llaudio') diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index a387bb23cd..ece0a12a7a 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -398,7 +398,7 @@ void LLAudioEngine::idle() for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; - if (sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) + if (!sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) { sync_masterp = sourcep; master_channelp = sync_masterp->getChannel(); -- cgit v1.2.3