V5.0.5-airspy dump1090-fa with native AirSpy support now available

To get airspy_adsb to use similar levels of cpu I need to drop the preamble filter quite a lot and that does definitely result in fewer messages decoded. I’m not sure I’d describe it as dramatic but certainly measurable.

One side effect of the hirate demod to note… dump1090-fa will use more cpu when things are quieter than when things are busy. It takes way more cpu cycles to search for a message than to actually decode one once you’ve identified it. In fact, the worst case is when there are actually no messages in a buffer.

I tried to come up with an search algorithm that would attempt to adapt itself to slow average rates but all I managed to do was miss messages. :slight_smile: The only way to do it would have been to have the demodulator periodically train itself based on decoded messages, signal and noise levels. I thought that was going a little overboard though.

That effect is also present in the airspy_adsb decoder. CPU usage is quite a bit higher during the night than when it’s busy during the day:

Dumb question:

Do i need to install the regular dump1090-fa first?
I am running readsb instead coming from the automatic installer script from @wiedehopf

Heh, I just found a minor reporting bug…

I was going to suggest adding --stats to your dump1090 command line to produce the /run/dump1090-fa/demod.json file which will have demodulator stats. Unfortunately, I forgot that the /run/dump1090-fa directory is automatically deleted when the service stops and the demod.json file is only written when dump1090-fa stops.

Anyway, if you update your /etc/default/dump1090-fa file to add the --stats option and restart dump1090-fa, the next time you stop it, it’ll dump some demod stats which you can view with journalctl -xeu dump1090-fa.

 Demod  HiRate:
 Successful Message Demod Offsets
 Demod window width: 15
 Offset   Count
  -7:               0
  -6:               0
  -5:               0
  -4:              11
  -3:              48
  -2:             393
  -1:            7457
   0:           17648
   1:            3939
   2:             787
   3:             217
   4:              32
   5:               0
   6:               0
   7:               0

You’ll notice that I had a demod window of -7:7 set but nothing was decoded in slots -7, -6, -5, 5, 6, and 7 so I could probably reduce the window to -4:4 and save some cycles.

Hmmm. You do if you don’t already have a dump1090-fa service file, a working /etc/default/dump1090-fa and the /etc/dump1090-fa and /usr/lib/dump1090-fa directories.

Tried it, but dump1090-fa (replaced before by your executable from the archive throws this error after trying to launch the service

dump1090-fa[3764]: /usr/bin/dump1090-fa: error while loading shared libraries: libairspy.so.0: cannot open shared object file: No such file or directory

You can’t run both unless you deconflict the settings.

dump1090-fa settings:

RECEIVER_GAIN="--airspy-linearity-gain 17"
RECEIVER_FORMAT="--sample-rate 12 --sample-format u16o12"
RECEIVER_OPTIONS="--device-type airspy ${RECEIVER_GAIN} ${RECEIVER_FORMAT} "
DEMOD_OPTIONS=" --demod hirate --demod-preamble-threshold 0.9 --demod-smoother-window 4 --demod-msg-window -7:7 "
WISDOM_OPTIONS=" --wisdom /etc/dump1090-fa/wisdom-airspy.armv7"
DECODER_OPTIONS="${DEMOD_OPTIONS} ${WISDOM_OPTIONS} --fix --no-modeac-auto --stats-range \
				 --stats-every 86400 --lat 23 --lon 123 --max-range 360"
NET_OPTIONS="--net --mlat --net-heartbeat 60 --net-ro-size 1000 --net-ro-interval 0.02 --net-ri-port 0 --net-ro-port 0 --net-sbs-port 0 --net-bi-port 0 --net-bo-port 47787"
JSON_OPTIONS="--json-location-accuracy 2"
# Automatically added by upgrade from 3.6.3
ENABLED=yes

In airspy_adsb settings change the network stuff

#network settings
NET= -l 47787:beast

As readsb options run this:

RECEIVER_OPTIONS="--net-only --net-connector-delay 5 --net-connector 127.0.0.1,47787,beast_in"

DECODER_OPTIONS="--lat 23 --lon 123--max-range 360"

NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1280 --net-ro-interval 0.05 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"

JSON_OPTIONS="--json-location-accuracy 2"

Now you can either start the dump1090-fa or the airspy_adsb service as a datasource for readsb.

And yes you’ll have to install dump1090-fa.

Well that just means you didn’t install libairspy.

As the release notes and readmes say… you have to install libairspy0.
apt-get install libairspy0

I know, the conflict is not the issue, but the missing airspy library.

Maybe i am blind, but i wasn’t able to find it initially. Thanks for the hint

Oops. My fault. :flushed: It was in the “compile” section of the release notes, not the “install” section above that. Fixed.

1 Like

First, great job! I tried one of the development versions back in december last year, gave up due to lack of time. Will give it a try and since I have the possibility to run two stations on one antenna, I’ve installed the latest version on my test station.

How to I interpret this:

 Demod  HiRate:
Successful Message Demod Offsets
Demod window width: 15
Offset   Count
  -7:              58
  -6:              88
  -5:             164
  -4:             278
  -3:             480
  -2:            1999
  -1:           44260
   0:          109368
   1:           29871
   2:            6424
   3:            3227
   4:            2061
   5:            1265
   6:             549
   7:             202

My settings are as follows:

# dump1090-fa won't automatically start unless ENABLED=yes
ENABLED=yes
RECEIVER_GAIN="--airspy-linearity-gain 18 "
RECEIVER_FORMAT="--sample-rate 20 --sample-format u16o12"
RECEIVER_OPTIONS="--device-type airspy --airspy-enable-packing ${RECEIVER_GAIN} ${RECEIVER_FORMAT} --stats"
DEMOD_OPTIONS=" --demod hirate --demod-preamble-threshold 0.9 --demod-smoother-window 4 --demod-msg-window -7:7 "
WISDOM_OPTIONS=" --wisdom /etc/dump1090-fa/wisdom-airspy.armv7"
DECODER_OPTIONS=" ${DEMOD_OPTIONS} ${WISDOM_OPTIONS} --max-range 500 --fix --no-modeac-auto"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1300 --net-ro-interval 0.2 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-
bo-port 30005 "
JSON_OPTIONS="--json-location-accuracy 2"

Should I increase the window to -8:8?
I know that I may be too low on the demod-smoother-window since I’m running a sample rate of 20. Forgot to change that, but will do that the next time I make some new stats (I let it run for approx 60 minutes between changes).

Getting a lot of dumped samples:

AirSpy: FIFO FULL!  Dropped 98304 samples.  Current Dropped: 98304

I’ve dropped the sample rate to 12 and changed the demod-msg-window to -6:6 but it still keeps dropping samples.

Packing is enabled.

Is there a setting that is more likely to cause dropped samples than the others?

Hm, I’d have thought that sensitivity mode might be better for ADS-B, since ADS-B shouldn’t be affected so much by IMD? (A signal at the wrong frequency will still contribute to the envelope power…)

The current maximum size of the window is 15 although I may change that for those who run art 20MHz.

Yeah, that is low for 20. You could easily bump that to 10 or even 15.

Hmmm… “FIFO FULL” means the demodulator isn’t keeping up with the device. How’s the CPU utilization and what hardware are you running on?

EDIT::

Also add --stats --stats-every 60 to your dump1090 params then watch the output with journalctl -fu dump1090-fa. Then look at the CPU load.

That has a very large impact on the number of messages decoded for me. When I tested a captured 20MHz rf sample, I found that a demod smoother window of 4 gave the highest number of decoded messages. Testing it just now, I increased it from 4 to 15 and the message rate dropped from ~2k/s to about 800/s.

A few more reminders and tuning notes…

The demodulator is attempting to detect symbols. At a 6MHz, there are 3 samples per symbol, at 12MHz there are 6, at 20MHz, it’s 10 and at 24MHz it’s 12. Make sure you adjust --demod-smoother-window accordingly. A good starting point would be 75% of the samples/symbol.

Please try different sample rates and formats! Don’t assume that “more” is better. For example, if you ran at 20MHz before, it’s quite possible that 12MHz might actually be better for you now.

Combinations to try…

Sample Rate Sample Format Notes
6 sc16 Hardware runs at 12MHz, IQ format
10 sc16 Hardware runs at 20MHz*, IQ format
12 sc16 Hardware runs at 24MHz*, IQ format
12 u16o12 Hardware runs at 12MHz, Unsigned real format
20 u16o12 Hardware runs at 20MHz*, Unsigned real format
24 u16o12 Hardware runs at 24MHz*, Unsigned real format
(*) You have to make sure you have the USB bandwidth for 20 and 24 MHz of course.

In particular, if you ran at 12MHz before, try 6/sc16.

That is an excellent point demonstrating that it doesn’t really matter what I think are the right settings. :slight_smile: It’s all about your environment!

The CPU usage was between 90 and 100%. It’s an RPi4, over clocked to 1900MHz with a little adjustment to the voltage both in software and via the PSU.
The device is an Airspy Mini.
It happened when I lowered the gain from 18 to 17 and added --demod-preamble-strictness 3. It got even worse when I adjusted the strictness to 2…

Now I have been running the same system with the same settings (gain 17) for a couple of hours without any dropped samples.

I’ve noticed that when I stop dump1090-fa (sudo systemctl stop dump1090-fa) it sometimes takes a lot of time for the command to finish and no stats are produced. Other times it finishes fast but fail to produce any stats. The only thing I can see in the logs is this:

-- The process' exit code is 'killed' and its exit status is 6.
Jul 07 18:31:23 airspy systemd[1]: dump1090-fa.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support