Raspberry Pi 5 release, info-beamer information and development diary

Revived an old idea: It would be nice to augment the normal info-beamer content (videos/images) with real plugins, implemented as external processes. Now that I’ve worked quite a bit with KMS/DRM, this suddenly seems rather easy to implement. So I did a first prototype. The idea is that info-beamer generates a texture, starts and external program and then allows an that program to modify the shared texture. If that external process is a browser, you suddenly have browser content right in info-beamer itself. The main problem was getting CEF working in a way that it renders into a buffer that happens to be shared with the main info-beamer process. ChatGPT was useful navigating that minefield. Behold:

From Lua this is rather easy to embed:

local b = resource.create_content_process(
    "browser", 800, 800, "https://info-beamer.com"
) 

"browser" is the name of the binary using CEF to render web pages. 800x800 is the texture size and the url is passed directly to the browser as command line argument. The returned value b is an info-beamer object that behaves basically like an image. So you can rotate or otherwise modify its position and draw it together with other content:

b:draw(0, 0, WIDTH, HEIGHT, 0.8)

Yes: it can also be transparent. The embedding of browser content is zero-copy, so there’s no overhead bringing such external data into the main info-beamer process. The rendering within CEF is currently not hardware accelerated though.

The plugin interface is incredibly simple: Create a program that parses WIDTH, HEIGHT from the process environment, mmap width x height x 4 (RGBA BGRA) bytes of file descriptor 3, provided to you by info-beamer, and then directly modify the mmapped data (preferably using sync ioctl to avoid tearing).

This all won’t make it into the next OS release, but I’m certainly looking at how this can be implemented fully production ready in the future. Actually it was easier that expected. So it will be included :slight_smile:

1 Like