Performance
An open driver can be profiled and improved by anyone. That work has made OpenRSP's service cheaper to run than the proprietary one: on x86 it uses about 18% less CPU at 2 MS/s and about 45% less at 10 MS/s, and about 55% less with the optional fast DC offset correction.
CPU use of the service
Measured on Linux x86-64 (AMD Ryzen 7 5700U) with a real RSPduo (tuner 1), as CPU time used by the service during 10 seconds of steady streaming with DC offset and IQ correction on, averaged over five runs of each, the three run in turn (lower is better):
| Sample rate | Proprietary service | OpenRSP | OpenRSP, fast DC |
|---|---|---|---|
| 2 MS/s | 498 ms | 408 ms (about 18% less) | 396 ms (about 20% less) |
| 10 MS/s | 1,438 ms | 794 ms (about 45% less) | 648 ms (about 55% less) |
Where the savings came from:
- DC offset correction in blocks. The DC offset filter was a long serial calculation, one sample after another. It is now worked out eight samples at a time, which makes it two to three times faster on x86 and ARM. It was the largest single cost in the stream path.
- IQ balance correction in one pass. Its scaling, rotation and level sums used to read and write the samples seven times per block; one pass now does all of it, with exactly the same result. That about halves its cost on a phone's power-efficient cores.
- Zero-copy USB buffers. Stream transfers now go into memory mapped directly from the kernel's USB layer on Linux and Android, so the kernel no longer copies every packet into user space.
- No more shuffling of the packet queue. The service used to move the remaining packets to the front of its queue after every block, up to 380 KB at a time. It now advances a read position instead.
- Fewer clock reads and lock set-ups on the uncontended fast path.
Optional fast DC offset correction
The exact DC offset correction updates its estimate after every sample, as the proprietary
driver does. The optional fast correction holds the estimate for a block of 256 samples and moves
it once per block, by the block's average, with the same time constant; the block's sum and the
subtraction are one vectorised pass (SSE2 or AVX2 on x86, NEON on ARM). It removes the DC just
as well; its output differs from the proprietary driver's by a few steps. The headless server and the Web Client always use it; the driver itself keeps the exact
correction unless it is turned on (SDRPLAY_FAST_DC=1 in the service's environment, see
the user guide).
In the measurements above it takes about 3% off the service's CPU time at 2 MS/s and about 18% at 10 MS/s, where the DC step is a larger share of the work.
The DC step alone is 3 to 6 times cheaper: on a Pixel 8a it handles 279 million sample pairs a second on a power-efficient core instead of 88 million (2,976 instead of 524 million on its fastest core), so at 8 MS/s it takes about 3% of a power-efficient core instead of about 9%. With it on, the largest part of the service's time is the operating system's USB handling and the copy of the samples into the memory applications read them from.
Checked against the proprietary driver
The sample stream, gain values and AGC decisions are checked against recordings of the proprietary driver's output. The one deliberate difference is the rounding of the block-wise DC offset correction: very rarely (about 1 sample in 3 million) a sample differs by the smallest step. The optional fast correction above differs more (a few steps) and is checked separately: it removes the same DC, settles as fast and behaves the same however the stream is divided. The SIMD kernels (SSE2 and AVX2 on x86, NEON on ARM) are chosen at run time from the CPU's features and are tested against the plain C++ code.
Phones and tablets
- Android: gap-free streaming at 8 MS/s on a Pixel 8a. With an RSPduo, the driver's own stream thread uses about 50% of one CPU core at that rate, down from about 77% before the DC offset and IQ balance changes. Android runs it mostly on the phone's power-efficient cores. The driver app shows this live, stage by stage.
- iPadOS: gap-free streaming at 8 MS/s isochronous on an iPad Air (M4).
What is next
With the exact correction, the DC offset correction is still the largest stage of the stream path; the optional fast correction above takes most of it away where byte-for-byte output is not needed. Most of the rest is fixed by the protocol applications expect: waking the application for every block of samples and copying the samples into the memory it reads them from. Profiles, patches and measurements from other hardware are welcome.
Gain corrections
When a receiver switches in a filter or uses a particular input, less signal reaches the tuner, and the gain values reported to applications are lowered to match. Those corrections are fixed tables, plotted below in the form of a network analyser sweep of the filter or input.
DAB notch filter
The RSP1B and the RSPdx can switch in a notch filter for the DAB Band III broadcasts at 174 to 240 MHz. The table gives the filter's loss every 5 MHz from 0 to 330 MHz; above 330 MHz the correction follows a straight line from 1.7 dB at 330 MHz down to 0.4 dB at 600 MHz.
The two tables are identical up to 150 MHz and from 240 MHz upwards. Across Band III the RSPdx notch is a single deep dip, while the RSP1B table is close to flat at 30 to 33 dB.
RSPdx antenna C input
On the RSPdx's antenna C input the reported gain is lowered, above 30 MHz, by an amount that rises in a straight line with frequency: 0.12 dB at 30 MHz and 2.35 dB at 200 MHz.
RSPdx IF bandwidth
The RSPdx's reported gain also depends on the IF bandwidth and on whether a low IF or zero IF is in use. This is not a sweep, so it is shown as the analyser's list of values.
Reported gain by LNA state
Applications are also told the receiver's total gain at the current frequency and LNA state. Those values come from a table for each model, plotted below for each model's main input: one trace per LNA state, with state 0 (no gain reduction) at the top. The steps are the edges of the receiver's frequency bands.