Repository navigation
egocap: fixes from the first run on a real station - #1689
Open
NVshawnhwang wants to merge 25 commits into
Open
NVshawnhwang wants to merge 25 commits into
NVshawnhwang wants to merge 25 commits into
Conversation
…opy can use The corrected copy asks ffmpeg which encoders it has and refuses an encoder that is not listed. The legend of that listing was told from the encoders by its flags, "V.....", which are also the flags of every video encoder that has no capability flag set. An ffmpeg that lists libx264 that way was read as having no libx264, and the copy was refused with the default encoder. The legend's rows are now told by the "=" that stands where a name does, and a video encoder is one whatever its other flags are. Nothing else reads an ffmpeg listing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…n its box is in The line under "Require calibration files before recording" was one fixed sentence that began "Off:", so with the box ticked the page said the opposite of what the checklist above it showed. The line now has one sentence for each position and shows the one for the position the box is drawn in, a choice still on its way to the backend included. Both say what happens to recording, in the words the checklist's advisory rows use. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…not by its directory's number The reader of takes left behind stops opening a session once it holds nothing to resolve, and told such a session from a directory put in its place under the same name by the directory's inode number. A file system may hand the number of a removed directory to the next one made, so on such a disk a session restored under its old name with an unresolved take in it was never read again and the take never listed. The same memory also skipped a settled session that a recorder had opened again and left a take in, since the directory was still the same one. A settled session is now known again by what its last recorder left in its lock file: the token drawn for that one holding of the session and the count of its beats. Only a recorder writes that value and no later holder writes an earlier one's, so a replaced directory and a reopened session both differ and are read as new, and nothing the file system assigns (a number, a time) is compared. A session no recorder ever locked has no such value and is read every time. A repeated read now costs one small read of each settled session's lock file beside the one listing of the output. The tests give the reader a file system on which every directory has one number and every file one set of times, so they hold on any disk. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…or its files Two tests of a calibration whose files the folder takes after the save was given up let the save go on, waited until the files were in place, and then asked the service once to act on them: its duty in one test, a take in the other. The service takes note of a late save when the folder's thread has come back with its answer, which is a moment after the last file is in place. Asked in that moment it finds nothing, and the tests then read the unchanged capture session as a failure. Under load that moment is long. The service is right: its duty runs again, and the next take asks again, once the answer is there. The tests now hold the folder's thread back while they look at the files, one of them showing that files in place alone start nothing, and wait for the answer itself before they ask, so neither depends on how fast the thread returns. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…e test with the reason The tests of the corrected copy hold the library's copy at a frame and wait for it to get there. A copy that was refused before it wrote that frame never did, and the wait ran out its twenty seconds and failed with a bare "assert False". That is how the cancel test with the real h264 encoder failed where the encoder list was misread and the copy refused for a missing libx264: nothing in the failure named the refusal. The stand-in now notes when the copy is over and what it raised, and the wait ends at once with that as its message. A test pins it with the refusal an ffmpeg without the encoder gives. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…not drawn The capture session goes on sending the last pose of a glove that was switched off or has no current data, every joint still flagged valid. The Tracking data rows counted those flags and the hand view drew the hand, so both showed a tracked hand beside a device listed as disconnected or degraded. Both now ask the capture status for the hand's device, by the rule the station checklist holds a required device to: it delivers while it is connected, or degraded only because its calibration file was refused. A hand whose device does not deliver reads "not delivered (glove disconnected)" in place of a joint count, its joints show no value, and the hand view draws it as a glove that sends nothing, in words and with its dashed outline. A hand the capture status reports no device for is judged on the sample alone, as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
The side panel's session details list the cameras of the capture status, which holds the capture server's own cameras only. At a station whose cameras all arrive over LiveKit the list was empty and read "No cameras selected." beside three live camera tiles. The details now count and name the cameras the started session offers over LiveKit and say where their state is shown: on the camera tiles and in the Devices checklist. "No cameras selected." is said only of a session with no camera of either kind. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
… start refuses a taken port Stopping the launcher could leave its children running, and the sender on the Orin with them: the children are in sessions of their own, so only the launcher's own stop ends them, and that stop could be cut off. A Ctrl-C that arrived while a child was being killed raised out of it, and so did a write to a terminal that had gone away (output piped into a program that Ctrl-C ends first). The next start then failed half way up on a port still held, with the Orin's sender already running. The stop - Nothing ends it before every child was dealt with. The first Ctrl-C, SIGTERM or SIGHUP asks for the stop, once, also when two arrive together; a later one hurries it (the children still running are killed without their grace) and any further one changes nothing. - Each child, and what is left of its process group, is waited for. One that is still there is named with the command that ends it. - The Orin is asked to stop its sender in a session of its own, which a Ctrl-C at the terminal does not reach. The deploy tool's stop succeeds only when no sender is left, and the launcher says which it was. - A run that left something running exits with 1. The output - What the launcher and its helpers print is also written to launcher.log in the run directory, named in its first line, so the output need not be piped to be kept. Helpers write through the launcher, never to a terminal that went away. - A stream that refuses a write is given up on; the line is still logged and nothing is raised. The start - Before anything is deployed or started, a port the stack listens on that is already taken refuses the start: the backend's, CaptureServer's and, with a LiveKit server, LiveKit's two TCP ports and its UDP port; with a local mock sender, the profile's video port. The refusal names each port, whose it is and, where ss or lsof tells, the program that holds it. Every command line and file of a one-stream and a three-stream start is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…tab's The checklist called a device what the Station tab calls it only when the station required it, and by the capture session's description otherwise. With one glove required and the other not, one list showed "Left Manus glove" beside "Right glove", and a row changed its name when its box was ticked. Every device a station can require now has the Station tab's name in every row, required or not. The capture session's own description is sent beside it as the item's reported_as and shown under the name, so the row can still be matched with the session's list of devices; it is null where the two are one name and for every other item. It is no part of the sentences made from an item's label and detail, which read as before for a required device. A device no station can require keeps the session's description as its name. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…e brings it in The checklist's Glove calibration item read "no operator name is set ... enter the operator name on the recording page" while the recording page showed an operator. The name is kept by the page and reaches the backend only with a take, so until a take that names an operator is asked for in a run the backend has no operator in use and cannot say whether a page has a name. The sentence now says what the backend knows and what brings the calibration in: no take naming an operator has been asked for in this run yet, and Record loads it for the operator named on the recording page. It is the one sentence for that state, for the checklist with and without the token and for the Glove calibration tool. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
The Devices step names a warning and added "takes are not held", which reads as takes that are not kept. It means that the warning does not stop a take from starting. The clause is now "recording is not blocked", one named sentence of the setup service, and the guide that quotes it says the same. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
… period on when asked The launcher started the bridge with neither, so the bridge's defaults always stood: a keyframe every 30 frames, which is one a second at 30 fps and two a second at 60. A keyframe costs many times an ordinary frame; at a bitrate that is low for the picture, two a second can show as a pulse in quality. --bridge-bitrate-mbps and --bridge-idr-period pass the bridge its own --bitrate-mbps (the maximum for each track) and --idr-period (frames between keyframes). Neither is passed unless given, so a start without them has the bridge command line it had. A value the bridge would misread is refused on the command line, since the bridge reads its numbers without checking them. CAMERA_SETTINGS.md says what the two settings are, how the keyframe period reads at each frame rate, and where the time shown on the page is spent, leg by leg, with the log line that reports each. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…ough Argus The launcher's three-camera example was written for the SIPL backend only. An Orin without the SIPL API cannot build that backend, so a station with such an Orin had no example to start from. configs/three-camera-settings.argus.example.yaml is the same three mono HEVC streams for the Argus backend, written from the sender's guide: no sipl section; each camera named by its Argus device index and sensor-mode index, which `argus_sender --list-modes` lists and which is not the number of the port the camera is cabled to; the head stream first, so that it is the sender's priority stream, captured in the default mailbox mode as a priority stream must be; the wrist streams in fifo, where the sender sends the frame closest in time to the head's. Every value that belongs to one station is a placeholder, and the launcher refuses the file while one is left, as it does the SIPL example. CAMERA_SETTINGS.md says which example a station uses and how to tell (the deploy tool's check prints whether the SIPL API is there), what differs between the two, and what the capture modes are. The example was not run on hardware, and the guide says so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…e's Python The example runs on Python 3.12 and imports the tracking bindings of the checkout it lives in. That checkout builds its bindings for Python 3.11 unless told otherwise, and a compiled module is found only by the Python it was built for, so the first real start failed on a missing module with nothing in the example's guides to say why. The example's README and CaptureServer's now give the configure flag, -DISAAC_TELEOP_PYTHON_VERSION=3.12, the error that bindings of another version produce, and that a build directory configured for another version cannot be switched and is deleted and configured again, as the build itself says. The launcher's guide also says that its output need not be piped to be kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…t was lost is asked again Two ways were left in which a stop request stopped less than everything. A request raises where the main thread is. Raised between a child's creation and the line that registers it, it left that child running in its own session, unknown to the stop, and the launcher said that every program had stopped. A request is now held while a child is created and registered and raised when that block ends, so a child that exists is one the stop knows of. The helper that waits for the clocks is created under the same hold. What a request raises inside a finalizer is printed by the interpreter and dropped. The request then counted as made, nothing stopped, and every later Ctrl-C, SIGTERM and SIGHUP returned at once. Signals closer together than a second are still one request (a terminal's Ctrl-C and the copy a wrapper passes on); one that comes later, while the stop has not begun, asks again. Once the stop has begun no signal asks for it again: its own handlers take them, as before. The new tests run the launcher's own main() as a real process with real children in their own sessions, and place the signal at the instant each child's creation returns, and inside a finalizer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…n unexpected error's traceback Started with its output closed the interpreter has no output streams, and the launcher's log took the place of a stream that was not there: its first line failed. A missing stream is now what a closed pipe already was, an output that takes nothing: every line is logged, and the launcher runs and stops as with a terminal. An error nobody expected ended the launcher after its log was closed, so the traceback the interpreter prints reached the terminal only. It is now written into the log first, beside the run it ended, and is still printed once. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
… the address it is bound on The check before a start left out two ports the stack binds: the backend's 3D view (EGOCAP_VISER_PORT, 8085) and the command port of the time-sync follower's chrony (--chrony-cmd-port). Both are now checked, each only when it will be bound: the 3D view unless the environment the backend is started in switches it off, the follower's port only with the Orin. Each port is asked on the address its program binds. Asked on every address, a listener on another address of the PC refused a start whose program would have bound loopback without trouble. LiveKit's media ports are still asked on every address, since LiveKit listens for media on the network interfaces' own addresses. With lsof, the program named as the holder is the one with a socket whose local end is the port. A process with a socket merely connected to that port could be named before. --backend-port and --chrony-cmd-port outside 1 to 65535 are refused in a sentence on the command line, where the check ended in a traceback. The guide lists what is checked, when and on which address. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…s it is written The bridge reads its bitrate maximum and keyframe period without checking them: as far as the text is a number, into 32 bits. The launcher accepted anything Python reads as a positive number, so some values reached the bridge as another number: 1_0 as 1 Mbit/s, digits of another script as 0, a value past 32 bits of bits a second wrapped, a tiny one became no bits at all, and a keyframe period past the bridge's whole number wrapped too. --bridge-bitrate-mbps now takes plain ASCII digits with an optional fraction, from 0.001 to 4294: a thousand bits a second at least, so the bridge's product is not rounded to none, and whole megabits below the 4294.967295 that 32 bits end at. --bridge-idr-period takes plain ASCII digits from 1 to 2147483647, the largest whole number the bridge reads. Everything else is refused in a sentence. A test holds the bounds to the two expressions the bridge reads the flags with. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
Four limits of the stop, none of them changed: a program that left its child's process group is neither stopped nor reported; a launcher killed outright stops nothing; the Orin's answer to the stop of its sender is waited for 60 s and no longer; and output piped into a program that never reads blocks the launcher, the stop included, which the launcher's own log makes unnecessary. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
A recorder rewrites a session's lock file at once when it takes the session and then on every beat. A holding shorter than a beat therefore left the lock as it was from its first moment to its last, so the session as the recorder left it and a copy taken while it was held showed one lock content for two states. The reader of takes left behind knows a session at rest by that content, and took a restored copy with a waiting take in it for the session it had already read. The release now writes one more beat before it gives the lock up: the same holder's token with the next count, a value the session showed at no moment while it was held. A beat that cannot be written is logged and the lock is released all the same. Every reader of the beat reads it after the release: the scan's judge and its note of a session it closed itself, the hold for a label correction, which writes nothing, and upload's test of an ended batch. A reader that looked at the session while it was held sees that last beat as it sees any beat: its next look says the beat changed, and the look after that finds the session at rest. That is what a reader already met whenever a regular beat fell between its looks; two tests that looked and released within one beat now expect it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…sion by The reader of takes left behind remembers a session at rest by what its last recorder left in its lock file. Two kinds of lock file say nothing and were taken for a value all the same. An empty lock file is what a recorder that wrote no beat left, and it is the same in every such session. Such a session was remembered by the empty value, so another put in its place with a waiting take was taken for the session already read, and its take was never listed. A lock file that is a link was read through, though what stands elsewhere is no word of a recorder of this session; the hold for a label correction already refuses such a lock file. Both now count as a session whose lock file says nothing, like one no recorder ever locked: never remembered, and read again at every look, records and all. The read of the value is the recording library's (session_lock_value), which does not follow a link. The module says what that costs: an output with many such sessions is read slowly for as long as it holds them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…pinned Three parts of how the reader knows a session at rest were right and no test failed without them. Each now has a test in which a real take is hidden when the part is taken out: - the count of beats is compared, not the holder's token alone: a copy of an earlier moment of the same holding, with a take waiting in it, is told from the session as the holder left it; - a session without a lock file is never remembered, also when its configuration reads and nothing waits in it; - the value is the one judged before the session's records are read: a recorder that opens the session, leaves a take and closes right after they were read has the session read again. A fourth test is the case the release's last beat exists for: a copy taken while a recorder wrote a take, restored after the recorder closed within the same beat. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…ols are, and that the Orin does not resize Three statements in the guides were no longer true, or said something the chain is not meant to do. Three cameras through the launcher have been run on an Orin: once, on one station, through the Argus backend, at one frame rate, published as received, from the launcher to the page. Each guide's "Not yet verified on hardware" says that and what is still not run: three cameras corrected live, the SIPL backend with three cameras, a recording of three cameras, and one camera dropping. What a station checks for itself is listed apart from what nobody has run. The sender, its deploy tool, the mock sender, the bridge and the timesync tool are in this repository; only a LiveKit server is not. The launcher's header, its help and the guides said several of them were not. They now name each tool's place and which the launcher has to be told of. The mock sender binds loopback, so its port is checked there. A stream of the Argus example states its sensor mode's own size. The example and the guide offered a smaller one for the sender to scale to; this chain does no resizing on the Orin, the PC corrects and resizes on its GPU, and correction would then start from a scaled picture. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…t loop After New batch, and after Recover or Discard of an earlier session's take, the coordinator tells the output reader that the session it just released is at rest. That call takes the reader's lock, which a read of the whole output holds in a worker thread for its walk, and reads the session's lock file. On the event loop it stopped the preview, every viewer's socket and the capture client for as long as that read took. Both calls now run in a thread, as the reader's other calls from the coordinator do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
…ocap_station_fixes_on_main Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch was successfully deployed
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.
Twenty-four commits, one per finding or follow-up, so each can be read by itself, and one merge that brings in the stack below with the main branch merged into it. All are under
examples/egocap/.Summary
The stack was run for the first time on a real station: three GMSL cameras on a Jetson AGX Orin through the Argus
backend, real gloves, Ubuntu 22.04. Three cameras ran end to end at 60 fps through the launcher. These are the
fixes for what that run found in this example's own code.
The launcher (
tools/start_system.py)launcher left LiveKit, the capture server, the backend and the Orin's sender running, and the next start failed
on ports in use. The stop now completes whatever happens to its output, waits for each child and what is left
of its process group, names anything still running, confirms the remote sender's stop and says so, and exits 1
when anything is not known to have stopped. A second Ctrl-C only hurries it. A stop request that lands while a
child is being created cannot leave that child unregistered, and one that was lost is asked again.
launcher.login the run directory, so its output need not be piped; an unexpectederror's traceback is in it.
the system tells, the process that holds it. The guide lists what is checked and on which address.
--bridge-bitrate-mbps,--bridge-idr-period). Not given, the command line is unchanged. At 60 fps the bridge's default keyframe periodgives two keyframes a second, which can show as a pulse in quality.
placeholder for every station value.
Recording and tools
lists takes waiting for Recover or Discard remembered a finished session by its directory's inode. A file
system that hands a freed number to the next directory made a replaced session look like the old one, and a
finished session that a recorder reopened and left a take in was never read again on any file system. It is now
known by the content of its lock file. An empty lock, which recorders before this stack left, and a lock that
is a link say nothing, and such a session is read at every look. A recorder writes a last beat as it releases.
Discard of an earlier session's take, the coordinator's note to the reader waited on the event loop for a read
of the whole output in flight, and so stopped the preview and every viewer for that long. This answers a
review finding on the quality-control pull request, and is fixed here because the reader change above adds a
small file read per finished session to that same hold.
libx264among them, and then refused to write a copy.
The page
detail (a new item field,
reported_as).Tests and guides
not reach.
What to know
confirmed, exits 1.
empty lock in full each time. On a development computer 500 such sessions took about 400 ms a look.
now says why if it fails again.
How it was reviewed and tested
every order, the terminal gone, a child dying at each stage of start-up) and compared 471 starts, old launcher
against new: command lines and written files are unchanged. It ran the session reader old against new over
every kind of session the recording service leaves: no decision of Recover, Discard, the label hold or upload
changed. Its findings are fixed here.
tests/tools;tests/recordingat 100% line and branch coverage;tests/recording_service;tests/backend;the page's lint, tests and build.
Not yet verified on hardware
None of these fixes has been run on the station yet. To repeat there: stopping the launcher with one Ctrl-C, with
two, and with its output piped, then a second start at once; a start with a port taken; the corrected copy with
the station's ffmpeg;
tests/recording_serviceon ext4; the preview with a longer keyframe period; the Argusexample filled in; the checklist and the side panel with a glove switched off.
🤖 Generated with Claude Code