From f2ef2b229882cc1f26611bddd93d89fa48fc92d9 Mon Sep 17 00:00:00 2001 From: Ezra Taimuty-Loomis Date: Thu, 31 Dec 2020 14:41:41 -0500 Subject: [PATCH] Build script changes --- .travis.yml | 3 ++- CMakeLists.txt | 2 +- README.md | 25 +++++++++++++++++++------ configure => configure_make | 0 configure_ninja | 8 ++++++++ install_prereqs.sh | 4 ++++ 6 files changed, 34 insertions(+), 8 deletions(-) rename configure => configure_make (100%) create mode 100644 configure_ninja create mode 100644 install_prereqs.sh diff --git a/.travis.yml b/.travis.yml index f821e96..c3d4b3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ compiler: - clang - gcc -script: sh ./configure && cd build && make && make test +script: sh ./configure_ninja && cd build && make && make test dist: - bionic @@ -23,3 +23,4 @@ addons: - libprotoc-dev - libssh-dev - libsoapysdr-dev + - ninja-build diff --git a/CMakeLists.txt b/CMakeLists.txt index be4b312..5776523 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.12.4) set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall -Wextra") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -Wall") set(CMAKE_BUILD_TYPE Debug) project(PiScan) diff --git a/README.md b/README.md index 7e762c3..9101325 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ A license hasn't been selected yet, though it's likely to be GPL - have to make - Broadcastify interfacing ## System requirements -- Linux OS - Debian or Ubuntu based distros recommended (untested on other distros) +- Linux OS - Debian or Ubuntu based distros recommended (untested on other distros - scripts are only configured for Debian builds) - CPU with 2+ cores * ARM: will work on at least an RPi 2B (900MHz BCM2836) * x86: should run well on most modern low-power CPUs, has been tested on dual-core Atom-class processors without maxing out the CPU @@ -54,23 +54,32 @@ The following packages need to be installed, if not already: protobuf-compiler, libprotoc-dev libssh-dev +Installation can automatically be done with: + + sh ./install_prereqs.sh + ### Initializing In a terminal, download the source with the command: git clone https://github.com/ezratl/PiScan Then configure the environment: - sh ./bootstrap.sh -There are three options available for audio output: PulseAudio, ALSA, JACK, and OSS. Your preference can be set by running one of the following commands from the `build` directory: + sh ./configure_make +Or + + sh ./configure_ninja +Depending on your preferred build system + +There are three options available for audio output: PulseAudio, ALSA, JACK, and OSS. By default ALSA is the selected library. Your preference can be set by running one of the following commands from the `build` directory: cmake ../src -DUSE_AUDIO_PULSE=ON cmake ../src -DUSE_AUDIO_ALSA=ON cmake ../src -DUSE_AUDIO_JACK=ON -By default PulseAudio is selected, however ALSA seems to use less CPU on the RPi +Do note that PulseAudio uses significantly more CPU than ALSA when streaming PiScan audio. Additionally, some versions of liquid have a different API, resulting in build errors in the "Modem" files of the `cubic` module. If that happens, try running this from `build`: - cmake ../src -DLIQUID_API_OLD=ON + cmake ../src -DLIQUID_API_OLD=OFF ### Building Once the environment is properly configured, `cd` into `build` and build the LiveMedia library: @@ -108,7 +117,7 @@ All data used by PiScan is stored in its working directory (this is the `data` d On the first run of PiScan, these files likely won't exist. It will continue running with default parameters, and a config and state file will be generated with these defaults when the program ends. If there is no scan file, PiScan cannot scan so it will instead hold at 100MHz. It will not allow the user to scan, but will allow manual frequency tuning. #### Scan Database File -`systems.json` MUST adhere to this format for PiScan to read it correctly. Use the sample file in `data/defaults` as a starting point for your database if writing it manually. +`systems.json` MUST adhere to this format (minus the comments) for PiScan to read it correctly. Use the sample file in `data/defaults` as a starting point for your database if writing it manually. { "systems": [ @@ -157,6 +166,10 @@ In short, it communicates through a TCP connection, with a default port 1234. To listen to PiScan's audio feed remotely, use a stream client that supports RTSP, such as VLC, and enter the MRL `rtsp://:8554/audio`. Setting a low network caching time is advised to reduce audio latency. Note: The client is being migrated to this repository to simplify API development. The version in the separate repo is still recommended for now, but it will be deprecated in the next update. + +## Troubleshooting + + ## Disclaimer This is a personal project; it lacks both the design standards and testing standards of commercially-built software, meaning no guarantees can be made of its reliability. Use at your own risk. diff --git a/configure b/configure_make similarity index 100% rename from configure rename to configure_make diff --git a/configure_ninja b/configure_ninja new file mode 100644 index 0000000..0b1d303 --- /dev/null +++ b/configure_ninja @@ -0,0 +1,8 @@ +#!/bin/sh + +git submodule init && git submodule update + +sh proto_gen.sh + +mkdir build data +cd build && cmake .. -G Ninja diff --git a/install_prereqs.sh b/install_prereqs.sh new file mode 100644 index 0000000..f65e8dc --- /dev/null +++ b/install_prereqs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Install prerequisites for building +sudo apt install -y g++ git build-essential cmake libboost-all-dev libliquid1d libliquid-dev libsoapysdr-dev soapysdr-module-rtlsdr librtlsdr0 libpulse-dev libasound2-dev libjack-dev protobuf-compiler libprotoc-dev libssh-dev