Turn a Raspberry Pi, a Webcam and a TV into a video call device

Looks like the BalenaDash has been undergoing a lot of changes, and I had a very difficult time trying to catch up T T.

I was thrilled when I got the device running a few weeks ago, used it for a few video meetings. But it didn’t work this morning when I set it up at another location. I went home, re-read the blog, follow every steps again, tried to make another disk image and add it as another device, sad to find out things weren’t working anymore. Half of the screen was blank, the microphone wasn’t working, then the camera went off too. Long story short, the project seems beyond repair now! Even the Chrome browser for initial setup couldn’t be seen when CONFIG_MODE is set to 1. I tried to re-use the old image but it also didn’t work…

Need a shoulder to cry on :(((( I thought I was able to help a few isolated people…

Have also tried this. No luck, same results.

Hi @stevie,

Can you tell us what kind of device you’re using? Did you deploy using Deploy with balena or another way?

John

Yes, I have tried using the Deploy with balena button directly from the blog page. It’s an RPi4 I am using.

Things seemed to have worked for this project when the “photo” block was there. Now that the fbcp block is used, the microphone failed to load, the camera has returned this morning (it went off yesterday), but the display is only occupying half of the screen.

Hey Stevie

You mention

I was thrilled when I got the device running a few weeks ago, used it for a few video meetings. But it didn’t work this morning when I set it up at another location

Can you please confirm the balenaOS versions on both of these devices?

Even the Chrome browser for initial setup couldn’t be seen when CONFIG_MODE is set to 1.

Can you try setting KIOSK=0 and SHOW_CURSOR=1

I tried to re-use the old image but it also didn’t work…

What do you mean by this? Are you using a previously downloaded balenaOS image and still seeing those issues?

Also are you able to clone the balenaDash repo, checkout to the last version and use balenaCLI to push the project and see if the issues persist?

Thanks

Seems to be a stretch for my skill level, but thanks for your advice. Let me work on it and get back to you. Thank you so much.

Thanks.

kindly confirm the balenaOS versions running on the devices please.

This one, downloaded from Balena’s page while I was struggling, didn’t boot up the device at all:
balena-cloud-balena-dash-raspberrypi4-64-2.58.6+rev1-dev-v11.14.0

This one, if I remember it correctly, was downloaded from Git repository, and had worked quite well for a few weeks until I took the device to another place:
balena-cloud-balena-dash-raspberrypi4-64-2.56.0+rev1-dev-v11.14.0

And thanks a million pointing me to the KIOSK and SHOW_CURSOR values. The microphone has been found, and I can have access to the Chrome browser settings again.

Still, the screen is half blanked. How to get around?

This one, if I remember it correctly, was downloaded from Git repository

Sorry, do you mean you downloaded the os image from git? I’m not sure I follow

the screen is half blanked. How to get around?

Can you try setting WINDOW_SIZE to the screen size you wish. The format is <width>,<height> e.g 800,600 if it is 800x600.

You can also try disabling the GPU by setting ENABLE_GPU=0 and see if it improves the performance?

Thanks

No, you are right. I probably didn’t get the image from Git. It was something else.

The screen is not responding to the WINDOW_SIZE values.

And there seem to be some conflicting config settings. The Chrome browser loads 3 webpages on reboot:

  • The Jitsi Meeting room, which is what the project wants to see.
  • One with the web address 0.0.0.0
  • One with another web address 0.0.2.208
    It also pops up message at upper right corner saying “Chromium didn’t shutdown properly”.

And the device CPU is constantly close to 98% usage. I should be worried, shoudn’t I?

Hi there,

I just tried to reproduce your issues on my local RPi3 device here with a USB webcam and was unable to do so. Can you confirm where you’ve set the WINDOW_SIZE variable?

I’d tried on Device Variables at first, and it didn’t work, and I tried again on Environmental Variables, of course, it didn’t work either.

Then I run the Jitsi App on RPi OS, looks like the App was running quite well on its own without Chromium. Could it be something that’s conflicting between Chrome and Jitsi’s script?

The CPU usage is so high that I’m beginning to take a different approach to this Video Call project. May be moving on to RealVCN. But really appreciate for all the comments from everyone here. I got to know more about BalenaDash and it’s a good tool in many ways.

Hi Stevie,

Just to let you know, we’ve found that in recent OS versions the CPU on the Pi isn’t automatically set for the most performance. In essence the CPU can be set into various modes, balancing performance and power consumption, much like a laptop or phone does. This project was born out of a need at the beginning of the Covid-19 pandemic to try and provide a video call solution, on low-cost hardware, to try and help isolated individuals. It was always going to be stretch to get it to run (at all) on a Raspberry Pi, even a 4b, since encoding your camera feed and decoding the other call participant’s feed - that’s hard work! We tested and tested the project, and really deliberated not putting it on the blog at all - but ultimately it did function and we felt could provide benefit to those people with no other method of seeing loved ones.

The other angle to consider here, is that there are quite a lot of moving parts, some of which we have no control over. Should Jitsi make changes to their jitsi.meet platform that stop this project performing at all - there is nothing we will be able to do.

For anyone else with this issue: we have found that the CPU scaling governor now needs to be set in projects that need all the performance the Pi can give. The CPU will still run at ~100%, because the video encoding/decoding is always going to be hard for it.
To set the governor you can run the following:

 echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

This will run the CPU in performance mode: https://wiki.archlinux.org/index.php/CPU_frequency_scaling

Lastly, another thing to remember is that the Pi will throttle performance if the CPU (and GPU…etc) reaches a certain temperature, to save the hardware. From memory this is ~85 Celsius. Therefore if your Pi is in a closed case (such as the official Pi case) it will run hotter, and throttle. Adding a heatsink may help, or putting the Pi into a specialised cooling case will help considerably.

For brave souls, there is also lots of information online about overclocking your Pi4. There is obvious risk here - so proceed with caution. :wink:

Phil

1 Like

Hi Phil,

I’ve just had a 15min Jitsi Meeting. The Pi’s running on the latest RPi OS. The CPU temperature was in the range of 58 to 61 degrees celsius. The Pi case I’m using is with a built-in little fan and the Pi board came with 3 heat sinks which I’ve got them all in their places. I’ll continue to explore and hopefully, nothing will get burnt^^

This project is a beginning for me. I certainly will stay tuned to find out more about Balena master classes. Thanks for all the tips and guides. Really appreciate it!

Stevie

Hi all,
First, I would really thank all who developped this amazing project and I hope more people will be connected with your idea.
I just received a pi 4 B today and went through all the steps you explained in the tutorial.
However, I am stuck when I need to access the browser setting on chromium. I set the CONFIG_MODE to 1 but I do not see any difference on the TV screen. It seams that the parameter is not took in account by the pi despite a reboot.
Do you have any solution for that ?
Thanks in advance and again, congratulation for the amazing work you did guys !

Hi Paul and thanks for the kind words!

Just to clarify, how exactly did you set that environment variable? If you can paste a screenshot to where it’s been set, we may be able to help diagnose what could have gone wrong for you.

Hi Matthew,
Thanks for the quick reply. Here is attached the screenshot of the parameter set in balena cloud.

However, I finally managed to access to the parameter tab by pressing F1 on the keyboard !

Then, instead of mentioning the CONFIG_MODE parameter in your tutorial, I would simply recommand to press the F1 key.

Finally, I have another advice for other user regarding the jitsy adress : I recommand to add the code #config.startWithVideoMuted=false to the jitsy URL meeting to make sure that the webcam is set to ON when joining the meeting. Example of a jitsy meeting : https://meet.jit.si/test1234#config.startWithVideoMuted=false

Now everything work for me and I can’t wait to see the sparks in the eyes of my grandparents when they’ll be able to see us on their tv screen simply by pressing the switch on button of the pi !

Thanks again for your very good work guys and I’ll try to be helpfull for people who might have issues setting up the pi :slight_smile: (I have a Pi 4B 4GB Ram with a fan case ordered on Amazon).

Best,

Paul

1 Like

Hey,

Just to give a quick update, I received today the auckey 1080p webcam I ordered also from amazon. Unfortunately, its HD Resolution is probably too much for the pie which results in lag…
I tested yesterday with a Microsoft 3000 720p and it seamed to work pretty well so maybe I’ll consider buying a new one…

You could try (if you haven’t already), enabling “performance” mode on the Pi as per Phil’s comment above, though if you are trying to push the device past its capability it will scale the CPU back down automatically to prevent overheating.

Hi,
Thanks for the advice. However, since I am a total beginner, I do not really know where to copy/paste this code :confused:.
Is it in the terminal in the balena cloud ?
Best,
Paul