OpenRSP

An independent, open-source driver stack for RSP-family SDR receivers

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):

Service CPU time, proprietary vs OpenRSP CPU time used by the service in 10 seconds of streaming. 2 MS/s: proprietary 498 ms, OpenRSP 408 ms, OpenRSP with fast DC correction 396 ms. 10 MS/s: proprietary 1,438 ms, OpenRSP 794 ms, OpenRSP with fast DC correction 648 ms. Proprietary service OpenRSP OpenRSP, fast DC (optional) 0 400 800 1,200 1,600 CPU time in 10 s of streaming (ms, lower is better) 2 MS/s Proprietary service, 2 MS/s: 498 ms 498 ms OpenRSP, 2 MS/s: 408 ms (18% less) 408 ms (18% less) OpenRSP, fast DC, 2 MS/s: 396 ms (20% less) 396 ms (20% less) 10 MS/s Proprietary service, 10 MS/s: 1,438 ms 1,438 ms OpenRSP, 10 MS/s: 794 ms (45% less) 794 ms (45% less) OpenRSP, fast DC, 10 MS/s: 648 ms (55% less) 648 ms (55% less)
Service CPU time, proprietary service and OpenRSP with the exact (default) and the optional fast DC offset correction, same receiver, host and settings. All three delivered every sample in every run.
Sample rateProprietary serviceOpenRSPOpenRSP, fast DC
2 MS/s498 ms408 ms (about 18% less)396 ms (about 20% less)
10 MS/s1,438 ms794 ms (about 45% less)648 ms (about 55% less)

Where the savings came from:

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

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.

RSP1B DAB notch, S21 from 0 to 330 MHz at 10 dB per division: within 3 dB of 0 dB up to 140 MHz, falling to -33 dB at 170 MHz, between -30 and -33 dB up to 220 MHz, then back to -10.7 dB at 240 MHz and -1.7 dB at 330 MHz.
RSP1B, DAB notch switched in. Deepest point 33.0 dB at 170 MHz.
RSPdx DAB notch, S21 from 0 to 330 MHz at 10 dB per division: within 3 dB of 0 dB up to 140 MHz, falling to -63.7 dB at 190 MHz, then back to -10.7 dB at 240 MHz and -1.7 dB at 330 MHz.
RSPdx, DAB notch switched in. Deepest point 63.7 dB at 190 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 antenna C, S21 from 30 to 200 MHz at 0.3 dB per division: a straight line from -0.12 dB at 30 MHz to -2.35 dB at 200 MHz.
RSPdx antenna C input, 30 to 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.

RSPdx gain correction by IF bandwidth. Low IF / zero IF: 5 MHz -14.0 / -11.0 dB, 6 MHz -15.5 / -12.5 dB, 7 MHz -16.5 / -13.5 dB, 8 MHz -18.0 / -15.0 dB, all other bandwidths -6.5 / -3.5 dB.
RSPdx gain correction by IF bandwidth. Zero IF is 3 dB above low IF on every row.

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.

RSP1 reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSP1.
RSP1A reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSP1A.
RSP1B reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSP1B.
RSP2, antenna A/B reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSP2, antenna A/B.
RSPduo, tuner 1 reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSPduo, tuner 1.
RSPdx reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSPdx.
RSPdx-R2 reported gain from 0 to 2000 MHz, one trace per LNA state, 15 dB per division from 120 dB.
RSPdx-R2.