Skip to content

Commit

Permalink
Implement new squelch-triggered audio recorder
Browse files Browse the repository at this point in the history
Move wav_sink into receiver_base_cf
Move file name generation to receiver_base_cf
Switch to pwr_squelch
Pull in wavfile_sink and fix gqrx-sdr#1075
Implement new squelch-triggered audio recorder while keeping in mind that
gqrx-sdr#946 would be next.
Add tag processing to wavfile_sink_gqrx.
Implement event-driven GUI updates.
Add GUI options
Make it possible to switch betweensimple_squelch and pwr_squelch implementations
to improve performace on weak systems
Update build dependencies (add libsndfile)
  • Loading branch information
vladisslav2011 committed Feb 16, 2022
1 parent 3559054 commit 3055f72
Show file tree
Hide file tree
Showing 27 changed files with 1,745 additions and 139 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
run: |
sudo add-apt-repository -y ppa:gnuradio/gnuradio-releases
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends cmake qt5-default qt5-gtk-platformtheme qttranslations5-l10n libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev libairspy-dev libairspyhf-dev libfreesrp-dev libhackrf-dev librtlsdr-dev libsoapysdr-dev soapysdr-module-remote libuhd-dev liborc-0.4-dev libhidapi-dev
sudo apt-get install -y --no-install-recommends cmake qt5-default qt5-gtk-platformtheme qttranslations5-l10n libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev libairspy-dev libairspyhf-dev libfreesrp-dev libhackrf-dev librtlsdr-dev libsoapysdr-dev soapysdr-module-remote libuhd-dev liborc-0.4-dev libhidapi-dev libsndfile1-dev
cd /tmp
git clone https://github.com/Nuand/bladeRF.git
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Install dependencies
run: |
brew update
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf librtlsdr libserialport portaudio pybind11 uhd qt@6
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf librtlsdr libserialport portaudio pybind11 uhd libsnfile qt@6
brew tap pothosware/homebrew-pothos
brew install soapysdr soapyremote
Expand Down
208 changes: 208 additions & 0 deletions .github/workflows/build.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Build

on: [push]

jobs:
appimage:
name: AppImage
runs-on: ubuntu-18.04
steps:
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:gnuradio/gnuradio-releases
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends cmake qt5-default qt5-gtk-platformtheme qttranslations5-l10n libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev libairspy-dev libairspyhf-dev libfreesrp-dev libhackrf-dev librtlsdr-dev libsoapysdr-dev soapysdr-module-remote libuhd-dev liborc-0.4-dev libhidapi-dev libsndfile1-dev

cd /tmp
git clone https://github.com/Nuand/bladeRF.git
cd bladeRF
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
sudo ldconfig

cd /tmp
git clone https://github.com/dl1ksv/gr-fcdproplus.git
cd gr-fcdproplus
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -j4
sudo make install
sudo ldconfig

cd /tmp
git clone git://git.osmocom.org/libosmo-dsp
cd libosmo-dsp
autoreconf -i
./configure --prefix=/usr
make -j4
sudo make install
sudo ldconfig

cd /tmp
git clone git://git.osmocom.org/gr-iqbal
cd gr-iqbal
git checkout gr3.8
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_MODULES_DIR=/usr/lib/x86_64-linux-gnu/cmake ..
make -j4
sudo make install
sudo ldconfig

cd /tmp
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr
git checkout gr3.8
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_MODULES_DIR=/usr/lib/x86_64-linux-gnu/cmake ..
make -j4
sudo make install
sudo ldconfig
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure
run: mkdir build && cd build && cmake ..
- name: Compile
working-directory: build
run: make -j4
- name: Build AppImage
run: ./appimage.sh
- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: gqrx-appimage-${{ github.run_id }}
path: Gqrx-*.AppImage
macos:
name: MacOS
runs-on: macos-10.15
steps:
- name: Install dependencies
run: |
brew update
<<<<<<< HEAD
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf librtlsdr libserialport portaudio pybind11 uhd qt@6
=======
brew install airspy airspyhf boost dylibbundler gnuradio hackrf libbladerf librtlsdr libserialport portaudio pybind11 uhd libsnfile
>>>>>>> a7de24d... Implement new squelch-triggered audio recorder
brew tap pothosware/homebrew-pothos
brew install soapysdr soapyremote

cd /tmp
git clone https://github.com/analogdevicesinc/libiio.git
cd libiio
git checkout v0.23
mkdir build
cd build
cmake ..
make -j4
sudo make install

cd /tmp
git clone https://github.com/analogdevicesinc/libad9361-iio.git
cd libad9361-iio
mkdir build
cd build
cmake ..
make -j4
sudo make install

cd /tmp
git clone https://github.com/pothosware/SoapyPlutoSDR.git
cd SoapyPlutoSDR
mkdir build
cd build
cmake ..
make -j4
make install

cd /tmp
cp /Library/Frameworks/iio.framework/iio /usr/local/lib/libiio.dylib
install_name_tool -id "/usr/local/lib/libiio.dylib" /usr/local/lib/libiio.dylib
cp /Library/Frameworks/ad9361.framework/ad9361 /usr/local/lib/libad9361.dylib
install_name_tool -id "/usr/local/lib/libad9361.dylib" /usr/local/lib/libad9361.dylib
install_name_tool -delete_rpath /Library/Frameworks /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/libad9361.dylib
install_name_tool -change @rpath/iio.framework/Versions/0.23/iio /usr/local/lib/libiio.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so
install_name_tool -change @rpath/ad9361.framework/Versions/0.2/ad9361 /usr/local/lib/libad9361.dylib /usr/local/lib/SoapySDR/modules0.*/libPlutoSDRSupport.so

cd /tmp
git clone git://git.osmocom.org/gr-iqbal
cd gr-iqbal
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make -j4
make install

cd /tmp
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr
mkdir build
cd build
cmake ..
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
make install
- name: Install Apple certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH

security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure
run: mkdir build && cd build && cmake ..
- name: Compile
working-directory: build
run: make -j4
- name: Build app bundle
run: ./macos_bundle.sh
- name: Notarize app bundle
uses: devbotsxyz/xcode-notarize@v1
with:
product-path: Gqrx.app
appstore-connect-username: ${{ secrets.NOTARIZE_USERNAME }}
appstore-connect-password: ${{ secrets.NOTARIZE_PASSWORD }}
- name: Staple app bundle
run: xcrun stapler staple --verbose Gqrx.app
- name: Create DMG
run: hdiutil create Gqrx.dmg -srcfolder Gqrx.app -format UDZO -fs HFS+ -volname Gqrx
- name: Notarize DMG
uses: devbotsxyz/xcode-notarize@v1
with:
product-path: Gqrx.dmg
primary-bundle-id: dk.gqrx.gqrx
appstore-connect-username: ${{ secrets.NOTARIZE_USERNAME }}
appstore-connect-password: ${{ secrets.NOTARIZE_PASSWORD }}
- name: Staple DMG
run: xcrun stapler staple --verbose Gqrx.dmg
- name: Rename DMG
run: |
GQRX_VERSION=$(<version.txt)
mv Gqrx.dmg Gqrx-$GQRX_VERSION.dmg
- name: Save artifact
uses: actions/upload-artifact@v2
with:
name: gqrx-macos-${{ github.run_id }}
path: Gqrx-*.dmg
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y cmake qt5-default libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr gr-fcdproplus liborc-0.4-dev appstream desktop-file-utils
run: sudo apt-get update -qq && sudo apt-get install -y cmake qt5-default libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr gr-fcdproplus liborc-0.4-dev appstream desktop-file-utils libsndfile1-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install dependencies
run: |
brew update
brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 uhd qt@6
brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 uhd libsndfile qt@6
cd /tmp
git clone git://git.osmocom.org/gr-osmosdr
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on: [push, pull_request]

jobs:
ubuntu-build:
name: Ubuntu CI
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
backend: [Pulseaudio, Portaudio, Gr-audio]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: sudo apt-get update -qq && sudo apt-get install -y cmake qt5-default libqt5svg5-dev libboost-dev libpulse-dev portaudio19-dev liblog4cpp5-dev gnuradio-dev gr-osmosdr gr-fcdproplus liborc-0.4-dev appstream desktop-file-utils libsndfile1-dev
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
run: mkdir build && cd build && cmake -DLINUX_AUDIO_BACKEND:STRING=${{ matrix.backend }} ..
- name: Compile
working-directory: build
run: make -j4
- name: Validate desktop entry
if: matrix.os == 'ubuntu-20.04'
run: desktop-file-validate dk.gqrx.gqrx.desktop
- name: Validate appstream metadata
if: matrix.os == 'ubuntu-20.04'
run: appstreamcli validate dk.gqrx.gqrx.appdata.xml
macos-build:
name: MacOS CI
strategy:
matrix:
os: [macos-10.15, macos-11.0]
backend: [Portaudio, Gr-audio]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: |
brew update
<<<<<<< HEAD
brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 uhd qt@6
=======
brew install airspy boost gnuradio hackrf libbladerf librtlsdr pybind11 uhd libsndfile
>>>>>>> a7de24d... Implement new squelch-triggered audio recorder

cd /tmp
git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr
mkdir build
cd build
cmake ..
LIBRARY_PATH=/usr/local/opt/icu4c/lib make -j4
make install
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
run: mkdir build && cd build && cmake -DOSX_AUDIO_BACKEND:STRING=${{ matrix.backend }} ..
- name: Compile
working-directory: build
run: make -j4
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ if(NOT Qt6_FOUND)
endif()
include(FindPkgConfig)
find_package(Gnuradio-osmosdr REQUIRED)
find_package(SNDFILE REQUIRED)

set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG AUDIO BLOCKS DIGITAL FILTER FFT PMT)
find_package(Gnuradio REQUIRED COMPONENTS analog audio blocks digital filter fft network)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ To compile gqrx from source you need the following dependencies:
- Network
- Widgets
- Svg (runtime-only)
- libsndfile
- cmake version >= 3.2.0

Gqrx can be compiled from within Qt Creator or in a terminal:
Expand Down
34 changes: 34 additions & 0 deletions cmake/Modules/FindSNDFILE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
find_package(PkgConfig)
PKG_CHECK_MODULES(PC_SNDFILE "sndfile")

FIND_PATH(SNDFILE_INCLUDE_DIRS
NAMES sndfile.h
HINTS ${PC_SNDFILE_INCLUDE_DIR}
${CMAKE_INSTALL_PREFIX}/include
PATHS
/usr/local/include
/usr/include
)

FIND_LIBRARY(SNDFILE_LIBRARIES
NAMES sndfile ${SNDFILE_LIBRARY_NAME}
HINTS ${PC_SNDFILE_LIBDIR}
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
PATHS
${SNDFILE_INCLUDE_DIRS}/../lib
/usr/local/lib
/usr/lib
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SNDFILE DEFAULT_MSG SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIRS)
MARK_AS_ADVANCED(SNDFILE_LIBRARIES SNDFILE_INCLUDE_DIRS)

if (SNDFILE_FOUND AND NOT TARGET sndfile::sndfile)
add_library(sndfile::sndfile INTERFACE IMPORTED)
set_target_properties(sndfile::sndfile PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SNDFILE_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${SNDFILE_LIBRARIES}"
)
endif()
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ target_link_libraries(${PROJECT_NAME}
${PULSEAUDIO_LIBRARY}
${PULSE-SIMPLE}
${PORTAUDIO_LIBRARIES}
${SNDFILE_LIBRARIES}
)

if(NOT Gnuradio_VERSION VERSION_LESS "3.10")
Expand Down
Loading

0 comments on commit 3055f72

Please sign in to comment.