I think I am hopefully on my last error getting Jibri to work in a Dockertized container.
I am getting the following error:
2023-04-26 14:30:29.444 INFO: [64] [session_id=ldfzryizqaselffm] JibriSubprocess.launch#42: Starting ffmpeg with command ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 60 -s 1920x1080 -thread_queue_size 13500 -i :0.0+0,0 -f alsa -thread_queue_size 13500 -i plug:bsnoop -acodec aac -strict -2 -ar 44100 -b:a 128k -af aresample=async=1 -c:v libx264 -preset medium -maxrate 2976k -bufsize 5952k -pix_fmt yuv420p -r 60 -crf 25 -g 120 -tune zerolatency -f flv rtmp://some-url ([ffmpeg, -y, -v, info, -f, x11grab, -draw_mouse, 0, -r, 60, -s, 1920x1080, -thread_queue_size, 13500, -i, :0.0+0,0, -f, alsa, -thread_queue_size, 13500, -i, plug:bsnoop, -acodec, aac, -strict, -2, -ar, 44100, -b:a, 128k, -af, aresample=async=1, -c:v, libx264, -preset, medium, -maxrate, 2976k, -bufsize, 5952k, -pix_fmt, yuv420p, -r, 60, -crf, 25, -g, 120, -tune, zerolatency, -f, flv, rtmp:/some-url])
2023-04-26 14:30:34.445 FINE: [19] [session_id=ldfzryizqaselffm] ProcessStatePublisher$startProcessAliveChecks$1.invoke#86: Process ffmpeg hasn't written in 2 seconds, publishing periodic update
2023-04-26 14:30:34.446 INFO: [59] [session_id=ldfzryizqaselffm] FfmpegCapturer.onFfmpegProcessUpdate#125: Ffmpeg quit abruptly. Last output line: plug:bsnoop: Input/output error
2023-04-26 14:30:34.447 INFO: [59] [session_id=ldfzryizqaselffm] FfmpegCapturer.onFfmpegStateMachineStateChange#134: Ffmpeg capturer transitioning from state Starting up to Error: QuitUnexpectedly SESSION plug:bsnoop: Input/output error
2023-04-26 14:30:34.447 INFO: [59] [session_id=ldfzryizqaselffm] StatefulJibriService.onServiceStateChange#39: Streaming service transitioning from state Starting up to Error: QuitUnexpectedly SESSION plug:bsnoop: Input/output error
So the error is the N plug:bsnoop: Input/output error, which I am assuming is the sound card.
On the instance running the docker container, when I run modinfo snd-aloop, I get the following:
filename: /lib/modules/5.4.0-1103-gcp/kernel/sound/drivers/snd-aloop.ko
license: GPL
description: A loopback soundcard
author: Jaroslav Kysela <perex@perex.cz>
srcversion: 44724425ED81756955CCD37
depends: snd-pcm,snd
retpoline: Y
intree: Y
name: snd_aloop
vermagic: 5.4.0-1103-gcp SMP mod_unload modversions
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
parm: index:Index value for loopback soundcard. (array of int)
parm: id:ID string for loopback soundcard. (array of charp)
parm: enable:Enable this loopback soundcard. (array of bool)
parm: pcm_substreams:PCM substreams # (1-8) for loopback driver. (array of int)
parm: pcm_notify:Break capture when PCM format/rate/channels changes. (array of int)
And inside the docker container, when I run modinfo snd-aloop, I also get the following:
filename: /lib/modules/5.4.0-1103-gcp/kernel/sound/drivers/snd-aloop.ko
license: GPL
description: A loopback soundcard
author: Jaroslav Kysela <perex@perex.cz>
srcversion: 44724425ED81756955CCD37
depends: snd-pcm,snd
retpoline: Y
intree: Y
name: snd_aloop
vermagic: 5.4.0-1103-gcp SMP mod_unload modversions
signat: PKCS#7
signer:
sig_key:
sig_hashalgo: md4
parm: index:Index value for loopback soundcard. (array of int)
parm: id:ID string for loopback soundcard. (array of charp)
parm: enable:Enable this loopback soundcard. (array of bool)
parm: pcm_substreams:PCM substreams # (1-8) for loopback driver. (array of int)
parm: pcm_notify:Break capture when PCM format/rate/channels changes. (array of int)
And running lsmod | grep snd_aloop gives me the following:
snd_aloop 24576 0
snd_pcm 106496 1 snd_aloop
snd 86016 3 snd_timer,snd_aloop,snd_pcm
And the docker container is started like this:
sudo docker run -d -p 80:80 -p 443:443 -p 4443:4443 -p 5222:5222 -p 5347:5347 -p 10000:10000/udp --shm-size=8gb -v /dev/shm:/dev/shm --rm --runtime=nvidia --gpus all -v /dev/snd:/dev/snd --privileged my-custom-jibri-image:latest
My Java Version:
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment (build 11.0.18+10-post-Ubuntu-0ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.18+10-post-Ubuntu-0ubuntu118.04.1, mixed mode, sharing)
My arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
And when I run cat /home/jibri/.asoundrc
pcm.amix {
type dmix
ipc_key 219345
slave.pcm "hw:Loopback,0,0"
}
pcm.asnoop {
type dsnoop
ipc_key 219346
slave.pcm "hw:Loopback_1,1,0"
}
pcm.aduplex {
type asym
playback.pcm "amix"
capture.pcm "asnoop"
}
pcm.bmix {
type dmix
ipc_key 219347
slave.pcm "hw:Loopback_1,0,0"
}
pcm.bsnoop {
type dsnoop
ipc_key 219348
slave.pcm "hw:Loopback,1,0"
}
pcm.bduplex {
type asym
playback.pcm "bmix"
capture.pcm "bsnoop"
}
pcm.pjsua {
type plug
slave.pcm "bduplex"
}
pcm.!default {
type plug
slave.pcm "aduplex"
}
So what could be causing the sound card not to be work? (if the error message is indeed a sound card issue).