Jesús Fernández

WebGL streaming in a Raspberry PI Zero W

Published Friday March 24th, 2017
22 Comments on WebGL streaming in a Raspberry PI Zero W
Posted in Dev Loop, Qt Quick 2.0, WebGL | Tags: ,

A week ago I received my Raspberry Pi Zero W to play a bit with some IoT device. The specs of this small device computer are the following:

  • 1GHz, single-core CPU
  • 512MB RAM
  • Mini HDMI and USB On-The-Go ports
  • Micro USB power
  • HAT-compatible 40-pin header
  • Composite video and reset headers
  • CSI camera connector

But the interesting part comes with the connectivity:

  • 802.11 b/g/n wireless LAN
  • Bluetooth 4.1
  • Bluetooth Low Energy (BLE)

And especially from one of the hidden features that allows one to use the device as a headless device and connect using SSH over USB adding the following line to config.txt:
dtoverlay=dwc2
And modifying the file cmdline.txt to add:
modules-load=dwc2,g_ether

remember to create a file called ssh to enable SSH access to your Raspberry Pi. There are plenty tutorials over the Internet showing this! 😀

To build a Qt version for the device you can follow this guide.
In the following screen shot, we can see the calqlatr example running directly on the Raspberry Pi:

clocks_pi_zero

One of the use cases which comes to my mind using this device and this feature is being able to create portable presentations and show them on any computer without the need of installing new software.

presentation_pi_zero

For the presentation, I used the qml-presentation-system (link).

More use cases could be:

  • Application showcase.
  • Custom text editor for taking your notes everywhere.

Please comment if you have other ideas or use cases.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Dev Loop, Qt Quick 2.0, WebGL | Tags: ,

22 comments

ikbel Boulabiar says:

“In the following screen shot, we can see the calqlatr example running directly on the Raspberry Pi

One of the use cases which comes to my mind using this device and this feature is being able to create portable”

Sorry, but where is the WebGL Streaming part in this article ? it seems something between these lines but it’s not clear.
Please modify this article into something we can understand.
In its current status it’s more like a set of links with the main content missing

Jesús Fernández Jesús Fernández says:

Have you read my previous article?
https://blog.qt.io/blog/2017/02/22/qt-quick-webgl-streaming/

Krasi Georgiev says:

That explains it all, maybe a good idea to include this link somewhere in the post.

Jason says:

We’ve replaced thirty normal OpenGL renderer with WebGL. Let’s see if they notice…

Stop taunting, release the patches!

I’m so stoked for this!!

Aleix says:

Cool stuff! o/

Jesús Fernández Jesús Fernández says:

🙂

Alexander says:

Does WebGL rendering require a working OpenGL driver on the server device (in this case the PI Zero)?

Jesús Fernández Jesús Fernández says:

Nope 😀

Alexander says:

Great, but the link is misleading since it explains how to build Qt for RPi with EGLFS.

Btw. were can we find a Qt version that supports WebGL rendering?

Jesús Fernández Jesús Fernández says:

It’s an old tutorial which allows you to build Qt for PI but the hardware does not need to execute GL calls.

The plugin is still under development.

Alexander says:

Sure, but is it publically available as source code so we can try it out and provide feedback?

Jesús Fernández Jesús Fernández says:

I’m working on it.

Petar says:

Nice stuff!
If it worked over multicast it would be viable solution for telecom operators.

Jesús Fernández Jesús Fernández says:

Thank you! 🙂

Can you elaborate a bit more this use case for telecom operators?

Petar says:

Telecom operators who have their own private network use multicast for video streaming (UDP/RTP), and can implement thin client devices where actually device is virtual and running in datacentar and client only does rendering (actually video streaming of the device in datacentar) and sending keys from remote. Doable since latency and bandwith usage (multicast) is much lower than implementing this over HTTP. This does require audio support though to be usable with your implementation.

The other obvious solution that also comes to mind is DMS (digital media signage). WebGL streaming could fit perfectly into that since current implementation are mostly also thin devices with web browsers in kiosk mode showing content from central server.

Jesús Fernández Jesús Fernández says:

Yeah! Sounds possible.

Airport says:

Are there any plans to create typical sites/web-applications based on Qt Quick?
Or the implementation of streaming with the ability to use as a typical site

Jesús Fernández Jesús Fernández says:

It’s not viable to use this as a web application replacement.

Jason says:

Why not?
One reason I came up with was a crash in one client will take down all clients, but I think this can be mitigated with a postmaster (a la postgres) process.

What are the reasons you think it is not viable for web apps?

Jesús Fernández Jesús Fernández says:

The main reason is latency.

Airport says:

Does it make sense to wait for the official port of Qt Quick for Web?

Jesús Fernández Jesús Fernández says:

I think this is not going to happen 😉

Commenting closed.

Get started today with Qt Download now