[VP] Fix VEBOX surface config crash in 60i->30p deinterlacing#1988
Open
tsukumijima wants to merge 1 commit intointel:masterfrom
Open
[VP] Fix VEBOX surface config crash in 60i->30p deinterlacing#1988tsukumijima wants to merge 1 commit intointel:masterfrom
tsukumijima wants to merge 1 commit intointel:masterfrom
Conversation
When performing 60i->30p deinterlacing (non-bob, b60fpsDi=false) with resize on pure softlet platforms (MTL+), m_sameSamples could be true, creating a VEBOX_SURFACES_CONFIG not registered in InitSurfaceConfigMap(). This caused a segfault in AssignVeboxResource() when looking up the config. Gate m_sameSamples by b60fpsDi: only 60fps DI (60i->60p) paths use the sameSample flag, since all 60i->30p entries in the surface config map have sameSample=false. Bug was introduced in f38f67c ("[VP] 30pRefdi case Linux", 2022-11-09) which added 60i->30p config entries without sameSample=true variants. The issue affects all pure softlet platforms (MTL, ARL, LNL, BMG, PTL, NVL) and is codec-agnostic.
tsukumijima
added a commit
to tsukumijima/KonomiTV
that referenced
this pull request
Feb 25, 2026
…lace normal を使うと QSVEncC がクラッシュする問題を iHD_drv_video.so とその依存関係自体を bundled することで解決する Intel Media Driver 側のバグであることは特定していて、Codex くんのおかげで修正パッチも作成済みなので、このパッチを当てた iHD_drv_video.so が常に使われるようにする 副次的ではあるが、これで Docker インストールかに関わらず KonomiTV を使う上では OS に関わらず同一の Intel ユーザーモードドライバが使われるようになり、各環境間での安定性が向上するはず ref: intel/media-driver#1988
|
Updates? |
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.
Summary
Fix a segfault (
SIGSEGV/ exit code 139) inVpResourceManager::AssignVeboxResource()that occurs when performing non-bob deinterlacing (normal/advanced mode, 60i->30p) on pure softlet platforms (Meteor Lake and later).Background
I originally encountered this crash while using QSVEncC (a hardware-accelerated video encoder leveraging Intel Quick Sync Video via libvpl) on an Intel Core Ultra 7 265K (ArrowLake-S) system running Ubuntu 22.04.5 LTS.
After discussions with @rigaya (the author of QSVEncC), we confirmed that the crash occurs in the Intel Media Driver, not in QSVEncC itself.
This is a significant regression for real-world use cases. In Japan, terrestrial TV broadcasts use MPEG-2 TS (1440x1080i, interlaced), and QSVEncC is widely used to transcode these recordings to H.264/H.265 with hardware-accelerated deinterlacing.
This workflow was working fine on older platforms (e.g., i5-9400 / Gen9, i5-12400 / ADL, Arc A310 / DG2), but is now completely broken on Meteor Lake and later platforms where the pure softlet VP adapter is used.
The bug also reproduces with FFmpeg's QSV VPP deinterlace filter (
vpp_qsv), confirming this is not application-specific but a driver-level issue affecting any VA-API consumer that uses VEBOX-based 60i->30p deinterlacing.We would appreciate prompt merging and backporting to distribution packages (e.g.,
intel-media-va-driver-non-freeon Ubuntu), as this currently renders non-bob deinterlacing unusable on all MTL+ platforms.Root Cause
In
AssignVeboxResource(), theVEBOX_SURFACES_CONFIGis constructed withm_sameSamplespassed directly as thesameSamplefield. However,InitSurfaceConfigMap()only registers entries withsameSample=truefor 60fps DI (b64DI=true) configurations. The 60i->30p section (lines 695-705,b64DI=false) has no entries withsameSample=true:When
b60fpsDi=false(60i->30p) andm_sameSamples=true, the constructed config value has no matching entry in the map, causingMOS_STATUS_INVALID_PARAMETERto be returned and ultimately a segfault.Fix
Gate
m_sameSamplesbyb60fpsDiso thatsameSampleis only set for 60fps DI (60i->60p) paths, where the surface config map does have matching entries:Affected Platforms
This bug affects all pure softlet VP adapter platforms that go through
InitSurfaceConfigMap():VpPipelineG12Adapter(legacy hybrid)VpPipelineAdapterXe_Hpm(legacy hybrid)VpPipelineAdapterXe_Lpm_Plus(pure softlet)VpPipelineAdapterXe_Lpm_Plus(pure softlet)VpPipelineAdapterXe2_Lpm(pure softlet)VpPipelineAdapterXe2_Hpm(pure softlet)VpPipelineAdapterXe3_Lpm(pure softlet)VpPipelineAdapterXe3P_Lpm(pure softlet)Legacy hybrid adapters (TGL/ADL/RPL, DG2/Arc) inherit from both
VphalState*andVpPipelineAdapterLegacy, using a different VEBOX resource management path that does not go throughInitSurfaceConfigMap(). This is why the bug was not noticed on older platforms.Bug Origin
Introduced in commit f38f67c (
[VP] 30pRefdi case Linux, 2022-11-09), which added 60i->30p config entries toInitSurfaceConfigMap()but only withsameSample=falsevariants. The bug remained latent until the pure softlet VP adapter transition starting with Meteor Lake (late 2023).The bug is codec-agnostic:
m_sameSamplesis computed from frame IDs and buffer object tracking in the VA-API layer, with no codec-specific logic. Any interlaced source (MPEG-2, H.264 interlaced, VC-1, etc.) can trigger it.Reproduction
Hardware: Intel Core Ultra 7 265K (ArrowLake-S, iGPU) — or any MTL+ platform
OS: Ubuntu 22.04.5 LTS, kernel 6.8.0-100-generic
Driver: intel-media-va-driver-non-free 25.2.4 (iHD 25.2.4)
Input: Any interlaced video file (e.g., MPEG-2 TS, 1440x1080i)
QSVEncC 8.04
FFmpeg 7.1
Test Results
The "After Fix" column was tested by building
iHD_drv_video.sofrom this branch and loading it viaLIBVA_DRIVERS_PATHat runtime, on the same system listed above.PS: This investigation and fix were performed using Codex (GPT-5.3-Codex) and Claude Code (Claude Opus 4.6).
However, it has been confirmed on an actual Core Ultra 7 265K machine that applying this patch to iHD_drv_video.so successfully avoids this error and enables deinterlacing.
Therefore, it is undeniable that this patch is effective, at the very least.