Skip to main content

bayertap

A passive conformance tap for bayerlink links.

In a streaming netlist, a tap is a sink that observes a stream without stalling it. This is that concept as bench equipment: point it at any V4L2 capture device carrying a bayerlink source and it tells you whether the bytes survive — judged with the same published codec the source encoded with, so the two ends cannot disagree about what conformance means.

bayertap probe                          # which byte-lane permutation is this rig?
bayertap --lane-map 2,1,0 check --pattern counting     # every sample, judged
bayertap --from-file frame.npy check    # no hardware at all

Capture tiers

Tier Hardware Path Fidelity
Trusted TC358743 HDMI→CSI-2 bridge (~$25, the PiKVM part) on any Pi or Jetson RGB888 (RGB3; --bgr for BGR3) byte-exact
Cheap MS2130S / MS2131S USB3 stick (~$15) on any Linux box RGB24 (RGB3) byte-exact if the stick's pipeline is transparent — check answers that in minutes
Rejected any USB2 stick MJPEG / starved YUYV physics: USB2 cannot carry uncompressed 1080p, and MJPEG is lossy. Refused in code, not just here

The two bring-up commands

probe resolves the byte-lane permutation — which captured channel holds container byte k — by trying all six against the header's magic and CRC. Its output is directly the lane_map for this tool's check and for the FPGA-side receiver (np2hw.bayerlink_in). One command instead of a scope.

check --pattern X regenerates the pattern locally (patterns are pure functions — nothing travels out of band) and compares every sample, watches frame_seq for gaps, tolerates scanout repeats (protocol-legal), and exits nonzero on any discrepancy. Point CI at it if you like.

For the TC358743 tier, remember the bridge needs an EDID loaded (v4l2-ctl --set-edid) before it captures — and that EDID is leverage: it is what the source reads, so advertise only RGB 4:4:4 at your one mode and the source is steered into the only format the protocol accepts.

No Linux box on the bench

The capture side is V4L2, but the stick does not care what it plugs into: contrib/macgrab.py grabs frames on macOS through ffmpeg/AVFoundation and writes the same .npy that --from-file consumes —

python3 contrib/macgrab.py --device 0 --out grab.npy
bayertap --from-file grab.npy check --pattern counting

Status

Everything except the ioctl layer is proven off-target: struct sizes pinned against the kernel uapi, the decode path (direct capture with lane maps) tested end-to-end from files, recordings included. First runs against real capture silicon are the bench session; the known-good device table starts there.

Funding

Developed independently; recurring support via github.com/sponsors/lanserge, or write first: s.rabykin@gmail.com. Sponsorable capability targets carry the sponsorable label on the issue tracker — currently DNG and bare-mosaic bridges (every DNG camera and raw dataset as a source). Scope is agreed in writing before work starts; sponsored work lands in the open tree immediately, MIT like everything else — sponsorship buys ordering and named credit, not exclusivity. The person behind it: serge.rabyking.com.

Licence

MIT.

Metadata

Release files for bayertap 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bayertap 0.2.1
File Size Uploaded Provenance Actions
bayertap-0.2.1.tar.gz 11.4 kB With provenance Details for bayertap-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bayertap 0.2.1
File Interpreter ABI Platform Actions
bayertap-0.2.1-py3-none-any.whl Python 3 none any Details for bayertap-0.2.1-py3-none-any.whl

Total release size: 22.2 kB

Release files / bayertap-0.2.1.tar.gz

Download URL bayertap-0.2.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
328bc0733ef475015baa2284fb63ba500d03a7b90c80b0be57a1b84dd4a8db30
BLAKE2b-256 checksum
How to use checksums
c1c8b094f3953d5e7946238615a2eb1210afbc0cd25628cc6169a57a04063acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / bayertap-0.2.1-py3-none-any.whl

Download URL bayertap-0.2.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af5e62feb9ed1d7ab75c1f5b8a519da6494aa7220f7ffbf68eb4dedadc4886a1
BLAKE2b-256 checksum
How to use checksums
a89b60a3a24ffe0d125e1c575eb8cc8d490fa30dcf2dc05cc914ccac3c44bca3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for bayertap 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bayertap-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page