docker-jitsi-meet icon indicating copy to clipboard operation
docker-jitsi-meet copied to clipboard

Jibri Docker checks /dev/snd/pcmC0D0p for ALSA audio group but that device does not always exist

Open Daan-xyz opened this issue 4 years ago • 2 comments

Probably if there is no main sound card, such as on a server, ALSA does not start numbering sound devices from /dev/snd/pcmC0D0. For example, this is the list on my Ubuntu 18.01 Server, a Docker host for Jitsi et al.:

drwxr-xr-x  3 root root      680 Aug 25 16:49 ./
drwxr-xr-x 20 root root     4400 Aug 25 16:10 ../
drwxr-xr-x  2 root root      140 Aug 25 16:20 by-path/
crw-rw----  1 root audio 116,  7 Aug 25 16:07 controlC0
crw-rw----  1 root audio 116,  2 Aug 25 16:07 controlC1
crw-rw----  1 root audio 116, 16 Aug 25 16:20 controlC2
crw-rw----  1 root audio 116, 21 Aug 25 16:20 controlC3
crw-rw----  1 root audio 116, 26 Aug 25 16:20 controlC4
crw-rw----  1 root audio 116, 12 Aug 25 16:07 hwC0D0
crw-rw----  1 root audio 116, 13 Aug 25 16:07 hwC0D1
crw-rw----  1 root audio 116, 14 Aug 25 16:07 hwC0D2
crw-rw----  1 root audio 116, 15 Aug 25 16:07 hwC0D3
crw-rw----  1 root audio 116,  6 Aug 25 16:07 hwC1D0
crw-rw----  1 root audio 116,  8 Aug 25 16:07 pcmC0D3p
crw-rw----  1 root audio 116,  9 Aug 25 16:07 pcmC0D7p
crw-rw----  1 root audio 116, 10 Aug 25 16:07 pcmC0D8p
crw-rw----  1 root audio 116, 11 Aug 25 16:07 pcmC0D9p
crw-rw----  1 root audio 116,  4 Aug 25 16:07 pcmC1D0c
crw-rw----  1 root audio 116,  3 Aug 25 16:07 pcmC1D0p
crw-rw----  1 root audio 116,  5 Aug 25 16:07 pcmC1D2c
crw-rw----  1 root audio 116, 18 Aug 25 16:20 pcmC2D0c
crw-rw----  1 root audio 116, 17 Aug 25 16:20 pcmC2D0p
crw-rw----  1 root audio 116, 20 Aug 25 16:20 pcmC2D1c
crw-rw----  1 root audio 116, 19 Aug 25 16:20 pcmC2D1p
crw-rw----  1 root audio 116, 23 Aug 25 16:20 pcmC3D0c
crw-rw----  1 root audio 116, 22 Aug 25 16:20 pcmC3D0p
crw-rw----  1 root audio 116, 25 Aug 25 16:20 pcmC3D1c
crw-rw----  1 root audio 116, 24 Aug 25 16:20 pcmC3D1p
crw-rw----  1 root audio 116, 28 Aug 25 16:20 pcmC4D0c
crw-rw----  1 root audio 116, 27 Aug 25 16:20 pcmC4D0p
crw-rw----  1 root audio 116, 30 Aug 25 16:20 pcmC4D1c
crw-rw----  1 root audio 116, 29 Aug 25 16:20 pcmC4D1p
crw-rw----  1 root audio 116,  1 Aug 25 16:07 seq
crw-rw----  1 root audio 116, 33 Aug 25 16:07 timer

This results in ERROR: Binding /dev/snd is not found. Please check that you run docker-compose with -f jibri.yml. which is not really a correct message in that case.

I followed the instructions on adding a ALSA feedback device to Ubuntu Server (it is not a VM), roughly (cannot completely remember):

apt-get install alsa-utils
# configure 5 capture/playback interfaces
echo "options snd-aloop enable=1,1,1,1,1 index=0,1,2,3,4" > /etc/modprobe.d/alsa-loopback.conf
# insert into startup 
echo "snd-aloop" >> /etc/modules
# insert into running kernel (otherwise reboot required)
modprobe snd-aloop
# check it is loaded
lsmod | grep snd_aloop

A mv pcmC0D3p pcmC0D0p makes the container start, but is reverted on reboot, and would add more complexity to the Jibri setup process.

The file that checks for the group is jibri/rootfs/etc/cont-init.d.

I am not a Jitsi or ALSA developer, but since only the audio group seems to be required, might a change to stat the seq or timer file fix this?

Daan-xyz avatar Aug 25 '20 15:08 Daan-xyz

Same here. It seems to me that using /dev/snd/pcmC2D0p has more probability to the success as the loop will create 3 more audio cards.. so either way, the C2D0p is the most likely the beginning of the loop card or the last one. (after change that in jibri/rootfs/etc/cont-init.d/10-config, you may have to do 'make' to regenerate the docker image. but it will rebuild everything so if anyone knows how to make it just for jibri, please let me know)

But as the author already pointed out, it is just try to get the group which is always the 'audio' and just try to add that user 'jibri' to that 'audio' group and consider that the docker env is more predictable so we could just blindly use group name 'audio'.

I am not ALSA expert either and it is really drive me crazy to see the name like CxDy.. After a while by staring at those names and suddenly I realized, it is simply saying ' PCM Card 2 Device 0 playback ' and for pcmC4D1c is saying ' PCM Card 4 Device 1 capture'. sigh...

andywangevertz avatar Oct 30 '20 02:10 andywangevertz

Good day. Were you able to solve the problem? I have jitsi installed in docker. I'm trying to set up a recording, run jitsi.. but it throws an error... sudo docker-compose -f docker-compose.yml -f jibri.yml up ERROR: Binding /dev/snd is not found. Please check that you run docker-compose with -f jibri.yml.

Alsa installed and working... Server - debian 11 I run everything as root

drno88 avatar Mar 01 '22 18:03 drno88