Update adaptive gain control loop to handle interactions between burst detection and dynamic range control.
Internal doc updates & naming cleanups.
Stats tweaks.
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.
* Create a network service and connection faup's stdin. Create a Modes.faup_rate_multiplier attribute and set from faup command input
* Use faup_rate_multiplier to adjust the minAge for emitting messages
* Convert upload_rate_multiplier to a double and adjust minAge with it
* Cleanup
* Var name change
* MODES_NOTUSED define for unused modes client object
* Sanity check on faup multiplier field
Previously, json stats updates were fixed to 60 seconds, and using --stats--every
with an interval less than 60 seconds produced confusing results.
This commit fixes --stats-every with short intervals, and adds --json-stats-every
to control the json stats update interval. Note that if --json-stats-every is not
a multiple of 60 seconds, then the 1-/5-/15-minute data may not include all data
up to the current time (in that case, the most recent data is reflected in
the "latest" stats)
This implements the alternative approach discussed in PR #89
When `unreliable_tracks` was added to the JSON output, the trailing `}` after `single_message` should likely have been removed.
Side note: should this just be `unreliable` since it is nested inside `tracks`? `all` and `single_message` don't have the `tracks` suffix.
Make --net-verbatim just control the default setting.
0x1A '1' 'v' disables verbatim mode (send "cooked" output);
0x1A '1' 'V' enables verbatim mode
Support clients with different settings by switching them between output
writers depending on what setting they want, so clients with different
settings can co-exist (unlike the Mode A/C setting)
In cooked mode, FEC corrections are applied to messages before they are send
and only trustworthy messages are forwarded; this is the default case for
downstream clients that don't want to apply their own rules and are happy with
the decisions that dump1090 makes.
In verbatim mode, all messages are forwarded, but no FEC corrections are applied;
the downstream client needs to make its own FEC / noise filtering decisions.
Usually the default for new connections is cooked mode. --net-verbatim changes the
default to be verbatim mode.
If the \n termination of TSV messages is missing, faup1090 encounters
the following error:
Caught background error: list must have an even number of elements
while executing
"array set row [split $line "\t"]"
(object "::faup1090" method "::FaupConnection::data_available" body line 28)
This missing termination with \n can happen when p == end is true in the
overrun check. vsnprintf will always terminate the string with \0, so if
the vsnprintf is called to write the to the last position in the buffer
(end-1), it will write \0 instead to terminate the string as not to
overflow the buffer.
To catch that possibility the overrun check is changed to p < end as
then vsnprintf is assured to have had enough room to write the \0
termination to end-1.
Due to commit 45886edc40
faup1090: write _v on every line, bump TSV_VERSION
and maybe other changes the TSV packets are bigger and some users have
reported the following error:
piaware[9040]: faup1090(27427): fatsv: output too large (max 600, overran by 20)
Fix this error by increasing TSV_MAX_PACKET_SIZE to 800