Skip to content

v1.5.0

Latest

Choose a tag to compare

@RikaCelery RikaCelery released this 28 Sep 16:05
d8dcd7a

XhRec v1.5.0

A reliability release. The recorder now stays inside the platform's WebSocket subscribe budget, so rooms that used to receive nothing get their pushes again; private shows record — a free-spy account joins the show before the model token is polled, and a lagging status read can no longer turn a private room into a public, token-less probe; the status read is keyed by room id. XhCut gains a timeline drawn from a pyramid of cached frames.

What's in the box

File What it is
XhRec-all.jar The recorder. Guards the room list, records on status changes, cuts files to disk, and serves the WebUI, Prometheus metrics and post-processing (move / transcode / script).
XhCut-all.jar Remote lossless rough-cut tool: file access and every ffmpeg computation happen on the recording host, the client only drives the UI.
extension.tar Browser extension XhRec Quick Send (MV3 + userscript): sends the room on the current page to XhRec in one click.
SHA256SUMS SHA-256 checksums for the three artifacts above.

Live events: every connection stays inside the subscribe budget

The platform answers only ~200-260 subscribe commands per WebSocket connection and silently ignores the rest, while the old fixed pool of three connections asked for 532-656 channels each — most rooms never received a push at all, their .event sidecar stayed empty, and nothing logged it: the writer simply had no open file to write to. The shard is now sized by the room set (160 channels per connection), rooms are placed by fill, subscribe frames are paced, connects are staggered 250 ms apart (the platform throttles new handshakes per source IP) and the lifecycle channels (broadcastChanged, modelStatusChanged, streamChanged) are subscribed before the chat channels, so a finished cannot arrive in the gap.

Two failure modes found while rolling that out are fixed as well:

  • Ktor's WebSocket handshake parks its thread inside runBlocking, so six simultaneous handshakes could consume every thread of Dispatchers.Default and freeze every actor in the process — no log line, no event, CPU idle. Connects and senders run on Dispatchers.IO now, the actor only enqueues into a per-connection outbox, and a single frame write is bounded by webSocketSendTimeout;
  • a reconnect re-subscribed channels through the session that already held them, and delivery collapsed to ~4 events/min about 1.7 h after each restart while all connections still reported "connected". Each dial mints its own session now.

The shard is visible in Prometheus per connection (xhrec_ws_connected, xhrec_ws_connects_total, xhrec_ws_disconnects_total, …), so the budget is measured rather than guessed at.

Private shows record again

  • A free-spy account is joined before the token is polled (#192). The free path returned early when cam.modelToken was empty and never asked to spy, so a room watched through a fan-club free-spy privilege could never obtain a token: no token in the dashboard until the show had been entered from a browser and the room disarmed/re-armed by hand.
  • A lagging status read can no longer strip a private room of its token. The preconfig asks the platform for the show's status twice: the one the room is driven with, and its own REST read, which can still be the cached answer from before the switch. When that read said public the room resolved the private show to the public, token-less URL, the CDN answered 403, and the reason read exactly like a room whose show had moved on — while the entry's own status had been overwritten with public and nothing corrected it. The room's own status now wins that disagreement, and a room that really did go public publishes its own event.
  • The failure reason says what the probe carried: playlist unusable (HTTP 403), no token was sent versus …, the model token was rejected. Those two were identical in the log, which is why the report behind #192 had to guess at the cause.
  • A missing privilege no longer needs a restart. The marker set when no account may spy for free schedules one slow re-probe (freeSpyReprobeInterval, 5 minutes), so an account that gains the club mid-show — or a show entered elsewhere — is picked up on its own instead of waiting for a disarm/re-arm.
  • Diagnostics for the next report. /diagnose entries report statusRead, tokenSource, tokenLength, freeSpyVerdicts and preconfigAttempts; the privilege check answers with a typed verdict (no-subscription / subscription-inactive / no-benefit / benefit-inactive) instead of a bare boolean, so a reshaped payload is a named answer; a failure reason that never changes is logged again every 20 attempts with the attempt number; the diagnose history keeps 1000 characters of a transition with its credentials masked; and every platform API call writes one DEBUG line, code path bodyLength (200 api/front/v2/models/<mask>/cam 4203).

Status reads are keyed by room id

The broadcasts read and the model-id lookup use the id forms (api/front/users/user-ids/{name}, api/front/v2/broadcasts/{id}), which survive a model rename. The id helper is one function that answers with an id or throws: an unknown slug is the domain ModelNotFoundException — asked for exactly once, never retried and never failed over — and a 200 that carries no usable id fails the same way instead of returning a null into every caller.

WebUI

The network log panel keeps 500 lines of scrollback with the newest line at the top. A line whose download has finished is frozen at the values it ended with, marked done and never refreshed again — a url that comes back on a retry turns live again — and the publish timestamp is only read from a name that carries one, so an init or playlist line no longer shows an epoch-sized [SERVER] value that only grew.

XhCut

The timeline lane is drawn from a pyramid over the frame cache's own 0.1 s grid instead of one bucket size guessed from the lane height. A level refines into the level above plus the buckets in between, so a subdivision never asks the cache for a frame it did not produce, a coarse frame stays valid while finer ones load (the strip sharpens in place instead of blanking), and the work is bounded at both ends — thumbnail-sized cells as the target, a 10 px floor — whatever the recording's length or the zoom.

Tooling

  • xhmelt/ — helper scripts that turn recordings and their .event files into a Shotcut/MLT project (xhmelt.py), plus the render helpers.
  • Grafana: the dashboard push carries panel transformations through, so a pushed dashboard no longer loses them.
  • CI: the rolling dev-build release now has the same shape as a curated one — a hand-written introduction above a marker, regenerated build metadata and changelog below it.

Getting started

# XhRec: reads list.conf, serves the WebUI (default port 8080)
java -jar XhRec-all.jar -f list.conf
# XhCut: media root, output directory and cache directory are required
java -jar XhCut-all.jar -m /media/nas/out -o /media/nas/cuts -c /mnt/xhcut_cache

Container deployment and the full option list are in README.md and cutter/README.md.

Full changelog: v1.4.0...v1.5.0