Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Jibri work in progress #739

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

pcorace
Copy link
Contributor

@pcorace pcorace commented Nov 29, 2020

[WIP] I'm working on adding jibri to the jitsi role.
I did not add host preparation tasks for Jibri to the playbook at the moment. (I did them manually on my host).
-ansible-playbook -i inventory / hosts setup.yml --tags = setup-jitsi, start -
ends without errors, but I must be missing some configuration because the recordings are not working.
The only weird thing I see in the logs is:
org.jitsi.xmpp.extensions.DefaultPacketExtensionProvider.parse () Could not add a provider for element busy-status from namespace http://jitsi.org/protocol/jibri
I leave it here to see if someone finds the error. (I already have my eyes crossed ... ha)

@spantaleev
Copy link
Owner

This may also be missing matrix_jitsi_enable_recording: true.

Since yesterday (e0d7d5f), we no longer enable recording by default, because it's not like Jibri was there for it to work anyway (see #726).

I think that when this PR lands, we should define matrix_jitsi_enable_recording in terms of matrix_jitsi_jibri_enabled (or vice versa), so that toggling one would be enough.

Copy link
Contributor

@teutat3s teutat3s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for starting to work on this and sharing this WIP! I think this is a nice addition to the playbook.

We could probably simplify this even more, because a lot of auto-configuration is already included in the https://github.com/jitsi/docker-jitsi-meet project.
For example, prosody already sets up its config for recording with Jibri when
https://github.com/jitsi/docker-jitsi-meet/blob/77aafe0573807e790013fecfaf84fb2c4f41980c/prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua#L71
is set, which we already do here

XMPP_RECORDER_DOMAIN={{ matrix_jitsi_recorder_domain }}

That means the file roles/matrix-jitsi/templates/jibri/jibri.cfg.lua.j2 shouldn't be necessary.

If I'm not mistaken, the only things we should need to do is add a jibri container and set its env correctly, which looks good to me already in this PR, and then set the ENABLE_RECORDING env to 1 in the web container, so that the Start recording button in the web UI becomes visible. Our var matrix_jitsi_enable_recording already takes care of this here:

ENABLE_RECORDING={{ 1 if matrix_jitsi_enable_recording else 0 }}

@@ -37,3 +41,9 @@
tags:
- setup-all
- setup-jitsi

- import_tasks: "{{ role_path }}/tasks/setup_jitsi_jibri.yml"
when: run_setup|bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if all these when here should be like above:

  when: "run_setup|bool and matrix_jitsi_enabled|bool"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be done in a separate PR as it's probably unrelated. Every task under setup_jitsi_jibri has sufficient checks.

Comment on lines +29 to +30
// MUST be unic for every instanse
"nickname": "jibri-instanse-1"
Copy link
Contributor

@teutat3s teutat3s Nov 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos: unique & instance

Copy link
Contributor

@teutat3s teutat3s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the unneeded files that get auto-generated at the containers first start via the env file would be:

  • roles/matrix-jitsi/templates/jibri/config.json.j2
  • roles/matrix-jitsi/templates/jibri/jibri.cfg.lua.j2
  • roles/matrix-jitsi/templates/jibri/logging.properties.j2

Comment on lines +14 to +23
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-jitsi-jibri \
--log-driver=none \
--network={{ matrix_docker_network }} \
--env-file={{ matrix_jitsi_jibri_base_path }}/env \
--device=/dev/snd:/dev/snd \
--mount type=bind,src={{ matrix_jitsi_jibri_config_path }},dst=/config \
{% for arg in matrix_jitsi_jibri_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_jitsi_jibri_docker_image }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -676,6 +676,7 @@ matrix_jitsi_jvb_container_colibri_ws_host_bind_port: "{{ '' if matrix_nginx_pro
matrix_jitsi_jibri_xmpp_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jibri') | to_uuid }}"
matrix_jitsi_jicofo_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jicofo') | to_uuid }}"
matrix_jitsi_jvb_auth_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'jvb') | to_uuid }}"
matrix_jitsi_jibri_recorder_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'recorder') | to_uuid }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that matrix_jitsi_jicofo_component_secret is still missing here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spantaleev - don't know if here or inventory/scripts/jitsi-generate-passwords.sh is the desired place to generate all passwords?

@pcorace
Copy link
Contributor Author

pcorace commented Nov 29, 2020

Thank you @spantaleev for your clarification and thank you very much @teutat3s for your extensive review!
I'll get to work on your suggestions.
(Sorry for my English, I am Argentine and I usually speak Spanish)

@ffuentes
Copy link

@pcorace Hello do you know if this on WIP?

I have just deployed a matrix server with this ansible playbook, defined matrix_jitsi_jibri_recorder_password and matrix_jitsi_jibri_xmpp_password in my custom vars but can't record any video.

Thanks in advance.

akshaylive added a commit to akshaylive/matrix-docker-ansible-deploy that referenced this pull request Mar 4, 2021
Most of the work is done [here](spantaleev#739).
akshaylive added a commit to akshaylive/matrix-docker-ansible-deploy that referenced this pull request Mar 4, 2021
Most of the work is done [here](spantaleev#739).
akshaylive added a commit to akshaylive/matrix-docker-ansible-deploy that referenced this pull request Mar 4, 2021
Most of the work is done [here](spantaleev#739).
@akshaylive
Copy link

I've made some modifications on a fork here

With this, the Jibri container doesn't crash and connects to the XMPP server but does not work.

@pcorace
Copy link
Contributor Author

pcorace commented Mar 4, 2021

Hello @ffuentes and @akshaylive . I had some problems in my work that kept me away from this project. This wip is out of date and Jibri is not working. I try to resume the project in the next few days. Any collaboration or comment is welcome.

@pcorace pcorace marked this pull request as ready for review March 4, 2021 13:49
@akshaylive
Copy link

Hello @ffuentes and @akshaylive . I had some problems in my work that kept me away from this project. This wip is out of date and Jibri is not working. I try to resume the project in the next few days. Any collaboration or comment is welcome.

Thanks for the effort put in! I do need your help with testing this fork. I am running my instance on the cloud VM and I do not have access to snd module. Specifically, on your machine, do you have a file called /dev/snd/pcmc0d0c? If so, it might work. I can see logs of Jibri connecting to prosody but is unable to record for an unknown reason.

@pcorace
Copy link
Contributor Author

pcorace commented Mar 6, 2021

@akshaylive you need to set up an ALSA loopback device on the host according to the instructions at: https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-docker#jitsi-broadcasting-infrastructure-jibri -configuration.
Anyway I don't think Jibri works. I think you have to add something to the nginx setup for the recordings to work.
I am going to analyze it. If I can get Jibri working I update this WIP.

hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 3, 2021
Most of the work is done [here](spantaleev#739).
hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 3, 2021
Most of the work is done [here](spantaleev#739).
hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 7, 2021
Most of the work is done [here](spantaleev#739).
hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 7, 2021
Most of the work is done [here](spantaleev#739).
hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 22, 2021
Most of the work is done [here](spantaleev#739).
hungrymonkey pushed a commit to mederrata/matrix-docker-ansible-deploy that referenced this pull request Aug 22, 2021
Most of the work is done [here](spantaleev#739).
@hungrymonkey
Copy link
Contributor

Damn it, how do i turn off these notification? They only annoy people. I am sorry for cherry-picking.

@hungrymonkey
Copy link
Contributor

hungrymonkey commented Aug 23, 2021

Hi everyone. If anyone needs to install a generic kernel for Debian 11 on AWS, I am attaching this ansible below. The ansible assumes a clean environment with only the cloud aws kernel installed.

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye

lsmod | grep snd
snd_aloop              32768  0
snd_pcm               135168  1 snd_aloop
snd_timer              49152  2 snd_aloop,snd_pcm
snd                   110592  3 snd_timer,snd_aloop,snd_pcm
soundcore              16384  1 snd
- hosts: matrix_servers
  become: true
  tasks:
    - name: Install Debian based dependencies
      block:
      - name: Update apt cache
        apt: update_cache=true cache_valid_time=600
        changed_when: false
        when: ansible_os_family == 'Debian'
      - name: Update all Packages
        apt: 
          upgrade: yes
        when: ansible_os_family == 'Debian'
      - name: Install Generic Kernel with snd-aloop support
        apt:
          name: 'linux-image-amd64'
          state: present
      when: ansible_os_family == 'Debian'
    - name: Change Grub Default Kernel
      ansible.builtin.lineinfile:
        path: /etc/default/grub
        regex: '^GRUB_DEFAULT=[\"0-9><,]+'
        state: present
        line: 'GRUB_DEFAULT="1>2"'
    - name: Update Grub.cfg
      ansible.builtin.command:
        cmd: grub-mkconfig -o /boot/grub/grub.cfg
      changed_when: false
    - name: Setup snd-aloop module modprobe
      block: 
      - name: /etc/modules
        ansible.builtin.lineinfile:
          path: /etc/modules
          regex: '^snd-aloop'
          state: present
          line: 'snd-aloop'
      - name: /etc/modprobe.d/alsa-loopback.conf
        ansible.builtin.copy:
          content: 'options snd-aloop enable=1,1,1,1,1 index=0,1,2,3,4'
          dest: /etc/modprobe.d/alsa-loopback.conf
          mode: '0644'
      - name: Reboot the machine
        reboot:
  vars:
    ansible_python_interpreter: /usr/bin/python3

I am trying to figure out why my record button is not appearing right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants