Commit Graph

95 Commits

Author SHA1 Message Date
Oliver Jowett 350664a13a
Merge pull request #169 from ffontaine/master
Makefile: set _POSIX_C_SOURCE
2022-01-15 20:44:22 +08:00
Fabrice Fontaine f24c932cf8 Makefile: set _POSIX_C_SOURCE
Set -D_POSIX_C_SOURCE=200112L to avoid the following build failure with
uclibc-ng:

anet.c: In function ‘anetTcpGenericConnect’:
anet.c:153:21: error: storage size of ‘gai_hints’ isn’t known
  153 |     struct addrinfo gai_hints;
      |                     ^~~~~~~~~

In file included from dump1090.h:83,
                 from dump1090.c:50:
compat/compat.h:46:3: error: conflicting types for ‘clockid_t’
   46 | } clockid_t;
      |   ^~~~~~~~~
In file included from /home/fabrice/buildroot/output/host/or1k-buildroot-linux-uclibc/sysroot/usr/include/sys/types.h:132,
                 from /home/fabrice/buildroot/output/host/or1k-buildroot-linux-uclibc/sysroot/usr/include/stdlib.h:198,
                 from dump1090.h:66,
                 from dump1090.c:50:
/home/fabrice/buildroot/output/host/or1k-buildroot-linux-uclibc/sysroot/usr/include/time.h:91:21: note: previous declaration of ‘clockid_t’ was here
   91 | typedef __clockid_t clockid_t;
      |                     ^~~~~~~~~

net_io.c: In function ‘writeJsonToFile’:
net_io.c:2122:18: error: ‘PATH_MAX’ undeclared (first use in this function)
 2122 |     char pathbuf[PATH_MAX];
      |                  ^~~~~~~~

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-01-15 10:54:32 +01:00
Cody 3be128877d
Fix syntax error 2022-01-14 12:23:30 -06:00
Oliver Jowett fa8a066b4c Disable cpufeatures on darwin/arm64 2021-12-07 15:18:58 +08:00
Oliver Jowett b645f7d4f2 Try to respect CFLAGS/CPPFLAGS as far as possible; move required extra flags into a separate var.
This means you can, in theory, completely override CFLAGS/CPPFLAGS without also having to
provide all the internal flags that the Makefile usually detects.

$ make CFLAGS=-qwerty
[...]
cc  -I. -DMODES_DUMP1090_VERSION=\"unknown\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\" -D_DEFAULT_SOURCE -DENABLE_CPUFEATURES -Icpu_features/include -DENABLE_RTLSDR -DENABLE_BLADERF -DENABLE_HACKRF -DENABLE_LIMESDR -DSTARCH_MIX_X86 -qwerty -std=c11 -fno-common -Wall -Wmissing-declarations -Werror -W -I/usr/include/ -I/usr/include/libusb-1.0 -I/usr/include/ -I/usr/include/ -I/usr/include/libusb-1.0  -c dump1090.c -o dump1090.o

Should fix #161
2021-12-07 15:12:49 +08:00
Oliver Jowett bc72177c8b Treat ARCH=arm64 like ARCH=aarch64 2021-12-07 13:17:02 +08:00
Oliver Jowett 059e48b82b Allow env vars (not only command line overrides) to set CPUFEATURES_{ARCH,UNAME}.
Change CPUFEATURES_{ARCH,UNAME} defaults to use {ARCH,UNAME} values.

Fixes #158
2021-09-23 13:24:59 +08:00
Oliver Jowett d6405ddefd Ignore bogus -I/ from librtlsdr pkgconfig 2021-07-26 20:25:35 +08:00
Oliver Jowett 56625449e8
Adaptive gain, first pass (#134)
This PR adds basic adaptive gain support, which adjusts SDR gain on the fly based on the noise & signal levels seen.

There are two control mechanisms:

Dynamic range control is enabled by the --adaptive-range option. This adjusts SDR gain to try to achieve a minimum dynamic range, regardless of the exact hardware in the RF path.

Burst (loud message) control is enabled by the --adaptive-burst option. This decreases SDR gain when undecodable loud messages are heard, allowing for better reception of nearby aircraft at the expense of range.

This is only the basic implementation - see the PR for remaining work to do.
2021-06-29 20:11:13 +08:00
Oliver Jowett a75296ae72 Reduce `make wisdom.local` iterations to match `generate-wisdom` 2021-03-08 15:18:35 +08:00
Jurre Van Wouw c4e346698e
Add NetBSD detection to Makefile; use NetBSD's curses (simply called curses) rather than ncurses on NetBSD (#111) 2021-02-10 12:44:30 +08:00
Oliver Jowett 5600d3fc71
Merge pull request #108 from gtjoseph/dev-fa-starch-aarch64
Starch config: Add aarch64
2021-02-09 14:08:52 +08:00
Oliver Jowett d8cca659e7 Remove stray extra cpufeatures makefile include 2021-02-09 00:30:25 +08:00
George Joseph 1b0bcefae6 Starch config: Add aarch64
* Added aarch64 to dsp/starchgen.py and Makefile.
* Regenerated files
2021-02-07 17:08:53 -07:00
Oliver Jowett bff71dc820
Move all converters to starch-based implementations (#97)
* Switch all conversion routines to use starch.

main user-visible changes:

 * ensure you check out submodules ('git clone --recurse-submodules")
 * --version shows the CPU features and DSP implementations in use
 * --wisdom allows overriding of the built-in architecture wisdom
 * --dcfilter no longer supported
 * "starch-benchmark" binary will benchmark all options on the
   current machine and can produce a wisdom file to feed to
   the --wisdom option

If you have a usecase for --dcfilter, please get in touch and
let me know - it's an edge case and for now there's no starch/DSP
support for it, but support can be written if needed.

In almost all cases the new conversion routines are slightly or
substantially faster than the old conversion routines. The only case
that is slower is SC16/SC16Q11 on a Pi 0, which is around 10% slower
due to changing from heavily approximated lookup tables to higher
quality results (but SC16 is probably already out of reach of a Pi 0)

* No need to build with SC16Q11_TABLE_BITS any more

* Add oneoff/uc8_capture_stats

(reads a UC8 capture; measures min/max/mean I and Q)

* Switch UC8 conversion to 127.4 center, 128 range.

Looking at actual UC8 captures from a RTL2832, the mean I and Q
are actually at 127.4, so use that as the zero point.

This means that the resulting I/Q maximum values could be as large as
127.6. Switch to 128 for simplicity.

* Switch to the new UC8 zero offset in benchmarks, fix some bugs

* Fix some bugs in SC16/SC16Q11 validation, tighten the max error requirements

* Ditch UC8 approximation path, add a NEON VRQSQRTE path.

* Tweak the SC16 exact path, add a new impl that uses a mix of
u32 & floats.

* SC16Q11 impl tweaks:

 * add a u32->float exact path
 * ditch the approximation path
 * add a NEON VRSQRTE path
 * add a 12-bit table path (using the full signed I/Q value, not absolute value)

* Ditch SC16 approximation path, add NEON vrsqrte path

* Add oneoff/dsp_error_measurement

This runs sample input through the DSP functions that are
allowed to be inexact and dumps the results as a TSV suitable for
feeding to gnuplot to look at the actual errors.

* Update make clean, make wisdom targets

* Update wisdom based on benchmarking

* Preserve the raw wisdom benchmark data

* Update to latest starch

* Update .gitignore for new wisdom files

* Update starch generated code

* Build starch-benchmark as part of the 'all' target

* Use wisdom from /etc/dump1090-fa/wisdom.local if present

* Package starch-benchmark and a helper script to generate local wisdom data

* Remove submodules in preparation for importing them directly

* Import cpu_features v0.6.0 from https://github.com/google/cpu_features/releases/tag/v0.6.0

* Import starch at commit a725c8491dc33a321565d451b385131e589d8490
from https://github.com/flightaware/starch
2021-01-21 19:45:00 +08:00
Oliver Jowett 74e11bd26f Reinstate the freebsd pkg-config workaround in another form 2020-08-07 14:43:44 +08:00
Oliver Jowett 1174841f71 Fix merge conflicts, clean up the Makefile 2020-08-07 14:30:54 +08:00
Oliver Jowett e857d042aa 'make clean' should clean object files in oneoff/ too 2020-08-05 19:50:38 +08:00
Oliver Jowett 74607b31ed Factor out FIFO handling; reimplement as a linked list, not a circular buffer.
Update all the SDR implementation to use it.

This was getting pretty ugly with code getting copy&pasted in all the SDR
implementations. Unify it all and give it a simpler API. Linked list works out
much simpler than the circular buffer. Also, simplify copying the overlap region
around by just using a separate buffer (it's only a few hundred bytes long, so
the double copy is not a big deal).
2020-08-05 19:50:38 +08:00
Oliver Jowett aa2929196d If DUMP1090_VERSION is unset, use "unknown" as the version (not an empty string) 2020-08-05 19:50:38 +08:00
Oliver Jowett 104575c602 Might as well compile with -O3 2020-08-05 19:50:38 +08:00
Oliver Jowett f82b7b7a8c Set SDR thread name if pthread_setname_np() is available 2020-08-05 19:50:38 +08:00
Oliver Jowett 84b1975e76 Fix benchmarks make target 2020-08-05 19:50:38 +08:00
Oliver Jowett d59e3bb136 Clean up Makefile SDR_OBJ a bit 2020-08-05 19:50:38 +08:00
Oliver Jowett 66ba823493 Merge branch 'limesdr' of https://github.com/Gluttton/dump1090 into Gluttton-limesdr 2020-08-03 15:16:32 +08:00
Oliver Jowett 6a9700a58c If no explicit library settings are given, try to detect what SDRs to support based on what pkg-config knows about. 2020-08-03 14:57:31 +08:00
Oliver Jowett 5261b98c95 Merge branch 'master' of https://github.com/kr105/dump1090 into kr105-master 2020-08-03 14:32:08 +08:00
Oliver Jowett 8d56c0af9d Turn on -Wmissing-declarations following #67 cleaning up a few places that triggered it 2020-08-03 11:44:34 +08:00
Gluttton 53183c0b2a limesdr: basic implementation of LimeSDR support
The commit provides a basic implementation of support for LimeSDR USB
receivers based on LMS7002 chip. The solution has several limitations:
 - passing parameters for tune LimeSDR receiver via command-line
   options is not implemented;
 - only hardcoded configuration is used (channel 0 of lower band LNA,
   LMS_FMT_I16 format, gain, bandwidth and timeout);
 - only one device is supported and it is not possible to select a
   desired one in case if several devices are connected to the host.

Test: compare the output of the program for RTL and LimeSDR receivers.
Environment:
 - RTL2832SDR dongle;
 - LMS7002M based USB LimeSDR board;
 - 800MHz-2200MHz omnidirectional antenna with SMA connector.
Procedure:
 - connect RTL dongle to the host and start the program with the
   following parameters:
   $ ./dump1090 --device-type rtlsdr --interactive
 - wait until several planes will be detected;
 - stop the program, connect the LimeSDR board to the host and restart
   the program with the following parameters:
   $ ./dump1090 --device-type limesdr --interactive
 - ensure that the same planes are detected.
Acceptance criteria: the same planes are detected using both receivers
   and track information matches with information from the
   FlightRadar24 application.

Signed-off-by: Gluttton <gluttton@ukr.net>
2020-07-29 23:09:27 +03:00
Oliver Jowett 651d6a4e0d Build with -fno-common to match GCC 10 behaviour on older
compiler versions, so that linkage problems are more visible.
2020-06-06 22:02:43 +08:00
Carlos Pizarro 0f0696c97b
Added support for HackRF One 2019-12-09 18:55:40 -03:00
Oliver Jowett 564f033087 Add some oneoff tools for comm-b decoding testing 2019-05-02 17:29:46 +08:00
Oliver Jowett 1b5b0dfa03 Put ais_charset in its own file to make building commb tests a little easier 2019-05-02 17:24:26 +08:00
Oliver Jowett 74d7ead41b Move convert_benchmark into oneoff/ 2019-05-02 17:21:56 +08:00
Oliver Jowett 34bfe10317 Rework use of pkg-config to work around librtlsdr packaging bugs in ubuntu disco 2019-04-17 11:58:59 +08:00
Michael Norton f497d7481f
Add FreeBSD support
FreeBSD support, reworked from earlier pr by @neveragainde
2019-03-31 17:57:48 -06:00
Michael Norton 91e9635563
Restore cross-platform compatibility
Re-implements platform-specific build of compatibility functions. Had been removed by bef563b8a3.
2019-03-31 15:01:06 -06:00
Oliver Jowett f4fa94f842 Merge branch 'more_mode_s' into dev 2018-05-09 16:20:58 +01:00
Michael Tatarinov 196ef89aca Cleanup after removed internal webserver code.
Fixes: 52464b97c1
2017-07-28 11:35:26 +04:00
Michael Tatarinov 417aee9dc5 Makefile: don't override the CC definition. 2017-07-28 11:30:09 +04:00
Oliver Jowett 98d64483d6 WIP: More Comm-B & ADS-B decoding. 2017-06-15 18:07:40 +01:00
Oliver Jowett 7700cd90d3 Build/packaging work for the bladeRF 2017-02-03 00:36:46 +00:00
Oliver Jowett bad821f5de Add a benchmarker for the sample converters. 2017-02-03 00:30:49 +00:00
Oliver Jowett cf9e3005e8 Add a bladeRF SDR type. 2017-02-03 00:30:42 +00:00
Oliver Jowett 75b221c0e3 Lots of refactoring to move the SDR-type-specific bits out of the
main code and make them optionally buildable.
2017-01-27 17:30:40 +00:00
Oliver Jowett f6b1b94c7d Use ncurses for interactive mode (reduces flicker on slow connections a lot!) 2016-10-11 20:37:28 +01:00
Oliver Jowett 73a3b5113e More attempts at getting this working again on wheezy. 2016-09-16 17:43:21 +01:00
Oliver Jowett bef563b8a3 More hacking on the Makefile to get it working nicely on both jessie + wheezy. 2016-09-16 17:16:28 +01:00
Oliver Jowett b213ab9a50 Tweak wheezy build so it builds rtl-sdr itself rather than relying
on a librtlsdr-dev package that needs to be built separately.
2016-09-16 16:19:16 +01:00
Oliver Jowett ac2b977168 Merge remote-tracking branch 'upstream/master' into dev 2016-09-10 21:40:13 +01:00