kmsgrab: HDR metadata blob ID changes cause repeated capture reinitialization and black/one-frame output
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp, linux
- Domain
- desktop-dev
Research direction
The payload names refresh() and is_hdr() as the code paths involved; start by finding where the KMS capture code reads the connector's HDR_OUTPUT_METADATA blob ID and where it decides to reinitialize. Reproducing needs an HDR-capable DRM display, so first confirm the blob ID drift in logs. Done means the cached ID is updated without reinitializing when the blob bytes are unchanged, and capture still reinitializes when the bytes differ.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your issue described in the documentation?
- I have read the documentation
Is your issue present in the latest beta/pre-release?
This issue is present in the latest pre-release
Describe the Bug
With DRM screencasting on an HDR display, the connector’s HDR_OUTPUT_METADATA blob ID changes unexpectedly even though the metadata bytes remain unchanged. refresh() runs on every display refresh, and an ID change can trigger capture reinitialization. This causes Moonlight to show only one frame or no frames.
The log shows the connector discovered with blob ID 159, followed by is_hdr() failing to read that ID. Capture then reinitializes, and the current metadata is reported under blob ID 146:
Note: The log excerpt below includes custom diagnostic logging.
Found connector ID [135]
Found hdr_metadata_blob_id [159]
...
is_hdr hdr_metadata_blob_id: 159
Unable to get HDR metadata blob: No such file or directory
...
Reinitializing capture after HDR metadata change
Previous HDR metadata: couldn't read blob 159: No such file or directory
Current HDR metadata (blob 146, 32 bytes)
It’s unclear why the blob ID changes.
Possible fix requires to compare the newly read metadata bytes with the last successfully read bytes: update the cached ID without reinitializing if the contents match; reinitialize if they differ.
Steps to reproduce
- Run DRM screencasting with an HDR display.
- Connect via Moonlight
- Observe the connector’s HDR metadata blob ID change during capture.
- Observe
refresh()trigger reinitialization and Moonlight display one frame or no frames. - This repeats infinitely.
Expected Behavior
No response
Additional Context
No response
Host Operating System
Linux
Operating System Version
Architecture
amd64/x86_64
Package
other (self built)
GPU Type
AMD
GPU Model
GPU Driver/Mesa Version
latest
Capture Method
KMS (Linux)
Apps
Log output
Online logs
No response
- Dominant language
- C++
- Stars
- 42k
- Forks
- 2.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 124
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LizardByte/Sunshine
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
LizardByte/Sunshine#5795 ·
Maintainers usually reply within 1 day
-
PIN pairing fails with "Missing CSRF token" - web UI never fetches/attaches the tokenMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LizardByte/Sunshine#5467 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
LizardByte/Sunshine#5919 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 44/100
LizardByte/Sunshine#5903 · 1 comment ·
Maintainers usually reply within 1 day
-
[Windows 11 Insider] Black screen when capturing secondary monitor (negative coordinates / AMD GPU)Open
Difficulty 4/5 3-5 days Newbie friendliness 15/100
LizardByte/Sunshine#5884 ·
Maintainers usually reply within 1 day
All issues in LizardByte/Sunshine
Similar issues
-
llvm.memcpy with destination align but no source align asserts "Missed Source alignment!"Possibly taken @pvelesko claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KhronosGroup/SPIRV-LLVM-Translator#4093 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
SIMQ silently truncates multi-query batch search to the first queryPossibly taken @LHT129 claimed this today. Openkind/bug module/index needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
antgroup/vsag#3080 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
[Bug] Title-bar audio controls shift horizontally when the TX timer appears and disappearsPossibly taken @w5jwp claimed this today. Openbug GUI maintainer-review
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aethersdr/AetherSDR#6455 · 3 comments ·
Maintainers usually reply within 1 day