Skip to content

fix: remove FPS-based throttling from input source receiver loop#701

Merged
leszko merged 1 commit intomainfrom
rafal/fix-fps-input-throttle
Mar 17, 2026
Merged

fix: remove FPS-based throttling from input source receiver loop#701
leszko merged 1 commit intomainfrom
rafal/fix-fps-input-throttle

Conversation

@leszko
Copy link
Copy Markdown
Collaborator

@leszko leszko commented Mar 17, 2026

The input source loop throttled frame reception based on pipeline FPS, creating a feedback loop: sleep(1/FPS) + receive_latency caused the effective input rate to always undershoot the target, driving FPS downward. For sources with non-trivial receive overhead (NDI, Syphon) this spiraled to ~5.6fps (v0.1.6) or ~2.8fps (v0.1.7). The v0.1.7 regression was caused by the batch-level FPS tracking (66e8d31) being more stable — the old per-frame jitter partially counteracted the spiral via temporary FPS overshoots.

Now the loop receives as fast as the source provides, matching the WebRTC camera input path. Backpressure is handled by put_nowait() dropping frames when the queue is full.

The input source loop throttled frame reception based on pipeline FPS,
creating a feedback loop: sleep(1/FPS) + receive_latency caused the
effective input rate to always undershoot the target, driving FPS
downward. For sources with non-trivial receive overhead (NDI, Syphon)
this spiraled to ~5.6fps (v0.1.6) or ~2.8fps (v0.1.7). The v0.1.7
regression was caused by the batch-level FPS tracking (66e8d31) being
more stable — the old per-frame jitter partially counteracted the
spiral via temporary FPS overshoots.

Now the loop receives as fast as the source provides, matching the
WebRTC camera input path. Backpressure is handled by put_nowait()
dropping frames when the queue is full.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Signed-off-by: Rafał Leszko <[email protected]>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 17, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 219291fb-b31d-42ac-8671-9a84b6c2a4bd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rafal/fix-fps-input-throttle
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

@github-actions
Copy link
Copy Markdown
Contributor

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-701--preview
WebSocket wss://fal.run/daydream/scope-pr-701--preview/ws
Commit ed11538

Testing

Connect to this preview deployment by running this on your branch:

uv run build && SCOPE_CLOUD_APP_ID="daydream/scope-pr-701--preview/ws" uv run daydream-scope

🧪 E2E tests will run automatically against this deployment.

@github-actions
Copy link
Copy Markdown
Contributor

✅ E2E Tests passed

Status passed
fal App daydream/scope-pr-701--preview
Run View logs

Test Artifacts

Check the workflow run for screenshots.

@leszko leszko merged commit 33478e2 into main Mar 17, 2026
10 checks passed
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.

2 participants