Build script changes

This commit is contained in:
Ezra Taimuty-Loomis 2020-12-31 14:41:41 -05:00
parent 7e870ff5f7
commit f2ef2b2298
6 changed files with 34 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -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://<host_address>: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.

8
configure_ninja Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
git submodule init && git submodule update
sh proto_gen.sh
mkdir build data
cd build && cmake .. -G Ninja

4
install_prereqs.sh Normal file
View File

@ -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