Commit graph

313 commits

Author SHA1 Message Date
Oliver Jowett
8246df8b2d Merge branch 'master' into oversampling 2014-10-31 19:42:15 +00:00
Oliver Jowett
bbd5a13030 Merge branch 'net-cleanups' 2014-10-31 19:38:06 +00:00
Oliver Jowett
29d1e53f9f Merge remote-tracking branch 'upstream/master' into net-cleanups 2014-10-31 17:58:03 +00:00
Malcolm Robb
a9cd75ded1 More Updates to Pull #54
Pull #54 breaks the Windows version of dump1090 due to a bug in the
inet_aton() windows function.

1) Fix the bug in the windows inet_aton()
2) Modify the command line code to strdup() the command line string.
3) Leave the Modes.net_bind_address pointer NULL if no command line
specified
2014-10-30 12:06:03 +00:00
demonx
5b4d811c7d Ability to assign bind address for services 2014-10-25 21:33:45 +02:00
Oliver Jowett
cd3efe2d63 Merge branch 'net-cleanups'
Conflicts:
	dump1090.c
2014-10-03 23:15:06 +01:00
Oliver Jowett
22f2a8db37 Merge branch 'net-cleanups' into oversampling
Conflicts:
	dump1090.c
	dump1090.h
2014-10-03 23:04:09 +01:00
Oliver Jowett
1769ac9006 Restructuring of network output side.
Mostly refactoring the common code that was duplicated
between the different output types so that there aren't
many copies floating around.

This introduces "struct net_writer" to store the state of a
particular type of output service - buffers, time of last write,
connection count etc. prepareWrite() / completeWrite() give access
to the buffer and handle the actual writes and flushing when needed.

Heartbeat and time-based flushing move into a generic periodic-work
function.

Update the SBS output code to use the new infrastructure. This makes
a big different to CPU use when under load.
2014-10-03 22:55:21 +01:00
Oliver Jowett
8d4f1a396c Merge branch 'fix-net-list-corruption' into net-cleanups 2014-10-03 20:58:52 +01:00
Oliver Jowett
4a4fed2b37 Merge branch 'fix-net-list-corruption' into oversampling 2014-10-02 21:18:50 +01:00
Oliver Jowett
1cf0097dac Merge branch 'fix-net-list-corruption' 2014-10-02 21:18:35 +01:00
Oliver Jowett
a2f49f2bb8 Fix a crash when an outbound client is closed in response to reading a remote message.
When we read from some client A, we may end up forwarding a message to other
clients. If we forward to some client B and there is a write error, then
we close B and remove it from the client list. However, if before this happened
A->next == B, then the read loop will still be holding on to a pointer to B,
and we crash.

As it's unpredictable what clients could be closed at what point, the simplest
approach is to retain closed clients in the list until we are at a point where
we know there are no stray pointers on stack, and only then modify the list.
This also simplifies anything that has to loop over clients, as it doesn't need
to worry about the current client being freed under it.
2014-10-02 21:06:10 +01:00
MalcolmRobb
bc496fbcad Merge pull request #43 from mutability/more-stats
Add --stats-every option, add sample block counters
2014-10-02 20:51:13 +01:00
Oliver Jowett
e008f0fc3f Resync with master. 2014-10-01 12:44:07 +01:00
Oliver Jowett
622b158367 Merge branches 'fix-obinary', 'net-client-eof-handling' and 'report-bind-errors' 2014-10-01 12:41:28 +01:00
Oliver Jowett
98c7c73d06 Only use O_BINARY on Win32 2014-10-01 12:17:51 +01:00
Oliver Jowett
9691e7bf79 Merge upstream. 2014-10-01 12:05:04 +01:00
Oliver Jowett
864660bf27 Use uint64_t in load stats to avoid overflow with large intervals. 2014-10-01 01:43:37 +01:00
Oliver Jowett
c11eca44bb Try all phases if --oversample --phase-enhance is on.
If we demodulate a message in 2.4MHz mode and it has a bad, uncorrectable CRC,
and --phase-enhance is on, then retry with the other possible phases until
we get a good CRC or run out of phases to try.

This is very expensive in AGC mode (lots of candidates that are not real
messages) but relatively cheap otherwise. It yields another 10% messages.

Also factor out some common stats code to avoid lots more copy/paste.
2014-09-30 17:02:22 +01:00
Malcolm Robb
e3bbf7b266 Read Files are binary
When replaying recordings, the read files are binary, so the file open
needs to reflect this so that spurious end of file characters aren't
misinterpreted.
2014-09-30 16:36:56 +01:00
Oliver Jowett
dcae71faa8 Move CPU instrumentation up into the main loop. 2014-09-29 23:11:36 +01:00
Oliver Jowett
7a0ca85a90 Measure CPU used by the sample processing thread. 2014-09-29 23:04:58 +01:00
Oliver Jowett
c3409302ce Fix mlat inter-block timestamp accounting in oversampling mode.
Add calculated phase into the per-message timestamp (it is already exactly a 12MHz offset)
2014-09-27 16:44:26 +01:00
Oliver Jowett
69a30535d4 Oversampling, round two.
This now seems to be at the point where it will decode more messages
than when using 2MHz with --phase-enhance.
2014-09-27 13:07:23 +01:00
Oliver Jowett
5c8e6198b7 First cut for sampling at 2.4MHz + phase detection. 2014-09-26 22:42:38 +01:00
Oliver Jowett
9fad408f57 Merge branch 'more-stats' 2014-09-25 22:03:57 +01:00
Oliver Jowett
b98c6856b3 Move the stats reset strictly after stats display, so the total message count is shown correctly. 2014-09-25 22:02:52 +01:00
Oliver Jowett
b58ae5a17e Merge branch 'more-stats' 2014-09-25 20:36:42 +01:00
Oliver Jowett
4fc2697555 Add stats for number of sample blocks processed and dropped. 2014-09-25 20:35:54 +01:00
Oliver Jowett
10061675de Add --stats-every <secs> option.
Periodically displays and resets stats.
Useful for unattended operation.
2014-09-25 20:33:50 +01:00
Oliver Jowett
3f9c859800 Merge branch 'fractional-gain' 2014-09-24 20:02:00 +01:00
Oliver Jowett
95ccb90c76 Fix --gain with fractional gain values. 2014-09-24 20:01:06 +01:00
Oliver Jowett
5bcc7e1b9a Merge branch 'report-snr' 2014-09-23 14:07:53 +01:00
Oliver Jowett
83d256e984 Fix a thinko in computing the log10 table.
(This shouldn't actually affect the resulting SNR since it's just a constant offset, and the errors in signal and noise will cancel out)
2014-09-23 14:05:25 +01:00
Oliver Jowett
e6e92b1e8e Merge branch 'no-decode'
Conflicts:
	mode_s.c
2014-09-23 00:01:54 +01:00
Oliver Jowett
5683001164 Add --no-decode option.
This disables most decoding of the contents of Mode S messages, aircraft tracking, and some output modes that depend on them.
It's intended for edge receivers that just forward to a central hub rather than processing data locally.
2014-09-22 23:56:49 +01:00
Oliver Jowett
76c958b03e Use a lookup table for SNR calculation. 2014-09-22 14:53:06 +01:00
Malcolm Robb
8b05286a24 Version 1.09.1007.14
Updates to support COAA Planeplotter Ground Station on an RPi
2014-08-06 15:29:05 +01:00
matthewbrandes
6f14ecf7dd Update dump1090.c 2014-07-08 17:34:43 -05:00
matthewbrandes
652af93b88 Update dump1090.c 2014-07-08 16:58:23 -05:00
matthewbrandes
d0207569b6 Update dump1090.c 2014-07-08 16:56:03 -05:00
matthewbrandes
8110549fee Update dump1090.c 2014-07-08 15:12:46 -05:00
hhm
59984ac8af B"H allow disable ports, doc disable net heartbeat 2014-06-24 23:58:46 -04:00
papasven
e6c43382b9 Incorrect value for auto-gain
Incorrect value for auto-gain option the Modes.gain is multiplied by 10.
2014-06-01 02:14:40 +02:00
Malcolm Robb
903f93f530 Publish Version 1.08.2705.14
A few minor additions and bug fixes as detailed below

1) Additional command line option "--net-buffer <n>" to specify the TCP
output buffer size. Default is n=0, which is 64Kb. Specify a value of n
to increase the buffer size according to  Size  = 64Kb * 2^n, so an n of
1 = 128Kb, n=2 is 256Kb etc. n is limited to 7, so the max size is 8Mb.
This option may assist if you have a high number of aircraft being
received, and an unreliable network connection, or if the receiving end
can be busy for an extended time.

2) Bug fix in ppup1090 which prevented the uploading of valid
ModeA/Squawk codes

3) Bug fix per Markus Grab's commit.
2014-05-27 13:16:57 +01:00
Malcolm Robb
30ae45ec2b Windows Version of dump1090
Make the modifications necessary to compile dump1090 for WinXP, Win7 and
hopefully Win8.

The files can be compiled using M$ Visual Studio/C++ 6.0. Due to various
licensing issues, I haven't included the libraries or DLLs. You will
need to locate pthreadVC2.lib and rtlsdr.lib to link the file, install
the zadig drivers to support the dongle, and locate libusb-1.0.dll,
msvcr100.dll, pthreadVC2.dll and rtlsdr.dll.

dump1090.exe will not run on any Windows version prior to XP SP2,
because msvcr100.dll imports several functions from the Windows kernel
that are not available on earlier versions. This means dump1090 won't
work on Win2K.

The major change to the code relates to file handles. The original code
assumes Linux behaviour in that handles are allocated from 0
sequentially upwards. However Windows handles are allocated pseudo
randomly, and handle numbers greater than 1024 would break the code. The
code has therefore been modified to use a linked list of connection
structures, rather than a static array limited to 1024 entries.
2014-04-25 14:48:14 +01:00
Malcolm Robb
f7843c1691 Implement TCP Heartbeat
Some users have reported issues where the TCP link to dump1090 can be
lost at times of low traffic density - typically in the middle of the
night. One possible reason for this is that some routers drop the link
if there is no traffic for a predetermined period.

To try and resolve this, dump1090 now sends a 'null' packet consisting
of 7 "0x00" bytes approximately once a  minute if there is no real
received traffic during this time. This packet should be discarded by
the application receiving the dump1090 because it will have an invalid
checksum, and ICAO address 0x000000 is also invalid. However, this null
packet should be enough to keep routers alive.
2014-03-11 01:09:49 +00:00
Malcolm Robb
97c7f69c83 Publish V1.08.2302.14
Final tidy up and publish
2014-02-24 10:28:35 +00:00
Malcolm Robb
75a4c6ee21 BUGFIX : Missed data causes timestamp slip
The Mutex on the RTL data reader thread does not "force" the data
processing thread to execute. Therefore, if the processor is busy, it is
possible for a second RTL callback to occur before the data from the
first has been processed. This will cause the loss of the first data,
but worse, it will cause a slip in the timestamp. This upsets Beamfinder
and MLAT operation in PlanePlotter.

To solve this, keep a Fifo buffer which is filled by the callback
thread, and emptied by the data processing thread. The fifo is the same
size as the number of buffers requested in the call to
rtlsdr_read_async().

Note - we only put the value of the pointer supplied in the callback
into the fifo. We do not attempt to cache the data in the buffer pointed
to by the pointer.  This would require us to memcopy() 2Mbytes per
second, which we don't want to do if we don't have to because it will
only make the processor loading worse. Instead, we assume that the data
in the buffer will remain valid after the callback returns, at least
until it is overwritten by new data.

It is still possible for us to lose data if we can't process it quickly
enough. However, we can now detect this loss of data when the fifo is
almost full, and correct the timestamp for the lost block/blocks.
2014-02-22 23:11:13 +00:00
Malcolm Robb
86093ea95e WIZARDISHUNGRY
Dynamically size terminal using SIGWINCH

f18180fef4
2014-02-22 22:11:11 +00:00