Run multiple instance of Jibri on Docker

Hi guys,
Please can you help with this?, till now i am not able to run multiple instance of Jibri on my Docker installation.
Actually, when the second room wants to record the session i get an error that all recorders are busy.

I have Ubuntu 18.04.

In jibri instance.

run this command:
lsmod | grep snd_aloop

snd_aloop              24576  0
snd_pcm                98304  1 snd_aloop
snd                    81920  3 snd_timer,snd_aloop,snd_pcm

I have the file /etc/modprobe.d/alsa-loopback.conf
options snd-aloop enable=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 index=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
I created multiple copies of .asoundrc file in /home/jibri, from Loopback1, Loopback2,… Loopback10 files.
I deleted .asoundrc file

but i run the command from host:
docker-compose -f jibri.yml up -d --scale jibri=10
I get the following error:
ERROR: Service 'jibri' depends on service 'jicofo' which is undefined.

Please could your advise. I need to solve this problem ASAP.

Thanks in advance.

comment out depends_on: in jibri.yaml file. This is a check to ensure that jicofo is running before jibri.

To run multiple jibri instances on same machine.

  1. Scale jibri to 2
  2. use docker exec docker-jitsi-meet_jibri_1 sed -i 's/Loopback/1/g' /home/jibri/.asoundrc
  3. docker exec docker-jitsi-meet_jibri_2 sed -i 's/Loopback/2/g' /home/jibri/.asoundrc

hi @metadata,

docker exec docker-jitsi-meet_jibri_2 sed -i 's/Loopback/2/g' /home/jibri/.asoundrc

For the second instance I am getting this error:
Error: No such container: dockerjitsimeet_jibri_2

I think because this container does not exist?, should i use the first container? dockerjitsimeet_jibri_1

Please advise?

hi @metadata,
I think i have running 10 jibri instance.
what i did was repeating the following these steps restarting before the jibri instance.

in file /etc/modprobe.d/alsa-loopback.conf
options snd-aloop enable=1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 index=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
I created multiple copies of .asoundrc file in /home/jibri , from Loopback1, Loopback2,… Loopback10 files.

and i run the command from host:
docker-compose -f jibri.yml up -d --scale jibri=10

comment in jibri.yml:
depend_on: jicofo
network:meet.jitsi

Now it is running 10 jibri, but when in a session I click in start recording, i have the following message:
“recording unavailable” for any session.

logs in jicofo:
in jicofo:
jicofo_1 | Jicofo 2020-07-10 03:42:42.888 SEVERE: [292] org.jitsi.jicofo.recording.jibri.JibriSession.log() Unable to find an available Jibri, can’t start
jicofo_1 | Jicofo 2020-07-10 03:42:42.889 INFO: [292] org.jitsi.jicofo.recording.jibri.JibriRecorder.log() Failed to start a Jibri session, no Jibris available

Any idea? please could you help me ASAP?

thanks

  1. check that the jibri,jicofo, prosody(complete setup) are running on same network. I’m using docker swarm and my config is like :
       environement:
             
            #depends_on:
            #- jicofo
        networks:
            jitsi:
networks:
    jitsi:
      external: true
  1. check the username/password of jibri is same in ever file i.e in jicofo,web,prosody. check every Jibri related env variable has same value.

  2. first start the jicofo and then jibri. if your jibri config is fine then whenever you start the jibri then u will see some logs in jicofo which basically states that jicofo discovered jibri.

  3. docker exec docker-jitsi-meet_jibri_1 sed -i 's/Loopback/1/g' /home/jibri/.asoundrc. Here docker-jitsi-meet_jibri_1 is container name. u have to change the container name as per your config. Also change Loopback/1 to Lookback/2 then 3, 4 and so on

hi @metadata
So, what i did to restart 10 jibri session was to comment in jibri.yml,
networks:
meet.jitsi

that was the only way to start 10 jibri sessions.

when i execute:
docker-compose -f jibri.yml up -d --scale jibri=10

I get this error:
ERROR: Service "jibri" uses an undefined network "meet.jitsi"

in all the configuration files i use meet.jitsi as the only domain, I do not use the external domain. meet.mydomain.com

Please could you advise which domain should i use?

thanks

This is my jibri.yml file and all other files has meet.jitsi network

    version: '3'

    services:
        jibri:
            image: jitsi/jibri:workaround01
            restart: ${RESTART_POLICY}
            volumes:
                - ${CONFIG}/jibri:/config:Z
                - /dev/shm:/dev/shm
            cap_add:
                - SYS_ADMIN
                - NET_BIND_SERVICE
            devices:
                - /dev/snd:/dev/snd
            environment:
                - XMPP_AUTH_DOMAIN
                - XMPP_INTERNAL_MUC_DOMAIN
                - XMPP_RECORDER_DOMAIN
                - XMPP_SERVER
                - XMPP_DOMAIN
                - JIBRI_XMPP_USER
                - JIBRI_XMPP_PASSWORD
                - JIBRI_BREWERY_MUC
                - JIBRI_RECORDER_USER
                - JIBRI_RECORDER_PASSWORD
                - JIBRI_RECORDING_DIR
                - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
                - JIBRI_STRIP_DOMAIN_JID
                - JIBRI_LOGS_DIR
                - DISPLAY=:0
                - TZ
            #depends_on:
            #    - jicofo
            networks:
                meet.jitsi:

@edzela Are you using docker-swarm or docker-compose?

If swarm then file is:

version: '3'

    services:
        jibri:
            image: jitsi/jibri:workaround01
            restart: ${RESTART_POLICY}
            volumes:
                - ${CONFIG}/jibri:/config:Z
                - /dev/shm:/dev/shm
            cap_add:
                - SYS_ADMIN
                - NET_BIND_SERVICE
            devices:
                - /dev/snd:/dev/snd
            environment:
                - XMPP_AUTH_DOMAIN
                - XMPP_INTERNAL_MUC_DOMAIN
                - XMPP_RECORDER_DOMAIN
                - XMPP_SERVER
                - XMPP_DOMAIN
                - JIBRI_XMPP_USER
                - JIBRI_XMPP_PASSWORD
                - JIBRI_BREWERY_MUC
                - JIBRI_RECORDER_USER
                - JIBRI_RECORDER_PASSWORD
                - JIBRI_RECORDING_DIR
                - JIBRI_FINALIZE_RECORDING_SCRIPT_PATH
                - JIBRI_STRIP_DOMAIN_JID
                - JIBRI_LOGS_DIR
                - DISPLAY=:0
                - TZ
            #depends_on:
            #    - jicofo
            networks:
                meet.jitsi:

networks:
    meet.jitsi:
      external: true

try this and let me know. If it didn’t work then remove external:true part and try.

Hi @metadata,
I am using docker-composer.

hi @metadata,
i commented external:true and it Works. thanks!,

What i see is that the log file is the same file for the all the instances of jibri, and the files of each session are saving in the same folder.

It is possible that every instance has its own files and folder?

thanks!

use docker logs container_id for checking the logs. to get the container_id, use command docker ps -a.

Anyone please guide me how to add jibri in my docker swarm setup. I’m getting following message while deploying the stack.

docker stack deploy -c docker-compose.yml jitsi
Ignoring unsupported options: cap_add, devices

and the error from jibri container,

ERROR: Binding /dev/snd is not found. Please check that you run docker-compose with -f jibri.yml.

Any solution?

you can’t use jibri using docker-swarm since swarm doesn’t offer hardware interaction. use docker-compose instead.
this is the reason Ignoring unsupported options: cap_add, devices why your setup is failing.