SoapySDRPlay3: Overflow with RSP1A approx. 4x per hour --> Single short audio pieces are missing in the stream (fraction of a second)
RTLSDR-Airband (latest unstable) SoapySDR 0.8.0 SoapySDRPlay 0.3.0 SDRplay_RSP_API-ARM32-3.07.2
I am currently doing tests for a new LiveATC streaming setup. I am using two SDRs in parallel with RTLSDR airband via SoapySDR: an RSP1A and an Airspy mini.
With the official version of RTLSDR-Airband it always stopped after about 5 to 15 minutes with the following message: OSoapySDR device 'driver=sdrplay,biasT_ctrl=false': readStream failed: OVERFLOW, disabling
The author of RTLSDR-Airband then referred me to the current unstable branch, which does not stop in such a case. And indeed: RTLSDR-Airband now runs, even when overflows occur at RSP1A.
Since the Airspy mini is running in parallel, I have two more or less identical MP3 files, which I record. However, I notice the following: It is always recorded for an hour in parallel into an MP3 file. While at the beginning of an hour both files are absolutely at the same time, the RSP1A file is a few seconds ahead (about 3 seconds) until the end of the hour. I then noticed that per hour maybe 4 to 5 times short moments (fraction of a second) are missing in the stream of the RSP1A. This manifests itself as a few syllables being swallowed each time. This then seems to add up over an hour.
I assume that the swallowed short time segments always occur when an overflow occurs. Since the Airspy mini does not have this problem: Is there any way to tell what is causing these sporadic overflows and what I can do about it?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20
@thowe-switzerland - Thomas, thanks for your extensive experiments and for reporting your very interesting findings!
I did some quick research in these days (sorry for not replying to you earlier, but during the week I can only spend a couple of hours of my free time after work/dinner on this kind of project), and I found a couple of interesting pages where they talk about real time issues for audio and music related applications; your case is slightly different, but I thought some of their comments and suggestions might apply to streaming off the RSP1A (and also if any of these ideas work, they might save you from having to patch, rebuild, run, and possibly troubleshoot, a real time kernel).
The first one is this tool written in Perl called ‘realtimequickconfigscan’, that runs a quick check of your Linux installation for potential causes of real time streaming issues: https://github.com/raboof/realtimeconfigquickscan
The second one is this section of the Fedora page about the audio application ‘JACK’ - https://fedoraproject.org/wiki/JACK_Audio_Connection_Kit#Running_Jack_in_Realtime_mode - they have some commands on how to make a process (
RTLSDR-Airbandin your case) run with real time priority; they also show there what the output from ‘realtimeconfigquickscan’ looks like for a well configured system, so you can see how to possibly address those short skips you noticed.Franco
@thowe-switzerland - Thomas, thanks for the detailed reports and the very thorough analysis.
I am not familiar at all with the program RTLSDR-Airband; that’s why I am asking you to also run tests using the stream loop test from
SoapySDRUtil, since if we can reproduce the overflow problem with this utility, it becomes much easier for me to troubleshoot it.I just pushed a new commit (https://github.com/pothosware/SoapySDRPlay3/commit/9d1c10d34a166a07b132892df68c2f52c34880f2) to the branch
debug_overflows; since the SDRplay API also returns the sequence number of the first sample when calling the RX streaming callback, I added a simple check to make sure there are no gaps in the sequence numbers (i.e. that each callback starts with a sequence number that is exactly after the last sequence number of the previous callback). I just run a test usingSoapySDRUtil --args='driver=sdrplay' --rate=8e6 --direction=RXfor more than 30 minutes with the RSPdx I have here, and it didn’t report any error.Please build the SoapySDRPlay driver again using the latest code from the
debug_overflowsbranch; run the usual tests with both RTLSDR-Airband and SoapySDRUtil (I think 30 minutes or so for each test should be enough at this point), and let me know if you see any warning due to gaps in the sample sequence numbers.Franco
@thowe-switzerland - Thomas, thanks for the detailed info.
To troubleshoot this problem, I created a new branch called
debug_overflows(https://github.com/pothosware/SoapySDRPlay3/tree/debug_overflows) - as you can see in the commit (https://github.com/pothosware/SoapySDRPlay3/commit/f263cff1ebc01c19b001455ba80fdc04572c8e24), the only difference between this branch andmasteris a couple of log warnings that you should see on the terminal whenever on overflow occurs inside the SoapySDRPlay3 driver.Please build this branch, and run the RTLSDR-Airband as usual for an hour or so with the same settings (sample rate, etc) you used before, and let me know if you see those warning messages.
Also I’d like you to run (again with the code from this branch
debug_overflows), the programSoapySDRUtilto test streaming without any other processing (that could add overhead), like this:Please let this one too run for an hour or so, and let me know if it reports any overflow warning.
As per the version number, you have a valid point - I should update the file
Changelog.txt, and assign a git tag for the currentmasterbranch, so there is no ambiguity.Franco