Closed thowe-switzerland closed 3 years ago
Please try the code from the current "unstable" branch. I have recently pushed a change there which makes SoapySDR stream reading errors non-fatal. It won't cure the root cause, but at least the program will continue running and try to read from the device anyway. Just note that the build system in unstable has recently changed, so compilation instructions from the Wiki no longer apply. Please use instructions from README.md in unstable branch.
Thanks Tomasz! 👍
Just checked it out and built for RPi4 according to README.md. Build/install went fine and the following version is spinning right now:
RTLSDR-Airband version 4.0.0pre-891dc48
I'll let you know for how long this version is remaining running. :-)
It seems not uncommon for SoapySDR devices to run into this read stream overflow problem. And you write in all cases that rtlsdr_airband can't fix the cause but at most handle it resiliently.
This raises some questions for me:
Interim report: The build based on unstable branch seems to run through so far: 2.5h uptime the release never achieved.
I'll stay in touch.
Looks really good! Thanks for the changes in the unstable branch.
Uptime is now around 7 hours without a problem. The audio quality of the RSP1A in this configuration with a bandwidth of 8 MHz is surprisingly good. If the operation remains stable, this will be my new setup.
Other question: Should read stream overflows be listed in the statistics file? Surprisingly there is always 0. Or is this counter no longer incremented due to the modification?
# HELP buffer_overflow_count Number of times a device's buffer has overflowed.
# TYPE buffer_overflow_count counter
buffer_overflow_count{device="0"} 0
There are two buffering layers involved. The first one is between SoapySDR and the application (in this case - rtl_airband's input thread). The second one is in rtl_airband - between the input thread and the demodulation thread. So there is a three-stage pipeline which is synchronized with mutexes, so that the writing thread does not clobber the buffer with the new data before the reading thread makes some free space by reading the data from it. In case there is not enough space in the buffer, the writing thread declares an overflow event which means a batch of samples gets dropped. The buffer_overflow_count
counter only counts overflows that happen in the second buffering stage and this is why you don't see it being incremented on SoapySDR overflows.
Overflows are more likely to happen when using high sampling rates. An occasional overflow isn't usually a problem. If they happen very often, it usually means that the CPU is not fast enough to handle that amount of work. The way to go then is either to reduce CPU usage (by reducing sample rate and/or FFT size or switching off other CPU intensive tasks) or use a faster machine.
Thank you for the very good and detailed explanation. I can understand it very well.
The RPi 4 has been running in this configuration for more than 30h now without any problems. I have listened to some of the MP3 files produced: everything seems fine in really excellent quality. I am always amazed to see what the team of SDR and rtlsdr_airband can produce. Fantastic!
From my point of view this ticket can be closed.
Thanks for the impressive software and the excellent support. Appreciate it very much.
Thanks for the feedback and your kind words.
I'll close the issue after releasing a stable version containing the fix.
A little addendum from the field with the new more robust behavior and catching of stream overflows.
The RSP1A now no longer crashes on such a buffer overflow. The audio stream continues to run. However, one notices that apparently samples are lost:
Completely different note: Through my intensive tests I can now say that the RSP1A and the Airspy mini have absolutely identical performance for air traffic communication in the VHF range at least in my setup on the same antenna. You can switch back and forth - zero difference.
Fix released in v4.0.0.
Closing.
Background
I have been running an absolutely stable LiveATC feed with an RTL dongle for several years. Now I have built a brand new installation with RPi 4 and the SDRPlay RSP1A. However, this feed has never run longer than 70 minutes because RTLSDR airband is always shutting down.
Describe your environment
Hardware:
Software:
What happened?
Using device RSP1A via SoapySDR (the only device).
Basically RTLSDR_Airband starts and works fine as systemd service for some time but shuts down after a random period of about 5 to 70 minutes. Cause seems to be "readStream failed: OVERFLOW, disabling"
Full message: OSoapySDR device 'driver=sdrplay,biasT_ctrl=false': readStream failed: OVERFLOW, disabling
Additional info
system journal at sudo systemctl start rtl_airband
system journal when rtl_airband is shutting down
/var/log/messages at sudo systemctl start rtl_airband
/var/log/messages when rtl_airband is shutting down
/usr/local/etc/rtl_airband.conf