diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ee2a1ff..dd51b91e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ Trunk Recorder ChangeLog ======================== +### Version 3.2 +* Added support for GnuRadio 3.8 + +### Version 3.1.3 +* Add support for uploading to Broadcastify +* Switch to using LibCurl for networking + ### Version 3.1.2 * Added support for Motorola TPS Signaling * Made Debug Recorder work over a nextwork connection diff --git a/CMakeLists.txt b/CMakeLists.txt index 21676ebbe..1311009d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,11 +81,14 @@ find_package(CppUnit) # find_package(Gnuradio) #endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") -set(GR_REQUIRED_COMPONENTS ANALOG DIGITAL RUNTIME BLOCKS FILTER PMT) -find_package(Gnuradio) +set(GR_REQUIRED_COMPONENTS ANALOG DIGITAL RUNTIME BLOCKS FILTER PMT FFT) +find_package(Gnuradio REQUIRED COMPONENTS analog blocks digital filter fft) find_package(GnuradioRuntime) find_package(CppUnit) +math(EXPR GNURADIO_VERSION "(${Gnuradio_VERSION_MAJOR} / 10) << 20 | (${Gnuradio_VERSION_MAJOR} % 10) << 16 | (${Gnuradio_VERSION_MINOR} / 10) << 12 | (${Gnuradio_VERSION_MINOR} % 10) << 8 | (${Gnuradio_VERSION_PATCH} / 10) << 4 | (${Gnuradio_VERSION_PATCH} % 10) << 0 ") +message(STATUS "GnuRadio Version: " ${GNURADIO_VERSION}) + if(NOT GNURADIO_RUNTIME_FOUND) message(FATAL_ERROR "GnuRadio Runtime required to compile Trunk Recorder") endif() @@ -105,9 +108,7 @@ find_package(UHD) find_package(OpenSSL REQUIRED) find_package(CURL REQUIRED) -if(NOT GNURADIO_RUNTIME_FOUND) - message(FATAL_ERROR "GnuRadio Runtime required to build " ${CMAKE_PROJECT_NAME}) -endif() + ######################################################################## # Setup boost @@ -141,14 +142,14 @@ set(Boost_ADDITIONAL_VERSIONS "1.70.0" "1.70" "1.71.0" "1.71" "1.72.0" "1.72" "1.73.0" "1.73" "1.74.0" "1.74" ) -find_package(Boost COMPONENTS ${BOOST_REQUIRED_COMPONENTS}) +find_package(Boost COMPONENTS ${BOOST_REQUIRED_COMPONENTS} REQUIRED) if(NOT Boost_FOUND) message(FATAL_ERROR "Boost required to build " ${CMAKE_PROJECT_NAME}) endif() ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) - +add_definitions(-DGNURADIO_VERSION=${GNURADIO_VERSION}) ######################################################################## # Setup the include and linker paths @@ -175,17 +176,14 @@ link_directories( ${OPENSSL_ROOT_DIR}/lib ) - set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wno-unused-local-typedef -Wno-deprecated-declarations -Wno-error=deprecated-declarations -g") SET(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wno-narrowing") - add_subdirectory(lib/op25_repeater) - list(APPEND trunk_recorder_sources trunk-recorder/main.cc trunk-recorder/formatter.cc @@ -240,4 +238,13 @@ target_compile_options( add_executable(recorder ${trunk_recorder_sources}) -target_link_libraries(recorder ssl crypto ${CURL_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GROSMOSDR_LIBRARIES} ${Boost_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater imbe_vocoder) +target_link_libraries(recorder ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GROSMOSDR_LIBRARIES} ${LIBOP25_REPEATER_LIBRARIES} gnuradio-op25_repeater imbe_vocoder) +message(STATUS "All libraries:" ${GNURADIO_ALL_LIBRARIES}) +if(NOT Gnuradio_VERSION VERSION_LESS "3.8") + target_link_libraries(recorder + gnuradio::gnuradio-analog + gnuradio::gnuradio-blocks + gnuradio::gnuradio-digital + gnuradio::gnuradio-filter + ) +endif() diff --git a/README.md b/README.md index 87c3c5e51..3a73c1910 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -Trunk Recorder - v3.1.2 +Trunk Recorder - v3.2 ======================= *Note: v3.1.1 changes from using `ffmpeg` to `fdkaac` and `sox` for compressing audio for OpenMHz. Both utilities can be easily installed using apt-get* *Note: v3.1.3 adds a dependency for `libcurl`, you can install it thru `apt-get` with `sudo apt-get install libcurl4-openssl-dev`.* - ## Sponsors **Do you find Trunk Recorder and OpenMHz useful? Become a [Sponsor](https://github.com/sponsors/robotastic) to help support continued development and operation.** Thank you: Vabrio, Blantonl, Olesza and others! @@ -23,7 +22,7 @@ Trunk Recorder currently supports the following: - Ettus USRPs - P25 Phase 1, **P25 Phase 2** & Analog voice channels -Trunk Recorder has been tested on Ubuntu (14.04, 16.04, 16.10, 17.04, 17.10 & 18.04), Arch Linux (2017.03.01), Debian 9.x and macOS (10.10, 10.11, 10.12, 10.13, 10.14). It has been successfully used with several SDRs including the Ettus USRP B200, B210, B205, a bank of 3 RTL-SDR dongles, and the HackRF Jawbreaker. +Trunk Recorder has been tested on Ubuntu (14.04, 16.04, 16.10, 17.04, 17.10, 18.04 & 20.04), Arch Linux (2017.03.01), Debian 9.x and macOS (10.10, 10.11, 10.12, 10.13, 10.14). It has been successfully used with several SDRs including the Ettus USRP B200, B210, B205, a bank of 3 RTL-SDR dongles, and the HackRF Jawbreaker. # Wiki Pages diff --git a/blacklist-rtl.conf b/blacklist-rtl.conf new file mode 100644 index 000000000..f723da335 --- /dev/null +++ b/blacklist-rtl.conf @@ -0,0 +1,4 @@ +blacklist dvb_usb_rtl28xxu +blacklist rtl2832 +blacklist rtl2830 +blacklist rtl2838 diff --git a/install.sh b/install.sh new file mode 100755 index 000000000..2aaa70fda --- /dev/null +++ b/install.sh @@ -0,0 +1,32 @@ +#! /bin/sh + +set -e + +# trunk-recorder install script for debian based systems +# including ubuntu 18.04/20.04 and raspbian + +if [ ! -d trunk-recorder/recorders ]; then + echo ====== ERROR: trunk-recorder top level directories not found. + echo ====== You must change to the trunk-recorder top level directory + echo ====== before running this script. + exit +fi + +sudo apt-get update +sudo apt-get install gnuradio gnuradio-dev gr-osmosdr libhackrf-dev libuhd-dev libgmp-dev +sudo apt-get install fdkaac sox +sudo apt-get install git cmake build-essential libboost-all-dev libusb-1.0-0.dev libssl-dev libcurl4-openssl-dev liborc-0.4-dev + +mkdir build +cd build +cmake ../ +make +sudo cp -i recorder /usr/local/bin/trunk-recorder + +cd .. + +if [ ! -f /etc/modprobe.d/blacklist-rtl.conf ]; then + echo ====== Installing blacklist-rtl.conf for selecting the correct RTL-SDR drivers + echo ====== Please reboot before running trunk-recorder. + sudo install -m 0644 ./blacklist-rtl.conf /etc/modprobe.d/ +fi diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 000000000..3b5cd0cde --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +git pull +mkdir -p build +cd build +rm -rf * +cmake ../ +make +sudo cp -i recorder /usr/local/bin/trunk-recorder diff --git a/trunk-recorder/recorders/analog_recorder.h b/trunk-recorder/recorders/analog_recorder.h index e5471aecc..290ef2c8a 100644 --- a/trunk-recorder/recorders/analog_recorder.h +++ b/trunk-recorder/recorders/analog_recorder.h @@ -20,11 +20,16 @@ #include #include -#include +#if GNURADIO_VERSION < 0x030800 +#include +#include +#else +#include +#include +#endif #include #include -#include #include #include diff --git a/trunk-recorder/recorders/debug_recorder.h b/trunk-recorder/recorders/debug_recorder.h index bc2b66848..a718f883a 100644 --- a/trunk-recorder/recorders/debug_recorder.h +++ b/trunk-recorder/recorders/debug_recorder.h @@ -20,24 +20,29 @@ #include #include -#include -#include -#include #include -#include - -#include #include #include #include #include +#if GNURADIO_VERSION < 0x030800 +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#endif + #include #include #include -#include -#include -#include #include #include diff --git a/trunk-recorder/recorders/p25_recorder.h b/trunk-recorder/recorders/p25_recorder.h index 2321df1e0..b307403e0 100644 --- a/trunk-recorder/recorders/p25_recorder.h +++ b/trunk-recorder/recorders/p25_recorder.h @@ -17,15 +17,11 @@ #include #include - #include -#include -#include -#include + #include #include -#include #include #include #include @@ -34,9 +30,22 @@ #include #include #include -#include + +#if GNURADIO_VERSION < 0x030800 +#include #include +#include #include +#include +#include +#include +#else +#include +#include +#include +#include +#endif + #include #include diff --git a/trunk-recorder/recorders/p25conventional_recorder.cc b/trunk-recorder/recorders/p25conventional_recorder.cc index 342644566..b61d7d789 100644 --- a/trunk-recorder/recorders/p25conventional_recorder.cc +++ b/trunk-recorder/recorders/p25conventional_recorder.cc @@ -63,7 +63,10 @@ void p25conventional_recorder::start(Call *call) { if (!qpsk_mod) { reset(); + } else { + costas_clock->reset(); } + if (d_delayopen) { BOOST_LOG_TRIVIAL(info) << "\t- Listening P25 Recorder Num [" << rec_num << "]\tTG: " << this->call->get_talkgroup_display() << "\tFreq: " << FormatFreq(chan_freq) << " \tTDMA: " << call->get_phase2_tdma() << "\tSlot: " << call->get_tdma_slot(); } else { diff --git a/trunk-recorder/recorders/recorder.h b/trunk-recorder/recorders/recorder.h index f1f5fdc30..4a0ccffea 100644 --- a/trunk-recorder/recorders/recorder.h +++ b/trunk-recorder/recorders/recorder.h @@ -17,21 +17,32 @@ #include #include -#include #include + +#if GNURADIO_VERSION < 0x030800 +#include +#include #include #include +#include +#include #include -#include #include -#include -#include -#include -#include -#include -#include #include #include +#else +#include +#include +#include +#include +#include +#include +#endif + +#include + +#include + #include #include #include diff --git a/trunk-recorder/recorders/sigmf_recorder.h b/trunk-recorder/recorders/sigmf_recorder.h index 280057477..db820ee6f 100644 --- a/trunk-recorder/recorders/sigmf_recorder.h +++ b/trunk-recorder/recorders/sigmf_recorder.h @@ -17,17 +17,13 @@ #include #include -#include #include -#include -#include -#include #include -#include + #include -#include + #include #include #include @@ -36,14 +32,30 @@ #include +#if GNURADIO_VERSION < 0x030800 +#include #include #include #include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#include +#include +#include +#include +#endif + #include #include -#include -#include + #include #include diff --git a/trunk-recorder/systems/p25_trunking.h b/trunk-recorder/systems/p25_trunking.h index 3c14aa8c1..e753878ab 100644 --- a/trunk-recorder/systems/p25_trunking.h +++ b/trunk-recorder/systems/p25_trunking.h @@ -20,19 +20,28 @@ #include #include + +#if GNURADIO_VERSION < 0x030800 #include #include +#include +#include +#include +#else +#include +#include +#include +#include +#endif + #include #include #include -#include #include -#include #include #include -#include #include #include #include diff --git a/trunk-recorder/systems/smartnet_trunking.h b/trunk-recorder/systems/smartnet_trunking.h index 13380d62c..fa636319f 100644 --- a/trunk-recorder/systems/smartnet_trunking.h +++ b/trunk-recorder/systems/smartnet_trunking.h @@ -11,19 +11,26 @@ #include +#if GNURADIO_VERSION < 0x030800 +#include +#include +#include +#else +#include +#include +#include +#endif + #include #include -#include #include #include #include #include #include -#include -#include -#include +#include #include "smartnet_decode.h"