Multiple Jibri Instances configuration in Docker

Hi guys,
I am following the instructions to install Jitsi meet on Docker and I don’t understand this section because the file /home/jibri/.asoundrc does not exist.
Please could you advise what to do here?
From https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker:

For using multiple Jibri instances, you have to select different loopback interfaces for each instance manually.

Set interface in file /home/jibri/.asoundrc inside a docker container.

Default the first instance has:

...
slave.pcm "hw:Loopback,0,0"
...
slave.pcm "hw:Loopback,0,1"
...
slave.pcm "hw:Loopback,1,1"
...
slave.pcm "hw:Loopback,1,0"
...

To setup the second instance, run container with changed /home/jibri/.asoundrc :

...
slave.pcm "hw:Loopback_1,0,0"
...
slave.pcm "hw:Loopback_1,0,1"
...
slave.pcm "hw:Loopback_1,1,1"
...
slave.pcm "hw:Loopback_1,1,0"
...

Also you can use numbering id for set loopback interface. The third instance will have .asoundrc that looks like:

...
slave.pcm "hw:2,0,0"
...
slave.pcm "hw:2,0,1"
...
slave.pcm "hw:2,1,1"
...
slave.pcm "hw:2,1,0"
...

It’s needed to reserve a loopback interface for each Jibri instance. A loopback interface can not be shared by multiple instances. Therefore the system should set a unique Loopback interface for each Jibri container.

Jibri learns from the .asoundrc file which interface allocated for itself. Therefore, you have to create and to customize the .asounrc file before the Jibri service starts.

@emrah From where I can register loopback instance in jitsi. I configured the jitsi not with docker but now I registering multiple jibri on a server through docker. When I configure the jibri with “hw:Loopback,0,1” it is working fine. but any change in keyword loopback will stop the jibri to recording. What I need to do for registering multiple jibri instances on one jitsi server.

Any help will be appreciated. thanks in advance

/etc/modprobe.d/alsa-loopback.conf on the host machine

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

On the host

rmmod snd_aloop -f
modprobe snd_aloop

Rename as Loopback_1, Loopback_2

1 Like

Thanks @emrah working with this. you really save my day.

1 Like

Hi emrah,

Sorry i am new on this, Please can you explain a Little bit o provide the steps that I missing?

So, doing this:
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
in
/etc/modprobe.d/alsa-loopback.conf
means 16 instances of jibri?

and what do you mean Rename as Loopback_1 , Loopback_2

I am using Ubuntu 18.04

Please can you give the command that I need to run?.
thanks

These are the loopback interfaces which will be created when the snd-aloop module loaded. There must be at least the number of the Jibri instances.

There is a file /home/jibri/.asoundrc in each Jibri container. This file sets the loopback interface which be used for this Jibri instance. You shouldn’t use the same name multiple times. Therefore you should set a unique Loopback interface for each Jibri instance when it’s created.

I’m using LXC, not Docker… Someone who is more familar with Docker maybe help you.

hi emrah,
I don’t have a folder /home/jibri.
when I follow the instructions above and It was created a folder called: /root/docker-jitsi-meet
I don’t fine any file .asoundrc
Where is the jibri container?
I have contracted a VPS in hosting company.

Hello @edzela,

I don’t know Docker related issues. It seems that Docker config is a bit different

Ok, thanks,
any idea who can help?

@edzela
For Container name type “docker ps”. this will list all your running docker container.

Login to your jibri container with below from your server host

docker exec -it /bin/bash

Change the loopback name ie .asoundrc file. then restart the container with

docker restart

after that It works well

Hi Garima,
Thanks a lot for your help. the file .asoundrc has the following content:

# playback PCM device: using loopback subdevice 0,0
pcm.amix {
  type dmix
  ipc_key 219345
  slave.pcm "hw:Loopback,0,0"
}

# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
  type dsnoop
  ipc_key 219346
  slave.pcm "hw:Loopback,0,1"
}

# duplex device combining our PCM devices defined above
pcm.aduplex {
  type asym
  playback.pcm "amix"
  capture.pcm "asnoop"
}

# ------------------------------------------------------
# for jack alsa_in and alsa_out: looped-back signal at other ends
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}

pcm.cloop {
  type dsnoop
  ipc_key 219348
  slave.pcm "hw:Loopback,1,0"
}

# ------------------------------------------------------
# default device

pcm.!default {
  type plug
  slave.pcm "aduplex"

What I suppose to do, change the name of .asoundrc to Loopback_1 for example for one instance? if I want more than once instance I need to copy .asoundrc the times of instance I want?
I need to change the content of .asoundrc file?
Please advise.

One more thing,
I have a SSL certificate, so I dont want to use Letsencrypt certificate, In /docker-jitsi-meet/web/rootfs/defaults file I see the following:

{{ if .Env.ENABLE_LETSENCRYPT | default "0" | toBool }}
ssl_certificate /etc/letsencrypt/live/{{ .Env.LETSENCRYPT_DOMAIN }}/fullchain.p$
ssl_certificate_key /etc/letsencrypt/live/{{ .Env.LETSENCRYPT_DOMAIN }}/privkey$
{{ else }}
ssl_certificate /config/keys/cert.crt;
ssl_certificate_key /config/keys/cert.key;
{{ end }}

So, where should I copy the SSL certificate files, I cann’t find the /config/keys folder or where should I copy the certificates?.

Please could you advise?

Thanks

You can continue with as default .asoundrc file, If you want to run only one instance.

To launch more than one instance on a server run following docker command

docker-compose -f jibri.yml up -d --scale jibri=2

“2” will run two instance of docker jibri container and change the loopback accordingly like " `Loopback_1, Loopback_2" of each container.

For more than one jibri instance change the .asoundrc file of each docker container.

I don’t have any idea on this, apologies.

Hi Garima,
I created 10 loopback interface inside /home/jibri and change them accordingly

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

I get this message:
ERROR: Service 'jibri' depends on service 'jicofo' which is undefined.

Please could you advise?

Thanks and Regards

Hi @edzela,

Did you setup the prosody or jicofo properly and register the user’s for jibri instance ?

Hi Garima,
Please could you help me how to do it? I just follow the steps in this guide:

Thanks in advance

Hello @edzela,

If Ubuntu and Docker are not a must for you, I would also recommend you to check out my guide.

Only the Jitsi Meet Server (JMS) part is needed for your case.

Hello @emrah,
As I mentioned, I follow the above Docker instructions. I used that because I wanted the option to record multiple meetings in the same VPS.
From that point, what should do?, reinstall everything from scratch?, or I just need to follow your instructions from my current installation?
Another question, Can I have many jibri instances in the same VPS?,
I am using Ubuntu 18.04

Please advise.

Thanks and Regards