pipewire: read a modifier choice at the right offset - #255
Merged
Conversation
jcelerier
force-pushed
the
fix/pipewire-modifier-choice-parse
branch
from
September 11, 2026 03:41
3727779 to
7b401de
Compare
jcelerier
force-pushed
the
fix/pipewire-modifier-choice-parse
branch
from
September 11, 2026 03:59
7b401de to
3cee443
Compare
jcelerier
added a commit
to ossia/libossia
that referenced
this pull request
Sep 11, 2026
Picks up celtera/libremidi#255. extract_modifier_choice read a DMA-BUF modifier list at the wrong offset, so a consumer fixated on a modifier the producer never offered and every Vulkan import failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q
extract_modifier_choice stepped past SPA_POD_CONTENTS(spa_pod_choice, ..) by another sizeof(spa_pod_choice_body). The macro already skips the pod header and the choice body, so it points at the first value; adding the body size again dropped the first two modifiers and read two entries past the end. What a consumer gets back is then a list of neighbouring pod bytes. Fixating on one of those asks the producer to import the dma-buf with a modifier nobody offered, and vkAllocateMemory fails with VK_ERROR_OUT_OF_DEVICE_MEMORY on every frame because the image that layout implies does not fit the buffer. Use SPA_POD_CHOICE_VALUES and SPA_POD_CHOICE_N_VALUES instead, and ignore a choice whose values are not 8 bytes wide, since a modifier is a Long. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q
jcelerier
force-pushed
the
fix/pipewire-modifier-choice-parse
branch
from
September 12, 2026 13:48
3cee443 to
4822d1d
Compare
jcelerier
added a commit
to ossia/libossia
that referenced
this pull request
Sep 12, 2026
Picks up celtera/libremidi#255. extract_modifier_choice read a DMA-BUF modifier list at the wrong offset, so a consumer fixated on a modifier the producer never offered and every Vulkan import failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q
jcelerier
added a commit
to ossia/libossia
that referenced
this pull request
Sep 12, 2026
Picks up celtera/libremidi#255. extract_modifier_choice read a DMA-BUF modifier list at the wrong offset, so a consumer fixated on a modifier the producer never offered and every Vulkan import failed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q
jcelerier
added a commit
to ossia/score
that referenced
this pull request
Sep 12, 2026
Picks up ossia/libossia#936, which pins celtera/libremidi#255. Without it the DMA-BUF modifier reaching DRMPrimeDecoder is garbage and every Vulkan import fails, so the video input renders black. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q
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.
extract_modifier_choicestepped pastSPA_POD_CONTENTS(spa_pod_choice, ..)by anothersizeof(spa_pod_choice_body). The macro already skips the pod header and the choice body, so it points at the first value; adding the body size again dropped the first two modifiers and read two entries past the end of the pod.What the consumer gets back is then a list of neighbouring pod bytes. Fixating on one of those asks the producer to import the dma-buf with a modifier nobody offered, and
vkAllocateMemoryfails withVK_ERROR_OUT_OF_DEVICE_MEMORYon every frame, because the image that layout implies does not fit the buffer.This uses
SPA_POD_CHOICE_VALUESandSPA_POD_CHOICE_N_VALUESinstead of stepping the pointer by hand, and ignores a choice whose values are not 8 bytes wide, since a modifier is a Long.Found while debugging ossia score's PipeWire DMA-BUF video input, which rendered black on Vulkan for this reason. With the fix the modifier list parses correctly, the import succeeds and the input renders correct pixels.
🤖 Generated with Claude Code
https://claude.ai/code/session_019QWYTEhFJonuUNTEmBfv7Q