Skip to content

Conversation

@robertkirkman
Copy link
Member

Makes this command work. Tested using mesa-vulkan-icd-freedreno on Samsung Galaxy S9 SM-G960U with Adreno 630.

mpv --vo=gpu-next --gpu-api=vulkan  BigBuckBunny_320x180.mp4

Note

This makes video rendering use Vulkan. Video decoding is a different kind of routine, and may work with --hwdec=vulkan on a compatible GPU, but doesn't work for me because I see h264: Device does not support the VK_KHR_video_decode_queue extension! with that.

Makes this command work. Tested using `mesa-vulkan-icd-freedreno` on Samsung Galaxy S9 SM-G960U with Adreno 630.

```bash
mpv --vo=gpu-next --gpu-api=vulkan  BigBuckBunny_320x180.mp4
```

> [!NOTE]
> This makes video **rendering** use Vulkan. Video **decoding** is a different kind of routine, and may work with `--hwdec=vulkan` on a compatible GPU, but doesn't work for me because I see `h264: Device does not support the VK_KHR_video_decode_queue extension!` with that.
@jpovixwm
Copy link
Contributor

jpovixwm commented Jan 9, 2026

I've experimented with this some time ago, a couple of months before I opened #27552, and the thing that ultimately made me pivot to GL was the apparent incompatibility of --vo=gpu-next --gpu-context=x11vk with --vf. And I wanted to use --vf=yuv420p as a workaround for some intermittent graphical glitches (the screen flashing green, also present with GL contexts) visible when viewing (10-bit) yuv420p10 content.

I downloaded the aarch64 artifact generated for this PR and tested it for a bit, and here's what I saw:

  • gpu-context=displayvk doesn't seem to work at all:

    [vo/gpu-next/libplacebo] Probing for vulkan devices:
    [vo/gpu-next/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/src/vulkan/context.c:957)
    [vo/gpu-next/vulkan] Failed to open physical device.
    [vo/gpu/libplacebo] Probing for vulkan devices:
    [vo/gpu/libplacebo] EnumeratePhysicalDevices(inst, &num, NULL): VK_ERROR_INITIALIZATION_FAILED (../src/src/vulkan/context.c:957)
    [vo/gpu/vulkan] Failed to open physical device.
    

    which I'd say is expected on a platform as locked down as Android, but I can't see an option in mpv's meson.options that would let us disable gpu-context=displayvk while keeping gpu-context=x11vk, and a patch is likely not worth the effort, so whatever.

  • vo=gpu-next gpu-context=x11vk still doesn't work reliably with vf. Curiously, not all filters are broken. E.g. I was able to use vf=vflip but not vf=hflip:

    ../src/src/vulkan/runtime/vk_buffer.c:39: void vk_buffer_init(struct vk_device *, struct vk_buffer *, const VkBufferCreateInfo *): assertion "pCreateInfo->size > 0" failed
    Aborted
    

    But this may be specific to mesa-vulkan-icd-freedreno. In contrast, the filters do work with vo=gpu gpu-context=x11vk. If you want to investigate this further, I think this failure is related to vd-lavc-dr:

    Using video filters of any kind that write to the image data (or output newly allocated frames) will silently disable the DR code path.
    

    Which I think is equivalent to running mpv with --vd-lavc-dr=no, which works OK for vo=gpu gpu-context=x11vk but crashes for vo=gpu-next gpu-context=x11vk:

    ../src/src/vulkan/runtime/vk_buffer.c:39: void vk_buffer_init(struct vk_device *, struct vk_buffer *, const VkBufferCreateInfo *): assertion "pCreateInfo->size > 0" failed
    Aborted
    
  • FYI: I saw the same Device does not support the VK_KHR_video_decode_queue extension! message with hwdec=vulkan and hwdec=vulkan-copy

So the overall reason why I skipped Vulkan and went with OpenGL for #27552 was that I couldn't get it to work reliably with my specific combination of device and media. But maybe it works better for others.

@robertkirkman
Copy link
Member Author

gpu-context=displayvk doesn't seem to work at all

That is expected. That is a vkCreateDisplayPlaneSurfaceKHR mode. vkCreateDisplayPlaneSurfaceKHR is an alternative windowing system, and unfortunately in Termux the only windowing system available is X11. You will not be able to use that mode in Termux. https://docs.vulkan.org/refpages/latest/refpages/source/vkCreateDisplayPlaneSurfaceKHR.html

assertion "pCreateInfo->size > 0" failed

I can confirm that this only happens with Turnip (mesa-vulkan-icd-freedreno) and not with other kinds of Vulkan drivers, because removing mesa-vulkan-icd-freedreno and installing mesa-vulkan-icd-swrast instead makes that error go away.

It seems like Turnip is not ready for mpv --vo=gpu-next --gpu-context=x11vk --vf=hflip yet, so I will leave this as draft.

@robertkirkman robertkirkman marked this pull request as draft January 9, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants