Skip to content

feat(config): single-scene webcam/blank default to infinite duration#71

Merged
kfox merged 2 commits into
mainfrom
feat/webcam-infinite-duration
Jul 6, 2026
Merged

feat(config): single-scene webcam/blank default to infinite duration#71
kfox merged 2 commits into
mainfrom
feat/webcam-infinite-duration

Conversation

@kfox

@kfox kfox commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Problem

Running a single webcam scene produced a periodic (~every 30 s) audio pop, a screen glitch, and a repeated burst of Mic Audio INFO lines. Root cause: a webcam scene has no natural length, so it fell back to the base Scene.duration_s = 30.0, and a single-scene playlist loops the one scene via a full teardown() + setup(). Each loop stopped/restarted the audio streamer (the pop), reopened the mic + rebuilt the DSP chain (the reprinted lines), and re-engaged the display mode (the glitch). YouTube looked clean because VideoScene runs video-driven to math.inf and never re-inits.

The 30 s default suited a convention demo, but the common webcam use case is "leave it running."

Change

  • Single-scene webcam/blank default to infinite. build_scene sets duration_s = math.inf for webcam/blank when they're the sole configured scene (interleaving is skipped for a 1-scene playlist, so scene count is the whole story). A multi-scene playlist keeps the finite 30 s default, because an infinite live scene never becomes is_done and would wedge the rotation.
  • duration_s = 0 is a universal "run forever" sentinel (mapped to math.inf for any non-video type). Negative durations are rejected at load. No schema/serializer change needed — SceneCfg.duration_s round-trips as a plain float; math.inf only lives on the built Scene.
  • Startup log formats inf as duration=unbounded (was video-driven, now accurate for the non-video case).
  • Docs (example TOML, architecture.md), field help, and regenerated JSON schema updated in the same change set.

Testing

  • make test (1902 tests), make typecheck (mypy strict + pyright), make lint, make schema — all green. New tests cover the single-scene infinite default, the multi-scene 30 s default, the 0 sentinel, positive durations, and the negative-duration rejection.
  • Hardware (U64): a single webcam scene ran ~77 s — past both old 30 s and 60 s loop points — with exactly one scene setup / mic init / DSP-active line and zero mid-run re-setup bursts.

kfox added 2 commits July 5, 2026 22:08
A single-scene webcam/blank playlist previously fell back to the base 30 s
duration and looped the one scene via full teardown + setup, which stopped
and restarted the audio streamer (an audible pop), reopened the mic +
rebuilt the DSP chain, and re-engaged the display mode every 30 s. The 30 s
default suited a convention demo, but the common case is "leave the camera
running."

build_scene now defaults webcam/blank to math.inf when they're the sole
configured scene (interleave_videos is skipped for a 1-scene playlist, so
scene count is the whole story); a multi-scene playlist keeps the finite
30 s default so an infinite live scene can't wedge the rotation. duration_s
= 0 is a universal "run forever" sentinel (mapped to math.inf for any
non-video type); negatives are rejected at load. The startup log formats
inf as "duration=unbounded" (was "video-driven", now accurate for the
non-video case too).

HW-verified on U64: a single webcam scene ran ~77 s (past both old 30 s/60 s
loop points) with exactly one scene setup / mic init and no mid-run
re-setup burst.
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.56%. Comparing base (5171975) to head (733c36d).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
c64cast/config.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #71   +/-   ##
=======================================
  Coverage   79.55%   79.56%           
=======================================
  Files          76       76           
  Lines       15420    15426    +6     
  Branches     2318     2321    +3     
=======================================
+ Hits        12268    12274    +6     
  Misses       2622     2622           
  Partials      530      530           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@kfox kfox merged commit 63da329 into main Jul 6, 2026
5 checks passed
@kfox kfox deleted the feat/webcam-infinite-duration branch July 6, 2026 03:11
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