Repository navigation
feat(videoout): write pad and present telemetry to APS5_VIDEOOUT_TELEMETRY_DIR - #7298
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Thanks, this reads well, and it stays cheap when the variable is unset. One CI blocker: the Linux job runs Could you change both skip messages in |
|
Windows run, since the description lists Windows as not built. Windows 11 10.0.26200.9711, WinLibs GCC 15.2.0 r7, Release, RTX 5070 Ti, real 2560x1440 display, DualSense over Bluetooth. Head b92caf4 merged onto main b51c65d (clean merge). Library: builds with no new errors. With
Pad lines carry buttons, sticks and triggers as expected, and an idle controller does not produce a stream of stick-jitter lines (the 3 idle lines are the initial state plus one press and release). There's only one present line because Tests:
So the Windows exclusion can probably go. If it does, the Windows registration would also need the Not checked: macOS, a title, and frame rate with the variable unset vs set. AI-assisted: yes |
…METRY_DIR APS5_VIDEOOUT_TELEMETRY_DIR=<directory> appends one JSON object per line to <directory>/videoout.jsonl: a contract line for the run (commit and pid), a pad line whenever the published pad state changes in its buttons, sticks, L2 or R2, a present line after the first present and every 30 after that with the count and rate the window title shows, and a drops line with the number of lines the writer discarded, reported every ten seconds while it grows and once at a normal exit. A bounded queue of 4096 lines and one writer thread batch the file, so neither the present nor the input path waits for it; a pad change that the full queue refused stays pending for a later publish, and the frame count moves from UpdateTitle's function-static to DisplayWindow so the input path can name the present it belongs to. Without the variable no file is opened and no thread is started: a present or an input update costs one call that checks a guard variable and returns null.
b92caf4 to
f185afe
Compare
|
Added two commits on top:
Checked: queue and pad-change retry logic against the tests, no code comments, test registered for non-Windows only, docs match the line shapes, and the Windows run by @cadenasynyster; merged. |
One conflict, in libSceVideoOut DisplayWindow.cpp: upstream's new present telemetry (boykopovar#7298) and the macOS main-thread window-title update are both kept. Checked: the macOS build has 0 failed objects, 209/209 converter tests pass, and the web converter builds and passes tools/test_web.py.
What
Adds
APS5_VIDEOOUT_TELEMETRY_DIR=<directory>, which writes<directory>/videoout.jsonl(appended if it exists, one JSON object per line) so that the input a title receives and the presents it makes can be lined up on one clock. A scripted or automated play test can then say what host controller input the title was given at each frame; nothing here feeds input.Four line shapes, each starting with
"v":1, the host steady-clock nanoseconds int_nsand the event inev:{"v":1,"t_ns":<ns>,"ev":"contract","contract":"v1-pad","commit":"<12 hex>","pid":<pid>,"prx":"libSceVideoOut"}is the first line of a run: the source commit the libraries were built from (unknownwithout Git at configuration) and the process.{"v":1,"t_ns":<ns>,"ev":"pad","n":<present>,"buttons":<bits>,"sticks":[<left x>,<left y>,<right x>,<right y>],"triggers":[<L2>,<R2>]}is written when the published pad state changes in its buttons, sticks, L2 or R2.nis the number of presents completed when the change was published, the count the window title shows; motion, touch and the device kind are not compared.{"v":1,"t_ns":<ns>,"ev":"present","n":<present>,"fps":<rate>}is written after the first present and every 30 presents after that, with the count and rate the window title reports.{"v":1,"t_ns":<ns>,"ev":"drops","dropped":<count>}reports the number of lines the writer has dropped so far, every ten seconds while the count grows, and once at a normal exit, only when lines were dropped. An exit that skips static destructors writes no last line. A pad line the full queue refused counts as dropped even though a later publish writes the change.src/Telemetry.cppandinclude/Telemetry.hpphold aBoundedLineQueueof 4096 lines and one writer thread that batches whatever is queued every 200 ms, so neither the present nor the input path waits for the file. A pad change that the full queue refused stays pending and is written by a later publish (PadChangeFilter::Changedis only committed after the line is in the queue); a present line is dropped rather than blocking.DisplayWindow::frameNummoves from a function-static inUpdateTitleto a member so the pad path can read it, andPadInput::Updatetakes the window for the same count.tests/Telemetry.cppcovers the change filter (motion and touch are not changes), the full-queue retry and thedropsline it produces, that an unset or empty variable opens nothing, the queue bound and drop count, the line shapes of the contract, pad and present events, and that the frame count still agrees with the title.Documented in
docs/user/USAGE.md(Video-out and pad telemetry) and listed indocs/dev/TRACING.md(Performance captures).Overlap with what is already there:
APS5_TRACE_*records presents insidelibSceAgcDriveras a Chrome trace and a summary line, without the pad state;APS5_PAD_INPUT_FILEinlibScePadfeeds scripted input in but records nothing about what the title read; the window title already prints the rate and the frame count, and the present line only copies those numbers into the file. Open PR #7080 adds per-interval presents, frame times and host identity to thelibSceAgcDriversummary and bench file, which is a different file and switch and does not carry pad state.Without the variable nothing is opened and no thread is started:
Instance()is a function-local static holding a null pointer, so a present or input update costs one call that checks a guard variable and returns null, and nothing is formatted. From reading the code, not measured.Field run
Blasphemous 2 (PPSA13579, content 01.007.000), three launches on Linux with a
libSceVideoOut.prxbuilt from this branch. The library was built from the commit before a later documentation-only amend (one sentence indocs/user/USAGE.md, no code change), so itscontractline names019a48e81b19; the code it was built from is this commit's.presentlinespadlinesdropslinesNo
dropsline in any run (about two lines a second, allpresent). The first three lines of run 2's file, verbatim and consecutive:{"v":1,"t_ns":10660159495401,"ev":"contract","contract":"v1-pad","commit":"019a48e81b19","pid":1730278,"prx":"libSceVideoOut"} {"v":1,"t_ns":10660165191777,"ev":"present","n":1,"fps":0.00} {"v":1,"t_ns":10661116071268,"ev":"present","n":30,"fps":0.00}The
presentrate is the number the window title shows, copied into the line: runs 2 and 3 held 59.94 in the title, the intro and two 60 s gameplay windows, and the only dip was one 0.75 s present interval at the New Game load, where the rate fell to 54.5 and recovered in about 3.5 s.A
padline records the controller and keyboard/mouse state read through SDL; input injected withAPS5_PAD_INPUT_FILEis applied later, inlibScePad, so a scripted run writes nopadline.Tested
CachyOS, Linux 7.2.9, GCC 16.2.1, NVIDIA GeForce RTX 3080 Ti on driver 615.78.08.
libSceVideoOutand everyvideo_outtest target build;ctest -R video_outgives 5 passed and 20 skipped of 25, 0 failed — every test that opens a window skips without a display, so of the new pairvideo_out_telemetryran (its change filter, full-queue retry and thedropsline it produces, queue bound and drop count, the contract, pad and present line shapes) andvideo_out_telemetry_caption, which compares the frame count with the window title, skipped here and needs a display.python3 tools/check_conventions.py --base origin/mainreports no findings. The cost with the variable unset is from reading the code path, not measured; no frame rate was compared with the variable unset and set. Not tested: Windows and macOS, neither of which was built here.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)