info-beamer pi 0.8 releasedPosted Oct 19 2014 by Florian Wesch
I'm proud to annouce the release of info-beamer pi release 0.8. It's been under development for a few month now and will enable you do get more out of your Raspberry. Faster rendering, reduced memory usage and new debugging abilities.
The new release changes how the root node is rendered to the screen. Previously it was scaled into the available screen space as an OpenGL texture. Now it's rendered directly on the screen by using Raspberry PI features. This makes rendering your visualizations
This change alone would be worth a new release. But there's more.
More flexible placement of the root node
As a direct result of the previous change it's now possible to position the root node to any location on the screen. Or scaling it. Or both. This is very useful if you use info-beamer to send a signal to HDMI and use a device that only grabs a subregion of the output to display on (for example) a video wall. Previously you had to do this transformation yourself. Now it's all done for you in a way that's going to be faster.
This feature is also useful if you develop a visualization on the PI itself, since you can now move then info-beamer output in (for example) the top right corner so you can still see your text editor to change node code. Moving the output to the top right corner works like this:
root@raspberrypi:~ # export INFOBEAMER_TARGET_X=70% root@raspberrypi:~ # export INFOBEAMER_TARGET_W=30% root@raspberrypi:~ # export INFOBEAMER_TARGET_H=30% root@raspberrypi:~ # export INFOBEAMER_TARGET_L=1 root@raspberrypi:~ # export INFOBEAMER_TRANSPARENT=1 root@raspberrypi:~ # info-beamer your_root_node
Instead of specifying percentages you can also use absolute pixel values. Just run info-beamer without any arguments to see all available options.
INFOBEAMER_TRANSPARENT=1 prevents info-beamer from rendering a black background. Use this feature if you want to overlay info-beamer output above other programs like for example video playback by omxplayer.
INFOBEAMER_TARGET_L specifies the layer info-beamer renders to. Different programs that use hardware acceleration on the PI can draw into different layers that are then drawn on the screen by hardware. Normally info-beamer uses layer 0. Setting the layer to 1 or above renders the info-beamer in front of other programs. This feature is pretty useful when combining info-beamer output with other tools that render to the screen.
Optimized memory handling when rendering child nodes
When rendering child nodes info-beamer automatically caches framebuffer objects that are used by OpenGL.
Each time you render a child node, a framebuffer object combined with a texture is used to render into. Allocating those framebuffer objects is expensive. So info-beamer uses a trick to gain more speed:
The idea is that you usually draw the same child node multiple times for a longer period of time. Each time you call resource.render_child you get a new image object that you usually just draw somewhere on the screen. You usually don't save those objects but get a new one each frame. Since a framebuffer/texture will probably be reused in the next frame, info-beamer puts them into a recycler. Each time resource.render_child is called again it first checks if there's already an unused framebuffer/texture available that has the same size. If so, info-beamer uses it instead of allocating a new one.
In previous versions unused framebuffers weren't release fast enough, so they might take up too much memory. In this version, old framebuffers get discarded when unused for 60 frames (at full framerate that's 1 second). This will hopefully allow you to display more child nodes without running into memory problems.
New debugging information
There's a new way to get debugging information out of a running info-beamer: Send a USR1 signal to the running process. The easiest way is probably
root@raspberrypi:~ # pkill -USR1 info-beamer
In the output of the running info-beamer you'll see output that describes currently allocated framebuffer objects as well as information about loaded fonts. There will probably be more output in later versions that help you get an even better insight on how system resources are used. Stay tuned.
Create snapshots of subregions
resource.create_snapshot now takes optional arguments that allow you to capture a subregion of the current output as a new image. Previously it was only possible to snapshot the complete screen. A demonstration on how to use this new capability is available in the Magifying Glass Demo
Each frame a subregion of the background is snapshotted and then rendered again using a shader.
TCP connections can now be noise free
If you wanted 2-way communication with your node using TCP you had to filter out messages create by info-beamer itself. While they were useful to get debugging information while developing node code they made it difficult to set up a reliable 2-way channel. Now it's possible and there's even more: You can now target connected clients and handle them differently thanks to the new sys.client_write function.
Here's how to use it: In your node register a handler for the input event. First create a new directory example and create the following node.lua file:
gl.setup(100, 100) node.event("input", function(line, client) print("new input from " .. client .. ": " .. line) sys.client_write(client, "I received your message") end)
Start info-beamer for this node and then use telnet to connect to the running info-beamer using TCP:
root@raspberrypi:~ # telnet localhost 4444 Connected to 127.0.0.1. Escape character is '^]'. Info Beamer PI 0.8.0 (https://info-beamer.com) [pid 3991/uptime 2]. *help to get help. *raw/example ok! hello node! I received your message
You can save references to clients and send them messages outside of the event handler later. Or you can use the connect and disconnect event to keep track of connected clients.
The example node parrot in your info-beamer distribution file is an example on how to use these features.
TCP *help command
When you connect to info-beamer-pi using TCP there's now a help command then describes available commands:
root@raspberrypi:~ # telnet localhost 4444 Connected to 127.0.0.1. Escape character is '^]'. Info Beamer PI 0.8.0 (https://info-beamer.com) [pid 2129/uptime 4]. *help to get help. *help info-beamer tcp help ----------------------------------- *help - this help *query/*ping - test connection *query/*uptime - get uptime *query/*version - get version *query/*fps - get framerate of top level node *query/*resources - get user-/system time & memory *query/*mem/<node_path> - get node mem (kb) used *query/*fps/<node_path> - get node fps *raw/<node_path> - connect to node (raw mode) <node_path> - connect to node
The query command can be used to get information about nodes. You can used the small library ibquery.py inside the info-beamer-pi contrib directory to easily access these values from Python.
Recent blog postsEdge computing and digital signage
info-beamer hosted 9 released
info-beamer hosted on the CM3-PANEL
info-beamer hosted CEC support
More blog posts...
info-beamer.com offers the most advanced digital signage platform for the Raspberry Pi. Fully hosted, programmable and easy to use. Learn more...
Get started for free!
Trying out the best digital signage solution for the Raspberry Pi is totally free: Use one device and 1GB of storage completely free of charge. No credit card required.
Follow @infobeamer on twitter to get notified of new blog posts and other related info-beamer news. It's very low traffic so just give it a try.
You can also subscribe to the RSS feed.
Share this post:
Questions or comments?
Get in contact!