jitsi-videobridge icon indicating copy to clipboard operation
jitsi-videobridge copied to clipboard

Jitsi Videobridge with Ejabberd on Raspberry PI 3

Open ttoine opened this issue 7 years ago • 19 comments

I followed the instruction to configure Ejabberd in order to add Jitsi Videobridge on a Raspberry PI 3 with Raspbian.

However, I realised afterward that there is no ARM version in your Debian stable repository. Is it possible to build it, and then to run it, on this setup?

ttoine avatar Apr 29 '17 20:04 ttoine

On 29/04/2017 15:53, Antoine THOMAS wrote:

I followed the instruction to configure Ejabberd in order to add Jitsi Videobridge on a Raspberry PI 3 with Raspbian.

However, I realised afterward that there is no ARM version in your Debian stable repository. Is it possible to build it, and then to run it, on this setup?

There aren't any packages, but the java code should run without any modification. There will be missing features unless you also compile the native libraries (SCTP, some statistics).

There are a couple other threads on the list about this.

Boris

jitsi-developers avatar Apr 29 '17 23:04 jitsi-developers

Thanks for the answer. In the doc, I see that I can run it with Maven. Is there a way to build it and run it as a service on system startup?

Also, that would be awesome if you could create an ARM package for Debian/Ubuntu. Should I open an other issue for that.

ttoine avatar May 02 '17 08:05 ttoine

I can't think of an automated way to run it as a service, apart from debian packages. Perhaps you can grab one of the linux packages and "dpkg -i" it (after installing dependencies manually)? No idea if this will work. @damencho any thoughts?

As for creating and maintaining an ARM package -- I don't think this is on our roadmap, and we likely won't have the resources for it.

bgrozev avatar May 02 '17 14:05 bgrozev

Yep, maybe if you manage to force installing the jvb package will work, if that doesn't work you can just reuse the startup script: https://github.com/jitsi/jitsi-videobridge/blob/master/resources/install/debian/init.d

damencho avatar May 02 '17 15:05 damencho

I am able to run JVB with Maven. I now have two questions.

  1. I am running my Raspberry PI 3 on a local network, so I don't have a domain. Both Ejabberd and JVB are on the device. This is my setup:
HOST="localhost"
DOMAIN="none"
PORT="5275" (as explained here: https://jitsi.org/Projects/JitsiVideobridge)
SECRET="xxxxxxxxxxx"
JVB_HOME="path to the JVB clone."

Is this correct? Should I keep DOMAIN to "none"?

  1. How do I use JVB once launched? I tried to connect from a laptop on the network to the ip address of the PI, but there is already an Apache server running for another service (the camera webcontrol). Should I stop Apache first? or set a different port to JVB?

Once this is running, my plan is to write a howto. would you be interested fot the Jitsy doc?

ttoine avatar May 03 '17 10:05 ttoine

The domain here is the xmpp domain so it doesn't need to be a real domain as long as you have certs for that domain (assuming you are using TLS for your BOSH connection).

As for running the videobridge on a raspberry pi. I have been able to do it (based on some initial work by https://github.com/gamvrosi). Below are links to the changes needed to build for/on arm. I meant to submit PRs for them but haven't gotten around to it. My branches are a pretty old version of the videobridge/libjitsi/jicofo and have some other changes so I would recommend cherry-picking the arm related commits into your own fork.

Here's a basic summary of the changes needed (encompassed by the diffs linked below).

  1. add arm maven build targets for libjitsi, jitsi-videobridge, and jicofo
  2. add run scripts for arm (jvb.sh, jicofo.sh)
  3. build native libraries for arm (libhwaddressretriever.so in jicofo, libjnsctp.so in libjitsi, and libhwaddressretriever.so and libsigar-arm-linux.so for jitsi-videobridge)

Another learning is that the oracle jre for the pi is a lot more efficient than the open jdk jre version. With the open jdk version I was able to get ~3 participants before the pi was about maxed and with the oracle version I was able to get about 15 participants before it was about maxed out.

https://github.com/pstros/libjitsi/compare/integration...pstros:arm https://github.com/pstros/jitsi-videobridge/compare/integration...pstros:arm https://github.com/pstros/jicofo/compare/integration...pstros:arm

dwilson6 avatar May 03 '17 18:05 dwilson6

So maybe it is better to stop spending time on trying to run it on ARM / Raspberry PI, and go with some x86, Debian Jessie and the package. It would save a lot of time, right?

ttoine avatar May 04 '17 09:05 ttoine

@dwilson6 nice writeup and good to know that it's actually possible to run the JVB on a pi!

gpolitis avatar May 04 '17 16:05 gpolitis

Hello,

I did some research about that:

Sigar library was removed here, so won't need it any more. The source code of the libhwaddressretriever.so is available here. The information to build the libjnsctp.so file is available here.

Josue-T avatar Dec 27 '19 13:12 Josue-T

I think we're also not using libhwaddressretriever anymore, and even libjnsctp is now handled by jitsi-sctp. It's on the todo list to revisit the jvb build soon, as it should be able to be simplified quite a bit since we no longer directly rely on these native libs.

bbaldino avatar Dec 27 '19 17:12 bbaldino

It's on the todo list to revisit the jvb build soon

Maybe it could be good to implement in the same time ARMv7 support.

Josue-T avatar Dec 27 '19 19:12 Josue-T

Maybe it could be good to implement in the same time ARMv7 support.

The goal is that JVB proper will be pure Java, i.e. no specific CPU support will be necessary at all.

Specific CPU support is still needed or helpful in some of the dependencies; https://github.com/jitsi/jitsi-sctp, as mentioned, is needed, and also for performance adding an arm library to https://github.com/jitsi/jitsi-srtp will be very helpful. PRs on those projects are welcome.

JonathanLennox avatar Dec 30 '19 15:12 JonathanLennox

hello good morning I want to install jitsi on a raspberry pi 3, but I have problems to do it the operating system is debian linux ARM

Jonathan-GC avatar Mar 17 '20 03:03 Jonathan-GC

Probably will work with latest from unstable, but Pi will not manage to handle any load and will not work, even the memory will not be enough ...

damencho avatar Mar 17 '20 14:03 damencho

Probably will work with latest from unstable, but Pi will not manage to handle any load and will not work, even the memory will not be enough ...

Hello, thanks, I've try now with the unstable version and I've this error:

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

As I see that this library is available in the package openjdk-11-jre-headless maybe we just need to specify the path to this library.

Josue-T avatar Mar 20 '20 20:03 Josue-T

Probably will work with latest from unstable, but Pi will not manage to handle any load and will not work, even the memory will not be enough ...

Hello, thanks, I've try now with the unstable version and I've this error:

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

As I see that this library is available in the package openjdk-11-jre-headless maybe we just need to specify the path to this library.

Well, I found the issue, it was due to a chroot.

Now I've this error : Could not reserve enough space for 3145728KB object heap, but I've only 2Go of RAM. So it's probably not possible to run videobridge on this device.

Josue-T avatar Mar 20 '20 21:03 Josue-T

You can set VIDEOBRIDGE_MAX_MEMORY=1024m in /etc/jitsi/videobridge/config

bgrozev avatar Mar 22 '20 17:03 bgrozev

You can set VIDEOBRIDGE_MAX_MEMORY=1024m in /etc/jitsi/videobridge/config

Thanks for the answer but it change nothing I still have the last error. For info I have this config file:

# Jitsi Videobridge settings

# sets the XMPP domain (default: none)
JVB_HOSTNAME=mydomain.tld

# sets the hostname of the XMPP server (default: domain if set, localhost otherwise)
JVB_HOST=

# sets the port of the XMPP server (default: 5275)
JVB_PORT=the_port

# sets the shared secret used to authenticate to the XMPP server
JVB_SECRET=the_pwd

# extra options to pass to the JVB daemon
JVB_OPTS="--apis=,"

VIDEOBRIDGE_MAX_MEMORY=1024m

# adds java system props that are passed to jvb (default are for home and logging config file)
JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties"

Josue-T avatar Mar 22 '20 21:03 Josue-T

Perhaps it doesn't get passed to java as I expect. See if hard-coding it in /usr/share/jitsi-vidobridge/jvb.sh (the -Xmx param on the last line) helps.

Edit: adding to config works for me.

bgrozev avatar Mar 23 '20 15:03 bgrozev