diff --git a/core/src/dsp/demodulator.h b/core/src/dsp/demodulator.h index 67126c5e..26dd0404 100644 --- a/core/src/dsp/demodulator.h +++ b/core/src/dsp/demodulator.h @@ -145,11 +145,8 @@ namespace dsp { } void setDeviation(float deviation) { - std::lock_guard lck(generic_block::ctrlMtx); - generic_block::tempStop(); _deviation = deviation; phasorSpeed = (2 * FL_M_PI) / (_sampleRate / _deviation); - generic_block::tempStart(); } float getDeviation() { diff --git a/core/src/dsp/filter.h b/core/src/dsp/filter.h index b77ac1ff..e02bd71e 100644 --- a/core/src/dsp/filter.h +++ b/core/src/dsp/filter.h @@ -41,10 +41,12 @@ namespace dsp { } void updateWindow(dsp::filter_window::generic_window* window) { + std::lock_guard lck(generic_block>::ctrlMtx); _window = window; volk_free(taps); tapCount = window->getTapCount(); taps = (float*)volk_malloc(tapCount * sizeof(float), volk_get_alignment()); + bufStart = &buffer[tapCount]; window->createTaps(taps, tapCount); } @@ -52,6 +54,8 @@ namespace dsp { int count = _in->read(); if (count < 0) { return -1; } + generic_block>::ctrlMtx.lock(); + memcpy(bufStart, _in->readBuf, count * sizeof(T)); _in->flush(); @@ -70,6 +74,8 @@ namespace dsp { memmove(buffer, &buffer[count], tapCount * sizeof(T)); + generic_block>::ctrlMtx.unlock(); + return count; }