35 Commits

Author SHA1 Message Date
15112c63b7 don't do debug, not needed anyway 2024-06-26 16:47:14 +02:00
115cb23672 Add debug redists 2024-06-26 16:42:28 +02:00
101f6777ee copy redist 2024-06-26 16:24:43 +02:00
82a2a4c04a Set cmake generator version explicitely 2024-06-26 14:01:37 +02:00
c4086f5719 add test on github 2024-06-26 13:29:05 +02:00
5f77718d75 trying without static initialization 2024-06-26 13:10:05 +02:00
e613087e97 another mutex test 2024-06-26 12:51:13 +02:00
beb18972ea try disabling pallet init 2024-06-24 19:13:47 +02:00
1b0a5ed88e add missing compile flags 2024-06-08 19:15:07 +02:00
b1ad7590cc add minimally broken example 2024-06-08 19:13:18 +02:00
9537ccf2d2 copy pdb 2024-06-08 18:40:46 +02:00
0ac1bd56bc new debug attempt 2024-06-08 18:01:17 +02:00
936c99dc40 windows debug build 2024-06-08 08:38:33 +02:00
bb9024fadd disable badgesdr_source module 2024-06-04 22:04:25 +02:00
d1dc20f4e2 fix rfnm device selection 2024-06-04 22:03:39 +02:00
762444d340 fix version number on Linux, MacOS and Android 2024-05-29 00:56:56 +02:00
18300e8916 switch to SDRplay API v3.15 2024-05-26 22:57:47 +02:00
a93bb9d468 fix source/samplerate selection bugs 2024-05-26 22:27:47 +02:00
ea0362b927 add microtelecom to hardware donor list 2024-05-24 17:06:30 +02:00
ffc642f270 set stage of rfnm source to beta 2024-05-24 01:58:17 +02:00
1b5975f563 Add RFNM to hardware donor list 2024-05-24 01:42:36 +02:00
733dc55723 added missing files 2024-05-24 01:38:24 +02:00
b841180f84 add ubuntu noble build 2024-05-24 01:38:15 +02:00
e99e84e809 add gain slider and FM notch controls to RFNM source$ 2024-05-15 13:01:57 +02:00
7a4281dd76 add rfnm_source module 2024-05-14 22:22:03 +02:00
c89763a989 Merge branch 'master' of https://github.com/AlexandreRouma/SDRPlusPlus 2024-05-04 16:38:52 +02:00
27edc260c9 fix some fft sizes not being saved as described in #1396 2024-05-04 16:38:47 +02:00
2ea7ac496f Merge pull request #1391 from rberaldo/master
Add a bandplan for Brazilian ham bands
2024-05-01 21:13:15 +02:00
314d78d9d2 Add another missing include to the spectran source 2024-04-27 07:00:27 +02:00
4e455e6661 Add missing include in spectran source 2024-04-27 06:53:15 +02:00
58b86fcee5 add brazil.json
Add a bandplan for the Brazilian ham bands inspired in netherlands.json.
I intend to improve and extend on this band plan, including by adding non-ham
bands.
2024-04-26 16:36:06 -03:00
27072e9fe7 version bump to indicate ABI change. modules just need to be recompiled. 2024-04-23 22:46:43 +02:00
da1417b5ab made recorder crash fix more robust 2024-04-22 21:54:01 +02:00
e60eca5d6d fix crash when attempting to record from disabled radio 2024-04-22 21:51:49 +02:00
ccb10bfb9a fix missing virtual destructors as reported in #1386 2024-04-22 18:54:12 +02:00
42 changed files with 1296 additions and 150 deletions

View File

@ -68,11 +68,15 @@ jobs:
- name: Prepare CMake
working-directory: ${{runner.workspace}}/build
run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
run: cmake "$Env:GITHUB_WORKSPACE" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE=Debug -DCOPY_MSVC_REDISTRIBUTABLES=ON -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_PERSEUS_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
- name: Build
working-directory: ${{runner.workspace}}/build
run: cmake --build . --config Release --verbose
run: cmake --build . --config Debug --verbose
- name: Run tests
working-directory: ${{runner.workspace}}/build
run: ./Debug/min_broken.exe
- name: Create Archive
working-directory: ${{runner.workspace}}
@ -100,7 +104,7 @@ jobs:
run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
- name: Install SDRplay API
run: wget https://www.sdrplay.com/software/SDRplayAPI-macos-installer-universal-3.14.0.pkg && sudo installer -pkg SDRplayAPI-macos-installer-universal-3.14.0.pkg -target /
run: wget https://www.sdrplay.com/software/SDRplayAPI-macos-installer-universal-3.15.0.pkg && sudo installer -pkg SDRplayAPI-macos-installer-universal-3.15.0.pkg -target /
- name: Install libiio
run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
@ -151,7 +155,7 @@ jobs:
run: git clone --recursive https://github.com/gnuradio/volk && cd volk && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
- name: Install SDRplay API
run: wget https://www.sdrplay.com/software/SDRplayAPI-macos-installer-universal-3.14.0.pkg && sudo installer -pkg SDRplayAPI-macos-installer-universal-3.14.0.pkg -target /
run: wget https://www.sdrplay.com/software/SDRplayAPI-macos-installer-universal-3.15.0.pkg && sudo installer -pkg SDRplayAPI-macos-installer-universal-3.15.0.pkg -target /
- name: Install libiio
run: wget https://github.com/analogdevicesinc/libiio/archive/refs/tags/v0.25.zip && 7z x v0.25.zip && cd libiio-0.25 && mkdir build && cd build && cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_BUILD_TYPE=Release .. && make -j3 && sudo make install && cd ../../
@ -340,6 +344,28 @@ jobs:
name: sdrpp_ubuntu_mantic_amd64
path: ${{runner.workspace}}/sdrpp_debian_amd64.deb
build_ubuntu_noble:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Docker Image
run: cd $GITHUB_WORKSPACE/docker_builds/ubuntu_noble && docker build . --tag sdrpp_build
- name: Run Container
run: docker run --name build -v $GITHUB_WORKSPACE:/root/SDRPlusPlus --env BUILD_NO="-$GITHUB_RUN_NUMBER" sdrpp_build /root/do_build.sh
- name: Recover Deb Archive
working-directory: ${{runner.workspace}}
run: docker cp build:/root/SDRPlusPlus/sdrpp_debian_amd64.deb ./
- name: Save Deb Archive
uses: actions/upload-artifact@v4
with:
name: sdrpp_ubuntu_noble_amd64
path: ${{runner.workspace}}/sdrpp_debian_amd64.deb
build_raspios_bullseye_armhf:
runs-on: ARM
@ -395,7 +421,7 @@ jobs:
path: ${{runner.workspace}}/sdrpp.apk
create_full_archive:
needs: ['build_windows', 'build_macos_intel', 'build_macos_arm', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_bookworm', 'build_debian_sid', 'build_ubuntu_focal', 'build_ubuntu_jammy', 'build_ubuntu_mantic', 'build_raspios_bullseye_armhf', 'build_android']
needs: ['build_windows', 'build_macos_intel', 'build_macos_arm', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_bookworm', 'build_debian_sid', 'build_ubuntu_focal', 'build_ubuntu_jammy', 'build_ubuntu_mantic', 'build_ubuntu_noble', 'build_raspios_bullseye_armhf', 'build_android']
runs-on: ubuntu-latest
steps:
@ -415,6 +441,7 @@ jobs:
mv sdrpp_ubuntu_focal_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_focal_amd64.deb &&
mv sdrpp_ubuntu_jammy_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_jammy_amd64.deb &&
mv sdrpp_ubuntu_mantic_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_mantic_amd64.deb &&
mv sdrpp_ubuntu_noble_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_noble_amd64.deb &&
mv sdrpp_raspios_bullseye_armhf/sdrpp_debian_armhf.deb sdrpp_all/sdrpp_raspios_bullseye_armhf.deb &&
mv sdrpp_android/sdrpp.apk sdrpp_all/sdrpp.apk

View File

@ -12,6 +12,7 @@ option(OPT_OVERRIDE_STD_FILESYSTEM "Use a local version of std::filesystem on sy
option(OPT_BUILD_AIRSPY_SOURCE "Build Airspy Source Module (Dependencies: libairspy)" ON)
option(OPT_BUILD_AIRSPYHF_SOURCE "Build Airspy HF+ Source Module (Dependencies: libairspyhf)" ON)
option(OPT_BUILD_AUDIO_SOURCE "Build Audio Source Module (Dependencies: rtaudio)" ON)
option(OPT_BUILD_BADGESDR_SOURCE "Build BadgeSDR Source Module (Dependencies: libusb)" OFF)
option(OPT_BUILD_BLADERF_SOURCE "Build BladeRF Source Module (Dependencies: libbladeRF)" OFF)
option(OPT_BUILD_FILE_SOURCE "Wav file source" ON)
option(OPT_BUILD_HACKRF_SOURCE "Build HackRF Source Module (Dependencies: libhackrf)" ON)
@ -20,6 +21,7 @@ option(OPT_BUILD_LIMESDR_SOURCE "Build LimeSDR Source Module (Dependencies: libl
option(OPT_BUILD_NETWORK_SOURCE "Build Network Source Module (no dependencies required)" ON)
option(OPT_BUILD_PERSEUS_SOURCE "Build Perseus Source Module (Dependencies: libperseus-sdr)" OFF)
option(OPT_BUILD_PLUTOSDR_SOURCE "Build PlutoSDR Source Module (Dependencies: libiio, libad9361)" ON)
option(OPT_BUILD_RFNM_SOURCE "Build RFNM Source Module (Dependencies: librfnm)" OFF)
option(OPT_BUILD_RFSPACE_SOURCE "Build RFspace Source Module (no dependencies required)" ON)
option(OPT_BUILD_RTL_SDR_SOURCE "Build RTL-SDR Source Module (Dependencies: librtlsdr)" ON)
option(OPT_BUILD_RTL_TCP_SOURCE "Build RTL-TCP Source Module (no dependencies required)" ON)
@ -61,6 +63,7 @@ option(OPT_BUILD_SCHEDULER "Build the scheduler" OFF)
# Other options
option(USE_INTERNAL_LIBCORRECT "Use an internal version of libcorrect" ON)
option(USE_BUNDLE_DEFAULTS "Set the default resource and module directories to the right ones for a MacOS .app" OFF)
option(COPY_MSVC_REDISTRIBUTABLES "Copy over the Visual C++ Redistributable" OFF)
# Module cmake path
set(SDRPP_MODULE_CMAKE "${CMAKE_SOURCE_DIR}/sdrpp_module.cmake")
@ -125,6 +128,10 @@ if (OPT_BUILD_AUDIO_SOURCE)
add_subdirectory("source_modules/audio_source")
endif (OPT_BUILD_AUDIO_SOURCE)
if (OPT_BUILD_BADGESDR_SOURCE)
add_subdirectory("source_modules/badgesdr_source")
endif (OPT_BUILD_BADGESDR_SOURCE)
if (OPT_BUILD_BLADERF_SOURCE)
add_subdirectory("source_modules/bladerf_source")
endif (OPT_BUILD_BLADERF_SOURCE)
@ -157,6 +164,10 @@ if (OPT_BUILD_PLUTOSDR_SOURCE)
add_subdirectory("source_modules/plutosdr_source")
endif (OPT_BUILD_PLUTOSDR_SOURCE)
if (OPT_BUILD_RFNM_SOURCE)
add_subdirectory("source_modules/rfnm_source")
endif (OPT_BUILD_RFNM_SOURCE)
if (OPT_BUILD_RFSPACE_SOURCE)
add_subdirectory("source_modules/rfspace_source")
endif (OPT_BUILD_RFSPACE_SOURCE)
@ -289,6 +300,7 @@ endif (OPT_BUILD_SCHEDULER)
if (MSVC)
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
add_executable(min_broken "min_broken/main.cpp" "win32/resources.rc")
else ()
add_executable(sdrpp "src/main.cpp")
endif ()
@ -297,13 +309,28 @@ target_link_libraries(sdrpp PRIVATE sdrpp_core)
# Compiler arguments
target_compile_options(sdrpp PRIVATE ${SDRPP_COMPILER_FLAGS})
target_compile_options(min_broken PRIVATE ${SDRPP_COMPILER_FLAGS})
# Copy dynamic libs over
if (MSVC)
add_custom_target(do_always ALL xcopy /s \"$<TARGET_FILE_DIR:sdrpp_core>\\*.dll\" \"$<TARGET_FILE_DIR:sdrpp>\" /Y)
add_custom_target(do_always_volk ALL xcopy /s \"C:/Program Files/PothosSDR/bin\\volk.dll\" \"$<TARGET_FILE_DIR:sdrpp>\" /Y)
endif ()
if (COPY_MSVC_REDISTRIBUTABLES)
# Get the list of Visual C++ runtime DLLs
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP True)
include(InstallRequiredSystemLibraries)
# Create a space sperated list
set(REDIST_DLLS_STR "")
foreach(DLL IN LISTS CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
set(REDIST_DLLS_STR COMMAND xcopy /F \"${DLL}\" \"$<TARGET_FILE_DIR:sdrpp>\" /Y ${REDIST_DLLS_STR})
endforeach()
# Create target
add_custom_target(do_always_msvc ALL ${REDIST_DLLS_STR})
endif ()
endif ()
if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
add_custom_target(do_always ALL cp \"$<TARGET_FILE_DIR:sdrpp_core>/libsdrpp_core.so\" \"$<TARGET_FILE_DIR:sdrpp>\")

View File

@ -10,7 +10,7 @@ android {
minSdkVersion 28
targetSdkVersion 28
versionCode 1
versionName "1.1.0"
versionName "1.2.0"
externalNativeBuild {
cmake {

View File

@ -42,8 +42,10 @@ namespace sdrpp_credits {
"Ettus Research",
"Howard Su",
"MicroPhase",
"Microtelecom",
"MyriadRF",
"Nuand",
"RFNM",
"RFspace",
"RTL-SDRblog",
"SDRplay"

View File

@ -9,6 +9,7 @@
namespace dsp {
class generic_block {
public:
virtual ~generic_block() {}
virtual void start() {}
virtual void stop() {}
virtual int run() { return -1; }
@ -16,8 +17,6 @@ namespace dsp {
class block : public generic_block {
public:
virtual void init() {}
virtual ~block() {
if (!_block_init) { return; }
stop();

View File

@ -10,6 +10,8 @@ namespace dsp {
Operator(stream<A>* a, stream<B>* b) { init(a, b); }
virtual ~Operator() {}
virtual void init(stream<A>* a, stream<B>* b) {
_a = a;
_b = b;

View File

@ -11,6 +11,7 @@
namespace dsp {
class untyped_stream {
public:
virtual ~untyped_stream() {}
virtual bool swap(int size) { return false; }
virtual int read() { return -1; }
virtual void flush() {}

View File

@ -19,6 +19,7 @@ namespace displaymenu {
std::string colorMapAuthor = "";
int selectedWindow = 0;
int fftRate = 20;
int fftSizeId = 0;
int uiScaleId = 0;
bool restartRequired = false;
bool fftHold = false;
@ -28,34 +29,9 @@ namespace displaymenu {
bool snrSmoothing = false;
int snrSmoothingSpeed = 20;
OptionList<int, int> fftSizes;
OptionList<float, float> uiScales;
const int FFTSizes[] = {
524288,
262144,
131072,
65536,
32768,
16384,
8192,
4096,
2048,
1024
};
const char* FFTSizesStr = "524288\0"
"262144\0"
"131072\0"
"65536\0"
"32768\0"
"16384\0"
"8192\0"
"4096\0"
"2048\0"
"1024\0";
int fftSizeId = 0;
const IQFrontEnd::FFTWindow fftWindowList[] = {
IQFrontEnd::FFTWindow::RECTANGULAR,
IQFrontEnd::FFTWindow::BLACKMAN,
@ -69,6 +45,18 @@ namespace displaymenu {
}
void init() {
// Define FFT sizes
fftSizes.define(524288, "524288", 524288);
fftSizes.define(262144, "262144", 262144);
fftSizes.define(131072, "131072", 131072);
fftSizes.define(65536, "65536", 65536);
fftSizes.define(32768, "32768", 32768);
fftSizes.define(16384, "16384", 16384);
fftSizes.define(8192, "8192", 8192);
fftSizes.define(4096, "4096", 4096);
fftSizes.define(2048, "2048", 2048);
fftSizes.define(1024, "1024", 1024);
showWaterfall = core::configManager.conf["showWaterfall"];
showWaterfall ? gui::waterfall.showWaterfall() : gui::waterfall.hideWaterfall();
std::string colormapName = core::configManager.conf["colorMap"];
@ -90,15 +78,12 @@ namespace displaymenu {
fullWaterfallUpdate = core::configManager.conf["fullWaterfallUpdate"];
gui::waterfall.setFullWaterfallUpdate(fullWaterfallUpdate);
fftSizeId = 3;
int fftSize = core::configManager.conf["fftSize"];
for (int i = 0; i < 7; i++) {
if (fftSize == FFTSizes[i]) {
fftSizeId = i;
break;
fftSizeId = fftSizes.valueId(65536);
int size = core::configManager.conf["fftSize"];
if (fftSizes.keyExists(size)) {
fftSizeId = fftSizes.keyId(size);
}
}
sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]);
sigpath::iqFrontEnd.setFFTSize(fftSizes.value(fftSizeId));
fftRate = core::configManager.conf["fftRate"];
sigpath::iqFrontEnd.setFFTRate(fftRate);
@ -229,10 +214,10 @@ namespace displaymenu {
ImGui::LeftLabel("FFT Size");
ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX());
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, FFTSizesStr)) {
sigpath::iqFrontEnd.setFFTSize(FFTSizes[fftSizeId]);
if (ImGui::Combo("##sdrpp_fft_size", &fftSizeId, fftSizes.txt)) {
sigpath::iqFrontEnd.setFFTSize(fftSizes.value(fftSizeId));
core::configManager.acquire();
core::configManager.conf["fftSize"] = FFTSizes[fftSizeId];
core::configManager.conf["fftSize"] = fftSizes.key(fftSizeId);
core::configManager.release(true);
}

View File

@ -52,4 +52,15 @@ namespace ImGui {
bufferMtx.unlock();
}
void SymbolDiagram::setCount(int count) {
std::lock_guard<std::mutex> lck(bufferMtx);
delete[] buffer;
buffer = new float[count];
sampleCount = count;
memset(buffer, 0, sampleCount * sizeof(float));
}
int SymbolDiagram::getCount() {
return sampleCount;
}
}

View File

@ -18,6 +18,10 @@ namespace ImGui {
void releaseBuffer();
void setCount(int count);
int getCount();
std::vector<float> lines;
private:

View File

@ -110,7 +110,7 @@ namespace ImGui {
viewBandwidth = 1.0;
wholeBandwidth = 1.0;
updatePallette(DEFAULT_COLOR_MAP, 13);
//updatePallette(DEFAULT_COLOR_MAP, 13);
}
void WaterFall::init() {

View File

@ -42,6 +42,7 @@ public:
class Instance {
public:
virtual ~Instance() {}
virtual void postInit() = 0;
virtual void enable() = 0;
virtual void disable() = 0;

View File

@ -1,3 +1,3 @@
#pragma once
#define VERSION_STR "1.1.0"
#define VERSION_STR "1.2.0"

View File

@ -8,15 +8,15 @@
#include "dsp.h"
#include "pocsag.h"
#define BAUDRATE 2400
#define SAMPLERATE (BAUDRATE*10)
class POCSAGDecoder : public Decoder {
public:
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, BAUDRATE) {
POCSAGDecoder(const std::string& name, VFOManager::VFO* vfo) : diag(0.6, 2400) {
this->name = name;
this->vfo = vfo;
// Default baudrate (TODO: Load from config)
baudrate = 2400;
// Define baudrate options
baudrates.define(512, "512 Baud", 512);
baudrates.define(1200, "1200 Baud", 1200);
@ -24,9 +24,9 @@ public:
// Init DSP
vfo->setBandwidthLimits(12500, 12500, true);
vfo->setSampleRate(SAMPLERATE, 12500);
dsp.init(vfo->output, SAMPLERATE, BAUDRATE);
reshape.init(&dsp.soft, BAUDRATE, (BAUDRATE / 30.0) - BAUDRATE);
vfo->setSampleRate(baudrate*10.0, 12500);
dsp.init(vfo->output, baudrate*10.0, baudrate);
reshape.init(&dsp.soft, baudrate, (baudrate / 30.0) - baudrate);
dataHandler.init(&dsp.out, _dataHandler, this);
diagHandler.init(&reshape.out, _diagHandler, this);
@ -42,7 +42,7 @@ public:
ImGui::LeftLabel("Baudrate");
ImGui::FillWidth();
if (ImGui::Combo(("##pager_decoder_pocsag_br_" + name).c_str(), &brId, baudrates.txt)) {
// TODO
setBaudrate(baudrates.value(brId));
}
ImGui::FillWidth();
@ -79,7 +79,8 @@ private:
static void _diagHandler(float* data, int count, void* ctx) {
POCSAGDecoder* _this = (POCSAGDecoder*)ctx;
float* buf = _this->diag.acquireBuffer();
memcpy(buf, data, count * sizeof(float));
int maxCount = std::min<int>(count, _this->diag.getCount());
memcpy(buf, data, maxCount * sizeof(float));
_this->diag.releaseBuffer();
}
@ -87,6 +88,15 @@ private:
flog::debug("[{}]: '{}'", (uint32_t)addr, msg);
}
void setBaudrate(double baudrate) {
vfo->setSampleRate(baudrate*10.0, 12500);
stop();
reshape.setKeep(baudrate);
reshape.setSkip((baudrate / 30.0) - baudrate);
diag.setCount(baudrate);
start();
}
std::string name;
VFOManager::VFO* vfo;
@ -100,6 +110,7 @@ private:
ImGui::SymbolDiagram diag;
int brId = 2;
double baudrate = 2400;
OptionList<int, int> baudrates;
};

View File

@ -597,14 +597,16 @@ private:
static void moduleInterfaceHandler(int code, void* in, void* out, void* ctx) {
RadioModule* _this = (RadioModule*)ctx;
if (!_this->enabled || !_this->selectedDemod) { return; }
// If no demod is selected, reject the command
if (!_this->selectedDemod) { return; }
// Execute commands
if (code == RADIO_IFACE_CMD_GET_MODE && out) {
int* _out = (int*)out;
*_out = _this->selectedDemodID;
}
else if (code == RADIO_IFACE_CMD_SET_MODE && in) {
else if (code == RADIO_IFACE_CMD_SET_MODE && in && _this->enabled) {
int* _in = (int*)in;
_this->selectDemodByID((DemodID)*_in);
}
@ -612,7 +614,7 @@ private:
float* _out = (float*)out;
*_out = _this->bandwidth;
}
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in) {
else if (code == RADIO_IFACE_CMD_SET_BANDWIDTH && in && _this->enabled) {
float* _in = (float*)in;
if (_this->bandwidthLocked) { return; }
_this->setBandwidth(*_in);
@ -621,7 +623,7 @@ private:
bool* _out = (bool*)out;
*_out = _this->squelchEnabled;
}
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in) {
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_ENABLED && in && _this->enabled) {
bool* _in = (bool*)in;
_this->setSquelchEnabled(*_in);
}
@ -629,7 +631,7 @@ private:
float* _out = (float*)out;
*_out = _this->squelchLevel;
}
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in) {
else if (code == RADIO_IFACE_CMD_SET_SQUELCH_LEVEL && in && _this->enabled) {
float* _in = (float*)in;
_this->setSquelchLevel(*_in);
}

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk2-dev
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk2-dev
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk1-dev
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk-dev l
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus

View File

@ -15,10 +15,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk1-dev
libcodec2-dev libudev-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install a more recent libusb version
@ -71,4 +71,4 @@ make VERBOSE=1 -j2
# Generate package
cd ..
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk1-dev, librtaudio-dev, libzstd-dev'
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk1-bin, librtaudio6, libzstd1'

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk2-dev
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make VERBOSE=1 -j2
cd ..
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk2-dev, librtaudio-dev, libzstd-dev'
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk2-bin, librtaudio6, libzstd1'

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk2-dev
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make VERBOSE=1 -j2
cd ..
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk2-dev, librtaudio-dev, libzstd-dev'
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk2-bin, librtaudio6, libzstd1'

View File

@ -9,10 +9,10 @@ apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk-dev l
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0.run
7z x ./SDRplay_RSP_API-Linux-3.14.0
cp x86_64/libsdrplay_api.so.3.14 /usr/lib/libsdrplay_api.so
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus
@ -32,4 +32,4 @@ cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD
make VERBOSE=1 -j2
cd ..
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libvolk-dev, librtaudio-dev, libzstd-dev'
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk-bin, librtaudio6, libzstd1'

View File

@ -0,0 +1,4 @@
FROM ubuntu:noble
ENV DEBIAN_FRONTEND=noninteractive
COPY do_build.sh /root
RUN chmod +x /root/do_build.sh

View File

@ -0,0 +1,35 @@
#!/bin/bash
set -e
cd /root
# Install dependencies and tools
apt update
apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libvolk-dev libzstd-dev libairspyhf-dev libairspy-dev \
libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget portaudio19-dev \
libcodec2-dev autoconf libtool xxd
# Install SDRPlay libraries
wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1.run
7z x ./SDRplay_RSP_API-Linux-3.15.1
cp x86_64/libsdrplay_api.so.3.15 /usr/lib/libsdrplay_api.so
cp inc/* /usr/include/
# Install libperseus
git clone https://github.com/Microtelecom/libperseus-sdr
cd libperseus-sdr
autoreconf -i
./configure
make
make install
ldconfig
cd ..
cd SDRPlusPlus
mkdir build
cd build
cmake .. -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_SDRPLAY_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON -DOPT_BUILD_PERSEUS_SOURCE=ON
make VERBOSE=1 -j2
cd ..
sh make_debian_package.sh ./build 'libfftw3-bin, libglfw3, libvolk-bin, librtaudio6, libzstd1'

View File

@ -8,7 +8,7 @@ mkdir sdrpp_debian_amd64/DEBIAN
# Create package info
echo Create package info
echo Package: sdrpp >> sdrpp_debian_amd64/DEBIAN/control
echo Version: 1.1.0$BUILD_NO >> sdrpp_debian_amd64/DEBIAN/control
echo Version: 1.2.0$BUILD_NO >> sdrpp_debian_amd64/DEBIAN/control
echo Maintainer: Ryzerth >> sdrpp_debian_amd64/DEBIAN/control
echo Architecture: all >> sdrpp_debian_amd64/DEBIAN/control
echo Description: Bloat-free SDR receiver software >> sdrpp_debian_amd64/DEBIAN/control

View File

@ -22,7 +22,7 @@ cp -R root/res/* $BUNDLE/Contents/Resources/
bundle_create_icns root/res/icons/sdrpp.macos.png $BUNDLE/Contents/Resources/sdrpp
# Create the property list
bundle_create_plist sdrpp SDR++ org.sdrpp.sdrpp 1.1.0 sdrp sdrpp sdrpp $BUNDLE/Contents/Info.plist
bundle_create_plist sdrpp SDR++ org.sdrpp.sdrpp 1.2.0 sdrp sdrpp sdrpp $BUNDLE/Contents/Info.plist
# ========================= Install binaries =========================

View File

@ -7,85 +7,86 @@ mkdir sdrpp_windows_x64
cp -Recurse $root_dir/* sdrpp_windows_x64/
# Copy core
cp $build_dir/Release/* sdrpp_windows_x64/
cp $build_dir/Debug/* sdrpp_windows_x64/
cp $build_dir/core/Debug/sdrpp_core.pdb sdrpp_windows_x64/
cp 'C:/Program Files/PothosSDR/bin/volk.dll' sdrpp_windows_x64/
# Copy source modules
cp $build_dir/source_modules/airspy_source/Release/airspy_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/airspy_source/Debug/airspy_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/airspy.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/airspyhf_source/Release/airspyhf_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/airspyhf_source/Debug/airspyhf_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/airspyhf.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/audio_source/Release/audio_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/audio_source/Debug/audio_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/bladerf_source/Release/bladerf_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/bladerf_source/Debug/bladerf_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/bladeRF.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/file_source/Release/file_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/file_source/Debug/file_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/hackrf_source/Release/hackrf_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/hackrf_source/Debug/hackrf_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/hackrf.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/hermes_source/Release/hermes_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/hermes_source/Debug/hermes_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/limesdr_source/Release/limesdr_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/limesdr_source/Debug/limesdr_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/LimeSuite.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/perseus_source/Release/perseus_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/perseus_source/Debug/perseus_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/perseus-sdr.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/plutosdr_source/Release/plutosdr_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/plutosdr_source/Debug/plutosdr_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/libiio.dll' sdrpp_windows_x64/
cp 'C:/Program Files/PothosSDR/bin/libad9361.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/rfspace_source/Release/rfspace_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/rfspace_source/Debug/rfspace_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/rtl_sdr_source/Release/rtl_sdr_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/rtl_sdr_source/Debug/rtl_sdr_source.dll sdrpp_windows_x64/modules/
cp 'C:/Program Files/PothosSDR/bin/rtlsdr.dll' sdrpp_windows_x64/
cp $build_dir/source_modules/rtl_tcp_source/Release/rtl_tcp_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/rtl_tcp_source/Debug/rtl_tcp_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/sdrplay_source/Release/sdrplay_source.dll sdrpp_windows_x64/modules/ -ErrorAction SilentlyContinue
cp $build_dir/source_modules/sdrplay_source/Debug/sdrplay_source.dll sdrpp_windows_x64/modules/ -ErrorAction SilentlyContinue
cp 'C:/Program Files/SDRplay/API/x64/sdrplay_api.dll' sdrpp_windows_x64/ -ErrorAction SilentlyContinue
cp $build_dir/source_modules/sdrpp_server_source/Release/sdrpp_server_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/sdrpp_server_source/Debug/sdrpp_server_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/spyserver_source/Release/spyserver_source.dll sdrpp_windows_x64/modules/
cp $build_dir/source_modules/spyserver_source/Debug/spyserver_source.dll sdrpp_windows_x64/modules/
# cp $build_dir/source_modules/usrp_source/Release/usrp_source.dll sdrpp_windows_x64/modules/
# cp $build_dir/source_modules/usrp_source/Debug/usrp_source.dll sdrpp_windows_x64/modules/
# Copy sink modules
cp $build_dir/sink_modules/audio_sink/Release/audio_sink.dll sdrpp_windows_x64/modules/
cp $build_dir/sink_modules/audio_sink/Debug/audio_sink.dll sdrpp_windows_x64/modules/
cp "C:/Program Files (x86)/RtAudio/bin/rtaudio.dll" sdrpp_windows_x64/
cp $build_dir/sink_modules/network_sink/Release/network_sink.dll sdrpp_windows_x64/modules/
cp $build_dir/sink_modules/network_sink/Debug/network_sink.dll sdrpp_windows_x64/modules/
# Copy decoder modules
cp $build_dir/decoder_modules/m17_decoder/Release/m17_decoder.dll sdrpp_windows_x64/modules/
cp $build_dir/decoder_modules/m17_decoder/Debug/m17_decoder.dll sdrpp_windows_x64/modules/
cp "C:/Program Files/codec2/lib/libcodec2.dll" sdrpp_windows_x64/
cp $build_dir/decoder_modules/meteor_demodulator/Release/meteor_demodulator.dll sdrpp_windows_x64/modules/
cp $build_dir/decoder_modules/meteor_demodulator/Debug/meteor_demodulator.dll sdrpp_windows_x64/modules/
cp $build_dir/decoder_modules/radio/Release/radio.dll sdrpp_windows_x64/modules/
cp $build_dir/decoder_modules/radio/Debug/radio.dll sdrpp_windows_x64/modules/
# Copy misc modules
cp $build_dir/misc_modules/discord_integration/Release/discord_integration.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/discord_integration/Debug/discord_integration.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/frequency_manager/Release/frequency_manager.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/frequency_manager/Debug/frequency_manager.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/iq_exporter/Release/iq_exporter.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/iq_exporter/Debug/iq_exporter.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/recorder/Release/recorder.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/recorder/Debug/recorder.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/rigctl_client/Release/rigctl_client.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/rigctl_client/Debug/rigctl_client.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/rigctl_server/Release/rigctl_server.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/rigctl_server/Debug/rigctl_server.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/scanner/Release/scanner.dll sdrpp_windows_x64/modules/
cp $build_dir/misc_modules/scanner/Debug/scanner.dll sdrpp_windows_x64/modules/
# Copy supporting libs

12
min_broken/main.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <mutex>
std::recursive_mutex mtx;
int main() {
std::lock_guard<std::recursive_mutex> lck(mtx);
printf("Works just fine!\n");
return 0;
}

View File

@ -476,9 +476,9 @@ private:
sprintf(monStr, "%02d", ltm->tm_mon + 1);
sprintf(yearStr, "%02d", ltm->tm_year + 1900);
if (core::modComManager.getModuleName(name) == "radio") {
int mode;
int mode = -1;
core::modComManager.callInterface(name, RADIO_IFACE_CMD_GET_MODE, NULL, &mode);
modeStr = radioModeToString[mode];
if (mode >= 0) { modeStr = radioModeToString[mode]; };
}
// Replace in template

View File

@ -331,6 +331,7 @@ Modules in beta are still included in releases for the most part but not enabled
| network_source | Unfinished | - | OPT_BUILD_NETWORK_SOURCE | ✅ | ✅ | ⛔ |
| perseus_source | Beta | libperseus-sdr | OPT_BUILD_PERSEUS_SOURCE | ⛔ | ✅ | ✅ |
| plutosdr_source | Working | libiio, libad9361 | OPT_BUILD_PLUTOSDR_SOURCE | ✅ | ✅ | ✅ |
| rfnm_source | Beta | librfnm | OPT_BUILD_RFNM_SOURCE | ⛔ | ⛔ | ⛔ |
| rfspace_source | Working | - | OPT_BUILD_RFSPACE_SOURCE | ✅ | ✅ | ✅ |
| rtl_sdr_source | Working | librtlsdr | OPT_BUILD_RTL_SDR_SOURCE | ✅ | ✅ | ✅ |
| rtl_tcp_source | Working | - | OPT_BUILD_RTL_TCP_SOURCE | ✅ | ✅ | ✅ |

View File

@ -0,0 +1,645 @@
{
"name": "Brazilian Ham Bands",
"country_name": "Brazil",
"country_code": "BR",
"author_name": "Rafael Beraldo",
"author_url": "https://github.com/rberaldo/",
"bands": [
{
"start": 135700,
"end": 137800,
"type": "amateur",
"name": "2200m Ham Band CW, Digital"
},
{
"start": 472000,
"end": 479000,
"type": "amateur",
"name": "635m Ham Band CW, Digital"
},
{
"start": 1800000,
"end": 1810000,
"type": "amateur",
"name": "|160m Ham Band CW, Digital"
},
{
"start": 1810000,
"end": 1839000,
"type": "amateur1",
"name": "CW"
},
{
"start": 1839000,
"end": 1840000,
"type": "amateur",
"name": "CW, Digital"
},
{
"start": 1840000,
"end": 1843000,
"type": "amateur1",
"name": "CW, SSB, Digital"
},
{
"start": 1843000,
"end": 1850000,
"type": "amateur",
"name": "CW, SSB"
},
{
"start": 1850000,
"end": 2000000,
"type": "amateur1",
"name": "CW, SSB, AM, DV, Digital 160 Ham Band|"
},
{
"start": 3500000,
"end": 3570000,
"type": "amateur",
"name": "|80m Ham Band CW"
},
{
"start": 3570000,
"end": 3590000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 3590000,
"end": 3600000,
"type": "amateur",
"name": "CW, SSD, AM, Digital"
},
{
"start": 3600000,
"end": 3775000,
"type": "amateur1",
"name": "CW, SSD, AM, DV, Digital"
},
{
"start": 3775000,
"end": 3875000,
"type": "amateur",
"name": "CW, SSD, DV, Digital"
},
{
"start": 3775000,
"end": 3875000,
"type": "amateur1",
"name": "CW, SSD, DV, Digital"
},
{
"start": 3875000,
"end": 4000000,
"type": "amateur",
"name": "CW, SSD, AM, DV, Digital, 80m Ham Band|"
},
{
"start": 5351500,
"end": 5354000,
"type": "amateur",
"name": "|60m Ham Band CW, Digital"
},
{
"start": 5354000,
"end": 5366000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital"
},
{
"start": 5366000,
"end": 5366500,
"type": "amateur",
"name": "CW, Digital 60m Ham Band|"
},
{
"start": 7000000,
"end": 7040000,
"type": "amateur",
"name": "|40m Ham Band CW"
},
{
"start": 7040000,
"end": 7047000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 7047000,
"end": 7050000,
"type": "amateur",
"name": "CW, SSB, Digital"
},
{
"start": 7050000,
"end": 7100000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital"
},
{
"start": 7100000,
"end": 7300000,
"type": "amateur",
"name": "CW, SSB, AM, DV, Digital 40m Ham Band|"
},
{
"start": 10100000,
"end": 10130000,
"type": "amateur",
"name": "|30m Ham Band"
},
{
"start": 10130000,
"end": 10150000,
"type": "amateur1",
"name": "CW, Digital 30m Ham Band|"
},
{
"start": 14000000,
"end": 14070000,
"type": "amateur",
"name": "|20m Ham Band CW"
},
{
"start": 14070000,
"end": 14099000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 14099000,
"end": 14101000,
"type": "amateur",
"name": "CW IBP"
},
{
"start": 14101000,
"end": 14282000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital"
},
{
"start": 14285000,
"end": 14350000,
"type": "amateur",
"name": "CW, SSB, AM, DV, Digital 20m Ham Band|"
},
{
"start": 18068000,
"end": 18095000,
"type": "amateur",
"name": "|17m Ham Band CW"
},
{
"start": 18095000,
"end": 18109000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 18109000,
"end": 18111000,
"type": "amateur",
"name": "CW IBP"
},
{
"start": 18111000,
"end": 18168000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital 17m Ham Band|"
},
{
"start": 21000000,
"end": 21070000,
"type": "amateur",
"name": "|15m Ham Band CW"
},
{
"start": 21070000,
"end": 21149000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 21149000,
"end": 21151000,
"type": "amateur",
"name": "CW, IBP"
},
{
"start": 21151000,
"end": 21380000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital"
},
{
"start": 21380000,
"end": 21450000,
"type": "amateur",
"name": "CW, SSB, AM, DV, Digital 15m Ham Band|"
},
{
"start": 24890000,
"end": 24915000,
"type": "amateur",
"name": "|12m Ham Band CW"
},
{
"start": 24915000,
"end": 24929000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 24929000,
"end": 24931000,
"type": "amateur",
"name": "CW IBP"
},
{
"start": 24931000,
"end": 24990000,
"type": "amateur1",
"name": "CW, SSB, DV, Digital 12m Ham Band|"
},
{
"start": 28000000,
"end": 28070000,
"type": "amateur",
"name": "|10m Ham Band CW"
},
{
"start": 28070000,
"end": 28190000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 28190000,
"end": 28199000,
"type": "amateur",
"name": "CW - Pilot Emissions"
},
{
"start": 28199000,
"end": 28201000,
"type": "amateur1",
"name": "CW IBP"
},
{
"start": 28201000,
"end": 28225000,
"type": "amateur",
"name": "CW - Pilot Emissions"
},
{
"start": 28225000,
"end": 28300000,
"type": "amateur1",
"name": "CW, Digital - Pilot Emissions"
},
{
"start": 28300000,
"end": 29000000,
"type": "amateur",
"name": "CW, SSB, DV, Digital"
},
{
"start": 29000000,
"end": 29300000,
"type": "amateur1",
"name": "All Modes"
},
{
"start": 29300000,
"end": 29510000,
"type": "amateur",
"name": "All Modes - Satellites"
},
{
"start": 29510000,
"end": 29520000,
"type": "amateur1",
"name": "All Modes"
},
{
"start": 29520000,
"end": 29590000,
"type": "amateur",
"name": "FM, DV - Repeater input"
},
{
"start": 29590000,
"end": 29620000,
"type": "amateur1",
"name": "CW, FM, DV - FM calling freq: 29.600 kHz"
},
{
"start": 29620000,
"end": 29700000,
"type": "amateur",
"name": "FM, DV - Repeater output 10m Ham Band|"
},
{
"start": 50000000,
"end": 54000000,
"type": "amateur",
"name": "6m Ham Band"
},
{
"start": 144000000,
"end": 144025000,
"type": "amateur",
"name": "|2m Ham Band All Modes - Satellites"
},
{
"start": 144025000,
"end": 144110000,
"type": "amateur1",
"name": "CW - EME"
},
{
"start": 144110000,
"end": 144150000,
"type": "amateur",
"name": "CW, Digital - EME"
},
{
"start": 144150000,
"end": 144180000,
"type": "amateur1",
"name": "CW, SSB, Digital"
},
{
"start": 144180000,
"end": 144275000,
"type": "amateur",
"name": "CW, SSB - Calling freq: 144.2 MHz"
},
{
"start": 144275000,
"end": 144300000,
"type": "amateur1",
"name": "CW - Pilot Emissions"
},
{
"start": 144300000,
"end": 144360000,
"type": "amateur",
"name": "CW, SSB - Calling freq: 144.2 MHz"
},
{
"start": 144360000,
"end": 144400000,
"type": "amateur1",
"name": "CW, SSB, Digital"
},
{
"start": 144400000,
"end": 144600000,
"type": "amateur",
"name": "All Modes"
},
{
"start": 144600000,
"end": 144900000,
"type": "amateur1",
"name": "FM, DV - Repeater input"
},
{
"start": 144900000,
"end": 145000000,
"type": "amateur",
"name": "CW, FM, DV, Digital"
},
{
"start": 145000000,
"end": 145200000,
"type": "amateur1",
"name": "All Modes, IVG"
},
{
"start": 145200000,
"end": 145500000,
"type": "amateur",
"name": "FM, DV - Repeater output"
},
{
"start": 145500000,
"end": 145565000,
"type": "amateur1",
"name": "All Modes"
},
{
"start": 145565000,
"end": 145575000,
"type": "amateur",
"name": "APRS"
},
{
"start": 145575000,
"end": 145790000,
"type": "amateur1",
"name": "All Modes"
},
{
"start": 145790000,
"end": 145800000,
"type": "amateur",
"name": "Guard Band"
},
{
"start": 145800000,
"end": 146000000,
"type": "amateur1",
"name": "All Modes - Satellites"
},
{
"start": 146000000,
"end": 146390000,
"type": "amateur",
"name": "FM, DV - Repeater input"
},
{
"start": 146390000,
"end": 146600000,
"type": "amateur1",
"name": "CW, FM, DV - Calling freq: 146.52 MHz"
},
{
"start": 146600000,
"end": 146990000,
"type": "amateur",
"name": "FM, DV - Repeater output"
},
{
"start": 146990000,
"end": 147400000,
"type": "amateur1",
"name": "FM, DV - Repeater input"
},
{
"start": 147400000,
"end": 147590000,
"type": "amateur",
"name": "CW, FM, DV"
},
{
"start": 147590000,
"end": 148000000,
"type": "amateur1",
"name": "FM, DV - Repeater output 2m Ham Band|"
},
{
"start": 220000000,
"end": 225000000,
"type": "amateur",
"name": "1.3m Ham Band"
},
{
"start": 430000000,
"end": 432000000,
"type": "amateur",
"name": "|70cm Ham Band All Modes"
},
{
"start": 432000000,
"end": 432025000,
"type": "amateur1",
"name": "CW - EME"
},
{
"start": 432025000,
"end": 432100000,
"type": "amateur",
"name": "CW, Digital - EME"
},
{
"start": 432100000,
"end": 432300000,
"type": "amateur1",
"name": "CW, SSB - Calling freq: 432.1 MHz"
},
{
"start": 432300000,
"end": 432400000,
"type": "amateur",
"name": "CW - Pilot Emissions"
},
{
"start": 432400000,
"end": 432420000,
"type": "amateur1",
"name": "CW, Digital - Pilot Emissions"
},
{
"start": 432420000,
"end": 433000000,
"type": "amateur",
"name": "CW, SSB, Digital"
},
{
"start": 433000000,
"end": 433050000,
"type": "amateur1",
"name": "CW, Digital"
},
{
"start": 433050000,
"end": 434000000,
"type": "amateur",
"name": "All Modes"
},
{
"start": 434000000,
"end": 435000000,
"type": "amateur1",
"name": "Fm, DV - Repeater input"
},
{
"start": 435000000,
"end": 438000000,
"type": "amateur",
"name": "All Modes - Satellites"
},
{
"start": 438000000,
"end": 439000000,
"type": "amateur1",
"name": "All Modes"
},
{
"start": 439000000,
"end": 440000000,
"type": "amateur",
"name": "FM, DV - Repeater output 70cm Ham Band|"
},
{
"start": 902000000,
"end": 928000000,
"type": "amateur",
"name": "33cm Ham Band"
},
{
"start": 1240000000,
"end": 1300000000,
"type": "amateur",
"name": "23cm Ham Band"
},
{
"start": 2330000000,
"end": 2450000000,
"type": "amateur",
"name": "13cm Ham Band"
},
{
"start": 3400000000,
"end": 3500000000,
"type": "amateur",
"name": "9cm Ham Band"
},
{
"start": 5650000000,
"end": 5925000000,
"type": "amateur",
"name": "5cm Ham Band"
},
{
"start": 10000000000,
"end": 10500000000,
"type": "amateur",
"name": "3cm Ham Band"
},
{
"start": 24000000000,
"end": 24250000000,
"type": "amateur",
"name": "1.2cm Ham Band"
},
{
"start": 47000000000,
"end": 47200000000,
"type": "amateur",
"name": "6mm Ham Band"
},
{
"start": 122250000000,
"end": 123000000000,
"type": "amateur",
"name": "2.5mm Ham Band"
},
{
"start": 134000000000,
"end": 141000000000,
"type": "amateur",
"name": "2mm Ham Band"
},
{
"start": 241000000000,
"end": 250000000000,
"type": "amateur",
"name": "1mm Ham Band"
}
]
}

View File

@ -152,7 +152,6 @@ public:
// Update samplerate from ID
sampleRate = sampleRates[srId];
core::setInputSampleRate(sampleRate);
}
private:
@ -232,6 +231,7 @@ private:
if (SmGui::Combo(CONCAT("##_audio_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
std::string dev = _this->devices.key(_this->devId);
_this->select(dev);
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["device"] = dev;
config.release(true);
@ -253,6 +253,7 @@ private:
if (SmGui::Button(CONCAT("Refresh##_audio_refr_", _this->name))) {
_this->refresh();
_this->select(_this->selectedDevice);
core::setInputSampleRate(_this->sampleRate);
}
if (_this->running) { SmGui::EndDisabled(); }

View File

@ -304,6 +304,7 @@ private:
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##_hackrf_dev_sel_", _this->name), &_this->devId, _this->devListTxt.c_str())) {
_this->selectBySerial(_this->devList[_this->devId]);
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["device"] = _this->selectedSerial;
config.release(true);

View File

@ -118,7 +118,6 @@ private:
// Update host samplerate
sampleRate = samplerates.key(srId);
core::setInputSampleRate(sampleRate);
}
static void menuSelected(void* ctx) {
@ -199,6 +198,7 @@ private:
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##_hermes_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
_this->selectMac(_this->devices.key(_this->devId));
core::setInputSampleRate(_this->sampleRate);
if (!_this->selectedMac.empty()) {
config.acquire();
config.conf["device"] = _this->devices.key(_this->devId);
@ -225,6 +225,7 @@ private:
std::string mac = config.conf["device"];
config.release();
_this->selectMac(mac);
core::setInputSampleRate(_this->sampleRate);
}
if (_this->running) { SmGui::EndDisabled(); }

View File

@ -210,7 +210,6 @@ public:
// Update samplerate
sampleRate = srList[srId];
core::setInputSampleRate(sampleRate);
// Close device
perseus_close(dev);
@ -329,6 +328,7 @@ private:
if (SmGui::Combo(CONCAT("##_airspyhf_dev_sel_", _this->name), &_this->devId, _this->devList.txt)) {
std::string serial = _this->devList.key(_this->devId);
_this->select(serial);
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["device"] = serial;
config.release(true);

View File

@ -244,9 +244,6 @@ private:
bwId = 0;
bandwidth = bandwidths.value(bwId);
}
// Update core samplerate
core::setInputSampleRate(samplerate);
}
static void menuSelected(void* ctx) {
@ -351,6 +348,7 @@ private:
SmGui::ForceSync();
if (SmGui::Combo("##plutosdr_dev_sel", &_this->devId, _this->devices.txt)) {
_this->select(_this->devices.key(_this->devId));
core::setInputSampleRate(_this->samplerate);
config.acquire();
config.conf["device"] = _this->devices.key(_this->devId);
config.release(true);
@ -373,7 +371,7 @@ private:
if (SmGui::Button(CONCAT("Refresh##_pluto_refr_", _this->name))) {
_this->refresh();
_this->select(_this->devDesc);
core::setInputSampleRate(_this->samplerate);
}
if (_this->running) { SmGui::EndDisabled(); }

View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.13)
project(rfnm_source)
file(GLOB SRC "src/*.cpp")
include(${SDRPP_MODULE_CMAKE})
target_include_directories(rfnm_source PRIVATE "C:/Users/ryzerth/Documents/Code/librfnm/include/librfnm")
target_link_directories(rfnm_source PRIVATE "C:/Users/ryzerth/Documents/Code/librfnm/build/Release")
target_link_libraries(rfnm_source PRIVATE librfnm)

View File

@ -0,0 +1,362 @@
#include <imgui.h>
#include <module.h>
#include <gui/gui.h>
#include <gui/smgui.h>
#include <signal_path/signal_path.h>
#include <librfnm.h>
#include <core.h>
#include <utils/optionlist.h>
SDRPP_MOD_INFO{
/* Name: */ "rfnm_source",
/* Description: */ "RFNM Source Module",
/* Author: */ "Ryzerth",
/* Version: */ 0, 1, 0,
/* Max instances */ -1
};
#define CONCAT(a, b) ((std::string(a) + b).c_str())
class RFNMSourceModule : public ModuleManager::Instance {
public:
RFNMSourceModule(std::string name) {
this->name = name;
sampleRate = 61440000.0;
handler.ctx = this;
handler.selectHandler = menuSelected;
handler.deselectHandler = menuDeselected;
handler.menuHandler = menuHandler;
handler.startHandler = start;
handler.stopHandler = stop;
handler.tuneHandler = tune;
handler.stream = &stream;
// Refresh devices
refresh();
// Select first (TODO: Select from config)
select("");
sigpath::sourceManager.registerSource("RFNM", &handler);
}
~RFNMSourceModule() {
}
void postInit() {}
void enable() {
enabled = true;
}
void disable() {
enabled = false;
}
bool isEnabled() {
return enabled;
}
private:
void refresh() {
#ifndef __ANDROID__
devices.clear();
auto list = librfnm::find(librfnm_transport::LIBRFNM_TRANSPORT_USB);
for (const auto& info : list) {
// Format device name
std::string devName = "RFNM ";
devName += info.motherboard.user_readable_name;
devName += " [";
devName += (char*)info.motherboard.serial_number;
devName += ']';
// Save device
devices.define((char*)info.motherboard.serial_number, devName, (char*)info.motherboard.serial_number);
}
#else
// Check for device presence
int vid, pid;
devFd = backend::getDeviceFD(vid, pid, backend::RFNM_VIDPIDS);
if (devFd < 0) { return; }
// Get device info
std::string fakeName = "RFNM USB";
devices.define(fakeName, fakeName, fakeName);
#endif
}
void select(const std::string& serial) {
// If there are no devices, give up
if (devices.empty()) {
selectedSerial.clear();
return;
}
// If the serial was not found, select the first available serial
if (!devices.keyExists(serial)) {
select(devices.key(0));
return;
}
// // Open the device
// librfnm* dev = new librfnm(librfnm_transport::LIBRFNM_TRANSPORT_USB, serial);
// Define bandwidths
bandwidths.clear();
bandwidths.define(-1, "Auto", -1);
for (int i = 1; i <= 100; i++) {
char buf[128];
sprintf(buf, "%d MHz", i);
bandwidths.define(i, buf, i);
}
// Get gain range
gainMin = -30;//dev->librfnm_s->rx.ch[0].gain_range.min;
gainMax = 60;//dev->librfnm_s->rx.ch[0].gain_range.max;
// // Close device
// delete dev;
// Define samplerates
samplerates.clear();
samplerates.define(61440000, "61.44 MHz", 2);
samplerates.define(122880000, "122.88 MHz", 1);
// TODO: Load options
srId = samplerates.keyId(61440000);
bwId = bandwidths.nameId("Auto");
gain = 0;
// Update samplerate
sampleRate = samplerates.key(srId);
// Save serial number
selectedSerial = serial;
}
static void menuSelected(void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
core::setInputSampleRate(_this->sampleRate);
flog::info("RFNMSourceModule '{0}': Menu Select!", _this->name);
}
static void menuDeselected(void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
flog::info("RFNMSourceModule '{0}': Menu Deselect!", _this->name);
}
static void start(void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
if (_this->running) { return; }
// Open the device
#ifndef __ANDROID__
_this->openDev = new librfnm(librfnm_transport::LIBRFNM_TRANSPORT_USB, _this->selectedSerial);
#else
_this->openDev = new librfnm(_this->devFd);
#endif
// Configure the device
_this->openDev->librfnm_s->rx.ch[0].enable = RFNM_CH_ON;
_this->openDev->librfnm_s->rx.ch[0].samp_freq_div_n = _this->samplerates[_this->srId];
_this->openDev->librfnm_s->rx.ch[0].freq = _this->freq;
_this->openDev->librfnm_s->rx.ch[0].gain = _this->gain;
_this->openDev->librfnm_s->rx.ch[0].rfic_lpf_bw = 100;
_this->openDev->librfnm_s->rx.ch[0].fm_notch = _this->fmNotch ? rfnm_fm_notch::RFNM_FM_NOTCH_ON : rfnm_fm_notch::RFNM_FM_NOTCH_OFF;
_this->openDev->librfnm_s->rx.ch[0].path = _this->openDev->librfnm_s->rx.ch[0].path_preferred;
rfnm_api_failcode fail = _this->openDev->set(LIBRFNM_APPLY_CH0_RX);
if (fail != rfnm_api_failcode::RFNM_API_OK) {
flog::error("Failed to configure device: {}", (int)fail);
}
// Configure the stream
_this->bufferSize = -1;
_this->openDev->rx_stream(librfnm_stream_format::LIBRFNM_STREAM_FORMAT_CS16, &_this->bufferSize);
if (_this->bufferSize <= 0) {
flog::error("Failed to configure stream");
}
// Allocate and queue buffers
flog::debug("BUFFER SIZE: {}", _this->bufferSize);
for (int i = 0; i < LIBRFNM_MIN_RX_BUFCNT; i++) {
_this->rxBuf[i].buf = dsp::buffer::alloc<uint8_t>(_this->bufferSize);
_this->openDev->rx_qbuf(&_this->rxBuf[i]);
}
// Start worker
_this->workerThread = std::thread(&RFNMSourceModule::worker, _this);
_this->running = true;
flog::info("RFNMSourceModule '{0}': Start!", _this->name);
}
static void stop(void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
if (!_this->running) { return; }
_this->running = false;
// Stop worker
_this->stream.stopWriter();
if (_this->workerThread.joinable()) { _this->workerThread.join(); }
_this->stream.clearWriteStop();
// Disable channel
_this->openDev->librfnm_s->rx.ch[0].enable = RFNM_CH_ON;
_this->openDev->set(LIBRFNM_APPLY_CH0_RX);
// Close device
delete _this->openDev;
// Free buffers
for (int i = 0; i < LIBRFNM_MIN_RX_BUFCNT; i++) {
dsp::buffer::free(_this->rxBuf[i].buf);
}
flog::info("RFNMSourceModule '{0}': Stop!", _this->name);
}
static void tune(double freq, void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
if (_this->running) {
_this->openDev->librfnm_s->rx.ch[0].freq = freq;
rfnm_api_failcode fail = _this->openDev->set(LIBRFNM_APPLY_CH0_RX);
if (fail != rfnm_api_failcode::RFNM_API_OK) {
flog::error("Failed to tune: {}", (int)fail);
}
}
_this->freq = freq;
flog::info("RFNMSourceModule '{0}': Tune: {1}!", _this->name, freq);
}
static void menuHandler(void* ctx) {
RFNMSourceModule* _this = (RFNMSourceModule*)ctx;
if (_this->running) { SmGui::BeginDisabled(); }
SmGui::FillWidth();
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##_rfnm_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
_this->select(_this->devices.key(_this->devId));
core::setInputSampleRate(_this->sampleRate);
// TODO: Save
}
if (SmGui::Combo(CONCAT("##_rfnm_sr_sel_", _this->name), &_this->srId, _this->samplerates.txt)) {
_this->sampleRate = _this->samplerates.key(_this->srId);
core::setInputSampleRate(_this->sampleRate);
// TODO: Save
}
SmGui::SameLine();
SmGui::FillWidth();
SmGui::ForceSync();
if (SmGui::Button(CONCAT("Refresh##_rfnm_refr_", _this->name))) {
_this->refresh();
_this->select(_this->selectedSerial);
core::setInputSampleRate(_this->sampleRate);
}
if (_this->running) { SmGui::EndDisabled(); }
SmGui::LeftLabel("Bandwidth");
SmGui::FillWidth();
if (SmGui::Combo(CONCAT("##_rfnm_bw_sel_", _this->name), &_this->bwId, _this->bandwidths.txt)) {
// TODO: Save
}
SmGui::LeftLabel("Gain");
SmGui::FillWidth();
if (SmGui::SliderInt(CONCAT("##_rfnm_gain_", _this->name), &_this->gain, _this->gainMin, _this->gainMax)) {
if (_this->running) {
_this->openDev->librfnm_s->rx.ch[0].gain = _this->gain;
rfnm_api_failcode fail = _this->openDev->set(LIBRFNM_APPLY_CH0_RX);
}
// TODO: Save
}
if (SmGui::Checkbox(CONCAT("FM Notch##_rfnm_", _this->name), &_this->fmNotch)) {
if (_this->running) {
_this->openDev->librfnm_s->rx.ch[0].fm_notch = _this->fmNotch ? rfnm_fm_notch::RFNM_FM_NOTCH_ON : rfnm_fm_notch::RFNM_FM_NOTCH_OFF;
rfnm_api_failcode fail = _this->openDev->set(LIBRFNM_APPLY_CH0_RX);
}
// TODO: Save
}
}
void worker() {
librfnm_rx_buf* lrxbuf;
int sampCount = bufferSize/4;
// TODO: Define number of buffers per swap to maintain 200 fps
while (true) {
// Receive a buffer
auto fail = openDev->rx_dqbuf(&lrxbuf, LIBRFNM_CH0, 1000);
if (fail == rfnm_api_failcode::RFNM_API_DQBUF_NO_DATA) {
flog::error("Dequeue buffer didn't have any data");
continue;
}
else if (fail) { break; }
// Convert buffer to CF32
volk_16i_s32f_convert_32f((float*)stream.writeBuf, (int16_t*)lrxbuf->buf, 32768.0f, sampCount * 2);
// Reque buffer
openDev->rx_qbuf(lrxbuf);
// Swap data
if (!stream.swap(sampCount)) { break; }
}
flog::debug("Worker exiting");
}
std::string name;
bool enabled = true;
dsp::stream<dsp::complex_t> stream;
double sampleRate;
SourceManager::SourceHandler handler;
bool running = false;
double freq;
OptionList<std::string, std::string> devices;
OptionList<int, int> bandwidths;
OptionList<int, int> samplerates;
int gainMin = 0;
int gainMax = 0;
int devId = 0;
int srId = 0;
int bwId = 0;
int gain = 0;
bool fmNotch = false;
std::string selectedSerial;
librfnm* openDev;
int bufferSize = -1;
librfnm_rx_buf rxBuf[LIBRFNM_MIN_RX_BUFCNT];
#ifdef __ANDROID__
int devFd = 0;
#endif
std::thread workerThread;
};
MOD_EXPORT void _INIT_() {
// Nothing here
}
MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {
return new RFNMSourceModule(name);
}
MOD_EXPORT void _DELETE_INSTANCE_(void* instance) {
delete (RFNMSourceModule*)instance;
}
MOD_EXPORT void _END_() {
// Nothing here
}

View File

@ -411,8 +411,6 @@ public:
agcSetPoint = config.conf["devices"][selectedName]["agcSetPoint"];
}
core::setInputSampleRate(sampleRate);
// Per device options
if (openDev.hwVer == SDRPLAY_RSP1_ID) {
// No config to load
@ -688,6 +686,7 @@ private:
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##sdrplay_dev", _this->name), &_this->devId, _this->devListTxt.c_str())) {
_this->selectById(_this->devId);
core::setInputSampleRate(_this->sampleRate);
config.acquire();
config.conf["device"] = _this->devNameList[_this->devId];
config.release(true);
@ -711,6 +710,7 @@ private:
if (SmGui::Button(CONCAT("Refresh##sdrplay_refresh", _this->name))) {
_this->refresh();
_this->selectByName(_this->selectedName);
core::setInputSampleRate(_this->sampleRate);
}
SmGui::LeftLabel("Bandwidth");

View File

@ -9,8 +9,13 @@
#include <gui/smgui.h>
#include <utils/optionlist.h>
#include <codecvt>
#include <locale>
#include <aaroniartsaapi.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#define CONCAT(a, b) ((std::string(a) + b).c_str())
SDRPP_MOD_INFO{
@ -189,7 +194,6 @@ public:
// Set samplerate
samplerate = sampleRateList.value(srId);
core::setInputSampleRate(samplerate.effective);
// Close device
AARTSAAPI_CloseDevice(&api, &dev);
@ -329,9 +333,10 @@ private:
SmGui::FillWidth();
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##_spectran_dev_", _this->name), &_this->devId, _this->devList.txt)) {
_this->selectSerial(_this->devList.key(_this->devId));
core::setInputSampleRate(_this->samplerate.effective);
}
// TODO: SR sel
if (SmGui::Combo(CONCAT("##_spectran_sr_", _this->name), &_this->srId, _this->sampleRateList.txt)) {
_this->samplerate = _this->sampleRateList.value(_this->srId);
core::setInputSampleRate(_this->samplerate.effective);

View File

@ -211,7 +211,6 @@ public:
// Apply samplerate
sampleRate = samplerates.key(srId);
core::setInputSampleRate(sampleRate);
}
void setBandwidth(double bw) {
@ -335,6 +334,7 @@ private:
SmGui::ForceSync();
if (SmGui::Combo(CONCAT("##_usrp_dev_sel_", _this->name), &_this->devId, _this->devices.txt)) {
_this->select(_this->devices.key(_this->devId));
core::setInputSampleRate(_this->sampleRate);
if (!_this->selectedSer.empty()) {
config.acquire();
config.conf["device"] = _this->devices.key(_this->devId);
@ -357,10 +357,8 @@ private:
SmGui::ForceSync();
if (SmGui::Button(CONCAT("Refresh##_usrp_refr_", _this->name))) {
_this->refresh();
config.acquire();
std::string ser = config.conf["device"];
config.release();
_this->select(ser);
_this->select(_this->selectedSer);
core::setInputSampleRate(_this->sampleRate);
}
if (_this->channels.size() > 1) {