RHEL 9 - virtual camera no longer working (solution)

ThomasCameron

New Member
OK, so I installed RHEL 9 on my workstation, installed OBS Studio via flatpak, and it worked just fine. Then I did a couple of kernel updates, and it mysteriously stopped working.

As far as I can tell, it's because the old version of the kernel that the kmod for v4l2loopback is built against gets removed by kernel updates. So the kernel source needed to rebuild was gone.

Very long complicated story short, to make it work I had to, as root (or via sudo):
dnf install kernel-devel-5.14.0-162.23.1.el9_1.x86_64
dnf remove kmod-v4l2loopback-5.14.0-284.el9_2-0.12.7-2.el9.x86_64
akmods --force

I see that the installer created two RPMs, one for 5.14.0-162 and one for 5.14.0-284:

[root@case ~]# ls /var/cache/akmods/v4l2loopback/
0.12.7-2-for-5.14.0-162.23.1.el9_1.x86_64.log
0.12.7-2-for-5.14.0-284.30.1.el9_2.x86_64.log
kmod-v4l2loopback-5.14.0-162.el9_1-0.12.7-2.el9.x86_64.rpm
kmod-v4l2loopback-5.14.0-284.el9_2-0.12.7-2.el9.x86_64.rpm

Only after I'd removed the old version of the kmod-v4l2loopback rpm did akmods --force work correctly and I was able to see the v4l2loopback module was loaded:

[thomas.cameron@case Desktop]$ lsmod | grep v4l2
v4l2loopback 61440 0
videobuf2_v4l2 40960 1 uvcvideo
videobuf2_common 86016 4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
videodev 299008 4 videobuf2_v4l2,v4l2loopback,uvcvideo,videobuf2_common
mc 69632 5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common

Hope this is helpful to the tiny niche of us using OBS Studio on RHEL or clones.
 
Top