Changelog¶
What changed in each release, newest first. Each release is tagged vX.Y.Z on GitHub, and the same version is on
PyPI.
0.6.2 (2026-11-30)¶
Added¶
pysdrlib update(alsopython -m pysdrlib update) installs the latest release with pip, keeping theremoteextra, or says that this is the latest. A copy installed from source is left alone.
Fixed¶
- Where USB hotplug events don't reach a program (an unprivileged container), a long-running one such as a server now
follows radios that reconnect: a HackRF that was replugged or reset is listed with its serial and opens again (while
another HackRF is open, not until it is closed), and the first open of an RX-888 after power-on, which loads its
firmware, no longer fails.
pysdrlib build extiorebuilds the RX-888 library.
0.6.1 (2026-11-30)¶
Fixed¶
- A remote client's
read(latest=True)looked for the newest samples only among those it had already taken in, so it could return old ones, andwait_available(0)didn't count what had just arrived. A viewer whose controller started receiving after it attached got the oldest samples queued on its first such read. - Drivers written in Python alone: samples that had arrived but weren't read yet at a retune (or another change of a
setting) were taken to be from after it.
get_samplesnow also returns what areadhad taken in and not returned. - A
readafterget_samplesno longer reports the samplesget_samplesreturned as lost. - HackRF, RTL-SDR, bladeRF and USRP: a radio just opened is put on the receive rate and frequency it reports, as the RX-888 already was. Streaming without tuning first got the radio's own power-on settings (a B210 ran at 1 MS/s while reporting 10, so its sample times were wrong).
- B210: receiving two channels after one channel failed with a multi-channel alignment error, every first time (UHD does
this by itself). After any receive error,
stop_rx()andstart_rx()now recover, where the next start could fail too.
0.6.0 (2026-11-28)¶
Breaking¶
- A server also vets the values a client sends. A
serial,serial_numberoraddrthat isn't text, or contains,,=or control characters, and anindexthat isn't a whole number are refused: a comma let a client add any UHD device argument (fpga=,fw=) past 0.5.2's limits. - A remote client that has lost control now says so:
is_controllerturns False,writeraisesNotController,claim()takes control again or raisesBusy, andclose()/detach()no longer raise.open()arguments are no longer silently ignored when the server chooses the radio: they are applied or refused. - bladeRF: receive and transmit share one sample rate (
caps.shared["rate"]is "device"); setting either sets both. - B210: while receiving, a transmit rate or channel count that would move the master clock raises
err.Busyinstead of silently pausing reception. - Drivers:
set_rx_bufferreturns the old stream total, a multi-channel driver delivers its first channel first in each round, and out-of-tree extensions must be rebuilt. File.set_pathstarts the new file at sample 0 with its own format (unlessfmtwas given; an unknown extension raiseserr.UnknownFormat).open("file", path=X, tx_path=X)raisesValueErrorinstead of erasing the recording. A secondShmStreamof a name already open in this process raisesFileExistsError. A recording that can't be read during playback raiseserr.Lost.- Writing a float sample of +1.0 to a 32-bit integer format with
scale=Trueraises withoutclip=True, as for 16-bit.
Changed¶
write'stimeoutbounds the whole call. A transmit queue that takes nothing forstall_timeoutraiseserr.StreamStalled(err.Lostwhen the device is gone).close()stops receiving and transmitting first.PYSDRLIB_CACHEtakes precedence for building and finding vendor libraries, and a current cached library is preferred over a stale one.- A driver's gain-stage hook may return the dB it actually set, which is then reported.
Simchanging its rate while receiving resizes its queue, as a radio does. A forked child no longer removes its parent's shared-memory stream.- SigMF reading honours
core:offset, andMeta.datetimeis the first sample's time. - Reopening a
FileSink(not appending) starts its counts, captures and annotations over.
Added¶
pysdrlib.open("sim", ...)takeschannels,block_samplesandsample_format, as documented.
Fixes¶
Building vendor libraries:
pysdrlib buildcould exhaust a machine's memory, starting every compiler at once on Linux and macOS. It now runs one per processor, and no more than the available memory (or a container's or systemd unit's cgroup limit) has room for at 1 GiB each.CMAKE_BUILD_PARALLEL_LEVELsets the number.- The bundled UHD did not compile without UHD's headers already installed, and with them could compile against another version's. Nor did it link with Boost 1.83.
- Rebuilding a library no longer crashes programs that have it loaded, and an interrupted build isn't taken as current.
pysdrlib buildandpysdrlib playno longer fail without pyzmq installed (everypysdrlibcommand did).
Samples, streams and files:
- Multi-channel streams stay aligned: through an aligned
readwith lost samples, a rate change while receiving, and awritethat times out. - Events are no longer lost or misplaced in blocks with lost samples; per-stage receive gain setters record them too.
writeno longer hangs or spins when the transmit stream dies or is stopped or closed by another thread.flushdiscards everything queued, past gaps too. Infinite or very large timeouts wait.hw_timestays right after a rate change.- A device closed while streaming starts cleanly when reopened. A refused sample rate leaves the old one reported.
sweepstarts the channel it reads and shifts the right way behind an inverting chain;streamtakes a numpy integer channel; transmit gain calls on a receiver raiseerr.NotSupported; the total-gain split is cached again; continuous stages with fractional limits stay within them; an unhashableon_dropraisesValueError.- Full scale no longer wraps to the opposite extreme in 32-bit integer files.
Sim: a block being made as a setting changed could pass for one made after it, sofind_gainon a loaded machine could settle on the wrong gain.- Replay:
seekwhile stopped updates the reported frequency.File.set_pathswitches an open file properly.FileSinkwrites one SigMF capture per frequency change. - Shared memory and air: closing a stream while another thread reads it no longer crashes; receivers place samples after a pause at the right time, keep up when the publisher raises its rate, lose nothing at a retune or close, and don't start with old backlog. On Windows a crashed publisher is detected and files in use are retried.
Radios (those marked † not yet confirmed on one):
- HackRF†: each direction keeps its own RF amp setting (transmit could run with the amp on while reporting 0 dB), the chosen filter bandwidth survives a rate change, and unplugging during transmit wakes the writer.
- USRP†: no false overflows with Unix or GPS device time; closing during a control call no longer crashes; partial sends are completed; a B210 rate change reports what the other direction's rate became.
- bladeRF†: no repeated transmit samples after a USB stall.
- bladeRF† and USRP†: a failed receive stream raises
err.StreamStalledat once with the library's reason. - RX-888†: reported gains are those set. RTL-SDR†: gain mode follows
set_agcand gain changes, and the frequency correction survives a reopen. Both: per-stage gain setters takechannel=.
Remote:
- A relay passes on a far radio's or server's failure instead of leaving reads waiting, and
find_gainworks through one. - A slow
openno longer expires other clients' leases; a failedopenno longer holds the radio, and a closedRemoteDeviceopens again. - Restarted streams: multi-channel ones keep shared memory and lose nothing, viewers get their first events, frequency
and rate, settings changed while idle don't discard their start, and
start_rxon a running stream changes nothing. - Closing or detaching while another thread reads or writes ends that call cleanly.
0.5.2 (2026-11-28)¶
Breaking¶
- A server no longer lets a client choose what a driver connects to or opens. A client may pass a driver a serial, an
index, a UHD radio's
addrand a simulated radio's signal; anything else (tcpiq'shost/listen,file'spathandtx_path,shm'sdirectory, UHD'sargs, positional arguments) is refused witherr.InvalidValue. Open those withpysdrlib server --open TYPE:KEY=VALUE, or allow keys with--allow-arg TYPE:KEY,KEY(Server(client_args=...)). It was a way to make a server read or write any file, or connect to any host, for anyone who could reach it. - A server hosts at most 32 devices (
--max-devices), refuses requests over 1 MiB, andSimtakes at most 8 channels and 4 Mi samples per block.pump,sweepandfindare no longer remote methods, andfind_gainthrough a server is bounded (each read at most 4 Mi samples and 30 s).
Changed¶
- A
socket_subscribers/shm_subscriberscount says someone is subscribed, not how many: a server counts a subscribe but hears of an unsubscribe only from the last subscriber of a topic. - Shared-memory stream manifests: the directory is created
0700, and one owned by another user (or writable by others, as a shared/tmpwould have it) is not believed.
Added¶
FileandFormatscan be pickled (aFormatsmember pickles by name). An unpickledFilekeeps its position and starts closed, opening at its first read.
Fixes¶
- A message of the wrong shape stopped a server. One with more than a request's frames killed the C2 thread (so the server exited), a device's control thread, or its transmit thread. A forged unsubscribe on a device's RX socket cut off real subscribers, and a flood of long subscriptions used gigabytes (a subscription is now at most 128 bytes, and only a device's own topics count). A transmit write blocked on a radio that stopped taking samples kept the server from stopping.
- A reader of a shared-memory ring refuses a header the segment cannot hold (a capacity of 0 divided by zero, one near 2^61 wrapped the size check) and gives up on a writer that keeps spoiling its reads.
claimandprogramtext can no longer forge log lines or send escape sequences to a terminal; mDNS announcements with bytes that are not UTF-8 no longer stopdiscover; a client maps only shared-memory segments named like a server's.copy.copy(file)gives aFilewith its own handle and position: it used to share the original's handle.
0.5.1 (2026-11-26)¶
Added¶
- An air that devices transmit into and receive from (
pysdrlib.air):Sim(transmit=True, air="lab")(orpysdrlib.open("sim", air="lab", transmit=True), and a server's--open sim:air=lab,transmit=true) transmits into it, and everySim(air="lab")hears it, in this process or another on the machine (each transmit channel a shared-memory stream): shifted to the receiver's frequency, resampled to its rate, attenuated by the air'sloss_db, then the receiver's gain, noise and ADC. Realtime sims are on the wall clock (transmitting is paced, a pause is silence); others count their own samples, so one process is exact and repeatable. Anything can attach channels without a sim (air.tx_channel(),air.rx_channel()). With an air,transmittedis not kept (get_tx_stats()counts what was written). - A transmitting sim has a transmit gain stage, "PA" (0-47 dB, full scale at 47):
set_tx_gain,set_tx_gain_dbandset_tx_pa_gainscale what it transmits. pysdrlib.find(virtual=True)lists a simulated radio in each air with a transmitter in it (a transmitting sim from its firstwrite, not fromopen). An air's transmit channels areshmstreams thatfind()lists only withvirtual=True.pysdrlib.shm.streams(prefix=)lists only the streams whose name starts with it.- Recordings say how the radio received.
Device.get_rx_context()gives a channel'sRxContext: the frequency over the air and the rate, thecaps.Chainin front of the radio (its LO, andinvertedwhen the LO is above the signal and the spectrum arrives mirrored), the reference correction (set_freq_correction) and clock source, gains, antenna port and radio.FileSink(..., context=)keeps it in a SigMF recording aspysdrlib:rx(an optionalcore:extensionsnamespace),sigmf.read(...).contextandFile(...).meta.contextgive it back, a replayed recording reports it (open("file", ...).get_rx_context()),pysdrlib client ... rx/watch -o x.sigmfwrites it (a viewer can ask too), andpysdrlib play --infoprints it. A remote radio on a server older than 0.5.1 raisesNotSupportedsaying so (client ... -o x.sigmftoo; a raw recording doesn't ask). Any call to a method the server's pysdrlib doesn't have raisesNotSupportednaming the method and the server's version, before it is sent. - How well the receiver is known travels with it.
set_freq_correction(ppm, accuracy=)(a standard error, ppm;get_freq_correction_accuracy) andcaps.Chain(lo_accuracy=)(Hz;lo_accuracyin a frontends file: a measured LO's) are inRxContext(ppm_accuracy,chain.lo_accuracy), so a reader can say what a frequency read off the samples is worth, andplay --infoshows them. - Levels in dBm.
Device.set_level_calibration(offset_db, accuracy=, span=): dBm at the antenna port = dBFS (full scale |x| = 1 in the complex64 samples) +offset_db, made at the gains and frequency current then.RxContext.level_offset/level_accuracy(dB) carry it while the gains (and gain mode) are unchanged and the frequency is withinspan(default: the sample rate when it was set); otherwise both are None.get_level_calibration()says what was set and whether it stillholds. It crosses the wire, andplay --infoshows it. - A chain names its feed and channel.
caps.Chain(polarization="H" | "V" | "RHCP" | "LHCP")says what the feed takes in, andcaps.Chain(channel=)puts a chain on one channel of a radio whose channels' ports share a name (a B210's RX2 on channels 0 and 1, a dual-feed LNB's two outputs). Both are keys of a frontends file too, andget_rx_context(channel=k)gives each channel's chain. Recordings written by 0.5.1 markpysdrlib:rxas version 1.2.0; whatever a recording doesn't have reads as None. Device.set_chains([caps.Chain(lo=5.15e9, invert=True)])puts an LNB or converter in front of a radio on this machine: frequencies are over the air from then on (the radio stays where it is tuned, andget_rx_freqsays what that is through the new chain). A remote radio's chains are its server's frontends file:set_chainson one raisesNotSupported.pysdrlib.open("sim", realtime=False)works:realtimeis taken byopenas well as the constructor, asairandtransmitare (and a server's--open sim:realtime=false).
Fixes¶
set_rx_gain(fraction)/set_tx_gain(fraction)no longer warn "... gain must be a multiple of N": a fraction nearly always falls between a stage's steps, so rounding it to one is expected (and withstrict = Trueit no longer raises).set_rx_gain_dbstill warns when the decibels asked for can't be set exactly.- A replayed recording's
get_rx_freq()is the recording's frequency from the start (it was the default, 100 MHz, until playback began). filetransmitting in real time paces withtime.perf_counter(). On Windows before Python 3.13,time.monotonic()ticks every ~15.6 ms, sowritecould leave more queued thanTX_BUFFER_SECONDSallows.
0.5.0 (2026-11-22)¶
Breaking¶
- pysdrlib is now licensed GPL-3.0-or-later (it was MIT). Releases up to 0.4.6 stay MIT.
- File format names count the bits of one value (I or Q), as SigMF does, not of the whole sample.
cf32is now two float32 (numpycomplex64, a GNU Radio.cfile; it wascf64).cf64wascf128,cf16wascf32, andci16twasci32t(likewise for ci4t, ci8t and ci32t). Two's complement is the default (ci8isci8t). Code that namescf32orcf64will misread files without an error, so check every caller. TcpIq(sample_format=...)in the constructor is gone. Pass it toopen()instead:pysdrlib.open("tcpiq", host=..., sample_format="ci16").- Remote: protocol version 4 only. A server refuses a client of another version and says which side to update. Run the same pysdrlib version on both ends.
OverflowandUnderflowmoved topysdrlib.err(pysdrlib.file.errkeeps the names).- The native extensions lost their Python receive-callback path (
set_rx_callback,read_rx_indexed,rx_available). This only affects drivers written outside pysdrlib.
Radios¶
- bladeRF 2.0 micro (
bladerf): 2 RX and 2 TX channels. Receive is tested on a 2.0 micro xA4 and is lossless from 0.52 to 40 MS/s. Transmit is so far checked for plumbing only. - tcpiq:
- Listening mode (
listen=True) waits for a client to reconnect (reconnect_timeout, default 10 s). A client that reconnects takes over the stream, and keepalive drops a dead client in about 5 s. - Skips rtl_tcp's 12-byte header (
sdr.rtl_tcpreports the tuner). - Measures the arrival rate (
sdr.measured_rate, andsdr.rate_mismatchagainstRATE_TOLERANCE) and warns (warn.RateMismatch) when it disagrees with the declaredFs. - Accepts 4-bit packed (
ci4) and half-float (cf16) streams.pysdrlib.tcpiq.FORMATSlists every stream format. The format can also be aFormatsmember (Formats.ci16t), as File and FileSink take. - Connected mode: when the server closes the stream, or stops answering (keepalive notices in about 5 s), a read
raises
err.Lostonce what arrived has been read. Before, it waited until its timeout. - sim runs on the same native streaming path as the hardware drivers. Its signal is built from tones, noise and
QPSK bursts, set in
open()orconfigure(). It can scale with gain and clip like an ADC, and can delay a retune, drop samples, stall or disconnect on demand. Each channel has its own gain and strength (channel_db).
Receiving¶
- A change at a block's first sample (or in a gap just before it) is an
Eventat offset 0 in that block'sRxMeta.events; before, onlyRxMeta.freq/rateshowed it. After a flush there is still none. err.Lostraised byreadcarries what that read had received:.samplesand.meta.read(latest=True)skips what is queued except the newest block, and anything from before the last setting change: what a display wants.err.Lostis raised when the radio is gone: unplugged, or a remote server that no longer hosts it.on_dropcan be set for a singleread,streamorsweep.on_drop="raise"raiseserr.Droppedcarrying the block, andsweep(on_drop="retry")captures that step again.RxMeta.hw_timeis the radio's own clock at a block's first sample. It is carried to remote clients and relays, and into SigMF recordings.- A retune, rate, gain or bandwidth change is marked at the stream position from before the driver's call, so samples that arrive during a slow retune report the new setting.
Device.sweep(start, stop, step, count)takes a list of frequencies,offset=(tune off centre, which moves the DC spike out of the way) andskip=.- Every device has
is_controller(always true locally),idandgranted(None locally), so code that handles local and remote devices alike doesn't needgetattr. RxMeta.index_at(k)(the stream index of a block's samplek),RxMeta.next_index(the stream index just after a block),RxMeta.follows(prev)(it starts whereprevended, nothing lost or discarded between) andRxMeta.wall_time(the radio's clock when it holds a date, else the receive time on the wall clock).indexis documented as the absolute position across gaps.rx_antenna_info()/tx_antenna_info(): each antenna port with its chain, the antenna fitted, whether the spectrum comes mirrored there, and whether it is selected.find_gain()finds and sets the highest receive gain that doesn't clip, for one channel or several, local or remote.- Gain splitting is cached: a repeated HackRF
set_rx_gaintakes 5 µs instead of 723 µs. - The native ring copies samples out with its lock released, so a slow reader no longer holds up the driver's thread.
Shared-memory streams¶
shmdriver andpysdrlib.shm.ShmStream: a process publishes samples under a name (ShmStream("rpps.ch3", Fs=, cf=), thenpublish(x, first)), and any other on the machine receives them like a radio (pysdrlib.open("shm@rpps.ch3"), listed byfind()). RxMeta carries the publisher's gaps, its wall-clock time (hw_time), and a freq or rate event when it retunes; a closed stream raiseserr.Lost.- The ring under it (
ShmWriter,ShmReader,fit_capacity) moved frompysdrlib.remote.shmtopysdrlib.shm, and needs no pyzmq.
Files¶
- SigMF:
FileSinkwrites.sigmf-dataand.sigmf-metafiles, with a capture per retune and an annotation where samples were lost.Filereads the format, rate and frequency back. pysdrlib.open("file", path=...)plays a recording as a radio (loop=,realtime=, seek).tx_path=records what is transmitted. A server can host either.- Big-endian formats (
ci16_be,cf32_be...), 4-bit packed and half-float formats, andFileSink(scale=True). File.is_open. A file whose format nothing names raiseserr.UnknownFormat(aValueError), as do an unsupported SigMF datatype and an unknown stream format name.- The format is taken from the file extension (
.cf32,.cu8,.cfile...) when none is given.
Finding and opening radios¶
pysdrlib.discover()lists radios attached here and on servers (PYSDRLIB_SERVERS, or zeroconf). Each comes with the target stringopen()takes:[server/]driver[@serial]. A malformed target raisesValueErrorup front.Radio.receivingsays whether a hosted radio is streaming.err.NoDevice.reasonsays why a server had no radio for a request:"none_attached","none_free","unmet"or"no_type"(it travels from the server to the client).
Command line and remote¶
pysdrlib play RECdescribes a recording and shows its power as it plays (--servehosts it like a radio).pysdrlib client ... rx|watch -o FILErecords in any format, or SigMF.server --open TYPE:KEY=VALUEandclient --arg KEY=VALUEpass arguments to a device'sopen().format_antennamoved frompysdrlib.remote.clitopysdrlib.base.antennas, which needs no remote extra.- Server metrics:
Client.metrics(),pysdrlib client ADDRESS stats, and a periodic log line per streaming device. - A viewer whose state is older than the server's (it attached before the controller started receiving) has
readask the server once instead of raisingerr.NotStreaming. RemoteDeviceforwards every publicDevicemethod. This fixessplit_rx_gain_dbrunning on the client.
Fixes¶
- Building from a source checkout works again (
pip install -e ., sdist to wheel, cibuildwheel). It was broken since hardware timestamps landed. - A recording played with
realtime=Falsecould lose whole blocks while a read was copying out of the queue: the ring now reports what is being copied (rx_stats()["reading"]), and playback waits for that as well. with pysdrlib.open(...) as sdrno longer warns that the device is already open.- pysdrlib's warnings point at the caller's line, not at pysdrlib's own code.
Docs and tooling¶
- Docs moved to Zensical + mkdocstrings: the reference is the docstrings, and the how-to guides embed the tested
examples.
AGENTS.md,llms.txtandllms-full.txtare for coding agents. tools/builder.pymatches RPPS's and pyspecan's. CI runs on Linux and Windows with Python 3.12, 3.13 and 3.14. Releases publish from a GitHub release taggedvX.Y.Z.
0.4.6 and earlier¶
See the tags on GitHub.