Florian Wesch

info-beamer pi 0.8.3 released

Posted Mar 05 2015 by Florian Wesch

info-beamer 0.8.3 adds improvements to JPEG loading speed and prevents screen tearing during video playback.

Faster JPEG loading

info-beamer now uses libjpeg-turbo to load JPEG files. This will result in faster loading times. On the Raspberry Pi 2 it will even utilize the ARM Neon features. During testing the previous version of info-beamer was able to load a FullHD JPEG of 660kb size around 5.4 times per second. info-beamer 0.8.3 can load the same image 7.8 times per second. So that's a solid speedup.

Double buffered video decoding

During certain FullHD videos, screen tearing could happen. The reason for that was that the hardware decoder was rendering directly into the texture buffer the OpenGL subsystem was using to render the video. The effect of that can be seen in the following image (taken from wikipedia):

To prevent this from happening, info-beamer now uses two buffers per video. It decodes the video into one of them while rendering the other. Once a video frame is fully decoded it switches between those buffers (obviouly waiting for the render buffer to be rendered). While this fixes the problem it also means that video playback now uses more GPU memory since it has to allocate those two buffers. For that reason the recommended GPU memory size was increased from 128MB to 192MB. You can change this setting in /boot/config.txt (look for gpu_mem).

If you don't want double buffering for any reason, you can disable it using INFOBEAMER_NO_VIDEO_DOUBLEBUFFER=1.

On top of that I fixed a resource leak that occured during video playback. While the leak itself was small, those lost allocation might add up when running lots of videos.

60fps? 30fps?

Previously info-beamer always used the maximum refresh rate of the connected screen. Usually that's 60Hz. When you try do build visualizations it might not always be possible to archive a solid 60 frame per second output at all times. Such minor hickups might be visible, especially when you have some element in your animation that's constantly moving (like running text for example). The human eye is just too good at predicting movement.

Now you have the option to run info-beamer at lower framerates. This might help you to archive a constant framerate. The new INFOBEAMER_SWAP_INTERVAL variable sets you control the framerate. Setting it to 0 will make info-beamer ignore all frame rate limits and it will render as fast as possible. Usually this makes no sense except for maybe benchmarking. The value 1 is the default value. It will make info-beamer wait for one screen refresh before switching the current output. Setting it to higher values will make info-beamer wait for more screen refreshs. So for example setting it to 2 will wait for two screen refreshs so you'll probably get 30fps if you're connected to a 60Hz screen.

Stuck detection

In the recent info-beamer version you have been able to freeze info-beamer completely by having an endless loop in your Lua code. The hardware watchdog feature of info-beamer can catch this, but it would result in a reboot of your Pi.

Now info-beamer will have another watchdog running at all times. Like in a train where the operator has to press a button at a regular interval to confirm that there's still someone awake to control the train, info-beamer now regularly has to reset a countdown to prevent it from triggering.

When the countdown triggers (after 5 seconds), which might happen if you have an endless loop in your lua code, info-beamer will try to get a traceback. After that info-beamer will terminate with a error.

Async autoloading

Since info-beamer 0.8.2 images are now loaded asynchronous. The new util.auto_loader now fully supports this. When you use the auto_loader it provides all resources (as it previously did) when you first invoke it. Since images and videos are not instantly available it will provide a dummy transparent 1x1 image for those resources instead. Once a resource has been loaded in the background info-beamer will swap the placeholder resouce with the loaded resource.

It now also supports atomically replacing async loaded resources. When you, for example, replace an image file, info-beamer will async load it in the background. Once it is fully loaded info-beamer will swap the resource variable.

You have to be careful to actually use atomic operations on the filesystem level to make it work. You have to copy or rename the file over the existing file. Removing the old file and then moving in the new file will force the auto_loader to unload the resource.

userlib

info-beamer provides a userlib.lua module that's embedded in the info-beamer binary. The userlib provides all functions that start with util., so you probably used it in the past. You can now easily have a look at it if you want to learn more about how info-beamer works under the hood. You might even extend it and have your own userlib.lua in your node directory. Be sure to read the comments in userlib.lua if you want to do that.

Extracting userlib.lua uses a new command line switch (-d). By default it outputs the content of the file to stdout, so you should probably pipe it into a file:

pi@raspberrypi:~# ./info-beamer -d userlib.lua > userlib.lua

Other small improvements

You can now exit info-beamer by pressing ESC while the terminal running info-beamer has focus. This hopefully helps new users that try info-beamer while running X and suddely have no obvious way to exit info-beamer.

Included a new pretty printer that produces a slightly more readable output. Try it by calling pp(_G) somewhere in your node code.

The bitop module is now available.

Fixed a crash bug that occured when calling node.client_write with no arguments.

Reorganized the sandboxing so the Lua environment uses less memory by default.

Update now!

Give the new version a try. I'd love to get feedback, so get in contact.


Read more...


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 RSS feed.


Share this post:

Share using Twitter


Questions or comments?
Get in contact!