From a33fe5a4ccb84bb821e2486c47e1010bb621e33d Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Fri, 25 Dec 2020 17:22:24 +0100 Subject: [PATCH 1/3] Added cropinghigh to contributor's list --- core/src/credits.cpp | 1 + readme.md | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/credits.cpp b/core/src/credits.cpp index 2e8f581d..b3a9bebe 100644 --- a/core/src/credits.cpp +++ b/core/src/credits.cpp @@ -6,6 +6,7 @@ namespace sdrpp_credits { "aosync", "Alexsey Shestacov", "Benjamin Kyd", + "Cropinghigh", "Tobias Mädel", "Raov", "Howard0su" diff --git a/readme.md b/readme.md index 7bbb431d..1a7e2365 100644 --- a/readme.md +++ b/readme.md @@ -224,6 +224,7 @@ I will soon publish a contributing.md listing the code style to use. * [aosync](https://github.com/aosync) * [Alexsey Shestacov](https://github.com/wingrime) * [Benjamin Kyd](https://github.com/benkyd) +* [cropinghigh](https://github.com/cropinghigh) * [Tobias Mädel](https://github.com/Manawyrm) * [Raov](https://twitter.com/raov_birbtog) * [Howard0su](https://github.com/howard0su) From bb7965b3c4a0a0368b047b90901f24b143230aac Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Fri, 25 Dec 2020 18:17:43 +0100 Subject: [PATCH 2/3] Fixed luckup bug --- core/src/dsp/stream.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/core/src/dsp/stream.h b/core/src/dsp/stream.h index ca021649..53560871 100644 --- a/core/src/dsp/stream.h +++ b/core/src/dsp/stream.h @@ -38,10 +38,7 @@ namespace dsp { swapCV.wait(lck, [this]{ return (canSwap || writerStop); }); // If writer was stopped, abandon operation - if (writerStop) { - writerStop = false; - return false; - } + if (writerStop) { return false; } // Swap buffers dataSize = size; @@ -66,23 +63,22 @@ namespace dsp { std::unique_lock lck(rdyMtx); rdyCV.wait(lck, [this]{ return (dataReady || readerStop); }); - // If stopped, abort - if (readerStop) { - readerStop = false; - return -1; - } - - dataReady = false; - - return dataSize; + return (readerStop ? -1 : dataSize); } void flush() { + // Clear data ready + { + std::lock_guard lck(rdyMtx); + dataReady = false; + } + // Notify writer that buffers can be swapped { std::lock_guard lck(swapMtx); canSwap = true; } + swapCV.notify_all(); } From db279d2b3639e01e239ae069e2a5babbdaa6243a Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Fri, 25 Dec 2020 19:58:52 +0100 Subject: [PATCH 3/3] Fixed audio freeze on linux --- audio_sink/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/audio_sink/src/main.cpp b/audio_sink/src/main.cpp index 6c31bb7e..5c748b18 100644 --- a/audio_sink/src/main.cpp +++ b/audio_sink/src/main.cpp @@ -179,6 +179,7 @@ private: } void doStop() { + s2m.stop(); monoRB.stop(); stereoRB.stop(); monoRB.data.stopReader();