jitsi / jitsi-videobridge

Jitsi Videobridge is a WebRTC compatible video router or SFU that lets build highly scalable video conferencing infrastructure (i.e., up to hundreds of conferences per server).
https://jitsi.org/jitsi-videobridge
Apache License 2.0
2.9k stars 989 forks source link

Jitsi Videobridge with Ejabberd on Raspberry PI 3 #458

Open ttoine opened 7 years ago

ttoine commented 7 years ago

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?

jitsi-developers commented 7 years ago

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

ttoine commented 7 years ago

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.

bgrozev commented 7 years ago

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.

damencho commented 7 years ago

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

ttoine commented 7 years ago

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?

dwilson6 commented 7 years ago

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

ttoine commented 7 years ago

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?

gpolitis commented 7 years ago

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

Josue-T commented 4 years ago

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.

bbaldino commented 4 years ago

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.

Josue-T commented 4 years ago

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.

JonathanLennox commented 4 years ago

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.

Jonathan-GC commented 4 years ago

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

damencho commented 4 years ago

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

Josue-T commented 4 years ago

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 commented 4 years ago

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.

bgrozev commented 4 years ago

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

Josue-T commented 4 years ago

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"
bgrozev commented 4 years ago

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.