How to bring fully distributed and secure communication capabilities to embedded products and IOT.
In order to give the opportunity to use Jami in embedded products and IOT, we decided to include Jami in Yocto, the Linux distribution creator. This addition is a huge step for providing secured communications between all kind of devices. This article gives a presentation of Yocto. It also gives the reason why we added Jami in Yocto and i.MX6 and how to use our work.
Yocto project, a simple way to customize your Linux distribution
The Yocto project is a free/libre software that helps to produce custom Linux distributions for multiple platforms. Savoir-faire Linux is member and an active contributor to the Yocto Project Participants.
From a reference distribution named Poky, Yocto gives the freedom to take layers already created but also to make your own. The goal of these layers is to include or customize any features you want in your final distribution. Each layer contains recipes which describe what you want to install in your Linux image.
Bitbake, the building tool of Yocto, will then generate a Linux image ready to be flashed on your embedded device, according to the content of your recipes.
More information at http://yoctoproject.org
Why add Jami in Yocto?
We packaged Jami in Yocto in order to use Jami in any custom distribution and make it easier to add it in your image.
We created a layer to wrap the application and all its dependencies. The created layer provides the graphical application of Jami that includes the backend daemon (https://git.jami.net/savoirfairelinux/ring-daemon) and the multiplatform QT client (https://git.jami.net/savoirfairelinux/jami-client-qt).
To use it, download the layer, add it to your configuration and just append Jami to an image that provides a graphical environment. Then, you will be able to create an account and call any other Jami user, as if you were on your standard Linux distribution.
The layer is available at https://github.com/savoirfairelinux/meta-jami
Jami on i.MX6
Including Jami in Yocto is a huge step to provide Jami on all types of devices. But this Yocto layer is only usable for x86 architectures. It is a step towards the embedded world, but it is not proving that Jami can run on an embedded board. That is why we have created a layer to run Jami on i.MX6.
Why add Jami to an embedded board?
Running Jami on an embedded board such as the i.MX6 opens the opportunity to run it on almost every embedded board. It also creates the possibility to have secure communication and private life protection on all kinds of devices. In today’s world and more tomorrow, lots of objects are connected to the Internet and can communicate. The security of these communications is very important for our private life. Jami therefore fits into this objective with its serverless, distributed and secure end-to-end encrypted communications.
A layer system to run Jami on any plateform
Yocto is organized on a layer system, this gives the freedom to take an existing layer and customize it by creating our own one on top of it. Therefore, the Jami i.MX6 layer is based on the previously created Jami layer (https://github.com/savoirfairelinux/meta-jami).
The main purpose of our work was to port Jami on a Toradex Apalis i.MX6 board without any significant source code modifications. Consequently, we created a layer that provides a machine, a distro and an image which includes Jami to run it on the Apalis i.MX6. The only source code modifications that we made was to use the hardware encoders and decoders of the i.MX6
Thus, we created two layers, the first one (meta-jami-imx : https://github.com/savoirfairelinux/meta-jami-imx) which includes Jami for i.MX6, that you can add to your i.MX6 custom image. And a second one (meta-jami-imx-toradex : https://github.com/savoirfairelinux/meta-jami-imx-toradex) that you just have to compile if you want to run Jami on the Toradex Apalis i.MX6.
Our work has just been tested with a Toradex kernel based on a Freescale one. But you are free to use a mainline kernel, and it will not lead to a compiling issue.
How it works?
In order to perform a call, we need to use the hardware encoders and decoders present on the board instead of software ones. Without hardware acceleration, all video encoding and decoding operations are executed on the CPU. Video compression and decompression are complex algorithms that generally can not be executed in real time on CPU cores. Therefore, using software codecs would make Jami unusable.
Jami is based on FFmpeg, and it doesn’t support i.MX hardware codecs. That is why, we applied some patches to FFmpeg to include these codecs (https://github.com/savoirfairelinux/FFmpeg/tree/sfl/master). We added h264 encoder and decoder for sending and receiving video, as well as MJPEG decoder to support some camera output format. In order to add them we based our work on the community API libimxvpuapi that provides the control of the i.MX VPUs (https://github.com/Freescale/libimxvpuapi). In addition, the only Jami source code modifications that we made, is to use these hardware encoders and decoders of the i.MX6.
To sum up, you can pick the layers you want for your personal purpose. To run Jami on x86, add meta-jami to your project ; to run Jami on an i.MX6, add meta-jami-imx6 to your Yocto environment. Finally, a straightforward test would be to take meta-jami-imx-toradex and its dependencies, build the image provided, and you can enjoy Jami on the Toradex Apalis i.MX6.
Feel free to install and try it out by yourself! We look forward to receiving your feedback.
By Kévin L'hôpital