Skip to content

fix(linux): skip h264_vulkan on RADV Raven, whose takes come out corrupt - #1542

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/linux-vulkan-encoder-drops-1465
Nov 13, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/linux-vulkan-encoder-drops-1465

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Refs #1465

What

The Linux helper no longer picks h264_vulkan on RADV Raven devices (Raven, Picasso, Raven2: VCN 1.0). The encoder ladder falls through to libopenh264 there.

Why

On the reporter's Ryzen 5 3550H (Vega 8 iGPU + GTX 1650, niri):

  • VA-API opens on renderD128 (NVIDIA, no H.264 encode entrypoint) and fails, so the ladder lands on Vulkan/RADV.
  • The Vulkan take is corrupt: frames from the attached video show 16×16 blocks of older content stuck over the picture, and only 254 distinct pictures in 1360 frames (about 11/s). The software take of the same screen has 1819 distinct in 1922.
  • OPENSCREEN_LINUX_ENCODER=software records cleanly, so software is the right rung on this device.

The device is identified by Mesa's name (… (RADV RAVEN) / (RADV RAVEN2)), read through vkGetPhysicalDeviceProperties the same way vulkan_can_encode_h264 reads its queues.

Not covered

  • VA-API on the AMD node (renderD129) would be the better encoder here. fix(linux): libva < 2.22 vaMapBuffer2 compatibility shim #1476's node loop retries only when the device or the frame pool fails to create; on this machine the NVIDIA node creates fine and fails later in avcodec_open2, so it would not reach renderD129 as written.

Checks

  • New unit test vulkan_is_skipped_on_vcn1_radv_only.
  • The new functions compile and the name match passes in a standalone rustc build. The crate itself was not built locally (no Linux toolchain here); the Nix build compiles it.
  • Under the compositor/native evidence lock: no evidence recorded by this worker.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved hardware encoding reliability on AMD Raven-family devices. If Vulkan encoding is unavailable on these devices, the app can continue with another supported encoder instead of failing during setup.

On a Ryzen 5 3550H (Vega 8, VCN 1.0) the Vulkan encoder opens but the
take holds stale blocks of older content and few distinct frames, while
libopenh264 records the same screen cleanly. Refuse the rung on Mesa's
RAVEN/RAVEN2 devices so the ladder falls through to software.

Refs #1465
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Vulkan hardware setup now queries the device name and returns an error for names matching the RADV Raven filter. Tests cover Raven and Raven2 matches and representative nonmatches.

Changes: Vulkan Raven device filter

Layer / File(s) Summary
Device-name check and hardware setup
electron/native/pipewire-capture/src/encoder.rs
The Vulkan setup path queries physical-device properties after confirming an H.264 encode queue. It returns an error when the device name matches (RADV RAVEN. Tests cover matching and nonmatching names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: beetix

Merge Risk: Minimal · up to a84cf

On affected RADV Raven, Raven2 and Picasso hardware, Linux screen recording is intended to skip the Vulkan encoder and fall back to software encoding, avoiding corrupt video. No actionable merge-blocking risk was found. The change has only been validated by a unit test of the name filter, not on real hardware.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: skipping h264_vulkan on RADV Raven devices because their output is corrupt. The raw summary and objectives confirm the filter on '(RADV RAVEN' names and the fall-throu…
Description check Passed The description follows the template's main sections: it has a What, Why, Checks section, and a Refs #1465 link. It describes the change, the motivation, and the testing done. Several template section…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: skipping h264_vulkan on RADV Raven devices because their output is corrupt. The raw summary and objectives confirm the filter on '(RADV RAVEN' names and the fall-through to another encoder. The title's 'fix(linux)' prefix and the phrase 'takes come out corrupt' are a little informal, but the title is specific and on topic.

Full details: Description check

Explanation

The description follows the template's main sections: it has a What, Why, Checks section, and a Refs #1465 link. It describes the change, the motivation, and the testing done. Several template sections are missing or incomplete. The Summary heading is replaced by What and Why. The Type of change, Release impact, Desktop impact, and Screenshots sections are absent. The Related issue uses Refs instead of the template's Fixes line, which is allowed for partial work. The Testing section lacks a full run because the crate was not built locally. Most required information is present, so the check passes, but the template sections should be added.

Resolution

Add the missing template sections: Type of change (Bug fix), Release impact, Desktop impact (Linux), and Screenshots or video. The attached video is referenced in the Why section but is not linked in the description body. Also state whether a Linux build or runtime test was run, because the crate was not built locally.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Clippy (1.99.1)

Clippy execution failed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e3889fa1-22cb-45f5-ab7d-8c2118807dcb
Commits

Reviewing files that changed from the base of the PR and between 5235414 and a84cf7a.

Files selected for processing: 1

  • electron/native/pipewire-capture/src/encoder.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@EtienneLescot
EtienneLescot merged commit af44d2c into main Nov 13, 2026
21 checks passed
@EtienneLescot

Copy link
Copy Markdown
Member Author

Merged: on Raven-family AMD iGPUs the Linux recorder now skips the Vulkan encoder and records with the software encoder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant