You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
8K videos start again on SteamOS 0.5.10's new video driver - #87
SteamOS 0.5.10 replaces the Frame's video decoder driver with the upstream Iris driver. On it, 8K HEVC Main 10 videos didn't start, and 8K H.264 could be refused at start. This makes the Frame's FFmpeg and mpv start streams the way that driver expects, while older SteamOS keeps the current path.
Detection by capability. Both drivers call themselves iris_driver. The upstream one reports V4L2_CID_MIN_BUFFERS_FOR_CAPTURE and the vendor one doesn't, so that control tells them apart. Every change below is behind that check (iris_reports_minimum), never the OS version.
Provisional input size. The driver sizes its working memory from the input format set before the stream's headers are parsed, then allocates the real size's at capture start before freeing the first. An 8K input format left no address space for 8K Main 10. Streams larger than 4096×2560 now start from a 4096×2560 input format, as the stateful decoder interface intends; the real size comes with the source change.
Capture buffers made after STREAMON. At capture STREAMON the driver allocates its own reference frames and the stream's working memory, the new set before it frees the old, all in one 2.9 GiB address range where each 8K Q10C buffer takes a 128 MiB-aligned slot. A pool allocated before that left 8K Main 10 streams with a minimum of 8 no room, even with only 8 buffers. FFmpeg now reads the minimum (V4L2_CID_MIN_BUFFERS_FOR_CAPTURE), creates one buffer, starts streaming, then adds buffers with VIDIOC_CREATE_BUFS (REQBUFS would raise the count to the minimum). It stops once memory runs out, provided it has reached the minimum. It retries briefly while the old working memory is still being freed.
Pool sized from the driver's minimum when refused. This driver keeps reference frames in buffers of its own, so the capture pool only holds frames waiting for display. When capture start fails with ENOMEM, FFmpeg flags it (capture_start_refused) and mpv reopens the decoder with the driver's minimum plus one. A session that already had that pool doesn't retry. mpv remembers the smallest refused picture area per codec and bit depth (an atomic minimum), so later files and seeks that size start with that pool at once.
Staged start kept for the vendor driver only. The upstream driver rejects input format changes once buffers exist, so it never takes that path.
sequenceDiagram
participant D as FFmpeg v4l2m2m
participant K as Iris (upstream)
D->>K: S_FMT input 4096x2560 (stream is 8192x4096)
D->>K: REQBUFS / STREAMON input
K-->>D: SOURCE_CHANGE 8192x4096, minimum N
D->>K: CREATE_BUFS 1 capture, STREAMON capture
alt STREAMON ENOMEM
K-->>D: refused
D->>D: capture_start_refused = 1
Note over D: mpv reopens with N + 1, remembers the size
else started
Note over K: reference frames and working memory allocated
loop until N + spare, or ENOMEM once N exist
D->>K: CREATE_BUFS 1, QBUF
end
end
Loading
8K HEVC Main 10, 8192×4096 at 59.94 fps, on SteamOS 0.5.10:
master
This PR
Starts (capture minimum of 7 or 8)
No (capture start refused)
Yes
Frame rate
—
60 fps, no dropped frames
First frame after a seek
—
67–175 ms
Not changed, on purpose:
The refused size is remembered when the pool is refused, not after the smaller pool decodes. References live in the driver's own buffers, so the smallest pool costs nothing measurable: 8K Main 10 plays at 60 fps with it. A refusal under memory pressure would also refuse a larger stream.
A second failure during the retry replays only what the retry path already saves. That is the existing allocation-retry path. If the smallest pool also fails, the file fails for good and its packets don't matter.
A same-size source change that raises the driver's minimum mid-stream. The video files this player opens carry one sequence.
A refusal at the smallest pool still gets the one-shot retry. That retry is for a refusal that clears by itself, such as just after a seek.
Medium — Recheck the capture minimum on same-resolution source changes. In v4l2_context.c:1443–1463, the minimum is read only when creating a pool. A new H.264 or HEVC sequence can change the required buffer count without changing the picture dimensions; the V4L2 decoder contract explicitly identifies this as a source change. For example, if late allocation stops at seven buffers and the next sequence requires eight, do_source_change() sees unchanged dimensions, keeps all seven, and restarts capture below the new minimum. On upstream Iris, re-read the minimum before reusing an existing pool and take the existing reallocation path if num_buffers is too small.
Low — A refused session already using the smallest pool still retries. In mpv-v4l2-reset.patch:249–257, opening another file at a remembered size sets v4l2_smallest_pool, but retried_v4l2_allocation starts false. If capture is refused, smaller is false yet the || still schedules a full decoder reopen and packet replay. For Main 10, that repeats both the same pool request and the same Q10C format, delaying fallback without reducing the allocation. For a flagged pool refusal, retry only if the session requested more than one spare; use the existing one-shot retry condition for other ENOMEM failures.
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
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.
SteamOS 0.5.10 replaces the Frame's video decoder driver with the upstream Iris driver. On it, 8K HEVC Main 10 videos didn't start, and 8K H.264 could be refused at start. This makes the Frame's FFmpeg and mpv start streams the way that driver expects, while older SteamOS keeps the current path.
iris_driver. The upstream one reportsV4L2_CID_MIN_BUFFERS_FOR_CAPTUREand the vendor one doesn't, so that control tells them apart. Every change below is behind that check (iris_reports_minimum), never the OS version.V4L2_CID_MIN_BUFFERS_FOR_CAPTURE), creates one buffer, starts streaming, then adds buffers withVIDIOC_CREATE_BUFS(REQBUFSwould raise the count to the minimum). It stops once memory runs out, provided it has reached the minimum. It retries briefly while the old working memory is still being freed.ENOMEM, FFmpeg flags it (capture_start_refused) and mpv reopens the decoder with the driver's minimum plus one. A session that already had that pool doesn't retry. mpv remembers the smallest refused picture area per codec and bit depth (an atomic minimum), so later files and seeks that size start with that pool at once.sequenceDiagram participant D as FFmpeg v4l2m2m participant K as Iris (upstream) D->>K: S_FMT input 4096x2560 (stream is 8192x4096) D->>K: REQBUFS / STREAMON input K-->>D: SOURCE_CHANGE 8192x4096, minimum N D->>K: CREATE_BUFS 1 capture, STREAMON capture alt STREAMON ENOMEM K-->>D: refused D->>D: capture_start_refused = 1 Note over D: mpv reopens with N + 1, remembers the size else started Note over K: reference frames and working memory allocated loop until N + spare, or ENOMEM once N exist D->>K: CREATE_BUFS 1, QBUF end end8K HEVC Main 10, 8192×4096 at 59.94 fps, on SteamOS 0.5.10:
masterNot changed, on purpose:
Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-solhighopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.2