feat(config): single-scene webcam/blank default to infinite duration#71
Merged
Conversation
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 Report❌ Patch coverage is
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Running a single webcam scene produced a periodic (~every 30 s) audio pop, a screen glitch, and a repeated burst of
Mic AudioINFO lines. Root cause: a webcam scene has no natural length, so it fell back to the baseScene.duration_s = 30.0, and a single-scene playlist loops the one scene via a fullteardown()+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 becauseVideoSceneruns video-driven tomath.infand never re-inits.The 30 s default suited a convention demo, but the common webcam use case is "leave it running."
Change
build_scenesetsduration_s = math.inffor 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 becomesis_doneand would wedge the rotation.duration_s = 0is a universal "run forever" sentinel (mapped tomath.inffor any non-video type). Negative durations are rejected at load. No schema/serializer change needed —SceneCfg.duration_sround-trips as a plain float;math.infonly lives on the builtScene.infasduration=unbounded(wasvideo-driven, now accurate for the non-video case).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, the0sentinel, positive durations, and the negative-duration rejection.