From bcc1744a7611b813c91f8f2ebdd4163a993b440d Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Tue, 30 Mar 2021 03:37:40 +0200 Subject: [PATCH] More bugfix --- core/src/core.cpp | 3 ++- core/src/dsp/convertion.h | 2 +- core/src/dsp/demodulator.h | 2 +- core/src/dsp/sink.h | 2 -- core/src/gui/main_window.cpp | 1 - make_windows_package.ps1 | 4 ++++ rtl_sdr_source/src/main.cpp | 12 ++++++++++++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/core/src/core.cpp b/core/src/core.cpp index 3bbe3eae..8ca6770a 100644 --- a/core/src/core.cpp +++ b/core/src/core.cpp @@ -131,7 +131,8 @@ int sdrpp_main(int argc, char *argv[]) { defConfig["moduleInstances"]["RTL-SDR Source"] = "rtl_sdr_source"; defConfig["moduleInstances"]["AirspyHF+ Source"] = "airspyhf_source"; defConfig["moduleInstances"]["Airspy Source"] = "airspy_source"; - //defConfig["moduleInstances"]["SDRplay Source"] = "sdrplay_source"; + defConfig["moduleInstances"]["File Source"] = "file_source"; + defConfig["moduleInstances"]["SDRplay Source"] = "sdrplay_source"; defConfig["moduleInstances"]["Audio Sink"] = "audio_sink"; defConfig["modules"] = json::array(); diff --git a/core/src/dsp/convertion.h b/core/src/dsp/convertion.h index 90ac9d29..c1821814 100644 --- a/core/src/dsp/convertion.h +++ b/core/src/dsp/convertion.h @@ -129,8 +129,8 @@ namespace dsp { RealToComplex(stream* in) { init(in); } ~RealToComplex() { - delete[] nullBuffer; generic_block::stop(); + delete[] nullBuffer; } void init(stream* in) { diff --git a/core/src/dsp/demodulator.h b/core/src/dsp/demodulator.h index 0438ccaa..fe59c1cf 100644 --- a/core/src/dsp/demodulator.h +++ b/core/src/dsp/demodulator.h @@ -193,7 +193,7 @@ namespace dsp { StereoFMDemod(stream* in, float sampleRate, float deviation) { init(in, sampleRate, deviation); } ~StereoFMDemod() { - stop(); + generic_block::stop(); delete[] doubledPilot; delete[] a_minus_b; delete[] a_out; diff --git a/core/src/dsp/sink.h b/core/src/dsp/sink.h index 7c219dd1..218d2c98 100644 --- a/core/src/dsp/sink.h +++ b/core/src/dsp/sink.h @@ -103,8 +103,6 @@ namespace dsp { NullSink(stream* in) { init(in); } - ~NullSink() { generic_block>::stop(); } - void init(stream* in) { _in = in; generic_block>::registerInput(_in); diff --git a/core/src/gui/main_window.cpp b/core/src/gui/main_window.cpp index 8a11068f..6394ceeb 100644 --- a/core/src/gui/main_window.cpp +++ b/core/src/gui/main_window.cpp @@ -54,7 +54,6 @@ // int fftSizeId = 0; int fftSize = 8192 * 8; -std::thread worker; std::mutex fft_mtx; fftwf_complex *fft_in, *fft_out; fftwf_plan p; diff --git a/make_windows_package.ps1 b/make_windows_package.ps1 index fc39c9bf..dec2404d 100644 --- a/make_windows_package.ps1 +++ b/make_windows_package.ps1 @@ -29,6 +29,10 @@ cp build/rtl_tcp_source/Release/rtl_tcp_source.dll sdrpp_windows_x64/modules/ cp build/soapy_source/Release/soapy_source.dll sdrpp_windows_x64/modules/ +cp build/file_source/Release/file_source.dll sdrpp_windows_x64/modules/ + +cp build/sdrplay_source/Release/sdrplay_source.dll sdrpp_windows_x64/modules/ + cp build/audio_sink/Release/audio_sink.dll sdrpp_windows_x64/modules/ cp "C:/Program Files (x86)/RtAudio/bin/rtaudio.dll" sdrpp_windows_x64/ diff --git a/rtl_sdr_source/src/main.cpp b/rtl_sdr_source/src/main.cpp index bc4b3866..09e578cf 100644 --- a/rtl_sdr_source/src/main.cpp +++ b/rtl_sdr_source/src/main.cpp @@ -346,6 +346,18 @@ private: if (ImGui::Combo(CONCAT("##_rtlsdr_ds_", _this->name), &_this->directSamplingMode, directSamplingModesTxt)) { if (_this->running) { rtlsdr_set_direct_sampling(_this->openDev, _this->directSamplingMode); + + // Update gains (fix for librtlsdr bug) + if (_this->directSamplingMode == false) { + rtlsdr_set_agc_mode(_this->openDev, _this->rtlAgc); + if (_this->tunerAgc) { + rtlsdr_set_tuner_gain_mode(_this->openDev, 0); + } + else { + rtlsdr_set_tuner_gain_mode(_this->openDev, 1); + rtlsdr_set_tuner_gain(_this->openDev, _this->gainList[_this->gainId]); + } + } } if (_this->selectedDevName != "") { config.aquire();