diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e17317..21c5a2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: branches: [ master ] jobs: - ubuntu-build: + build-ubuntu: runs-on: ubuntu-latest steps: @@ -21,10 +21,8 @@ jobs: run: meson setup -Dwerror=true build - name: compile run: cd build && meson compile - - name: test - run: cd build && meson test - build-deb: + build-ubuntu-deb-package: runs-on: ubuntu-latest steps: @@ -35,11 +33,25 @@ jobs: run: sudo mk-build-deps --install --tool 'apt-get --yes' - name: Build .deb run: debuild -us -uc - # TODO: need a way to find the binary - #- name: Install .deb - # run: dpkg -i ../redsea_*.deb + - name: Install .deb + run: sudo dpkg -i ../redsea_*.deb - macos-build: + build-debian-oldoldstable: + runs-on: ubuntu-latest + container: debian:buster + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies (apt-get) + run: apt-get update && apt-get -y install python3-pip ninja-build build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev + - name: Install meson (pip3) + run: pip3 install --user meson + - name: meson setup + run: export PATH=$PATH:$HOME/.local/bin && meson setup -Dwerror=true build + - name: compile + run: export PATH=$PATH:$HOME/.local/bin && cd build && meson compile + + build-test-macos: runs-on: macos-latest steps: @@ -53,7 +65,7 @@ jobs: - name: test run: cd build && meson test - windows-msys2-mingw-build: + build-windows-msys2-mingw: runs-on: windows-latest steps: @@ -84,9 +96,6 @@ jobs: shell: msys2 {0} run: | meson setup -Dwerror=true build && cd build && meson compile - - name: test - shell: msys2 {0} - run: cd build && meson test - name: Package into distrib shell: msys2 {0} run: >- @@ -100,7 +109,7 @@ jobs: awk '{$1=$1};1' | xargs -I{} cp {} distrib/ - windows-cygwin-build: + build-windows-cygwin: runs-on: windows-latest steps: @@ -139,6 +148,3 @@ jobs: - name: Build redsea shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}' run: meson setup -Dwerror=true build && cd build && meson compile - - name: test - shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}' - run: cd build && meson test diff --git a/CHANGES.md b/CHANGES.md index 2fb1281..1fe3ea0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,25 +5,29 @@ * New features: * Add support for Enhanced RadioText (eRT) * Add support for Long PS in Group 15A (#104) - * Add runtime option to disable error correction with --no-fec -* Maintainability: - * Migrate build system from autotools to meson (#90) - * Switch from packaged-in JsonCPP to nlohmann-json (#109) - * Add GitHub Workflows CI builds for macOS and Windows via MSYS2/MinGW + Cygwin - * Add basic Catch2 unit tests (#84) - * Add .clang-format (not automated) - * Remove unmaintained build options for non-liquid, non-TMC builds - * Fix compiler warnings, issues identified via static analysis, and other code cleanup + * Add runtime option `--no-fec` for disabling error correction * UX changes: * Breaking: Print a warning to stderr if the raw MPX input sample rate is - not specified + not specified (breaks the previous silent assumption of 171 kHz) * Improve error reporting in general * Add `--output hex` (same as `--output-hex`) to mirror `--input hex` * Fixes: * Fix detection of invalid date/time (timestamps >2000 years ago) - * Noise resistance improvements: + * Noise resistance improvements (#106): * Require three (instead of two) repeats of a new PI before accepting it * Require three (instead of two) synchronization pulses before locking +* Maintainability: + * Migrate build system from autotools to meson (#90) + * Switch from patched, packaged-in JsonCPP to external nlohmann-json (#109) + * Breaking: The order of some JSON elements has changed (insertion order + instead of alphabetical) + * Add automated CI builds for macOS, Windows (MSYS2/MinGW + Cygwin), Ubuntu-latest, + Debian Buster + * Add Debian packaging (#101) + * Add basic Catch2 unit tests (#84) + * Add .clang-format (not automated) + * Remove unmaintained build options for non-liquid, non-TMC builds + * Fix compiler warnings, issues identified via static analysis, and other code cleanup ## 0.21 (2024-01-26) diff --git a/README.md b/README.md index b93469d..e9bfd52 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,11 @@ On Ubuntu: $ sudo apt install git build-essential meson libsndfile1-dev libliquid-dev +Or on older Debians: + + $ sudo apt-get install python3-pip ninja-build build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev + $ pip3 install --user meson + Or on macOS using Homebrew: $ brew install meson libsndfile liquid-dsp nlohmann-json diff --git a/meson.build b/meson.build index f7cfcd3..128c116 100644 --- a/meson.build +++ b/meson.build @@ -104,7 +104,8 @@ sources_no_main = [ 'src/util.cc' ] -executable('redsea', [sources_no_main, 'src/redsea.cc'], dependencies: [iconv, json, liquid, sndfile]) +executable('redsea', [sources_no_main, 'src/redsea.cc'], dependencies: [iconv, json, liquid, sndfile], + install: true) ################## diff --git a/src/redsea.cc b/src/redsea.cc index 58d859f..12ca917 100644 --- a/src/redsea.cc +++ b/src/redsea.cc @@ -128,26 +128,26 @@ int processMPXInput(Options options) { auto& output_stream = options.feed_thru ? std::cerr : std::cout; - std::vector channels; + std::vector> channels; std::vector> subcarriers; for (uint32_t i = 0; i < options.num_channels; i++) { - channels.emplace_back(options, i, output_stream); + channels.emplace_back(std::make_unique(options, i, output_stream)); subcarriers.push_back(std::make_unique(options)); } while (!mpx.eof()) { mpx.fillBuffer(); for (uint32_t i = 0; i < options.num_channels; i++) { - channels[i].processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); - if (channels[i].getSecondsSinceCarrierLost() > 10.f && + channels[i]->processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); + if (channels[i]->getSecondsSinceCarrierLost() > 10.f && subcarriers[i]->getSecondsSinceLastReset() > 5.f) { subcarriers[i]->reset(); - channels[i].resetPI(); + channels[i]->resetPI(); } } } - for (uint32_t i = 0; i < options.num_channels; i++) channels[i].flush(); + for (uint32_t i = 0; i < options.num_channels; i++) channels[i]->flush(); return EXIT_SUCCESS; }