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
bug: obs-ffmpeg: VAAPI encoders fail to start on a stale vaapi_device instead of falling back (upstream #13773) #197
and gives up when that fails. The good default (vaapi_get_*_default_device() in vaapi-utils.c, the first render node that encodes the codec) is only set with obs_data_set_default_string, so it never replaces a value saved in the profile.
Class
Logic error: the output fails to start, no fallback.
How it is reached
A profile keeps the device path the user picked. It goes stale when the profile moves to another machine, a second GPU is removed, or a driver change renumbers the render nodes. Starting a stream or recording then fails with only a generic error in the UI and this in the log:
Failed to create VAAPI device context: Invalid argument
Reproduced with libobs on a Radeon 680M (radeonsi), encoding a color source with ffmpeg_vaapi, ffmpeg_vaapi_tex and hevc_ffmpeg_vaapi:
vaapi_device
Result
missing render node (/dev/dri/renderD129)
fails, Invalid argument
by-path node of another PCI slot (the issue's path)
fails, Invalid argument
primary node the user can't open (/dev/dri/card0)
fails, Invalid argument
/dev/null
fails, Generic error in an external library
empty string
fails, Input/output error or Invalid argument (FFmpeg reads "" as an X11 display or device name, so the report's "leave it empty to auto-detect" doesn't hold)
unset, or the real render node
works, 60 frames
Proposed fix and failing test
Fix: if the configured device is set and can encode the codec, use it. Otherwise use the codec's default device and log Device '<configured>' is not usable, falling back to '<default>'. With no usable device, keep the configured path and fail as before. Cost: one extra libva initialisation when an encoder starts.
RED test (cmocka, test_vaapi_device_select), with the choice moved into obs-ffmpeg/vaapi-device-select.[ch] (no libva or FFmpeg calls; the usability probe is a callback): 5 of 7 fail today (missing node, other machine's by-path node, unusable existing node, unusable candidates skipped, empty setting). The 2 that pass pin that a working configured device is kept and that nothing usable still fails as before. With the fix, all 7 pass, and on the 680M all three encoders encode 60 frames for every bad path above.
The VAAPI encoders now keep the saved device if it works, and otherwise fall back to the codec's default device (the first render node that encodes it), logging Device '<saved>' is not usable, falling back to '<default>'.
One correction to the upstream report: leaving the device setting empty doesn't make FFmpeg auto-detect. OBS passes "", which libavutil reads as an X11 display or device name, so it fails too. Workaround on stock OBS: pick the current render node (e.g. /dev/dri/renderD128) in the encoder settings again, or reset the encoder settings so the key is unset.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not. Your GPU, distro and the device path you had saved are the useful details.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_vaapi_device_select(5 of 7 failing), device choice moved intovaapi-device-select.[ch]with no behaviour change.PR within the hour.
obs-ffmpeg: Fall back to a working VAAPI device
test/cmocka: Add RED VAAPI stale device tests
rdoupe commentedon Oct 11, 2026
@chengjilai you reported this in obsproject/obs-studio#13773, so a heads-up: it's fixed here in obs-rust by #198.
The VAAPI encoders now keep the saved device if it works, and otherwise fall back to the codec's default device (the first render node that encodes it), logging
Device '<saved>' is not usable, falling back to '<default>'.One correction to the upstream report: leaving the device setting empty doesn't make FFmpeg auto-detect. OBS passes
"", which libavutil reads as an X11 display or device name, so it fails too. Workaround on stock OBS: pick the current render node (e.g./dev/dri/renderD128) in the encoder settings again, or reset the encoder settings so the key is unset.obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you get a chance to try it, a short reply here on whether it fixes it for you would really help, especially if it does not. Your GPU, distro and the device path you had saved are the useful details.