I have the need to use 2 frame buffer. I’m trying to run a mp4 in the background and then display a progress bar or some .pngs in the foreground. Since the imx8 does not use /dev/fbx. How do I work with multiple frame buffers
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
The i.MX 8 series, including the Verdin iMX8M Plus, uses the DRM/KMS (Direct Rendering Manager/Kernel Mode Setting) subsystem instead of the older fbdev subsystem. This means that traditional /dev/fbX
framebuffers are not used. Instead, you will need to work with DRM/KMS and possibly a compositor like Weston to manage multiple layers and framebuffers.
Here are the steps you can follow to achieve your goal:
-
Use DRM/KMS for Framebuffer Management:
- DRM/KMS allows you to manage multiple framebuffers and layers. You can use the
modetest
utility fromlibdrm
to interact with DRM/KMS and set up your framebuffers.
- DRM/KMS allows you to manage multiple framebuffers and layers. You can use the
-
Weston Compositor:
- Weston is a reference compositor for Wayland, which can handle multiple layers and surfaces. You can configure Weston to display your video in the background and overlay other graphics like a progress bar or PNG images in the foreground.
- The configuration for Weston is typically done in the
weston.ini
file located at/etc/xdg/weston/weston.ini
.
-
GStreamer for Video Playback:
- Use GStreamer to play the MP4 video. GStreamer has good support for hardware-accelerated video playback on i.MX 8 series.
- You can use the
waylandsink
plugin to render the video directly to a Wayland surface managed by Weston.
-
Overlaying Graphics:
- For overlaying graphics like a progress bar or PNG images, you can use a toolkit like GTK or Qt, which supports Wayland. These toolkits can create additional surfaces that Weston can composite on top of the video.
Example Configuration
-
Weston Configuration (
weston.ini
):[core] backend=drm-backend.so [output] name=HDMI-A-1 mode=1920x1080 [shell] panel-position=top
-
GStreamer Command for Video Playback:
gst-launch-1.0 filesrc location=your_video.mp4 ! decodebin ! videoconvert ! waylandsink
-
Overlaying Graphics with GTK:
- Create a GTK application that displays your progress bar or PNG images. Ensure that the application uses Wayland as the backend.
Additional Resources
- **
hey @jeffbelz,
The graphical stack we would recommend is to use weston compositor, which is based on the wayland protocol. Here is more information.
For audio, you can look at using ALSA, with our documents here.
-Eric
Still having issues.
What I have:
-
A verdin imx8p running on a Mallow board
-
I have a docker-compose that launches Crank Storyboard and Weston
-
I have a simple sb app that has some text and a an image in the center.
-
When I touch the screen a lua script launches a gst-launch pipline
gst-launch-1.0 filesrc location=/usr/vid/dis.mp4 ! qtdemux ! decodebin ! videoconvert ! videoscale ! videoflip method=clockwise ! waylandsink’ -
The mp4 plays on top of the sb images (ie it blocks it)
I want to do the opposite. I want sb always on top and the MP4s to be on bottom, so the sb images are overlaid on top of the mp4.
I combed through the Weston docs, the gstream docs, and the DRM/KMS docs.
just can’t figure out to change either weston or the gstreamer pipeline to do what I want. As far as I can tell if I can tell gstreamer to use a different plane that sb I could set the zorder. I have discussed this with crank, but they seem to be having a bit of a time with it as well.