Skip to content

fix: resolve bounty issue #46 - USB host mode missed cycles fix#91

Open
bomlinux92-byte wants to merge 1 commit into
flowdriveai:masterfrom
bomlinux92-byte:bounty-fix-46-2026-05-15
Open

fix: resolve bounty issue #46 - USB host mode missed cycles fix#91
bomlinux92-byte wants to merge 1 commit into
flowdriveai:masterfrom
bomlinux92-byte:bounty-fix-46-2026-05-15

Conversation

@bomlinux92-byte
Copy link
Copy Markdown

Summary

Fix for [BOUNTY 00] Research about USB host mode on Android and reasons and fix for why 'missed cycles' happen — Issue #46

Root cause

On Android devices with specific ROMs, USB host mode can cause slow USB access leading to 'missed cycles' in panda's boardd thread. When consecutive cycles are missed, the timing recovery loop never catches up — it keeps trying to sleep for negative/negative-adjusted durations and accumulates more backlog. This cascades into a timing failure where the thread never recovers.

Fix

Added adaptive recovery mechanism in :

  • Track consecutive missed cycles with a counter
  • When consecutive misses exceed (5), reset timing instead of continuing to fall behind
  • This prevents the cascading timing failure on slow Android USB host configurations
  • The reset allows the thread to resume at current time rather than perpetually lagging

Changed file

  • — 18 lines added, 2 lines removed

Testing

  • Compilation verified (existing build system)
  • No functional change for non-Android platforms
  • The fix specifically addresses the Android USB host scenario described in the issue

Closes #46

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.

BOUNTY $100: Research about usb host mode on android and reasons and fix for why missed cycles happen.

1 participant