Can't get h/w video acceleration on rpi4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Expired
|
High
|
Unassigned | ||
linux-raspi (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi, we've run into an issue where we can't get h/w video acceleration working on rpi4 on ubuntu core 18 (and 20).
Our snap is using the following stack:
Qt 5 eglfs + gstreamer + mesa.
Raspberry's config txt has: dt_overlay=
I've enabled all video/opengl related interfaces:
- opengl
- hardware-observe
- framebuffer.
Gstreamer can't detect that it has support for h264 h/w decoding using v4l2 plugin. The very same snap unpacked on the raspbian and that is running in a pretty same way it is on the core immediately detects that h264 decoding is available (i.e. I unsquashfs it there, set the LD_LIBRARY_PATH, WEBGL_DRIVERS_PATH, and all other environment variables that are returned from `env` command when running snap run --shell my_snap).
Because of that Qt falls back to the GStreamer pipeline with s/w decoder (avdec) and outputs like 0.5 frames per second (I am not sure if OpenGL actually works with h/w acceleration because even then it's so slow).
Running on core 20 did not help - I tried running it in devmode as well without any differences.
Raspbian, where it works, has 5.5 version of Linux kernel, I did try the beta version of core 20 which had 5.4 kernel version but it made no difference.
lsmod on raspbian shows some extra modules related to vc4 not present on the core (not sure how relevant they are though):
- v4l2_mem2mem
- bcm2835_codec
Changed in snapd: | |
importance: | Undecided → High |
Changed in linux-raspi (Ubuntu): | |
status: | New → Invalid |
while v4l2_mem2mem is a rather old module from the mainline kernel (and is shiped in our kernels, bcm2835_codec is pi4 specific and should essentially provide access to the decoder, this seems to be missing in our kernel ...