From c1d156f47337ca7db43524f093bfa28ffe368d6d Mon Sep 17 00:00:00 2001 From: Tom Hensel Date: Wed, 29 Apr 2026 22:25:44 +0200 Subject: [PATCH] SoapyUHDDevice: surface UHD 4.10 'mtu' stream argument UHD 4.10 added two new stream/device arguments: - 'mtu' (stream-arg) -- override the link-detected MTU - 'force_mtu' (device-arg) -- skip MTU detection entirely Both already flow through SoapyUHD without code change: setupStream() passes its kwargs verbatim into stream_args_t::args via kwargsToDict(), and make_uhd() does the same for device_args. They work today on UHD 4.10 -- they just aren't surfaced in getStreamArgsInfo(). Pothos GUI / SoapySDRUtil --probe / Sonneman / etc. enumerate the ArgInfo list when populating UI knobs and hint dropdowns. Without an ArgInfo entry, users have to know the magic key by reading UHD docs and type it manually. Adding one ArgInfo struct surfaces 'mtu' in every Soapy front-end automatically. Use case: remote streaming over WAN where path-MTU discovery fails (common with X410/X310 over consumer routers), or local network topologies that interfere with auto-detection. Guard with '#if UHD_VERSION >= 4100000' so the option only shows on UHD versions that actually honor it. The matching 'force_mtu' device arg already flows through; documenting it requires no ArgInfo (we don't expose getDeviceArgsInfo at the Soapy layer). No code change for the runtime path -- the kwargs already pipe to stream_args_t::args. This commit is pure metadata advertisement. Signed-off-by: Tom Hensel --- SoapyUHDDevice.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SoapyUHDDevice.cpp b/SoapyUHDDevice.cpp index 41140a8..97c5d73 100644 --- a/SoapyUHDDevice.cpp +++ b/SoapyUHDDevice.cpp @@ -219,6 +219,17 @@ class SoapyUHDDevice : public SoapySDR::Device streamArgs.push_back(underflowPolicyArg); } +#if UHD_VERSION >= 4100000 + SoapySDR::ArgInfo mtuArg; + mtuArg.key = "mtu"; + mtuArg.value = "0"; + mtuArg.name = "Override link MTU"; + mtuArg.description = "Override the auto-detected link MTU (UHD >= 4.10). 0 = use detected value."; + mtuArg.units = "bytes"; + mtuArg.type = SoapySDR::ArgInfo::INT; + streamArgs.push_back(mtuArg); +#endif + return streamArgs; }