Skip to content

Commit

Permalink
Merge branch 'unstable'
Browse files Browse the repository at this point in the history
  • Loading branch information
szpajder committed Aug 11, 2016
2 parents d8e1958 + dc3d1b4 commit d2af767
Show file tree
Hide file tree
Showing 6 changed files with 792 additions and 419 deletions.
43 changes: 30 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
RTLSDR-Airband
=====================

RTLSDR Airband is intended for Airband reception and online streaming to services such as liveatc.net
RTLSDR Airband is intended for AM/NFM voice channels reception and online streaming to services such as liveatc.net

Features
---------------------
* Multichannel mode - decode up to eight AM channels per dongle (within bandwidth frequency range)
* Scanner mode - decode unlimited number of AM channels with frequency hopping in a round-robin
* Multichannel mode - decode up to eight AM or NFM channels per dongle (within bandwidth frequency range)
* Scanner mode - decode unlimited number of AM and/or NFM channels with frequency hopping in a round-robin
fashion (no frequency range limitations)
* Decode multiple dongles simutaneously
* Auto squelch and Automatic Gain Control
Expand Down Expand Up @@ -107,7 +107,7 @@ Building
* Install RTLSDR library (http://sdr.osmocom.org/trac/wiki/rtl-sdr):

sudo apt-get update
sudo apt-get install git gcc autoconf make libusb-1.0-0-dev
sudo apt-get install git gcc autoconf make libusb-1.0-0-dev libtool
cd
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
Expand Down Expand Up @@ -143,26 +143,39 @@ Building

sudo apt-get install libmp3lame-dev libvorbis-dev libshout-dev libconfig++-dev

* Set the PLATFORM environment variable (to indicate your hardware platform) and run `make`.
For example, to build a binary for RPi version 1 (ARMv6 CPU, Broadcom VideoCore GPU) type
the following:
* Set the build options and run `make`. Available build options:

`PLATFORM=platform_name` - selects the hardware platform. This option is mandatory. See below.

`NFM=1` - enables NFM support. By default, NFM is disabled.

**Warning:** Do not enable NFM, if you only use AM (especially on low-power platforms, like RPi).
This incurs performance penalty, both for AM and NFM.

Examples:

Build a binary for RPi version 1 (ARMv6 CPU, Broadcom VideoCore GPU):

PLATFORM=rpiv1 make

Building for RPi V2 (ARMv7 CPU, Broadcom VideoCore GPU):
Same platform, but with NFM support enabled:

PLATFORM=rpiv2 make
PLATFORM=rpiv1 NFM=1 make

Building for RPi V2 (ARMv7 CPU, Broadcom VideoCore GPU), with NFM support:

PLATFORM=rpiv2 NFM=1 make

Building for other ARMv7-based platforms without VideoCore GPU, eg. Cubieboard (FFTW3
library is needed in this case):
library is needed in this case), NFM disabled:

sudo apt-get install libfftw3-dev
PLATFORM=armv7-generic make

Building for generic x86 CPU (FFTW3 library is needed in this case):
Building for generic x86 CPU (FFTW3 library is needed in this case), NFM enabled:

sudo apt-get install libfftw3-dev
PLATFORM=x86 make
PLATFORM=x86 NFM=1 make

* Install the software:

Expand Down Expand Up @@ -215,6 +228,10 @@ rtl_airband accepts the following command line options:
-f Run in foreground, display textual waterfalls
-c <config_file_path> Use non-default configuration file

Additional options are avalable when rtl_airband is compiled with NFM support:

-Q Use quadri correlator for FM demodulation (default is atan2)

Troubleshooting
--------------------

Expand Down Expand Up @@ -278,7 +295,7 @@ any error messages, for example: `tail /var/log/messages`. Common problems:

License
--------------------
Copyright (C) 2015 Tomasz Lemiech <[email protected]>
Copyright (C) 2015-2016 Tomasz Lemiech <[email protected]>

Based on original work by Wong Man Hang <[email protected]>

Expand Down
19 changes: 13 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ FFT = hello_fft/hello_fft.a
ifeq ($(PLATFORM), rpiv1)
CFLAGS += -DUSE_BCM_VC
CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
CFLAGS += -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk -mfpu=vfp
LDLIBS += -lbcm_host
CFLAGS += -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk -mfpu=vfp -ffast-math
LDLIBS += -lbcm_host -ldl
export LDFLAGS = -L/opt/vc/lib
DEPS = $(OBJ) $(FFT) rtl_airband_vfp.o
else ifeq ($(PLATFORM), rpiv2)
CFLAGS += -DUSE_BCM_VC
CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux
CFLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
LDLIBS += -lbcm_host
CFLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math
LDLIBS += -lbcm_host -ldl
export LDFLAGS = -L/opt/vc/lib
DEPS = $(OBJ) $(FFT) rtl_airband_neon.o
else ifeq ($(PLATFORM), armv7-generic)
CFLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
CFLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -ffast-math
LDLIBS += -lfftw3f
DEPS = $(OBJ)
else ifeq ($(PLATFORM), x86)
Expand All @@ -43,14 +43,21 @@ else ifeq ($(PLATFORM), x86)
else
DEPS =
endif
ifeq ($(NFM), 1)
CFLAGS += -DNFM
endif

$(BIN): $(DEPS)
ifndef DEPS
@printf "\nPlease set PLATFORM variable to one of available platforms:\n \
\tPLATFORM=rpiv1 make\t\tRaspberry Pi V1 (VFP FPU, use BCM VideoCore for FFT)\n \
\tPLATFORM=rpiv2 make\t\tRaspberry Pi V2 (NEON FPU, use BCM VideoCore for FFT)\n \
\tPLATFORM=armv7-generic make\tOther ARMv7 platforms, like Cubieboard (NEON FPU, use main CPU for FFT)\n \
\tPLATFORM=x86 make\t\tbuild binary for x86\n\n"
\tPLATFORM=x86 make\t\tbuild binary for x86\n\n \
Additional options:\n \
\tNFM=1\t\t\t\tInclude support for Narrow FM demodulation\n \
\t\t\t\t\tWarning: this incurs noticeable performance penalty both for AM and FM\n \
\t\t\t\t\tDo not enable NFM, if you only use AM (especially on low-power platforms, like RPi)\n\n"
@false
endif

Expand Down
116 changes: 103 additions & 13 deletions rtl_airband.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@

# PID file path (default: /run/rtl_airband.pid)
# This setting has no effect on Windows.
# pidfile = /run/rtl_airband.pid
# pidfile = "/run/rtl_airband.pid"

# De-emphasis filter time constant
# The filter suppresses high-frequency noise in NFM channels.
# Larger values cause more noise suppression.
# Set it to 0 if you don't want filtering.
# Default value: 200 (microseconds).
# You can also set this parameter per dongle and / or per channel.
# tau = 200;

# Number of USB read buffers to be used per dongle
# The default value is 10. If you use four or more dongles simultaneously
# or you get error messages like "Failed to submit transfer 12!"
# you may need to lower this value
# rtlsdr_buffers = 10;

# devices section contains all settings related to the RTLSDR receivers.
#
Expand All @@ -56,6 +70,8 @@ devices = (
{
# Device index (as identified by librtlsdr library)
index = 0;
# A quick way to ignore this device temporarily. Default: false
disable = false;
# Gain (integer, in decibels, optional). Default is auto-gain.
# gain = 28;
# Dongle mode. Can be one of the following:
Expand All @@ -80,10 +96,25 @@ devices = (
# (ie. +- 1.25 MHz around center frequency)
# This setting is valid in multichannel mode only.
freq = 118925000;
# A quick way to ignore this channel temporarily. Default: false
disable = false;
# Modulation - "am" or "nfm". Default is "am".
modulation = "am";
# Squelch level (integer, greater than 0). Default is auto.
# Set this parameter only when auto squelch does not work correctly
# (this is common with channels which transmit continuously, like ATIS/AWOS,
# when auto squelch is unable to figure out the correct noise floor level)
# squelch = 100;
#Automatioc Frequency Control (AFC) level (optional value)
#0 - disabled (by default)
#value from range 1...10 - AFC enabled, larger value means more aggressive AFC.
afc = 0;
# Multiple outputs per channel are supported. For example, a single channel
# can be sent to multiple Shoutcast servers.
outputs = (
{
# A quick way to ignore this output temporarily. Default: false
disable = false;
# Output type. Supported types are: icecast and file.
type = "icecast";
# Host name or IP address of Shoutcast/Icecast server
Expand All @@ -105,6 +136,9 @@ devices = (
# Subsequent channels
{
freq = 119100000;
# You can use both AM and NFM modulations for different channels on the same dongle.
# Probably not very useful in multichannel mode, but it's possible.
modulation = "nfm";
# This channel is streamed to two destinations
outputs = (
{
Expand All @@ -127,6 +161,7 @@ devices = (
},
{
freq = 119500000;
modulation = "am";
# This channel is streamed to Icecast and saved to local files
outputs = (
{
Expand All @@ -148,11 +183,18 @@ devices = (
# Set this to false if you want to skip silence (record only when squelch is open).
# Default is false.
continuous = true;
# Set this to true if you want to append to file if its exists with demarkation of missing fragment.
# Set this to false if you want to overwrite existing files.
# Default is true.
append = false;
}
);
},
{
freq = 120600000;
# Manual squelch setting for this channel
squelch = 250;
modulation = "am";
# This channel is not streamed to Icecast.
# It is saved to local files into two destinations - one of them records continuously, the other one
# skips silence periods.
Expand All @@ -172,7 +214,12 @@ devices = (
);
},
{
# This channel will be ignored.
# This way you can quickly disable a channel without commenting out or deleting
# large sections of config file
disable = true;
freq = 121300000;
modulation = "am";
outputs = (
{
type = "icecast";
Expand All @@ -186,6 +233,7 @@ devices = (
},
{
freq = 121600000;
modulation = "am";
outputs = (
{
type = "icecast";
Expand All @@ -198,68 +246,86 @@ devices = (
);
} );
},
# Receiver 1 - multichannel mode
# Receiver 1 - multichannel mode, 4 NFM channels
{
index = 1;
gain = 28;
mode = "multichannel";
centerfreq = 123000000;
correction = 80;
# De-emphasis filter time constant
# This setting overrides the global tau setting for all channels on this dongle
tau = 0;
channels = (
{
freq = 122000000;
freq = 152000000;
modulation = "nfm";
outputs = (
{
type = "icecast";
server = "www.example.com";
port = 8000;
mountpoint = "122000.mp3";
mountpoint = "152000.mp3";
username = "source";
password = "password";
}
);
},
{
freq = 122950000;
freq = 152100000;
modulation = "nfm";
# De-emphasis filter time constant
# Applies to this channel only
tau = 500;
outputs = (
{
type = "icecast";
server = "www.example.com";
port = 8000;
mountpoint = "122950.mp3";
mountpoint = "152100.mp3";
username = "source";
password = "password";
}
);
},
{
freq = 123800000;
freq = 152200000;
modulation = "nfm";
outputs = (
{
type = "icecast";
server = "www.example.com";
port = 8000;
mountpoint = "123800.mp3";
mountpoint = "152200.mp3";
username = "source";
password = "password";
}
);
},
{
freq = 123950000;
freq = 152300000;
modulation = "nfm";
outputs = (
{
type = "icecast";
server = "www.example.com";
port = 8000;
mountpoint = "123950.mp3";
mountpoint = "152300.mp3";
username = "source";
password = "password";
}
},
{
# This output will be ignored.
# This way you can quickly disable an output without deleting or commenting it out
disabled = true;
type = "file";
directory = "/home/pi/streams";
filename_template = "152300";
}
);
} );
},
# Receiver 2 - scan mode
# Receiver 2 - scan mode, AM modulation (default)
{
index = 2;
gain = 28;
Expand All @@ -282,4 +348,28 @@ devices = (
);
}
);
} );
},
{
# This device will be ignored.
# This way you can quickly disable a device without deleting or commenting it out
index = 3;
gain = 28;
mode = "scan";
correction = 80;
channels = (
{
freqs = ( 126300000, 121500000 );
outputs = (
{
type = "icecast";
server = "www.example.com";
port = 8000;
mountpoint = "test.mp3";
username = "source";
password = "password";
}
);
}
);
}
);
Loading

0 comments on commit d2af767

Please sign in to comment.