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
AV1 videos play with the headset's hardware decoder on SteamOS 0.5.10 - #89
The Iris decoder in SteamOS 0.5.10 decodes AV1. The Frame now uses it for 8-bit AV1, which played in software before: 8K AV1 at about 28 fps, with frequent dropped frames.
FFmpeg: a new av1_v4l2m2m decoder in the Frame's V4L2 wrapper. AV1 maps to the driver's AV01 format. Each buffer gets one temporal unit, which opens with exactly one temporal delimiter. MP4 and Matroska leave the delimiter out; one already in the packet, extension header and padded size included, is parsed and replaced. The first unit also carries the sequence header from the av1C record, without the record's four-byte header. A malformed av1C is refused. It is registered after libdav1d and FFmpeg's own AV1 decoder, so it is never picked by default or for probing.
App: at startup the player reads the decoder node's sysfs name, opens only that node, and checks whether it lists AV01. Only then does it add av1 to mpv's hwdec-codecs. The vendor driver in earlier SteamOS doesn't list it, so AV1 stays in software there. The "Software decoding" tooltip only names AV1 as unsupported when the decoder doesn't take it.
mpv (mpv-v4l2-av1.patch): AV1 frames come out in decoding order, so the capture pool is the driver's minimum plus three. A refused pool is retried and remembered as it is for HEVC and H.264. If the hardware refuses an AV1 file, mpv still falls back to software, even for files of 8K and up.
10-bit AV1 stays in software. If the demuxer gives no pixel format, the av1C must say Main, 8-bit 4:2:0. Seeks reopen the decoder, as they do for H.264.
8000×4000 AV1, 60 fps, over SMB, on the Frame at 3780 px per eye and 120 Hz:
Before (libdav1d)
This PR (Iris)
Frames per second
12–41, median 28
60
Dropped frames
357
0
Not changed, on purpose:
With --hwdec=no the player doesn't probe the decoder, so the "Software decoding" tooltip names AV1 as unsupported. That flag is a diagnostic switch, not a setting users reach.
An MP4 track that switches to 10-bit mid-stream, a last OBU without its size field, a truncated av1C, or a padded delimiter before a three-byte packet. Common encoders and muxers don't write these.
Medium — Recheck AV1 bit depth when the configuration changes.v4l2_m2m_dec.c:288–305 strips the av1C header without checking its format. The 8-bit gate runs only at decoder initialization. An MP4 track can switch sample descriptions; FFmpeg delivers the replacement av1C as AV_PKT_DATA_NEW_EXTRADATA, which try_enqueue_src() passes to this same copy function. If an 8-bit track switches to a 10-bit sequence, the wrapper therefore sends it to the existing 8-bit Iris session instead of falling back to software. Check the replacement record before discarding its header, and keep an unsupported configuration from enqueueing packets so mpv can fall back.
Medium — Add the missing size field when converting MP4 samples to OBU-stream format.v4l2_m2m_dec.c:759–774 changes the delimiter but copies the remaining OBUs verbatim. AV1's MP4 binding, §2.4, permits the last OBU in a sample to omit its size; FFmpeg's MOV demuxer and AV1 parser preserve those bytes. That sample is valid in MP4, but the low-overhead OBU stream expected by V4L2_PIX_FMT_AV1 requires the size field. For such files, even ordinary frame buffers are submitted in the wrong format. When the final OBU omits its size, set the flag and encode the remaining payload length before enqueueing it.
Low — Compare the delimiter length with the original packet size.v4l2_m2m_dec.c:764–771 subtracts delimiter before checking whether the packet consisted only of that delimiter. For example, a three-byte delimiter with a padded size field followed by a three-byte show_existing_frame OBU leaves s->buf_pkt.size == 3. After the first packet, prefix_size is zero, so the comparison suppresses the replacement delimiter and sends the frame header alone. Determine delimiter_only before trimming, and trim a local packet view so an EAGAIN retry starts from the same input.
Low — Reject truncated OBUs in av1C before appending the first sample.v4l2_m2m_dec.c:291–305 checks the record's version and four-byte minimum, but not that its configOBUs fit inside the record. An MP4 with a truncated sequence-header OBU can therefore pass validation: once the prefix and sample are concatenated, the declared OBU length can consume bytes from the first frame. Validate the OBU headers and declared lengths against the configuration-record boundary before copying them; a full sequence-header parser is not needed for this check.
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.
The Iris decoder in SteamOS 0.5.10 decodes AV1. The Frame now uses it for 8-bit AV1, which played in software before: 8K AV1 at about 28 fps, with frequent dropped frames.
av1_v4l2m2mdecoder in the Frame's V4L2 wrapper. AV1 maps to the driver'sAV01format. Each buffer gets one temporal unit, which opens with exactly one temporal delimiter. MP4 and Matroska leave the delimiter out; one already in the packet, extension header and padded size included, is parsed and replaced. The first unit also carries the sequence header from theav1Crecord, without the record's four-byte header. A malformedav1Cis refused. It is registered after libdav1d and FFmpeg's own AV1 decoder, so it is never picked by default or for probing.AV01. Only then does it addav1to mpv'shwdec-codecs. The vendor driver in earlier SteamOS doesn't list it, so AV1 stays in software there. The "Software decoding" tooltip only names AV1 as unsupported when the decoder doesn't take it.mpv-v4l2-av1.patch): AV1 frames come out in decoding order, so the capture pool is the driver's minimum plus three. A refused pool is retried and remembered as it is for HEVC and H.264. If the hardware refuses an AV1 file, mpv still falls back to software, even for files of 8K and up.av1Cmust say Main, 8-bit 4:2:0. Seeks reopen the decoder, as they do for H.264.8000×4000 AV1, 60 fps, over SMB, on the Frame at 3780 px per eye and 120 Hz:
Not changed, on purpose:
--hwdec=nothe player doesn't probe the decoder, so the "Software decoding" tooltip names AV1 as unsupported. That flag is a diagnostic switch, not a setting users reach.av1C, or a padded delimiter before a three-byte packet. Common encoders and muxers don't write these.Important
AI disclosure
anthropic/claude-opus-5-5highopenai/gpt-6.2-solhighopenai/gpt-6.2-astrahighAgent harness OpenCode 2.3.2