Skip to content

[codex] support variable packet lengths for isochronous transfers#64

Merged
ZR233 merged 2 commits intomainfrom
dev-api
Apr 23, 2026
Merged

[codex] support variable packet lengths for isochronous transfers#64
ZR233 merged 2 commits intomainfrom
dev-api

Conversation

@ZR233
Copy link
Copy Markdown
Member

@ZR233 ZR233 commented Apr 23, 2026

What changed

  • carry explicit per-packet lengths through TransferKind::Isochronous instead of only storing a packet count
  • add submit_with_packet_lengths helpers for isochronous endpoints while keeping the even-split fallback API
  • update the xHCI and userspace backends to enqueue/fill ISO packets using the provided packet lengths
  • expose DeviceInfo::id() for callers that need a stable device identifier

Why

Some isochronous workloads need uneven packet sizing, but the previous transfer model only kept num_pkgs and then recomputed even slices in each backend. That could not represent variable packet layouts correctly.

Impact

  • callers can now submit isochronous transfers with exact packet boundaries
  • backend packet descriptors and TRB layout stay aligned with the caller-provided packet sizes
  • existing callers that only know num_packets still work through the even-split helper

Validation

  • cargo fmt --check
  • cargo check -p crab-usb --lib
  • cargo check -p crab-uvc --lib
  • attempted cargo test -p crab-usb -p crab-uvc but it still fails in pre-existing crab-uvc tests/examples (VideoFormat::* variant resolution and missing USBHost::new_libusb), unrelated to this diff

@ZR233 ZR233 marked this pull request as ready for review April 23, 2026 09:57
@ZR233 ZR233 merged commit 3dca7a5 into main Apr 23, 2026
2 checks passed
@ZR233 ZR233 deleted the dev-api branch April 23, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant