From 585f6f2fa5cac44a4eb275870816d30b92aec456 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Tue, 6 Jun 2023 20:15:34 -0400 Subject: [PATCH] Staging for Main Branch #127 Lit Update; --- CMakeLists.txt | 7 ++++ README.md | 18 +++++++-- download-and-install-nodeps.sh | 23 ++++++++++++ download-and-install.sh | 67 ++++++++++++++++++++++++++++++++++ examples/Example_Usage.md | 19 ++++++---- examples/Install_Notes.md | 50 +++++++++++++++++++++---- install.sh | 12 ++++++ rebuild.sh | 16 ++++++++ src/dsd_main.c | 4 +- src/dsd_ncurses.c | 19 +++++++--- 10 files changed, 209 insertions(+), 26 deletions(-) create mode 100644 download-and-install-nodeps.sh create mode 100644 download-and-install.sh create mode 100644 install.sh create mode 100644 rebuild.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index f4c10a2..e63934d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,13 @@ if (TN) add_definitions(-DTONES) endif () +#use cmake option -DZDEV to change designation of this build from MAIN to zDEV +option(NXDN + "change designation of this build from MAIN to zDEV" OFF) +if (ZDEV) + add_definitions(-DZDEV_BUILD) +endif () + include(git_revision) git_describe(GIT_TAG) diff --git a/README.md b/README.md index 3b655d7..4c39ee8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,18 @@ -## Notice -This branch is for development and experimentation. Results are not gauranteed to be stable. -This branch will also attempt to consolidate the code bases for 'Main' and 'Aero' into one codeset -with the differences needed for Aero (Cygwin) handled by cmake option `cmake -DAERO=ON ..` when building. +# Digital Speech Decoder - Florida Man Edition + +DSD-FME is an evolution of the original DSD project from 'DSD Author' using the base code of [szechyjs](https://github.com/szechyjs/dsd "szechyjs"), some code and ideas from [LouisErigHerve](https://github.com/LouisErigHerve/dsd "LouisErigHerve"), [Boatbod OP25](https://github.com/boatbod/op25 "Boatbod OP25") and +[Osmocom OP25](https://gitea.osmocom.org/op25/op25 "Osmocom OP25"), along with other snippets of code, information, and inspirations from other projects including [DSDcc](https://github.com/f4exb/dsdcc "DSDcc"), [SDRTRunk](https://github.com/DSheirer/sdrtrunk "SDRTrunk"), [MMDVMHost](https://github.com/g4klx/MMDVMHost "MMDVMHost"), [LFSR](https://github.com/mattames/LFSR "LFSR"), [OK-DMRlib](https://github.com/OK-DMR/ok-dmrlib "OK-DMRlib"), and [EZPWD-Reed-Solomon](https://github.com/pjkundert/ezpwd-reed-solomon "EZPWD"), Eric Cottrell, SP5WWP and others. Finally, this is all brought together with original code to extend the fuctionality and add new features including NCurses Terminal and Menu system, Pulse Audio, TCP Direct Link Audio, RIGCTL, Trunking Features, LRRP/GPS Mapping, P25 Phase 2, EDACS, OP25 Capture Bin compatability, etc. DSD-FME is primarily focused with Linux Desktop users in mind, so please understand that this version may not compile, compile easily, or run correctly in other environments. + +This project wouldn't be possible without a few good people providing me plenty of sample audio files to run over and over again. Special thanks to jurek1111, KrisMar, noamlivne, racingfan360, iScottyBotty, LimaZulu, Forts, thewraithe2008, RayAir, and others for the many hours of wav samples and information provided by them. Most importantly, HRH17, whose insight, information, samples, and willingness to let me remote into a computer half-way across the globe in order to test trunking features are what make DSD-FME what it has become. I'd also like to thank mrscanner2008 for providing an additional remote where additional NXDN Type-C, 'Idas' Type-D, and XPT decoding and trunking could be sorted out. Thank you everybody. + +![DSD-FME](https://github.com/lwvmobile/dsd-fme/blob/main/dsd-fme2.png) + +![DSD-FME](https://github.com/lwvmobile/dsd-fme/blob/main/dsd-fme3.png) + +## Information + +See the [examples](https://github.com/lwvmobile/dsd-fme/tree/main/examples "examples") folder for information on [cloning and installing](https://github.com/lwvmobile/dsd-fme/blob/main/examples/Install_Notes.md "cloning and installing"), [example usage](https://github.com/lwvmobile/dsd-fme/blob/main/examples/Example_Usage.md "example usage"), and [trunking examples](https://github.com/lwvmobile/dsd-fme/blob/main/examples/trunking.sh "trunking examples"). ## License Copyright (C) 2010 DSD Author diff --git a/download-and-install-nodeps.sh b/download-and-install-nodeps.sh new file mode 100644 index 0000000..47d52b2 --- /dev/null +++ b/download-and-install-nodeps.sh @@ -0,0 +1,23 @@ +#! /bin/bash +clear +echo DSD-FME Digital Speech Decoder - Florida Man Edition Auto Installer +echo This will clone, build, and install DSD-FME only. +echo If you need dependencies installed, please run download-and-install.sh instead. +echo + +read -p "Press enter to continue" + +git clone https://github.com/lwvmobile/dsd-fme +cd dsd-fme +sudo cp tone8.wav /usr/share/ +sudo cp tone24.wav /usr/share/ +sudo cp tone48.wav /usr/share/ +sudo chmod 777 /usr/share/tone8.wav +sudo chmod 777 /usr/share/tone24.wav +sudo chmod 777 /usr/share/tone48.wav +mkdir build +cd build +cmake .. +make -j `nproc` +sudo make install +sudo ldconfig diff --git a/download-and-install.sh b/download-and-install.sh new file mode 100644 index 0000000..1554815 --- /dev/null +++ b/download-and-install.sh @@ -0,0 +1,67 @@ +#! /bin/bash +clear +echo DSD-FME Digital Speech Decoder - Florida Man Edition Auto Installer +echo MBELib is considered a requirement on this build. +echo You must view this notice prior to continuing. +echo The Patent Notice can be found at the site below. +echo https://github.com/lwvmobile/mbelib#readme +echo Please confirm that you have viewed the patent notice by entering y below. +echo +echo y/N +read ANSWER +Y='y' +if [[ $Y == $ANSWER ]]; then + +sudo apt update +sudo apt install libpulse-dev pavucontrol libsndfile1-dev libfftw3-dev liblapack-dev socat libusb-1.0-0-dev libncurses5 libncurses5-dev rtl-sdr librtlsdr-dev libusb-1.0-0-dev cmake git wget make build-essential libitpp-dev libncursesw5-dev + +echo ITPP Manual Build and Install has been temporarily removed from this script due to issues with older versions of Ubuntu. +echo Please check to see that libitpp-dev has successfully been downloaded and installed from the repo. +read -p "Press enter to continue" + +#wget -O itpp-latest.tar.bz2 http://sourceforge.net/projects/itpp/files/latest/download?source=files +#tar xjf itpp* +#if you can't cd into this folder, double check folder name first +#cd itpp-4.3.1 +#mkdir build +#cd build +#cmake .. +#make -j `nproc` +#sudo make install +#sudo ldconfig +#cd .. +#cd .. + +git clone https://github.com/lwvmobile/mbelib +cd mbelib +mkdir build +cd build +cmake .. +make -j `nproc` +sudo make install +sudo ldconfig +cd .. +cd .. + +git clone https://github.com/lwvmobile/dsd-fme +cd dsd-fme +sudo cp tone8.wav /usr/share/ +sudo cp tone24.wav /usr/share/ +sudo cp tone48.wav /usr/share/ +sudo chmod 777 /usr/share/tone8.wav +sudo chmod 777 /usr/share/tone24.wav +sudo chmod 777 /usr/share/tone48.wav +mkdir build +cd build +cmake .. +make -j `nproc` +sudo make install +sudo ldconfig + +else +echo +echo Sorry, you cannot build DSD-FME without acknowledging the Patent Notice. +fi + + + diff --git a/examples/Example_Usage.md b/examples/Example_Usage.md index a18a2b4..7e54931 100644 --- a/examples/Example_Usage.md +++ b/examples/Example_Usage.md @@ -79,8 +79,8 @@ RTL-SDR options: freq RTL-SDR Frequency (851800000 or 851.8M) gain RTL-SDR Device Gain (0-49)(default = 0; Hardware AGC recommended) ppm RTL-SDR PPM Error (default = 0) - bw RTL-SDR Bandwidth kHz (default = 12)(4, 6, 8, 12, 16, 24) - sq RTL-SDR Squelch Level (Optional) + bw RTL-SDR Bandwidth kHz (default = 12)(8, 12, 16, 24) + sq RTL-SDR Squelch Level vs RMS Value (Optional) udp RTL-SDR Legacy UDP Remote Port (Optional -- External Use Only) Example: dsd-fme-zdev -fs -i rtl -C cap_plus_channel.csv -T Example: dsd-fme-zdev -fp -i rtl:0:851.375M:22:-2:24:0:6021 @@ -165,7 +165,7 @@ c - toggle compact mode h - toggle call history z - toggle console payloads a - toggle call alert beep -4 - force dmr privacy key assertion over fid and svc bits +4 - force privacy key assertion over fid and svc bits i - toggle signal inversion on types that can't auto detect (dmr, dpmr) m - toggle c4fm/qpsk 10/4 (everything but phase 2 signal) M - toggle c4fm/qpsk 8/3 (phase 2 tdma control channel) @@ -173,17 +173,20 @@ R - start capturing symbol capture bin (date/time name file) r - stop capturing symbol capture bin spacebar - replay last symbol capture bin (captures must be stopped first) s - stop playing symbol capture bin or wav input file -P - start per call decoded wav files -p - stop per call decoded wav files +P - start per call decoded wav files (Capital P) +p - stop per call decoded wav files (Lower p) t - toggle trunking (needs either rtl input, or rigctl connection) y - toggle scanner (needs either rtl input, or rigctl connection) -1 - Lockout Tuning/Playback of TG in Slot 1 or Conventional (Current Session Only) -2 - Lockout Tuning/Playback of TG in Slot 2 (Current Session Only) +1 - Lockout Tuning/Playback of TG in Slot 1 or Conventional -- Current Session Only if no group.csv file specified +2 - Lockout Tuning/Playback of TG in Slot 2 -- Current Session Only if no group.csv file specified 0 - Toggle Audio Smoothing - May produce crackling if enabled on RTL/TCP or wav/bin files w - Toggle Trunking/Playback White List (Allow A Groups Only) / Black List (Block B or DE groups only) Mode g - Toggle Trunking Tuning to Group Calls (DMR T3, Con+, Cap+, P25, NXDN) u - Toggle Trunking Tuning to Private Calls (DMR T3, Cap+, P25) d - Toggle Trunking Tuning to Data Calls (DMR T3, NXDN) e - Toggle Trunking Tuning to Encrypted Calls (P25) - +8 - Connect to SDR++ TCP Audio Sink with Defaults/Retry Sink Connection on Disconnect +9 - Connect to SDR++ RIGCTL Server with Defaults/Retry RIGCTL Connection +D - Reset DMR Site Parms/Call Strings, etc. +Z - Simulate NoCarrier/No VC/CC sync (capital Z) ``` \ No newline at end of file diff --git a/examples/Install_Notes.md b/examples/Install_Notes.md index 2be044e..7b0a15a 100644 --- a/examples/Install_Notes.md +++ b/examples/Install_Notes.md @@ -2,7 +2,7 @@ ### Ubuntu 22.04/20.04/LM20/Debian Bullseye or Newer: -Using the included download-and-install.sh should make for a simple and painless clone, build, and install on newer Debian/Ubuntu/Mint/Pi systems. Simply acquire or copy the script, and run it. Update: Ubuntu 22.04 and RPi Bullseye 64-bit has been tested working with the installer script and functions appropriately. +Using the included download-and-install.sh should make for a simple and painless clone, build, and install on newer Debian/Ubuntu/Mint/Pi systems. Simply acquire or copy the script, and run it. Update: Ubuntu 23.04 and RPi Bullseye 64-bit has been tested working with the installer script and functions appropriately. If you need all dependencies build and installed first (only on Debian/Ubuntu/Mint/Pi), run: @@ -20,18 +20,23 @@ chmod +x download-and-install-nodeps.sh ./download-and-install-nodeps.sh ``` -### Ubuntu 18.04/LM19/Buster Note: -The above install.sh should now function on older system types. You can elect to manually follow the steps down below. Do NOT Manually build and install ITPP 4.3.1 on older systems, it is currently not wanting to build on Ubuntu 18.04 and Linux Mint 19. Install it from the repository instead. - ## Manual Install First, install dependency packages. This guide will assume you are using Debian/Ubuntu based distros. Check your package manager for equivalent packages if different. +Debian/Mint/Ubuntu/Pi + ``` sudo apt update sudo apt install libpulse-dev pavucontrol libsndfile1-dev libfftw3-dev liblapack-dev socat libusb-1.0-0-dev libncurses5 libncurses5-dev rtl-sdr librtlsdr-dev libusb-1.0-0-dev cmake git wget make build-essential libitpp-dev libncursesw5-dev ``` -## Headless + +Fedora 36/37 -- from https://github.com/lwvmobile/dsd-fme/issues/99 + +``` +sudo dnf install libsndfile-devel fftw-devel lapack-devel rtl-sdr-devel pulseaudio-libs-devel libusb-devel cmake git ncurses ncurses-devel gcc wget pavucontrol gcc-c++ +``` +## Headless Ubuntu Server/Pi If running headless, swap out pavucontrol for pulsemixer, and also install pulseaudio as well. Attempting to install pavucontrol in a headless environment may attempt to install a minimal desktop environment. Note: Default behavior of pulseaudio in a headless environment may be to be muted, so check by opening pulsemixer and unmuting and routing audio appropriately. @@ -93,9 +98,40 @@ sudo make install sudo ldconfig ``` -Optional 'Virtual Sinks' for routing audio from SDR++ or GQRX, Media Players, etc. into DSD-FME -You may wish to direct sound into DSD-FME via Virtual Sinks. You may set up a Virtual Sink or two on your machine for routing audio in and out of applications to other applications using the following command, and opening up pavucontrol "PulseAudio Volume Control" in the menu (or `pulsemixer` in headless mode) to change line out of application to virtual sink, and line in of DSD-FME to monitor of virtual sink. This command will not persist past a reboot, so you will need to invoke them each time you reboot, or search for how to add this to your conf files for persistency if desired. +### Windows Cygwin Builds + +If using RTL input support, you must install libusb-win32 before proceed with Cygwin installation. You will also need to build and compile a version of librtlsdr, but this can be tricky, and personally, I had to resort to using a much older version of the source code to get it to build at all with the rtl support in the precompiled 'Aero' builds. + +Then install all dependencies available in the repo prior to building, either directly selecting them during setup with the setup-x86.exe or setup-x64.exe or by issuing a command similar to this: + +``` +setup-x64.exe --packages libpulse-devel,libpulse-mainloop-glib0,libpulse-simple0,libpulse0,pulseaudio,pulseaudio-debuginfo,pulseaudio-equalizer,pulseaudio-module-x11,pulseaudio-module-zeroconf,pulseaudio-utils,sox-fmt-pulseaudio,xfce-pulseaudio-plugin,libusb0,libusb1.0,libusb1.0-debuginfo,libusb1.0-devel,libncurses++w10,libncurses-devel,libncursesw10,ncurses,cmake,gcc-core,gcc-debuginfo,gcc-objc,git,make,socat,sox,sox-fmt-ao,unzip,wget,gcc-g++,libsndfile-devel +``` + +Then manually install ITPP and MBElib, see above install notes. Be sure to run `cp libmbe* /usr/lib` after compiling MBElib. + +Then you can build and install using + +``` +git clone https://github.com/lwvmobile/dsd-fme +cd dsd-fme +sudo cp tone8.wav /usr/share/ +sudo cp tone24.wav /usr/share/ +sudo cp tone48.wav /usr/share/ +sudo chmod 777 /usr/share/tone8.wav +sudo chmod 777 /usr/share/tone24.wav +sudo chmod 777 /usr/share/tone48.wav +mkdir build +cd build +cmake -DAERO=ON .. +make +make install +``` + +### Virtual Sinks + +You may wish to direct sound into DSD-FME via Virtual Sinks. You may set up a Virtual Sink or two on your machine for routing audio in and out of applications to other applications using the following command, and opening up pavucontrol "PulseAudio Volume Control" in the menu (or `pulsemixer` in headless mode) to change line out of application to virtual sink, and line in of DSD-FME to monitor of virtual sink. This command will not persist past a reboot, so you will need to invoke them each time you reboot, or search for how to add this to your conf files for persistency if desired. Note: This setup is completely optional if using TCP Network Sink Audio and/or RTL Input. ``` pactl load-module module-null-sink sink_name=virtual_sink sink_properties=device.description=Virtual_Sink diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..058cd27 --- /dev/null +++ b/install.sh @@ -0,0 +1,12 @@ +sudo cp tone8.wav /usr/share/ +sudo cp tone24.wav /usr/share/ +sudo cp tone48.wav /usr/share/ +sudo chmod 777 /usr/share/tone8.wav +sudo chmod 777 /usr/share/tone24.wav +sudo chmod 777 /usr/share/tone48.wav +mkdir build +cd build +cmake .. +make -j `nproc` +sudo make install +sudo ldconfig diff --git a/rebuild.sh b/rebuild.sh new file mode 100644 index 0000000..15862db --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,16 @@ +#! /bin/bash +clear +echo DSD-FME Digital Speech Decoder - Florida Man Edition +echo Automatic Git Pull and Rebuild +echo +sleep 1 +##Open your clone folder## +git pull +sleep 2 +##cd into your build folder## +cd build +cmake .. +make -j `nproc` +sudo make install +sudo ldconfig + diff --git a/src/dsd_main.c b/src/dsd_main.c index 1e56757..3897518 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -1078,7 +1078,7 @@ usage () printf (" gain RTL-SDR Device Gain (0-49)(default = 0; Hardware AGC recommended)\n"); printf (" ppm RTL-SDR PPM Error (default = 0)\n"); printf (" bw RTL-SDR Bandwidth kHz (default = 12)(4, 6, 8, 12, 16, 24) \n"); - printf (" sq RTL-SDR Squelch Level (Optional)\n"); + printf (" sq RTL-SDR Squelch Level vs RMS Value (Optional)\n"); printf (" udp RTL-SDR Legacy UDP Remote Port (Optional -- External Use Only)\n"); printf (" Example: dsd-fme -fs -i rtl -C cap_plus_channel.csv -T\n"); printf (" Example: dsd-fme -fp -i rtl:0:851.375M:22:-2:24:0:6021\n"); @@ -1358,7 +1358,7 @@ main (int argc, char **argv) } #ifdef AERO_BUILD - fprintf (stderr, "Build Version: v2.0.1-27 Win32 \n"); + fprintf (stderr, "Build Version: v2.1 Win32 \n"); #else fprintf (stderr, "Build Version: %s \n", GIT_TAG); #endif diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 9010489..f37313e 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -2127,7 +2127,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (opts->ncurses_compact == 1) { printw ("------------------------------------------------------------------------------\n"); - printw ("| Digital Speech Decoder: Florida Man Edition - Aero %s \n", "v2.0.1-27 Win32"); + printw ("| Digital Speech Decoder: Florida Man Edition - Aero %s \n", "v2.1 Win32"); printw ("------------------------------------------------------------------------------\n"); } #elif LIMAZULUTWEAKS @@ -2137,13 +2137,20 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) printw ("| Digital Speech Decoder: LimaZulu Edition V: The Empire Strikes Back \n"); printw ("------------------------------------------------------------------------------\n"); } -#else +#elif ZDEV_BUILD if (opts->ncurses_compact == 1) { printw ("------------------------------------------------------------------------------\n"); printw ("| Digital Speech Decoder: Florida Man Edition - zDEV %s \n", GIT_TAG); printw ("------------------------------------------------------------------------------\n"); } +#else + if (opts->ncurses_compact == 1) + { + printw ("------------------------------------------------------------------------------\n"); + printw ("| Digital Speech Decoder: Florida Man Edition - Main %s \n", GIT_TAG); + printw ("------------------------------------------------------------------------------\n"); + } #endif if (opts->ncurses_compact == 0) { @@ -2156,10 +2163,12 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (i == 4) printw (" MBElib %s", versionstr); #ifdef AERO_BUILD if (i == 5) printw (" %s ", "Aero Win32"); - if (i == 6) printw (" v2.0.1-27 Win32 \n"); - #else + if (i == 6) printw (" v2.1 Win32 \n"); + #elif ZDEV_BUILD if (i == 5) printw (" %s ", "zDEV BUILD"); - // if (i == 5) printw (" %s ", "MAIN BUILD"); + if (i == 6) printw (" %s \n", GIT_TAG); + #else + if (i == 5) printw (" %s ", "MAIN BUILD"); if (i == 6) printw (" %s \n", GIT_TAG); #endif else printw ("\n");