Repository navigation
ALI-2358: Videos and songs play, in the jailed GPU helper - #7
Conversation
|
Review round 1 (fresh-context reviewer, Fixed:
Also fixed here, from #8's review because the code is in this PR: a helper that dies mid-play now takes its frozen last frame with it, so the reason shows. Redirected to #8, which is stacked on this:
Checks:
|
…ay, Ctrl+C Merges ali-2358-player-video (its review round: buffer checks, re-centring, failures, FIFOs, full screen). Conflicts resolved to keep both: the player's keys stay in media_key, which now lets Left and Right change file when the file can't play. Review fixes for this PR: - The keyboard focus in the bar stays on the same control from file to file (Next pressed again goes on); close_media had reset it before it was read. - Announcements are said once: each goes in one of two alternating status nodes and is gone from the next tree, so the same words twice (t) are said again, and a stale one is never read back when a toast ends. - A position or volume report redraws only the bar on the overlay, not all of it. - Ctrl+C on a video or song offers the file only; it offered a PNG the picture decoders would have tried to make from the media file. - The music view's fallback line height comes from the type tokens.
|
Review round 2 (fresh-context reviewer, The reviewer confirmed these round-1 fixes hold: re-centring on resize, the early-release slot (no loss and no double release), Left and Right on a failed file, full screen, the buffer validation and retired buffers, the FIFO check, and the video ending on failure. Fixed:
Redirected to #8:
Declined:
Checks: clippy (1.100) is clean, and 115 tests pass. |
|
Review round 3 (final, narrow: 5648de2 and 756fbf4). There are no P1 or P2 findings. The reviewer confirmed:
Fixed (P3, in d4c5ab0): a helper that exits with commands unread can end in a reset rather than a clean close, and then the kill could still beat its exit code. It now gets 100 ms of Declined (P3): d4c5ab0 also moves alias-playback to e11d5f4. #2's non-waiting requests and #3's tags now read without waiting: a song's cover played 12 of 12 times in the private weston, with its tags each time. Checks: clippy (1.100) is clean, 115 tests pass, and CI is green on the earlier heads. |
- A video or song in the list opens in alias-playback's GPU helper: libmpv in a bubblewrap jail, drawing on the card the compositor uses (from linux-dmabuf feedback) and handing its frames over as dmabufs. They show in a subsurface above the window, so they never pass through this process. Sound goes through the session's PulseAudio socket, bound into the jail read-only. - The folder list takes videos and songs, so n, p, Page Up and Page Down move between them and pictures. - Space plays and pauses (after the end, plays from the start), Left and Right seek 5 s (seek-step), f toggles full screen and Escape leaves it. - While a file opens, the window says so; a file that can't play says why. - alias-playback is a git dependency on the branch of its PR #3 until #2 and #3 merge.
…IFOs, full screen - A buffer the helper sends is checked before it reaches the compositor: its format and modifier must be one the compositor listed (dmabuf feedback's table, or v3's events) and its planes must fit in the dmabuf. A bad one was a protocol error that closed the window; now the file can't play and says why. - A buffer replaced while on screen is destroyed with the video layer if it's never let go. - A buffer the compositor lets go while still on screen goes back to the helper once the next frame replaces it; before, the slot was lost, and after three the video froze. - The frame on screen moves to the middle of the window when it changes size, even with no new frame coming (paused, ended, a song's cover). - A helper that dies mid-play takes its last frame with it, so the reason shows. - Session::failure ends the helper before waiting for it: the socket can fail with the helper still running, and the wait froze the window. - A path that isn't a regular file (a FIFO) is refused before it's opened, which waited for a writer. - Full screen carries from one video to the next, and ends for a song or a picture. - Left and Right change file when the file can't play, as for pictures.
…kept - A file that can't play (a refused buffer, or the helper saying it can't) ends its helper, so no sound plays on under the reason, and frames that still arrive are given back, not shown. - A helper that closed its socket cleanly is waited for, not killed, so its exit code says why (libmpv missing, the sandbox not set up). Only after a read error is it ended first. - The format table comment says what the table is now used for.
- Session::send waited for nothing: the socket is non-blocking (for reading), so a full one dropped the command, and a lost release left the helper a buffer short for good. A full socket is now waited on briefly. - Video is shown only where the compositor has viewporter, which places a frame at any window scale; without it the frame would be drawn at the wrong size.
…reset - alias-playback e11d5f4: #2's requests and reads that never wait, and #3's tags read with them (a song's cover played 12 of 12 times in the private weston, tags each time). - A helper whose socket ends in a reset rather than a clean close (it exited with commands unread) gets 100 ms to finish before it's ended, so its exit code still says why it stopped.
…re confirmed by the loading file)
With no list (the table couldn't be read), any modifier was taken; now nothing is, so a buffer from the helper is never one the compositor hasn't said it takes.
c4eeb7d to
2c03d01
Compare
main's tree is the same as ali-2358-player-video's c4eeb7d, which this branch already merged, so the branch's side is kept as it is.
Part of ALI-2358: Alias View plays video and music. This is the first of three stacked PRs: #6 (tokens) ← this ← the player UI ← MPRIS.
This PR makes videos and songs play. The control bar, the music view and the screen-reader work come in the next PR, following the design canvas.
What changes
src/player/gpu.rs): libmpv in a bubblewrap jail, started asalias-view --gpu-helper …, withlock_down_gpu_helper(Landlock and seccomp) applied before any other thread starts. Untrusted video never decodes in this process.main_device, matched to/dev/dri/renderD*through /sys), falling back to the first render node. Frames reach the app as dmabufs and show in a desynchronised subsurface above the window, positioned with wp_viewport and placed in the middle of the window. They never pass through this process. Buffers go back to the helper when the compositor releases them.seek-step); f toggles full screen in a video; Escape leaves full screen. Pictures keep Left and Right for changing file (Mike's decision, 2026-12-02).Depends on alias-playback #2 and #3
alias-playbackis a git dependency on the branch of aliasproject/alias-playback#3 (ali-2358-gpu-media, stacked on #2). #3 adds sound in the GPU jail and the file's tags.After #2 and #3 merge: change the dependency in
Cargo.tomltobranch = "main"(or a tag) and runcargo update -p alias-playback.Not in this PR
These come in the player UI PR:
Checks
cargo clippy --all-targets -D warningsis clean. New tests cover:--backend=headless --renderer=gl, own runtime dir) on the desktop (RTX 4090, NVDEC path, so Landlock is on):/dev/sndhidden): the jailed helper's stream reached the null sink, and the monitor captured the test tone for both the video and a FLAC song.