Skip to content

visionfs: a setting changed under a reader no longer ends its feed (frozen boxes after place dla0) - #1154

Open
pdfinn wants to merge 4 commits into
masterfrom
fix/vision-restart-readers
Open

pdfinn wants to merge 4 commits into
masterfrom
fix/vision-restart-readers

Conversation

@pdfinn

@pdfinn pdfinn commented Nov 10, 2026

Copy link
Copy Markdown
Member

Fixes the frozen recognition boxes in the vision demo. After echo place dla0 > /mnt/vision/N/ctl, wm/camera kept drawing the last boxes. They updated again only after the layer was unmounted and bound again.

Cause

  1. A place change starts a new follower for the same feed (restart in visionfs's settings). So does a change of threshold, classes, model or rate.
  2. It stopped the old follower with stopfeed. That marks the session ended and answers every waiting reader with end of file.
  3. layers(2)'s reader takes end of file as the end of the layer: it keeps what it has and exits.
  4. A new reader starts only when the file's stamp changes or the layer is bound again. So the boxes froze until the unmount and bind.

It isn't specific to the DLA: any of those settings does the same.

Fix

The restart only kills the old follower (killfeed). The sequence numbers continue, so a reader takes the new follower's next frame. src none still ends readers, as before.

Test

tests/host/vision_feed_test.sh, against a camera (camsrv -t): cat reads the session's detections in the background, which stops at end of file as a layer's reader does. The threshold changes from 0.3 to 0.45 while cat is waiting, and its output must keep growing.

Run on the Jetson with the yolox-nano model:

visionfs result
unfixed cat stopped at 6 then 6 lines (fails)
fixed 12 then 24 lines (passes)

My first two versions of the check didn't reproduce the bug. One used shell reads that weren't waiting at the restart. The other wrote thresh 0.3, which is the default, so nothing restarted.

Two notes on that run:

  • The other failure in the run, frame 3's detection, comes from the picture I used: the test expects a dog, still.jpg shows a person. The live and camera checks pass.
  • The test skips without a model, so it doesn't run in CI.

A place, threshold, classes, model or rate change starts a new
follower for the same feed. It stopped the old one with stopfeed,
which marks the feed ended and answers every waiting reader with end
of file. A layer bound into a camera's (wm/camera, Matrix's
video-pane) took that as its end: the boxes froze where they were
until the layer was unmounted and bound again. Seen in the vision
demo at `echo place dla0 > /mnt/vision/N/ctl`.

The restart now only kills the old follower (killfeed); the frame
numbers go on, and a reader takes the new follower's next frame.

vision_feed_test.sh changes thresh under a reader of a camera's
session and reads three more frames from the same open file.
pdfinn added a commit that referenced this pull request Nov 10, 2026
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