8.1 KiB
KDE checkpoints
komorebi-recorder is built and tested on Linux, but with no KWin to talk to: what touches a real Plasma session was
written from KWin's and komorebi for KDE's sources and has not been seen running. Each checkpoint below is a short list
of commands to run on a Plasma 6.8 session that runs komorebi for KDE, what to expect, and what to send back. The point
of each is to replace something read in a source with something observed.
Send back, for any step that does not behave: the exact command, what it printed, the output of
komorebi-recorder doctor --json, and the session directory if there is one.
What has been seen
Against komorebi for KDE's in-memory desktop (komorebi --fake-backend, which has no windows) and the Wayland compositor
of WSLg (which has outputs and no screencast):
doctornames komorebi for KDE and finds its socket in$XDG_RUNTIME_DIR/komorebi;record --no-videorecords its log, its commands as events with the handler of each, and the journal in two streams, andevents,summaryandfindingsread the session with the KDE rules;- the displays are listed from the compositor, with a size and a position;
- a made-up source of frames is written to an H.264 file, which the decoder reads back, at the size of the display and at an odd size.
And in the Plasma guest of komorebi for KDE (nix run .#run-kde, KWin 6.8.2, komorebi with windows, headless over ssh;
the recorder from nix build runs in it, as the guest mounts the host's store):
- K1:
doctorsayspermitted: yesand a recording works with no desktop file written. Whether KWin offers the screencast to every program, or this guest's configuration allows it, was not found out. - K2: a recording of the output is a playable H.264 file with the windows, the panel and the cursor in it, and its length is the recording's. The frames' times were wrong at first (the GStreamer pipeline took the clock of the PipeWire stream, which starts at zero) and are on the master clock now. The log, the events and their handlers line up.
- K3: the rule that leaves the recorder's window out of the capture works: a window of the class
komorebi-recorderthat had the focus and was on top is not in the video, and one of another class is. KWin 6.8 rewriteskwinrulesrcwithOrder=in place ofcount=andrules=, and the recorder extends whichever the file has. --probe-windows: a window of an event is found in KWin and its facts are read: frame, minimized, the desktops. The probes of a recording with workspace switches, a new window, a stack and a closed window agree with komorebi, and the one of a window that was closed says it no longer exists. komorebi's workspaces are KWin's virtual desktops, so a window of another workspace is not on the desktop that shows; the park desktop holds only windows hidden behind a front one. What was not seen: a probe that disagrees with komorebi (nothing was broken), and a window that cannot be told from another by class, title and frame (it has no probe).
Getting the binary
nix build .#komorebi-recorder --out-link result
result/bin/komorebi-recorder doctor
The package wraps the program so that GStreamer finds its plugins (gst-libav, x264enc, the PipeWire source) and the
program finds libwayland-client. Outside Nix, install the same.
K0: what komorebi for KDE really sends
Status: can be run now, and is the most useful one. The rules that read komorebi for KDE's events, State and log
were written from its source and checked against its log and commands, not against windows (the analysis says so in a
warning until they have been).
- Start komorebi for KDE with debug logging:
komorebi --log-level debug(orRUST_LOG=komorebi=debug). komorebi-recorder doctor. Expectkomorebi for KDE,running: yes, the socket under$XDG_RUNTIME_DIR/komorebianswering a state query, the log directory~/.local/share/komorebiwith akomorebi_plaintext.log.<date>in it, your outputs, andclock: Monotonic.- Record 60 seconds with
--no-video, and during them: open and close a few windows of different programs, focus between them, drag one to a new place and drag-resize one, stack and unstack, switch workspaces (komorebic focus-workspace 1and back), and lock and unlock the screen. komorebi-recorder events <session>. Expect each window event with its window id, program and notification (WindowAdded,InteractiveMoveFinished, ...), each with a handler. Send back any event namedunreadableor classifiedother, any window event with no handler, and anyMoveEndthat is not classifieddrag.
K1: the screencast is offered, and what it asks
Status: not run. This is the one the Linux host depends on.
komorebi-recorder doctor: undercapture,permitted: noand the note with the desktop file.- Write
~/.local/share/applications/komorebi-recorder.desktopas the note says (Exec=is the path of the executable that runs), and start the recorder again. Expectpermitted: yes. In the Nix package the program is a wrapper that starts.komorebi-recorder-wrapped, and that is the executable the compositor sees, so it is the pathdoctorprints (it iscurrent_exe). - If it is still
no: say where KWin looks for desktop files and how it matches the program to one. Whether a desktop file in the user'sapplicationsdirectory is enough, whetherExec=has to be the executable's real path, and whether a program started from a terminal is matched at all, are what this finds out. If it cannot be made to work, the screencast portal (xdg-desktop-portal) is the way around it, behind the sameCaptureBackend.
K2: recording the screen
Status: not run.
komorebi-recorder displays. Expect each output with its size and position in the layout (logical pixels). Compare the ids with komorebi's:komorebic monitor-information(they agree for a monitor with no serial number).komorebi-recorder record --duration 20, and move windows during it. Expect avideo-<id>.mp4for each output andframes-<id>.csv, and in the session summary no error.- Play it with
komorebi-recorder view <session>. Expect the picture to move with the windows, and the cursor in it. komorebi-recorder doctor --json: the clock check (latency) of the segments should be near zero. A large number means the frames' times are not on the master clock, which would be the PipeWire timestamps: send the numbers back.- Leave the screen still for ten seconds: the video should still advance (the last frame is repeated).
- Unplug a monitor, or turn one off, if there is one to spare: the segment ends and a new one starts when it returns.
- Suspend and resume: every output starts a new segment.
K3: the program's own window
Status: not run.
komorebi-recorderwith no command opens the window. Expect it to be titledkomorebi-recorderand not tiled.- If it was tiled,
komorebic ignore-rule class komorebi-recorderwas not applied in time, or the window's class is not what is expected:komorebic statesays what the window's class is. recordwrites a KWin window rule (~/.config/kwinrulesrc, groupkomorebi-recorder-exclude-from-capture) that forcesexcludefromcapturefor the classkomorebi-recorder. Record with the window open and play the video: the window should not be in it. If it is, say whetherkwinrulesrchas the rule, whether System Settings > Window Rules shows it, and whatqdbus6 org.kde.KWin /KWin supportInformationsays of the window's class.
K4: the OS trace and the window track
Status: the journal was followed on a machine with no Plasma.
record --duration 30, and cause some noise: open a program that is not in the session, plug something in. Expectoslog/system.ndjsonto havekwin_waylandandplasmashellentries, andoslog/eventlog.ndjsonthe warnings. A user who is not in thesystemd-journalgroup may see none of the system's: the problems say so.record --duration 30(the window track is on by default). Expectwindows.jsonlwith the windows komorebi manages, a window behind a stack not shown, and a window of another workspace not shown.