From 5e9486ef4cd9bbea233e9928e9a1bbef7e595654 Mon Sep 17 00:00:00 2001 From: Ryzerth Date: Sun, 21 Mar 2021 19:51:38 +0100 Subject: [PATCH] Fixed broken code --- CMakeLists.txt | 8 ++++++-- falcon9_decoder/src/main.cpp | 15 ++++++++++++--- recorder/src/main.cpp | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbeeefb4..67407800 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ option(OPT_BUILD_PLUTOSDR_SOURCE "Build PlutoSDR Source Module (Depedencies: lib option(OPT_BUILD_HACKRF_SOURCE "Build HackRF Source Module (Depedencies: libhackrf)" OFF) option(OPT_BUILD_RTL_SDR_SOURCE "Build HackRF Source Module (Depedencies: libhackrf)" ON) option(OPT_BUILD_AUDIO_SINK "Build Audio Sink Module (Depedencies: rtaudio)" ON) +option(OPT_BUILD_FALCON9_DECODER "Build the falcon9 live decoder" OFF) # Core of SDR++ add_subdirectory("core") @@ -21,7 +22,6 @@ add_subdirectory("core") add_subdirectory("radio") add_subdirectory("recorder") add_subdirectory("file_source") -add_subdirectory("falcon9_decoder") # Source modules if (OPT_BUILD_RTL_TCP_SOURCE) @@ -68,6 +68,10 @@ if (OPT_BUILD_AUDIO_SINK) add_subdirectory("audio_sink") endif (OPT_BUILD_AUDIO_SINK) +if (OPT_BUILD_FALCON9_DECODER) +add_subdirectory("falcon9_decoder") +endif (OPT_BUILD_FALCON9_DECODER) + if (MSVC) set(CMAKE_CXX_FLAGS "-O2 /std:c++17 /EHsc") else() @@ -101,7 +105,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_custom_target(do_always ALL cp \"$/libsdrpp_core.dylib\" \"$\") endif () -# cd +# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64" # Install directives install(TARGETS sdrpp DESTINATION bin) diff --git a/falcon9_decoder/src/main.cpp b/falcon9_decoder/src/main.cpp index 48f883be..b58de445 100644 --- a/falcon9_decoder/src/main.cpp +++ b/falcon9_decoder/src/main.cpp @@ -22,6 +22,8 @@ #include +#include + #define CONCAT(a, b) ((std::string(a) + b).c_str()) SDRPP_MOD_INFO { @@ -34,6 +36,8 @@ SDRPP_MOD_INFO { #define INPUT_SAMPLE_RATE 6000000 +std::ofstream file("test.ts", std::ios::binary); + class Falcon9DecoderModule : public ModuleManager::Instance { public: Falcon9DecoderModule(std::string name) { @@ -49,7 +53,7 @@ public: // dsp::Threshold thr; demod.init(vfo->output, INPUT_SAMPLE_RATE, 2000000.0f); - recov.init(&demod.out, (float)INPUT_SAMPLE_RATE / 3572000.0f, 0.00765625f, 0.175f, 0.005f); + recov.init(&demod.out, (float)INPUT_SAMPLE_RATE / 3571400.0f, powf(0.01f, 2) / 4.0f, 0.01, 100e-6f); // 0.00765625f, 0.175f, 0.005f split.init(&recov.out); split.bindStream(&reshapeInput); split.bindStream(&thrInput); @@ -72,7 +76,11 @@ public: deframe.start(); thr.start(); - ffplay = _popen("ffplay -framedrop -hide_banner -loglevel panic -window_title \"Falcon 9 Cameras\" -", "wb"); +#ifdef _WIN32 + ffplay = _popen("ffplay -framedrop -infbuf -hide_banner -loglevel panic -window_title \"Falcon 9 Cameras\" -", "wb"); +#else + ffplay = popen("ffplay -framedrop -infbuf -hide_banner -loglevel panic -window_title \"Falcon 9 Cameras\" -", "wb"); +#endif gui::menu.registerEntry(name, menuHandler, this, this); } @@ -189,7 +197,8 @@ private: _this->logsMtx.unlock(); } else if (pktId == 0x01123201042E1403) { - fwrite(data + 25, 1, 940, _this->ffplay); + //fwrite(data + 25, 1, 940, _this->ffplay); + file.write((char*)(data + 25), 940); } //printf("%016" PRIX64 ": %d bytes, %d full\n", pktId, length, count); diff --git a/recorder/src/main.cpp b/recorder/src/main.cpp index 2615cbb0..4c61997e 100644 --- a/recorder/src/main.cpp +++ b/recorder/src/main.cpp @@ -50,7 +50,7 @@ public: RecorderModule(std::string name) : folderSelect("%ROOT%/recordings") { this->name = name; - recPath = "%ROOT%/recordings"; + recPath = "%ROOT%/recording"; // Init audio path vol.init(&dummyStream, 1.0f);