Fix Intel GPU VA-API support and video streaming#1572
Draft
lukemarsden wants to merge 12 commits intomainfrom
Draft
Fix Intel GPU VA-API support and video streaming#1572lukemarsden wants to merge 12 commits intomainfrom
lukemarsden wants to merge 12 commits intomainfrom
Conversation
Problem: Video streaming froze after first frame on Intel GPU systems. Root cause: GPU_VENDOR=none forced software rendering, and pipewiresrc keepalive-time property wasn't producing frames. Fix: Enable Intel GPU hardware acceleration: - Set GPU_VENDOR=intel in .env - Configure HELIX_RENDER_NODE=/dev/dri/renderD128 - Set LIBVA_DRIVER_NAME=iHD for Intel VA-API driver This enables VA-API or QSV hardware encoding instead of OpenH264 software encoding, which works correctly with GNOME ScreenCast. See INTEL_GPU_FIX.md for verification steps.
Problem: Headless GNOME uses damage-based rendering, only sending frames when screen content changes. This causes: - 0-1 FPS on static screens - Capped at 10 FPS even with active interaction (previous wrong fix) Root cause: gnome-shell --headless uses damage-based ScreenCast. This is CORRECT behavior for power efficiency, not a bug. Solution: Add videorate to software encoders (openh264, x264): - Duplicates last frame on static screens (~10 FPS smooth video) - Allows up to 60 FPS when content actively changes - NO framerate caps - let videorate handle frame timing naturally Removed previous framerate=10/1 caps that was limiting to 10 FPS.
Changed videorate caps from ~10 FPS to 2-60 FPS range: - 2 FPS minimum on static screens (saves bandwidth) - Up to 60 FPS when content is actively changing - Framerate cap: video/x-raw,framerate=[2/1,60/1]
The framerate=[2/1,FPS/1] caps was forcing negotiation to 2 FPS. videorate handles frame timing naturally without needing caps filter. Result: ~10 FPS on static screens, up to max-rate on active content.
Testing if keepalive-time=500 on pipewiresrc works in software mode without videorate workaround.
The renderD128 device on this Intel GPU system has group ownership 'sgx' (Intel SGX - Software Guard Extensions) instead of 'video'. The permission-fixing script only changed group ownership when the group was 'root', so it skipped the sgx-owned render device. This caused VA-API to fail with 'Permission denied' when trying to access /dev/dri/renderD128. Fix: Add 'sgx' to the list of groups that need to be changed to 'video' so VA-API can access the render device for hardware encoding.
Previous commit modified wrong file (15-setup_devices.sh in desktop/ubuntu-config) but the actual init script is defined inline in Dockerfile.ubuntu-helix as a heredoc at line 362. The renderD128 device has group 'sgx' (Intel SGX) instead of 'video', causing VA-API to fail with 'Permission denied'. Fix by adding 'sgx' to the list of groups that need to be changed to 'video'. Removed unused 15-setup_devices.sh file that wasn't being copied into image.
Add intel-media-va-driver (iHD, modern Intel Gen8+) and i965-va-driver (legacy Intel) packages to enable VA-API hardware encoding on Intel GPUs. Previously only mesa-va-drivers was installed which provides AMD/NVIDIA/ virtio drivers but not Intel. This caused gst-inspect-1.0 vaapi to show '0 features' and video encoding to fall back to software (openh264enc). Fixes Intel VA-API initialization errors: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so va_openDriver() returns -1
Collaborator
Author
|
This PR needs thorough testing before merge. Please verify:
Current test results show VA-API drivers loading correctly with 13 features including vaapih264enc, but end-to-end video streaming needs verification on real hardware. |
vaapipostproc (legacy gst-vaapi plugin) doesn't support the add-borders property - that only exists in the newer vapostproc element (gst-va plugin). Error: failed to parse pipeline: no property "add-borders" in element "vaapipostproc" Fix by removing add-borders from vaapipostproc. The element will still scale to the target resolution using its width/height properties.
- Removed tune=low-latency from vaapih264enc pipeline (property doesn't exist) - This completes the fix for Intel GPU video streaming - VA-API drivers already installed and device permissions fixed Testing needed: - Intel GPU mode (GPU_VENDOR=intel) video streaming - Mouse clicks in Intel GPU mode - Software rendering mode (GPU_VENDOR=none) - Verify software mode works without /dev/dri devices Note: Automated testing blocked by spectask CLI timing out when creating new sessions. Manual session creation required to test the pipeline fix.
Collaborator
Author
VA-API Fix UpdateFixed the GStreamer pipeline error for Intel GPU hardware encoding: Changes:
Testing Status:❌ Blocked: Unable to start new sessions via The fix is complete and ready for manual testing, but I encountered a workflow issue where:
What Needs Testing:
Manual testing required - start a new Ubuntu session manually through the UI or debug why spectask CLI can't create new sessions. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
This PR fixes video streaming issues on Intel GPU systems by enabling VA-API hardware encoding.
Issues Fixed
1. VA-API Permission Denied
2. Missing Intel VA-API Drivers
3. Video Streaming Pipeline
Test Results
Before fixes:
After fixes:
Changes
Testing Needed
Related Issues
Related to video streaming freeze issue on Intel GPU machines.