From 8a26abaf796300147b17fb6c0cc61344173d0169 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 3 Jun 2018 15:19:53 +0200 Subject: [PATCH] Add Debian packaging information This allows (among others) to build rtl-sdr nightly packages for a variety of distributions as part of the network:osmocom:nightly builds --- debian/README.Debian | 55 +++++++ debian/changelog | 159 ++++++++++++++++++++ debian/compat | 1 + debian/control | 54 +++++++ debian/copyright | 230 +++++++++++++++++++++++++++++ debian/copyright-scan-patterns.yml | 3 + debian/heatmap.py | 134 +++++++++++++++++ debian/librtlsdr-dev.dirs | 2 + debian/librtlsdr-dev.install | 4 + debian/librtlsdr0.dirs | 2 + debian/librtlsdr0.install | 2 + debian/librtlsdr0.maintscript | 1 + debian/librtlsdr0.metainfo.xml | 57 +++++++ debian/librtlsdr0.udev | 142 ++++++++++++++++++ debian/rtl-sdr-blacklist.conf | 6 + debian/rtl-sdr.dirs | 1 + debian/rtl-sdr.examples | 1 + debian/rtl-sdr.install | 1 + debian/rtl-sdr.manpages | 7 + debian/rtl_adsb.1 | 70 +++++++++ debian/rtl_eeprom.1 | 65 ++++++++ debian/rtl_fm.1 | 103 +++++++++++++ debian/rtl_power.1 | 176 ++++++++++++++++++++++ debian/rtl_sdr.1 | 73 +++++++++ debian/rtl_tcp.1 | 81 ++++++++++ debian/rtl_test.1 | 60 ++++++++ debian/rules | 12 ++ debian/source/format | 1 + debian/watch | 4 + 29 files changed, 1507 insertions(+) create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/copyright-scan-patterns.yml create mode 100644 debian/heatmap.py create mode 100644 debian/librtlsdr-dev.dirs create mode 100644 debian/librtlsdr-dev.install create mode 100644 debian/librtlsdr0.dirs create mode 100644 debian/librtlsdr0.install create mode 100644 debian/librtlsdr0.maintscript create mode 100644 debian/librtlsdr0.metainfo.xml create mode 100644 debian/librtlsdr0.udev create mode 100644 debian/rtl-sdr-blacklist.conf create mode 100644 debian/rtl-sdr.dirs create mode 100644 debian/rtl-sdr.examples create mode 100644 debian/rtl-sdr.install create mode 100644 debian/rtl-sdr.manpages create mode 100644 debian/rtl_adsb.1 create mode 100644 debian/rtl_eeprom.1 create mode 100644 debian/rtl_fm.1 create mode 100644 debian/rtl_power.1 create mode 100644 debian/rtl_sdr.1 create mode 100644 debian/rtl_tcp.1 create mode 100644 debian/rtl_test.1 create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 debian/watch diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..2e6d774 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,55 @@ +rtl-sdr for Debian +------------------- + +In the beginning Antti Palosaari noticed that some digital video +receiver tuners can be turned into a cheap software defined radio. + +Since there is also support in the Linux kernel to use these devices +as digital video receivers, by default the hardware will be claimed +by Linux keernel drivers for that purpose. + +Having these rtl-sdr packages installed likely means that these +devices should be available for the alternate software defined +radio use. + +The librtlsdr0 package in Debian has configuration files to +help manage the conflicting uses: + +1. Blacklists DVB-T kernel modules provided by the Linux kernel +------------------------------------------------------------------- + +Config file: +/etc/modprobe.d/librtlsdr-blacklist.conf + +contains lines to blacklist dvb_usb_rtl28xxu, e4000 and rtl2832 +kernel modules. + +Should you wish to use a device via the Linux video receiver software +while still having the librtlsdr0 package installed you may edit +this file. (Placing a # at the beginning os a line makes it a comment.) + +Then unplug/plug the USB stick. + +Not that if rtl-sdr applications are then run, they will complain about +failing to open the device. In that case, restore the blacklist and +unplug/plug the USB stick. + +If librtlsdr-blacklist.conf does not exist, then rtl-sdr was built +with the DETACH_KERNEL_DRIVER option. + +2. Permissions +-------------- + +Devices are available to users in the plugdev group. + +The librtlsdr0 package installs these default rules: +/lib/udev/rules.d/60-librtlsdr0.rules + +If you have permissions issues, you may override these values +with your own rules in /etc: + +/etc/udev/rules.d/60-librtlsdr0.rules + +After editing udev rules, run as root: + udevadm control --reload-rules + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..24d97e2 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,159 @@ +rtl-sdr (0.6git) unstable; urgency=medium + + * New upstream release + + -- Harald Welte Sun, 06 Jun 2018 15:09:42 +0200 + +rtl-sdr (0.5.4-1) unstable; urgency=medium + + * New upstream release + * update to v0.5.4-3-ga854ae8 + use USB zero-copy transfers if possible + + -- A. Maitland Bottoms Sat, 12 May 2018 16:49:43 -0400 + +rtl-sdr (0.5.3-14) unstable; urgency=medium + + * update to v0.5.3-20-g4520f00 (Closes: #892974) + * minimal ipv6 support (Closes: #870804) + * VCS to salsa + * AppStream metadata.xml + + -- A. Maitland Bottoms Mon, 16 Apr 2018 20:45:53 -0400 + +rtl-sdr (0.5.3-13) unstable; urgency=medium + + * build with libusb-1.0-0-dev stub on hurd-i386 + * initial ipv6 support for rtl_tcp... + + -- A. Maitland Bottoms Thu, 23 Nov 2017 15:59:40 -0500 + +rtl-sdr (0.5.3-12) unstable; urgency=medium + + * add new HanfTek dongle + * Bias T support (Closes: #854378, #842249) + + -- A. Maitland Bottoms Wed, 23 Aug 2017 23:31:27 -0400 + +rtl-sdr (0.5.3-11) unstable; urgency=medium + + * correct invocation of rm_conffile (Thanks Chris!) (Closes: #838161) + * drop uploaders line on advice of MIA team. (Closes: #836590) + + -- A. Maitland Bottoms Sat, 08 Oct 2016 11:17:47 -0400 + +rtl-sdr (0.5.3-10) unstable; urgency=medium + + * remove rtl-sdr-blacklist.conf on upgrade. Thanks Bob! (Closes: #829517) + + -- A. Maitland Bottoms Sat, 09 Jul 2016 23:38:24 -0400 + +rtl-sdr (0.5.3-9) unstable; urgency=medium + + * Edit of debian/librtlsdr0.udev in 0.5.3-8 was a no-op. Real fix + done to debian/patches/use-udev-uaccess-rules. (Closes: #825073) + + -- A. Maitland Bottoms Wed, 25 May 2016 17:19:57 -0400 + +rtl-sdr (0.5.3-8) unstable; urgency=high + + * Fix syntax errors for systemd-udevd in udev rules (Closes: #825073) + + -- A. Maitland Bottoms Tue, 24 May 2016 21:08:50 -0400 + +rtl-sdr (0.5.3-7) unstable; urgency=medium + + * better udev rules (more like camera devices in libgphoto2-6) + + -- A. Maitland Bottoms Tue, 10 May 2016 19:20:27 -0400 + +rtl-sdr (0.5.3-6) unstable; urgency=medium + + * Use ENV{ID_SOFTWARE_RADIO}=1 in udev rules (Closes: #823089) + * Enable DETACH_KERNEL_DRIVER (Closes: 823022) + * Make myself maintainer so I get the bug reports + + -- A. Maitland Bottoms Sun, 08 May 2016 12:12:13 -0400 + +rtl-sdr (0.5.3-5) unstable; urgency=medium + + * Add watch fiule + * place rtl-sdr -n comm section (Closes: #758077) + * improve-librtlsdr-pc-file (Closes: #784912) + * improve-scanning-range-parsing (LP: #1469478) + + -- A. Maitland Bottoms Sun, 23 Aug 2015 10:35:42 -0400 + +rtl-sdr (0.5.3-4) unstable; urgency=low + + * Update to v0.5.3-12-ge3c03f7 + + -- A. Maitland Bottoms Sat, 08 Aug 2015 23:43:54 -0400 + +rtl-sdr (0.5.3-3) unstable; urgency=low + + * Update to v0.5.3-5-g6ee5573 + lib: handle events after canceling transfers + lib: change default number of transfers to 15 + rtl_tcp: make all global variables static + + -- A. Maitland Bottoms Sun, 13 Apr 2014 10:48:49 -0400 + +rtl-sdr (0.5.3-2) unstable; urgency=low + + * Upstream: lib: only print to stderr in tuner_r82xx_set_pll() + * Update man pages (New -M (modulation) and -E (option) and ppm setting) + * Have librtlsdr0 also install a blacklist for linux video drivers + + -- A. Maitland Bottoms Sat, 08 Feb 2014 22:40:06 -0500 + +rtl-sdr (0.5.3-1) unstable; urgency=low + + * New upstream git tag release + + -- A. Maitland Bottoms Thu, 06 Feb 2014 20:45:38 -0500 + +rtl-sdr (0.5.2.7.3ab6-1~bpo70+1) wheezy-backports; urgency=low + + * Rebuild for wheezy-backports. + + -- A. Maitland Bottoms Tue, 21 Jan 2014 19:34:16 -0500 + +rtl-sdr (0.5.2.7.3ab6-1) unstable; urgency=low + + * New upstream snapshot + + -- A. Maitland Bottoms Sun, 29 Dec 2013 21:37:19 -0500 + +rtl-sdr (0.5.1.14.360d-1~wheezy) stable; urgency=low + + * New upstream snapshot + * GNU Radio LiveDVD 2013-1110 + + -- A. Maitland Bottoms Mon, 11 Nov 2013 12:46:00 -0500 + +rtl-sdr (0.5.0.4.4914-2) unstable; urgency=low + + * Use kfreebsd libusb + + -- A. Maitland Bottoms Fri, 01 Nov 2013 17:16:42 -0400 + +rtl-sdr (0.5.0.4.4914-1) stable; urgency=low + + * New upstream snapshot (Closes: #701018). + * Match GNU Radio live distribution version + * Sponsored upload + + -- A. Maitland Bottoms Sat, 28 Sep 2013 16:55:08 -0400 + +rtl-sdr (0.5.0+git20130715-1) unstable; urgency=low + + * Initial release (Closes: #701018). + + -- Adam Cécile (Le_Vert) Mon, 15 Jul 2013 15:51:05 +0200 + +librtlsdr (0.0git3198f14-1) unstable; urgency=low + + * New upstream git + + -- A. Maitland Bottoms Mon, 14 May 2012 20:28:18 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c77877d --- /dev/null +++ b/debian/control @@ -0,0 +1,54 @@ +Source: rtl-sdr +Section: comm +Priority: optional +Maintainer: A. Maitland Bottoms +Build-Depends: cmake, + debhelper (>= 9.0.0~), + libusb-1.0-0-dev [linux-any], + libusb-dev [hurd-i386], + libusb2-dev [kfreebsd-any] +Standards-Version: 4.1.4 +Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr +Vcs-Browser: https://salsa.debian.org/bottoms/pkg-rtl-sdr +Vcs-Git: https://salsa.debian.org/bottoms/pkg-rtl-sdr.git + +Package: librtlsdr-dev +Section: libdevel +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: librtlsdr0 (= ${binary:Version}), + libusb-1.0-0-dev [!kfreebsd-any], + libusb2-dev [kfreebsd-any], + ${misc:Depends} +Description: Software defined radio receiver for Realtek RTL2832U (development) + rtl-sdr is a software defined radio (SDR) receiver software for certain + low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip. + . + This package contains development files. + +Package: librtlsdr0 +Section: libs +Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} +Multi-Arch: same +Description: Software defined radio receiver for Realtek RTL2832U (library) + rtl-sdr is a software defined radio (SDR) receiver software for certain + low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip. + . + This package contains the shared library. + +Package: rtl-sdr +Architecture: any +Depends: librtlsdr0 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Description: Software defined radio receiver for Realtek RTL2832U (tools) + rtl-sdr is a software defined radio (SDR) receiver software for certain + low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip. + . + This package contains a set of command line utilities: + * rtl_adsb: a simple ADS-B decoder for RTL2832 based DVB-T receivers + * rtl_eeprom: an EEPROM programming tool for RTL2832 based DVB-T receivers + * rtl_fm: a narrow band FM demodulator for RTL2832 based DVB-T receivers + * rtl_sdr: an I/Q recorder for RTL2832 based DVB-T receivers + * rtl_tcp: an I/Q spectrum server for RTL2832 based DVB-T receivers + * rtl_test: a benchmark tool for RTL2832 based DVB-T receivers diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..72f251f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,230 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rtl-sdr +Upstream-Contact: http://sdr.osmocom.org/trac/wiki/rtl-sdr +Source: + git clone git://git.osmocom.org/rtl-sdr.git + The upstream package source tarball was generated from the tag: + git archive --format=tar --prefix=rtl-sdr-0.5.2.7.3ab6/ 3ab6ff | gzip > ../rtl-sdr_0.5.2.7.3ab6.orig.tar.gz +Comment: + Debian packages sponsored by A. Maitland Bottoms, + based upon packaging work by Adam Cécile. + . + Upstream Authors: + Steve Markgraf + Dimitri Stolnikov + Hoernchen + Kyle Keen +Copyright: 2012,2013 OSMOCOM Project +License: GPL-2.0+ + +Files: * +Copyright: 2012, 2013, OSMOCOM Project +License: GPL-3+ + +Files: debian/* +Copyright: 2013 Adam Cécile (Le_Vert) + 2012,2013 A. Maitland Bottoms +License: GPL-2.0+ + +Files: debian/librtlsdr0.udev +Copyright: 2012, 2013, Osmocom rtl-sdr project +License: GPL-3+ + +Files: debian/rtl_adsb.1 +Copyright: Copyright (c) 2013, A. Maitland Bottoms +License: GPL-2.0+ + +Files: debian/rtl_eeprom.1 + debian/rtl_test.1 +Copyright: Copyright (c) 2013, A. Maitland Bottoms +License: GPL-2+ + +Files: git-version-gen +Copyright: 2007-2010, Free Software Foundation, Inc. +License: GPL-3+ + +Files: include/* +Copyright: 2012, Steve Markgraf + 2012, Hans-Frieder Vogt +License: GPL-2+ + +Files: include/CMakeLists.txt +Copyright: 2012, 2013, OSMOCOM Project +License: GPL-3+ + +Files: include/rtl-sdr.h +Copyright: 2012, Dimitri Stolnikov + 2012, 2013, Steve Markgraf +License: GPL-2+ + +Files: include/rtl-sdr_export.h +Copyright: 2012, Hoernchen +License: GPL-2+ + +Files: include/tuner_e4k.h +Copyright: 2012, Sylvain Munaut + 2012, Hoernchen + 2011, 2012, Harald Welte +License: GPL-2+ + +Files: include/tuner_fc2580.h +Copyright: Steve Markgraf +License: GPL-2.0+ + +Files: include/tuner_r82xx.h +Copyright: 2013, Steve Markgraf + 2013, Mauro Carvalho Chehab +License: GPL-2+ + +Files: rtl-sdr.rules +Copyright: 2012, 2013, Osmocom rtl-sdr project +License: GPL-3+ + +Files: src/* +Copyright: 2012, Steve Markgraf +License: GPL-2+ + +Files: src/CMakeLists.txt +Copyright: 2012, 2013, OSMOCOM Project +License: GPL-3+ + +Files: src/Makefile.am +Copyright: 2012 Steve Markgraf + 2012 Dimitri Stolnikov +License: GPL-2.0+ + +Files: src/convenience/* +Copyright: 2014, Kyle Keen +License: GPL-2+ + +Files: src/getopt/* +Copyright: 88-96, 98, 99, 1987, 2000, 2001 +License: LGPL-2.1+ + +Files: src/getopt/getopt.h +Copyright: 1989-1994, 1996-1999, 2001, Free Software Foundation, Inc. +License: LGPL-2.1+ + +Files: src/librtlsdr.c +Copyright: 2012-2014, Steve Markgraf + 2012, Dimitri Stolnikov +License: GPL-2+ + +Files: src/rtl_adsb.c +Copyright: 2012, Youssef Touil + 2012, Steve Markgraf + 2012, Kyle Keen + 2012, Ian Gilmour + 2012, Hoernchen +License: GPL-2+ + +Files: src/rtl_fm.c +Copyright: 2013, Elias Oenal + 2012, Steve Markgraf + 2012, Kyle Keen + 2012, Hoernchen +License: GPL-2+ + +Files: src/rtl_power.c +Copyright: 2012, Steve Markgraf + 2012, Kyle Keen + 2012, Hoernchen +License: GPL-2+ + +Files: src/rtl_tcp.c +Copyright: 2012, Steve Markgraf + 2012, 2013, Hoernchen +License: GPL-2+ + +Files: src/rtl_test.c +Copyright: 2014, Michael Tatarinov + 2012-2014, Steve Markgraf + 2012-2014, Kyle Keen +License: GPL-2+ + +Files: src/tuner_e4k.c +Copyright: 2012, Sylvain Munaut + 2012, Hoernchen + 2011, 2012, Harald Welte +License: GPL-2+ + +Files: src/tuner_fc0012.c +Copyright: 2012, Steve Markgraf + 2012, Hans-Frieder Vogt +License: GPL-2+ + +Files: src/tuner_fc0013.c +Copyright: 2012, Steve Markgraf + 2012, Hans-Frieder Vogt + 2010, Fitipower Integrated Technology Inc +License: GPL-2+ + +Files: src/tuner_fc2580.c +Copyright: Steve Markgraf + Dimitri Stolnikov +License: GPL-2.0+ + +Files: src/tuner_r82xx.c +Copyright: 2013, Steve Markgraf + 2013, Mauro Carvalho Chehab +License: GPL-2+ + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991, or (at + your option) any later version. + . + On Debian systems, the complete text of version 2 of the GNU General + Public License can be found in '/usr/share/common-licenses/GPL-2'. + +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/GPL-3". + +License: LGPL-2.1+ + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in "/usr/share/common-licenses/LGPL-2". diff --git a/debian/copyright-scan-patterns.yml b/debian/copyright-scan-patterns.yml new file mode 100644 index 0000000..5c8b524 --- /dev/null +++ b/debian/copyright-scan-patterns.yml @@ -0,0 +1,3 @@ +ignore : + suffixes : + - in diff --git a/debian/heatmap.py b/debian/heatmap.py new file mode 100644 index 0000000..c3ac935 --- /dev/null +++ b/debian/heatmap.py @@ -0,0 +1,134 @@ +#! /usr/bin/env python2 + +from PIL import Image, ImageDraw, ImageFont +import sys, gzip, math, colorsys, datetime +from collections import defaultdict +from itertools import * + +# todo: matplotlib powered --interactive +# arbitrary freq marker spacing + +path = sys.argv[1] +output = sys.argv[2] + +raw_data = lambda: open(path) +if path.endswith('.gz'): + raw_data = lambda: gzip.open(path, 'rb') + +def frange(start, stop, step): + i = 0 + while (i*step + start <= stop): + yield i*step + start + i += 1 + +print("loading") + +freqs = set() +f_cache = set() +times = set() +labels = set() +min_z = 0 +max_z = -100 +start, stop = None, None +for line in raw_data(): + line = [s.strip() for s in line.strip().split(',')] + line = [line[0], line[1]] + [float(s) for s in line[2:] if s] + + low = line[2] + high = line[3] + step = line[4] + f_key = (int(low), int(high), step) + if f_key not in f_cache: + freqs.update(list(frange(int(low), int(high), step))) + freqs.add(high) + labels.add(low) + f_cache.add(f_key) + + t = line[0] + ' ' + line[1] + times.add(t) + + zs = line[6:] + min_z = min(min_z, min(z for z in zs if not math.isinf(z))) + max_z = max(max_z, max(zs)) + + if start is None: + start = datetime.datetime.strptime(line[0] + ' ' + line[1], '%Y-%m-%d %H:%M:%S') + stop = datetime.datetime.strptime(line[0] + ' ' + line[1], '%Y-%m-%d %H:%M:%S') + +freqs = list(sorted(list(freqs))) +times = list(sorted(list(times))) +labels = list(sorted(list(labels))) + +if len(labels) == 1: + delta = (max(freqs) - min(freqs)) / (len(freqs) / 500) + delta = round(delta / 10**int(math.log10(delta))) * 10**int(math.log10(delta)) + delta = int(delta) + lower = int(math.ceil(min(freqs) / delta) * delta) + labels = list(range(lower, int(max(freqs)), delta)) + +print("x: %i, y: %i, z: (%f, %f)" % (len(freqs), len(times), min_z, max_z)) + +def rgb2(z): + g = (z - min_z) / (max_z - min_z) + return (int(g*255), int(g*255), 50) + +def rgb3(z): + g = (z - min_z) / (max_z - min_z) + c = colorsys.hsv_to_rgb(0.65-(g-0.08), 1, 0.2+g) + return (int(c[0]*256),int(c[1]*256),int(c[2]*256)) + +print("drawing") +img = Image.new("RGB", (len(freqs), len(times))) +pix = img.load() +x_size = img.size[0] +for line in raw_data(): + line = [s.strip() for s in line.strip().split(',')] + line = [line[0], line[1]] + [float(s) for s in line[2:] if s] + t = line[0] + ' ' + line[1] + if t not in times: + continue # happens with live files + y = times.index(t) + low = line[2] + high = line[3] + step = line[4] + x_start = freqs.index(low) + for i in range(len(line[6:])): + x = x_start + i + if x >= x_size: + continue + z = line[6+i] + # fast check for nan/-inf + if not z >= min_z: + z = min_z + pix[x,y] = rgb2(z) + +print("labeling") +draw = ImageDraw.Draw(img) +font = ImageFont.load_default() +pixel_width = step +for label in labels: + y = 10 + #x = freqs.index(label) + x = int((label-min(freqs)) / pixel_width) + s = '%.3fMHz' % (label/1000000.0) + draw.text((x, y), s, font=font, fill='white') + +duration = stop - start +duration = duration.seconds +pixel_height = duration / len(times) +hours = int(duration / 3600) +minutes = int((duration - 3600*hours) / 60) +draw.text((2, img.size[1] - 45), 'Duration: %i:%02i' % (hours, minutes), font=font, fill='white') +draw.text((2, img.size[1] - 35), 'Range: %.2fMHz - %.2fMHz' % (min(freqs)/1e6, max(freqs)/1e6), font=font, fill='white') +draw.text((2, img.size[1] - 25), 'Pixel: %.2fHz x %is' % (pixel_width, int(round(pixel_height))), font=font, fill='white') +draw.text((2, img.size[1] - 15), 'Started: {0}'.format(start), font=font, fill='white') +# bin size + +print("saving") +img.save(output) + + + + + + diff --git a/debian/librtlsdr-dev.dirs b/debian/librtlsdr-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/debian/librtlsdr-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/debian/librtlsdr-dev.install b/debian/librtlsdr-dev.install new file mode 100644 index 0000000..76f28fa --- /dev/null +++ b/debian/librtlsdr-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/*/lib*.a +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/* diff --git a/debian/librtlsdr0.dirs b/debian/librtlsdr0.dirs new file mode 100644 index 0000000..7774c51 --- /dev/null +++ b/debian/librtlsdr0.dirs @@ -0,0 +1,2 @@ +etc/modprobe.d +usr/lib diff --git a/debian/librtlsdr0.install b/debian/librtlsdr0.install new file mode 100644 index 0000000..d8ef58a --- /dev/null +++ b/debian/librtlsdr0.install @@ -0,0 +1,2 @@ +usr/lib/*/lib*.so.* +debian/librtlsdr0.metainfo.xml usr/share/metainfo diff --git a/debian/librtlsdr0.maintscript b/debian/librtlsdr0.maintscript new file mode 100644 index 0000000..9819521 --- /dev/null +++ b/debian/librtlsdr0.maintscript @@ -0,0 +1 @@ +rm_conffile /etc/modprobe.d/rtl-sdr-blacklist.conf 0.5.3-10~ diff --git a/debian/librtlsdr0.metainfo.xml b/debian/librtlsdr0.metainfo.xml new file mode 100644 index 0000000..bab9c83 --- /dev/null +++ b/debian/librtlsdr0.metainfo.xml @@ -0,0 +1,57 @@ + + + librtlsdr0 + GPL-2+ + librtlsdr0 + Control of rtl-sdr radio receiver + +

+rtl-sdr is a software defined radio (SDR) receiver software for certain +low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip. +

+
+ + usb:v0BDAp2832d* + usb:v0BDAp2838d* + usb:v0413p6680d* + usb:v0413p6F0Fd* + usb:v0458p707Fd* + usb:v0CCDp00A9d* + usb:v0CCDp00B3d* + usb:v0CCDp00B4d* + usb:v0CCDp00B5d* + usb:v0CCDp00B7d* + usb:v0CCDp00B8d* + usb:v0CCDp00B9d* + usb:v0CCDp00C0d* + usb:v0CCDp00C6d* + usb:v0CCDp00D3d* + usb:v0CCDp00D7d* + usb:v0CCDp00E0d* + usb:v1554p5020d* + usb:v15F4p0131d* + usb:v15F4p0133d* + usb:v185Bp0620d* + usb:v185Bp0650d* + usb:v185Bp0680d* + usb:v1B80pD393d* + usb:v1B80pD394d* + usb:v1B80pD395d* + usb:v1B80pD397d* + usb:v1B80pD398d* + usb:v1B80pD39Dd* + usb:v1B80pD3A4d* + usb:v1B80pD3A8d* + usb:v1B80pD3AFd* + usb:v1B80pD3B0d* + usb:v1D19p1101d* + usb:v1D19p1102d* + usb:v1D19p1103d* + usb:v1D19p1104d* + usb:v1F4DpA803d* + usb:v1F4DpB803d* + usb:v1F4DpC803d* + usb:v1F4DpD286d* + usb:v1F4DpD803d* + +
diff --git a/debian/librtlsdr0.udev b/debian/librtlsdr0.udev new file mode 100644 index 0000000..b2f4054 --- /dev/null +++ b/debian/librtlsdr0.udev @@ -0,0 +1,142 @@ +# +# Copyright 2012-2013 Osmocom rtl-sdr project +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# original RTL2832U vid/pid (hama nano, for example) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE:="0666" + +# RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc. +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666" + +# DigitalNow Quad DVB-T PCI-E card (4x FC0012?) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6680", MODE:="0666" + +# Leadtek WinFast DTV Dongle mini D (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6f0f", MODE:="0666" + +# Genius TVGo DVB-T03 USB dongle (Ver. B) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0458", ATTRS{idProduct}=="707f", MODE:="0666" + +# Terratec Cinergy T Stick Black (rev 1) (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00a9", MODE:="0666" + +# Terratec NOXON rev 1 (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b3", MODE:="0666" + +# Terratec Deutschlandradio DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b4", MODE:="0666" + +# Terratec NOXON DAB Stick - Radio Energy (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b5", MODE:="0666" + +# Terratec Media Broadcast DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b7", MODE:="0666" + +# Terratec BR DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b8", MODE:="0666" + +# Terratec WDR DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b9", MODE:="0666" + +# Terratec MuellerVerlag DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c0", MODE:="0666" + +# Terratec Fraunhofer DAB Stick (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c6", MODE:="0666" + +# Terratec Cinergy T Stick RC (Rev.3) (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d3", MODE:="0666" + +# Terratec T Stick PLUS (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0666" + +# Terratec NOXON rev 2 (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00e0", MODE:="0666" + +# PixelView PV-DT235U(RN) (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1554", ATTRS{idProduct}=="5020", MODE:="0666" + +# Astrometa DVB-T/DVB-T2 (R828D) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0131", MODE:="0666" + +# HanfTek DAB+FM+DVB-T +SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0133", MODE:="0666" + +# Compro Videomate U620F (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0620", MODE:="0666" + +# Compro Videomate U650F (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0650", MODE:="0666" + +# Compro Videomate U680F (E4000) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0680", MODE:="0666" + +# GIGABYTE GT-U7300 (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d393", MODE:="0666" + +# DIKOM USB-DVBT HD +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d394", MODE:="0666" + +# Peak 102569AGPK (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d395", MODE:="0666" + +# KWorld KW-UB450-T USB DVB-T Pico TV (TUA9001) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d397", MODE:="0666" + +# Zaapa ZT-MINDVBZP (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d398", MODE:="0666" + +# SVEON STV20 DVB-T USB & FM (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d39d", MODE:="0666" + +# Twintech UT-40 (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a4", MODE:="0666" + +# ASUS U3100MINI_PLUS_V2 (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a8", MODE:="0666" + +# SVEON STV27 DVB-T USB & FM (FC0013) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3af", MODE:="0666" + +# SVEON STV21 DVB-T USB & FM +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3b0", MODE:="0666" + +# Dexatek DK DVB-T Dongle (Logilink VG0002A) (FC2580) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1101", MODE:="0666" + +# Dexatek DK DVB-T Dongle (MSI DigiVox mini II V3.0) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1102", MODE:="0666" + +# Dexatek DK 5217 DVB-T Dongle (FC2580) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1103", MODE:="0666" + +# MSI DigiVox Micro HD (FC2580) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1104", MODE:="0666" + +# Sweex DVB-T USB (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="a803", MODE:="0666" + +# GTek T803 (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="b803", MODE:="0666" + +# Lifeview LV5TDeluxe (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="c803", MODE:="0666" + +# MyGica TD312 (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d286", MODE:="0666" + +# PROlectrix DV107669 (FC0012) +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d803", MODE:="0666" diff --git a/debian/rtl-sdr-blacklist.conf b/debian/rtl-sdr-blacklist.conf new file mode 100644 index 0000000..94dc04e --- /dev/null +++ b/debian/rtl-sdr-blacklist.conf @@ -0,0 +1,6 @@ +# This system has librtlsdr0 installed in order to +# use digital video broadcast receivers as generic +# software defined radios. +blacklist dvb_usb_rtl28xxu +blacklist e4000 +blacklist rtl2832 diff --git a/debian/rtl-sdr.dirs b/debian/rtl-sdr.dirs new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/debian/rtl-sdr.dirs @@ -0,0 +1 @@ +usr/bin diff --git a/debian/rtl-sdr.examples b/debian/rtl-sdr.examples new file mode 100644 index 0000000..545e5bd --- /dev/null +++ b/debian/rtl-sdr.examples @@ -0,0 +1 @@ +debian/heatmap.py diff --git a/debian/rtl-sdr.install b/debian/rtl-sdr.install new file mode 100644 index 0000000..1df36c6 --- /dev/null +++ b/debian/rtl-sdr.install @@ -0,0 +1 @@ +usr/bin/* diff --git a/debian/rtl-sdr.manpages b/debian/rtl-sdr.manpages new file mode 100644 index 0000000..b090ac9 --- /dev/null +++ b/debian/rtl-sdr.manpages @@ -0,0 +1,7 @@ +debian/rtl_adsb.1 +debian/rtl_eeprom.1 +debian/rtl_fm.1 +debian/rtl_power.1 +debian/rtl_sdr.1 +debian/rtl_tcp.1 +debian/rtl_test.1 diff --git a/debian/rtl_adsb.1 b/debian/rtl_adsb.1 new file mode 100644 index 0000000..96b4920 --- /dev/null +++ b/debian/rtl_adsb.1 @@ -0,0 +1,70 @@ +.TH "rtl_adsb" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl_adsb \- a simple ADS-B decoder +.SH DESCRIPTION +Uses a re-purposed DVB-T receiver as a software defined +radio to receive and decode ADS-B data. Written by Kyle Keen +and incorporated in the osmocom rtl-sdr project. +.LP +Automatic dependent surveillance-broadcast, ADS-B, consists +of position and other status data transmitted by aircraft +in support of air traffic control in order to improve safety +of flight. +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH USAGE +With a suitable antenna for receiving the 1090 MHz signal attached +to the rtl-sdr supported device, this program will output the +data decoded from that signal. +.SH SYNOPSIS +.B rtl_adsb [-R] [-g gain] [-p ppm] [output file] +.SH OPTIONS +.IP "-d device_index (default: 0)" +.IP "-V verbove output (default: off)" +.IP "-S show short frames (default: off)" +.IP "-Q quality (0: no sanity checks, 0.5: half bit, 1: one bit (default), 2: two bits)" +.IP "-e allowed_errors (default: 5)" +.IP "-g tuner_gain (default: automatic)" +.IP "-p ppm_error (default: 0)" +.IP tfilename + (a '-' dumps samples to stdout) + (omitting the filename also uses stdout) +.SH EXAMPLES +.IP "Streaming with netcat:" + rtl_adsb | netcat -lp 8080 + + while true; do rtl_adsb | nc -lp 8080; done +.IP "Streaming with socat:" + rtl_adsb | socat -u - TCP4:sdrsharp.com:47806 +.SH SEE ALSO +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_eeprom(1), rtl_fm(1), rtl_sdr(1), rtl_tcp(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_eeprom.1 b/debian/rtl_eeprom.1 new file mode 100644 index 0000000..32ec3e8 --- /dev/null +++ b/debian/rtl_eeprom.1 @@ -0,0 +1,65 @@ +.TH "rtl_eeprom" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl-eeprom \- EEPROM programming tool for RTL2832 based DVB-T receivers +.SH DESCRIPTION +Dumps configuration and also writes EEPROM configuration. +Written by Steve Markgraf and incorporated in the osmocom rtl-sdr project. +.LP +Use at your own risk, especially -w! +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH USAGE +Writing bad information to the EEPROM will make your +device useless. +.SH SYNOPSIS +.B rtl_eeprom [OPTIONS] +.SH OPTIONS +.IP "-d device_index (default: 0)" +.IP "-m set manufacturer string" +.IP "-p set product string" +.IP "-s set serial number string" +.IP "-i <0,1> disable/enable IR-endpoint" +.IP "-g generate default config and write to device" + can be one of: + realtek Realtek default (as without EEPROM) + realtek_oem Realtek default OEM with EEPROM + noxon Terratec NOXON DAB Stick + terratec_black Terratec T Stick Black + terratec_plus Terratec T Stick+ (DVB-T/DAB) +.IP "-w write dumped file to device" +.IP "-r dump EEPROM to file" +.IP "-h display this help text" +.LP +Use on your own risk, especially -w! +.SH SEE ALSO +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_fm(1), rtl_sdr(1), rtl_tcp(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_fm.1 b/debian/rtl_fm.1 new file mode 100644 index 0000000..00e3f72 --- /dev/null +++ b/debian/rtl_fm.1 @@ -0,0 +1,103 @@ +.TH "rtl_adsb" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl_fm \- a simple FM demodulator for RTL2832 based DVB-T receivers +.SH DESCRIPTION +Uses a re-purposed DVB-T receiver as a software defined +radio to receive narrow band FM signals and demodulate +to audio. Written for and incorporated in the osmocom rtl-sdr project. +.LP +Narrowband FM is commonly used by public service agencies and +commercial dispatch operations in the VHF and UHF bands. +Also can demodulate Wideband FM, as found in the 88-108 MHz FM +broadcast band. +Experimental options include AM, LSB, USB and DSB demodulation. +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH USAGE +With a suitable antenna for receiving the signal attached +to the rtl-sdr supported device, this program will output the +digital audio data decoded from that signal. The data can be +listened to by piping to Sox or aplay applications to play the +stream on the computer sound card. +.SH SYNOPSIS +.B rtl_fm [-f freq] [-options] [filename] +.SH OPTIONS +.IP "-f frequency_to_tune_to [Hz]" + use multiple -f for scanning, (requires squelch) + ranges supported, -f 118M:137M:25k +.IP "[-M modulation (default: fm)]" + fm, wbfm, raw, am, usb, lsb + wbfm == -M fm -s 170k -o 4 -A fast -r 32k -l 0 -E deemp + raw mode outputs 2x16 bit IQ pairs +.IP "-s sample_rate (default: 24k)" +.IP "-d device_index (default: 0)" +.IP "-g tuner_gain (default: automatic)" +.IP "-l squelch_level (default: 0/off)" +.IP "-o oversampling (default: 1, 4 recommended)" + for fm squelch is inverted +.IP "[-o oversampling (default: 1, 4 recommended)]" +.IP "-p ppm_error (default: 0)" +.IP "[-E enable_option (default: none)]" + use multiple -E to enable multiple options + edge: enable lower edge tuning + dc: enable dc blocking filter + deemp: enable de-emphasis filter + direct: enable direct sampling + offset: enable offset tuning +.IP "filename ('-' means stdout)" + omitting the filename also uses stdout +.SH Experimental options +.IP "[-r resample_rate (default: none / same as -s)]" +.IP "[-t squelch_delay (default: 10)]" + +values will mute/scan, -values will exit +.IP "[-F fir_size (default: off)]" + enables low-leakage downsample filter + size can be 0 or 9. 0 has bad roll off +.IP "-A std/fast/lut choose atan math (default: std)" +.IP filename + (a '-' dumps samples to stdout) + (omitting the filename also uses stdout) +.SH EXAMPLES +Produces signed 16 bit ints, use Sox or aplay to hear them. +.IP "rtl_fm ... - | play -t raw -r 24k -es -b 16 -c 1 -V1 -" + | aplay -r 24k -f S16_LE -t raw -c 1 + -M wbfm | play -r 32k ... +.IP "rtl_fm ... -s 22050 - | multimon -t raw /dev/stdin" +.SH SEE ALSO +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Rtl_fm Guide: +.B http://kmkeen.com/rtl-demod-guide/ +.LP +.sp +sox(1), play(1), aplay(1) +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_eeprom(1), rtl_sdr(1), rtl_tcp(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_power.1 b/debian/rtl_power.1 new file mode 100644 index 0000000..16b5812 --- /dev/null +++ b/debian/rtl_power.1 @@ -0,0 +1,176 @@ +.TH rtl_power: "1" "0.5.1" RTL_SDR "User Commands" +.SH NAME +rtl_power: \- wideband spectrum monitor utility +.SH DESCRIPTION +Uses a re-purposed DVB-T receiver as a software defined +radio to receive signals in I/Q data form. Written for +and incorporated in the osmocom rtl-sdr project. +.SH USAGE +rtl_power, a simple FFT logger for RTL2832 based DVB\-T receivers +.PP +This tool gathers signal data over a very wide area of the frequency spectrum, +and then that data can be used to find active areas of the spectrum. +.PP +Use: rtl_power \fB\-f\fR freq_range [\-options] [filename] +.HP +\fB\-f\fR lower:upper:bin_size [Hz] +.IP +(bin size is a maximum, smaller more convenient bins +.TP +will be used. +valid range 1Hz \- 2.8MHz) +.IP +[\-i integration_interval (default: 10 seconds)] +.IP +(buggy if a full sweep takes longer than the interval) +.IP +[\-1 enables single\-shot mode (default: off)] +[\-e exit_timer (default: off/0)] +[\-d device_index (default: 0)] +[\-g tuner_gain (default: automatic)] +[\-p ppm_error (default: 0)] +filename (a '\-' dumps samples to stdout) +.IP +(omitting the filename also uses stdout) +.SS "Experimental options:" +.IP +[\-w window (default: rectangle)] +.IP +(hamming, blackman, blackman\-harris, hann\-poisson, bartlett, youssef) +.IP +[\-c crop_percent (default: 0%, recommended: 20%\-50%)] +.IP +(discards data at the edges, 100% discards everything) +(has no effect for bins larger than 1MHz) +.IP +[\-F fir_size (default: disabled)] +.IP +(enables low\-leakage downsample filter, +.TP +fir_size can be 0 or 9. +0 has bad roll off, +.IP +try with '\-c 50%') +.IP +[\-P enables peak hold (default: off)] +[\-D enable direct sampling (default: off)] +[\-O enable offset tuning (default: off)] +.SS "CSV FFT output columns:" +.IP +date, time, Hz low, Hz high, Hz step, samples, dbm, dbm, ... +.SH EXAMPLES +.IP +rtl_power \fB\-f\fR 88M:108M:125k fm_stations.csv +.IP +(creates 160 bins across the FM band, +.IP +individual stations should be visible) +.IP +rtl_power \fB\-f\fR 100M:1G:1M \fB\-i\fR 5m \fB\-1\fR survey.csv +.IP +(a five minute low res scan of nearly everything) +.IP +rtl_power \fB\-f\fR ... \fB\-i\fR 15m \fB\-1\fR log.csv +.IP +(integrate for 15 minutes and exit afterwards) +.IP +rtl_power \fB\-f\fR ... \fB\-e\fR 1h | gzip > log.csv.gz +.IP +(collect data for one hour and compress it on the fly) +.SS "Convert CSV to a waterfall graphic with:" +.IP +http://kmkeen.com/tmp/heatmap.py.txt +.PP +rtl_power, a simple FFT logger for RTL2832 based DVB\-T receivers +.PP +Use: rtl_power \fB\-f\fR freq_range [\-options] [filename] +.HP +\fB\-f\fR lower:upper:bin_size [Hz] +.IP +(bin size is a maximum, smaller more convenient bins +.TP +will be used. +valid range 1Hz \- 2.8MHz) +.IP +[\-i integration_interval (default: 10 seconds)] +.IP +(buggy if a full sweep takes longer than the interval) +.IP +[\-1 enables single\-shot mode (default: off)] +[\-e exit_timer (default: off/0)] +[\-d device_index (default: 0)] +[\-g tuner_gain (default: automatic)] +[\-p ppm_error (default: 0)] +filename (a '\-' dumps samples to stdout) +.IP +(omitting the filename also uses stdout) +.SS "Experimental options:" +.IP +[\-w window (default: rectangle)] +.IP +(hamming, blackman, blackman\-harris, hann\-poisson, bartlett, youssef) +.IP +[\-c crop_percent (default: 0%, recommended: 20%\-50%)] +.IP +(discards data at the edges, 100% discards everything) +(has no effect for bins larger than 1MHz) +.IP +[\-F fir_size (default: disabled)] +.IP +(enables low\-leakage downsample filter, +.TP +fir_size can be 0 or 9. +0 has bad roll off, +.IP +try with '\-c 50%') +.IP +[\-P enables peak hold (default: off)] +[\-D enable direct sampling (default: off)] +[\-O enable offset tuning (default: off)] +.SS "CSV FFT output columns:" +.IP +date, time, Hz low, Hz high, Hz step, samples, dbm, dbm, ... +.IP +rtl_power \fB\-f\fR 88M:108M:125k fm_stations.csv +.IP +(creates 160 bins across the FM band, +.IP +individual stations should be visible) +.IP +rtl_power \fB\-f\fR 100M:1G:1M \fB\-i\fR 5m \fB\-1\fR survey.csv +.IP +(a five minute low res scan of nearly everything) +.IP +rtl_power \fB\-f\fR ... \fB\-i\fR 15m \fB\-1\fR log.csv +.IP +(integrate for 15 minutes and exit afterwards) +.IP +rtl_power \fB\-f\fR ... \fB\-e\fR 1h | gzip > log.csv.gz +.IP +(collect data for one hour and compress it on the fly) +.SS "Convert CSV to a waterfall graphic with:" +.IP +http://kmkeen.com/tmp/heatmap.py.txt +.SH "SEE ALSO" +.LP +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_eeprom(1), rtl_fm(1), rtl_sdr(1), rtl_tcp(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_sdr.1 b/debian/rtl_sdr.1 new file mode 100644 index 0000000..6b651e2 --- /dev/null +++ b/debian/rtl_sdr.1 @@ -0,0 +1,73 @@ +.TH "rtl_sdr" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl-sdr \- an I/Q recorder for RTL2832 based DVB-T receivers +.SH DESCRIPTION +Uses a re-purposed DVB-T receiver as a software defined +radio to receive signals in I/Q data form. Written for +and incorporated in the osmocom rtl-sdr project. +.LP +In-Phase and Quadrature Phase data can faithfully represent +all of the information in a band of frequencies centered +on a carrier signal frequency. +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH USAGE +This program captures information from a band of frequencies +and outputs the data in a form useful to other software radio +programs. +.SH SYNOPSIS +.B rtl_adsb [-f freq] [OPTIONS] [output file] +.SH OPTIONS +.IP "-f frequency_to_tune_to [Hz]" +.IP "-s samplerate (default: 2048000 Hz)" +.IP "-d device_index (default: 0)" +.IP "-g gain (default: 0 for auto)" +.IP "-p ppm_error (default: 0)" +.IP "-b output_block_size (default: 16 * 16384)" +.IP "-n number of samples to read (default: 0, infinite)" +.IP "-S force sync output (default: async)" +.IP tfilename + (a '-' dumps samples to stdout) +.SH EXAMPLES +.IP "Example: To tune to 392.0 MHz, and set the sample-rate to 1.8 MS/s, use:" + ./rtl_sdr /tmp/capture.bin -s 1.8e6 -f 392e6 +.LP +to record samples to a file or to forward the data to a fifo. +.LP +If the device can't be opened, make sure you have the appropriate +rights to access the device (install udev-rules from the repository, +or run it as root). +.SH SEE ALSO +gnuradio(1) +.LP +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_eeprom(1), rtl_fm(1), rtl_power(1), rtl_tcp(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_tcp.1 b/debian/rtl_tcp.1 new file mode 100644 index 0000000..2cff495 --- /dev/null +++ b/debian/rtl_tcp.1 @@ -0,0 +1,81 @@ +.TH "rtl_tcp" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl_tcp \- an I/Q spectrum server for RTL2832 based DVB-T receivers +.SH DESCRIPTION +Uses a re-purposed DVB-T receiver as a software defined +radio to receive and send I/Q data via TCP network to another +demodulation, decoding or logging apllication. Written for +and incorporated into the osmocom rtl-sdr project. +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH USAGE +Run this program on a machine with an rtl-sdr supported +device connected and it will provide I/Q data to other applications +via TCP/IP. +.SH SYNOPSIS +.B rtl_tcp [OPTIONS] +.SH OPTIONS +.IP "-a listen address" +.IP "-p listen port (default: 1234)" +.IP "-f frequency to tune to [Hz]" +.IP "-g gain (default: 0 for auto)" +.IP "-s samplerate in Hz (default: 2048000 Hz)" +.IP "-b number of buffers (default: 32, set by library)" +.IP "-n max number of linked list buffers to keep (default: 500)" +.IP "-d device_index (default: 0)" +.IP "-P ppm_error (default: 0)" +.SH Example: +.IP "rtl_tcp -a 10.0.0.2 [-p listen port (default: 1234)]" + Found 1 device(s). + Found Elonics E4000 tuner + Using Generic RTL2832U (e.g. hama nano) + Tuned to 100000000 Hz. + listening... +.LP +Use the device argument 'rtl_tcp=10.0.0.2:1234' in OsmoSDR (gr-osmosdr) source +to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...). +.LP +use the rtl_tcp=... device argument in gr-osmosdr source to receive +the samples in GRC and control the rtl settings remotely. +.LP +This application has been successfully crosscompiled for ARM and MIPS +devices and is providing IQ data in a networked ADS-B setup at a rate +of 2.4MSps. The gr-osmosdr source is being used together with an +optimized gr-air-modes version (see Known Apps below). It is also +available as a package in OpenWRT. +.LP +A use case is described ​https://sites.google.com/site/embrtlsdr/ +.SH SEE ALSO +gnuradio(1) +.LP +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_eeprom(1), rtl_fm(1), rtl_sdr(1), rtl_test(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rtl_test.1 b/debian/rtl_test.1 new file mode 100644 index 0000000..e4293cf --- /dev/null +++ b/debian/rtl_test.1 @@ -0,0 +1,60 @@ +.TH "rtl_test" 1 "0.5.0" RTL-SDR "User Commands" +.SH NAME +rtl_test \- a benchmark tool for RTL2832 based DVB-T receivers +.SH DESCRIPTION +Test tuning range and functional sample rates of your device +on your system. +Uses a re-purposed DVB-T receiver as a software defined +radio. Written for and incorporated into the osmocom rtl-sdr project. +.LP +Much software is available for the RTL2832. Most of the user-level +packages rely on the librtlsdr library which comes as part of the +rtl-sdr codebase. This codebase contains both the library itself and +also a number of command line tools such as rtl_test, rtl_sdr, +rtl_tcp, and rtl_fm. These command line tools use the library to test +for the existence of RTL2832 devices and to perform basic data +transfer functions to and from the device. +.LP +Because most of the RTL2832 devices are connected using USB, the +librtlsdr library depends on the libusb library to communicate with +the device. +.SH SYNOPSIS +.B rtl_test [OPTIONS] +.SH OPTIONS +.IP "-s samplerate (default: 2048000 Hz)" +.IP "-d device_index (default: 0)" +.IP "-t enable Elonics E4000 tuner benchmark]" +.IP "-p enable PPM error measurement" +.IP "-b output_block_size (default: 16 * 16384)" +.IP "-S force sync output (default: async)" +.SH EXAMPLES +.IP "To check the possible tuning range (may heavily vary by some MHz depending on device and temperature), call" + rtl_test -t +.IP "To check the maximum samplerate possible on your machine, type (change the rate down until no sample loss occurs):" + rtl_test -s 3.2e6 +.LP +A samplerate of 2.4e6 is known to work even over tcp connections (see +rtl_tcp above). A sample rate of 2.88e6 may work without lost samples +but this may depend on your PC/Laptop's host interface. +.SH SEE ALSO +RTL-SDR wiki documentation: +.B http://sdr.osmocom.org/trac/wiki/rtl-sdr +.LP +Other rtl-sdr programs: +.sp +rtl_adsb(1), rtl_eeprom(1), rtl_fm(1), rtl_sdr(1), rtl_tcp(1) +.SH AUTHOR +This manual page was written by Maitland Bottoms +for the Debian project (but may be used by others). +.SH COPYRIGHT +Copyright (c) 2013 A. Maitland Bottoms +.LP +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. +.LP +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..901ea73 --- /dev/null +++ b/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +export DEB_HOST_MULTIARCH + +%: + dh $@ + +override_dh_auto_configure: debian/librtlsdr0.udev + dh_auto_configure -- -DLIB_INSTALL_DIR=lib/$(DEB_HOST_MULTIARCH) -DDETACH_KERNEL_DRIVER=ON + +debian/librtlsdr0.udev: rtl-sdr.rules + cp -p rtl-sdr.rules debian/librtlsdr0.udev diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..b4a1ab5 --- /dev/null +++ b/debian/watch @@ -0,0 +1,4 @@ +version=4 +opts="mode=git, gitmode=full, pgpmode=none" \ + git://git.osmocom.org/rtl-sdr.git \ + refs/tags/v([\d\.]+) debian uupdate