Commit Graph

1911 Commits

Author SHA1 Message Date
Oliver Jowett e3a8e00412 WIP on MRAR decoding 2021-07-29 19:04:49 +08:00
Oliver Jowett 6b8cac3922 Increase default adaptive gain rescan interval to 1 hour 2021-07-26 22:08:57 +08:00
Oliver Jowett 899ee2530c Add CONFIG_STYLE to default config for unambiguous detection of
new-style config. Try to handle un-upgraded config files in
start-dump1090-fa. Always pass --quiet to dump1090-fa.
2021-07-26 20:26:17 +08:00
Oliver Jowett d6405ddefd Ignore bogus -I/ from librtlsdr pkgconfig 2021-07-26 20:25:35 +08:00
Oliver Jowett e058929977 stretch compile fixes? round two 2021-07-21 20:51:57 +08:00
Oliver Jowett 7b1771cdad Fix limesdr build 2021-07-21 20:03:06 +08:00
Oliver Jowett 017e5d391b Add ADAPTIVE_DYNAMIC_RANGE_TARGET config var 2021-07-21 19:42:09 +08:00
Oliver Jowett 5bd1718bb2 try non-static const to make stretch build happy? 2021-07-21 19:41:42 +08:00
Oliver Jowett f3e498a62a Treat the magic agc setting as just another gain step.
The legacy -10 value is still supported for compatbility with old
configs, but new configs should just select an appropriate gain e.g.
60dB.

rtlsdr default gain continues to be the highest regular gain step (~ 49.6dB)
2021-07-19 17:34:45 +08:00
Oliver Jowett d4b3b03fe0 Try to rewrite old-style config files to new-style config files
on upgrade to 6.0. (Not extensively tested yet)

We do this for two reasons:

1) the config file layout is completely different, it's error-prone
and tedious to force the user to manually transfer their customizations
on upgrade;

2) if there are user modifications to the config file, an upgrade triggered
remotely via piaware will prefer to keep the original config file intact
rather than installing the new version, and the old version just won't
work correctly with the new infrastructure.
2021-07-19 15:50:55 +08:00
Oliver Jowett ec69b94544 Overhaul of /etc/default/dump1090-fa
Now we have specific config options for different features rather
than just a big list of command-line options. You can still provide
custom options via EXTRA_OPTIONS or OVERRIDE_OPTIONS.

Also adds adaptive gain settings, and a "slow cpu" setting which
can turn on cpu-reducing options automatically when a slower (armv6)
CPU is in use.
2021-07-19 15:50:55 +08:00
Oliver Jowett 3069f3d99f Set some sensible net flush defaults rather than relying on the default config file 2021-07-19 15:50:55 +08:00
Oliver Jowett 4cf8eb254e Report actual duty cycle on startup 2021-07-19 15:50:55 +08:00
Oliver Jowett be3c9930f1 Add --adaptive-duty-cycle option.
This makes the adaptive gain code only process some fraction of all samples,
rather than every sample. This helps a lot with CPU on slower machines.
We default to a 50% duty cycle to save some CPU without really affecting
the behavior much.

We split the one-second adaptive gain blocks into 20* 50ms "subblocks"
Each subblock is either entirely processed or not processed at all,
based on the configured duty cycle. (This means that the duty cycle
can only be specified in approx 5% increments, but that should be
fine)

For adaptive dynamic range, there's no further complications - we
just look at fewer samples to compute the noise floor.

For adaptive burst, we need to scale up the measured burst rate by
1/duty cycle to account for the samples that we didn't process. It's
also more likely to cause functional changes as it's quite possible
for a relatively small number of loud messages being missed to
affect the computed rate substantially. Not many options there other
than increasing the duty cycle when adaptive burst handling is wanted.
2021-07-19 15:50:55 +08:00
Oliver Jowett e0f7a33df4 Fix some case where adaptive_range_gain_limit would not be correctly decreased 2021-07-19 15:50:55 +08:00
wiedehopf 9e671a14e4
restrict overlay rendering to covered areas (reduce source load) (#137) 2021-07-15 15:46:30 -05:00
eric1tran 4e21610c50 Merge commit 'refs/pull/127/head' of github.com:flightaware/dump1090 into dev 2021-07-14 13:59:46 +00:00
Matthias Wirth 603da245bd restrict overlay rendering to covered areas (reduce source load) 2021-07-14 09:39:37 +02:00
Oliver Jowett 6e5f2595e0 Update starch to upstream commit f4b84e62d5747ff44cd468c4d8ca1626434378c0 2021-07-13 13:16:02 +08:00
Oliver Jowett 2480e5169c Use a starch implementation for the burst-detection sample counting loop. 2021-07-08 18:53:02 +08:00
Oliver Jowett 1cb4284e6c Move the --wisdom help somewhere more sensible 2021-07-08 18:46:48 +08:00
Oliver Jowett ac97423249 Misc adaptive gain changes:
Update adaptive gain control loop to handle interactions between burst detection and dynamic range control.

Internal doc updates & naming cleanups.

Stats tweaks.
2021-07-07 20:57:34 +08:00
Oliver Jowett fd8f2d77e1 Fix adaptive gain stats not getting set on stats_current -> zeros
appearing in stats output. Now we have a validity flag for the stats
members where we have to pick one value and not simply sum data.
2021-07-07 20:18:54 +08:00
Oliver Jowett b3172181d5 Use compat/compat.h for endian-swapping functions in DSP code.
Might fix #128
2021-07-07 11:26:41 +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
Eric Gideon b775f2b326 tweaks to group, mostly 2021-05-22 11:48:05 -07:00
Eric Gideon 8d877eeed8 further color cleanup, fixing links and headers in the settings box 2021-05-22 11:48:05 -07:00
Eric Gideon 88741d097b ol-layerswitcher pinned to global vars, adjusted margin/padding for consistent spacing 2021-05-22 11:48:05 -07:00
Eric Gideon 24c425c968 initial global vars added, BG color changed 2021-05-22 11:48:05 -07:00
Eric Gideon acde5b4a91 Prettier default-settings pass using 4 spaces for tabs to clean up CSS and enforce consistency 2021-05-22 11:48:05 -07:00
eric1tran f7b6f7aefc Merge branch 'dev' of github.com:flightaware/dump1090 into dev 2021-05-20 21:25:56 +00:00
Chris Carini a4cd5bb42d
Fixing spelling mistake in deprecated (#125) 2021-05-20 16:25:46 -05:00
eric1tran 465d436174 Fix ignored DisplayUnits in config.js PR #76 2021-05-20 17:29:17 +00:00
eric1tran 223283863f 6.0~dev 2021-05-18 20:41:27 +00:00
Oliver Jowett b4acf08738 Fix overflow in get_deadline for large (>2000ms) timeouts 2021-04-29 14:52:45 +08:00
Oliver Jowett 265055106b
Merge pull request #123 from VasiliyTurchenko/hackrf_ant_power
add "--enable-antenna-power" command line option for HackRF config
2021-03-22 18:52:18 +08:00
Турченко Василий Владимирович 80acb91dbc add "--enable-antenna-power" command line option for HackRF configuration
to be able to feed antenna's connector with +3.3v HackRF's internal DC
voltage.
2021-03-22 00:31:47 +03:00
Oliver Jowett 3d013c4251 Note that build profiles only work with buster 2021-03-22 00:36:11 +08:00
Oliver Jowett 86bb40a31c Update install docs to mention use of prepare-build.sh for package builds.
Soft removal of jessie support (just remove the build docs)
2021-03-22 00:33:03 +08:00
Oliver Jowett 8dd83d2e7e Don't hang on exit if rtlsdr hardware stops sending samples.
Give up and exit after 30 seconds of no sample data, rather than just warning and continuing.

background & discussion: https://discussions.flightaware.com/t/cpu-hikes-crash-dump1090-fa/74759

The scenario this addresses is:

 * Hardware wedges, USB bulk endpoint stops providing data
 * librtlsdr remains in rtlsdr_read_async() waiting for either USB data which never arrives,
   or a cancellation via _a different thread_ calling rtlsdr_cancel_async().
 * main thread notices the lack of SDR data and complains
 * something external e.g. piaware tries a restart and sends SIGTERM
 * the signal handler sets Modes.exit = 1; the main thread starts waiting for receive thread termination
 * because we're never getting callbacks from rtlsdr_read_async(), we never call rtlsdr_cancel_async
 * dump1090 hangs waiting on receive thread termination

To fix this, add a sdrStop() handler function where the general contract is "make the receive thread terminate".
In the rtlsdr case, this calls rtlsdr_cancel_async directly, which will make rtlsdr_read_async() return even
if the hardware is stuck.

The main thread then calls sdrStop() before waiting for receive thread termination.

Also, as discussed in the thread above, there's not really much point in continuing to run if the SDR
has wedged, so bail out after 30 seconds of no sample data.

Also, if pthread_timedjoin_np is available, use it in preference to pthread_join so that we do not wait
indefinitely for the receive thread on shutdown. If the join times out, give up and abort() as we can't
safely continue a clean shutdown while the receive thread is running.
2021-03-21 02:03:08 +08:00
Oliver Jowett c433463392 Reduce CPU further in --no-fix-df mode. Add --enable-df24 option.
This reinstates the fastpath in the 2.4MHz demodulator that
aborts message demodulation early if the DF bits don't match a message
type that we know how to decode, or stops early if the DF bits can
only correspond to a short 56-bit message.

Do this in a more general form where we test against a set of valid
DF values, rather than a switch/case. Then populate the sets based on
the current error-correction settings (e.g. if we are allowed to repair
DF damage with 1 bit error correction, then a DF17 message could appear
with any of DF=17, DF=16, DF=19, DF=21, DF=25, or DF=1 and still be
correctable to a valid DF17 message)

In the default case this produces a small CPU improvement as short
messages might be able to stop earlier and a few DF values can be ignored
early. With --no-fix-df it produces a larger improvement as relatively few
DF values are valid in that mode.

To further reduce CPU, the default behaviour has changed to _not_
decode DF24 messages (Comm-D ELM messages). These are rarely seen in
the wild and dump1090 can't do anything useful with them. Disabling
them allows us to further reduce the set of valid DF values as they
effectively use all DF values from 24..31, 25% of all possible values.
To re-enable DF24 decoding, use the new `--enable-df24` option.

Finally, avoid doing some CRC calculations twice. This was only happening
once per valid decoded message, not per demodulation attempt, so it's not
such a large win.
2021-03-19 17:03:15 +08:00
Oliver Jowett 455896e86d Fix broken 32-bit x86 test that broke builds on non-x86 2021-03-17 02:21:18 +08:00
eric1tran 037fe4f37f Remove extra <td> tag 2021-03-15 12:35:12 +00:00
Oliver Jowett c97b83d3ed Maybe fix alignment warnings in arm neon code with recent gcc 2021-03-13 20:24:01 +08:00
Oliver Jowett 462dee56f3 Fix builds on 32-bit x86 2021-03-13 12:49:40 +08:00
Oliver Jowett d3c692f630 5.1~dev for the dev branch 2021-03-13 12:41:21 +08:00
eric1tran f862b530c8 Release 5.0 2021-03-11 13:08:06 +00:00
eric1tran 740d73ac71 Merge branch 'dev' into staging 2021-03-09 21:14:27 +00:00
eric1tran 2a62c514f1 Don't show button to stats page if there's an issue getting the link 2021-03-09 18:47:27 +00:00
eric1tran fe91fbc3a4 Bump css version 2021-03-09 08:30:19 +00:00