Impact
- The values of the
Format enumeration in the bladerf Python bindings are incorrect, causing confusing behavior and breaking applications that worked on previous versions of libbladeRF.
- This bug affects the current release candidate:
2025.05-rc2
Background
Commit 79cae1e introduced a new value to the bladerf_format enumeration: BLADERF_FORMAT_SC16_Q11_PACKED (see here).
This caused values declared later in the enumeration to increment by 1, effectively changing the ABI of libbladeRF.
Root Cause
However, it appears that the host/libraries/libbladeRF_bindings/python/bladerf/_cdef.py file used by the bladerf python bindings was not updated.
Since the Format(enum.Enum) enumeration in _bladerf.py references these enumeration values as loaded from _cdef.py (see here), Format.SC16_Q11_META and all subsequent values in the Format enum have the incorrect values.
This causes confusing behavior when users are, for instance, trying to receive data with timestamps using the SC16_Q11_META format, since the data returned by sync_rx() and friends is not in the expected format.
Actions to remedy:
Impact
Formatenumeration in thebladerfPython bindings are incorrect, causing confusing behavior and breaking applications that worked on previous versions oflibbladeRF.2025.05-rc2Background
Commit 79cae1e introduced a new value to the
bladerf_formatenumeration:BLADERF_FORMAT_SC16_Q11_PACKED(see here).This caused values declared later in the enumeration to increment by 1, effectively changing the ABI of
libbladeRF.Root Cause
However, it appears that the
host/libraries/libbladeRF_bindings/python/bladerf/_cdef.pyfile used by thebladerfpython bindings was not updated.Since the
Format(enum.Enum)enumeration in_bladerf.pyreferences these enumeration values as loaded from_cdef.py(see here),Format.SC16_Q11_METAand all subsequent values in theFormatenum have the incorrect values.This causes confusing behavior when users are, for instance, trying to receive data with timestamps using the
SC16_Q11_METAformat, since the data returned bysync_rx()and friends is not in the expected format.Actions to remedy:
import_header.pyscript to update the_cdef.pyfile and commit the result.version_change_checklist.mdfile suggests running this before cutting a new release, but it seems this was not run for the release candidate.import_header.pyto generate_cdef.pyevery time as part of the libbladerf build process (and maybe not have_cdef.pycommitted in the repository at all) as this would make it less likely for_cdef.pyandlibbladeRF.hto get out-of-sync.BLADERF_FORMAT_SC16_Q11_PACKEDvalue should have been added to the pythonFormat(enum.Enum)enumeration in_bladerf.py