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

The module loads but not creating any device #547

Closed
happyme531 opened this issue Jul 7, 2023 · 8 comments
Closed

The module loads but not creating any device #547

happyme531 opened this issue Jul 7, 2023 · 8 comments
Assignees
Labels
needs triage new issues

Comments

@happyme531
Copy link

  • v4l2loopback version: 0.12.7 (0.12.7-397-g9ba7e29)
  • kernel version: 5.10.160-rk35xx
  • Distribution (+version): Debian GNU/Linux 11 (bullseye)

Steps to reproduce:

  1. clone the v4l2loopback repo
  2. make, sudo make install, sudo depmod -a
  3. sudo modprobe v4l2loopback

Observed Results:

The module loaded: (dmesg)

[57666.139808] v4l2loopback driver version 0.12.7 (0.12.7-397-g9ba7e29) loaded

but no new /dev/videoX created and /dev/v4l2loopback is not exist

user@hinlink-h88k ~/v4l2loopback (main)> ls /dev/v4l2loopback
ls:  '/dev/v4l2loopback': no such file or directory
user@hinlink-h88k ~/v4l2loopback (main) [2]> ls /dev/video1
ls:  '/dev/video1':  no such file or directory

(/dev/video0 is the platform's video device and not related to v4l2loopback)

user@hinlink-h88k ~/v4l2loopback (main) [2]> ls /dev/
ashmem           gpiochip0    initctl@      mmcblk1boot0  rtc@     tty17  tty33  tty5   tty9      vcsa4
autofs           gpiochip1    input/        mmcblk1boot1  rtc0     tty18  tty34  tty50  ttyS2     vcsa5
block/           gpiochip2    kmsg          mmcblk1p1     shm/     tty19  tty35  tty51  ubi_ctrl  vcsa6
btrfs-control    gpiochip3    kvm           mmcblk1rpmb   snd/     tty2   tty36  tty52  uhid      vcsu
bus/             gpiochip4    log@          mpp_service   stderr@  tty20  tty37  tty53  uinput    vcsu1
char/            gpiochip5    loop0         mqueue/       stdin@   tty21  tty38  tty54  urandom   vcsu2
console          hdmirx_hdcp  loop1         net/          stdout@  tty22  tty39  tty55  v4l/      vcsu3
cpu_dma_latency  hugepages/   loop2         null          sw_sync  tty23  tty4   tty56  vcs       vcsu4
crypto           hwrng        loop3         port          tty      tty24  tty40  tty57  vcs1      vcsu5
cuse             i2c-0        loop4         ppp           tty0     tty25  tty41  tty58  vcs2      vcsu6
disk/            i2c-10       loop5         ptmx          tty1     tty26  tty42  tty59  vcs3      vendor_storage
dma_heap/        i2c-11       loop6         ptp0          tty10    tty27  tty43  tty6   vcs4      vhci
dri/             i2c-12       loop7         pts/          tty11    tty28  tty44  tty60  vcs5      video0
drm_dp_aux0      i2c-2        loop-control  ram0          tty12    tty29  tty45  tty61  vcs6      zero
drm_dp_aux1      i2c-6        mali0         random        tty13    tty3   tty46  tty62  vcsa      zram0
fd@              i2c-7        mapper/       rfkill        tty14    tty30  tty47  tty63  vcsa1
full             i2c-9        mem           rga           tty15    tty31  tty48  tty7   vcsa2
fuse             iio:device0  mmcblk1       rkspi-dev2    tty16    tty32  tty49  tty8   vcsa3

However there are something in the /sys/devices/virtual/video4linux/

user@hinlink-h88k ~/v4l2loopback (main)> ll /sys/devices/virtual/video4linux/
总用量 0
drwxr-xr-x 3 root root 0 Jul  7 17:45 video2/
user@hinlink-h88k ~/v4l2loopback (main)> ll /sys/devices/virtual/video4linux/video2/
总用量 0
-r--r--r-- 1 root root 4.0K Jul  7 17:52 buffers
-r--r--r-- 1 root root 4.0K Jul  7 17:45 dev
-rw-r--r-- 1 root root 4.0K Jul  7 17:52 dev_debug
-rw-r--r-- 1 root root 4.0K Jul  7 17:52 format
-r--r--r-- 1 root root 4.0K Jul  7 17:45 index
-rw-r--r-- 1 root root 4.0K Jul  7 17:52 max_openers
-r--r--r-- 1 root root 4.0K Jul  7 17:52 name
drwxr-xr-x 2 root root    0 Jul  7 17:52 power/
-r--r--r-- 1 root root 4.0K Jul  7 17:52 state
lrwxrwxrwx 1 root root    0 Jul  7 17:52 subsystem -> ../../../../class/video4linux/
-rw-r--r-- 1 root root 4.0K Jul  7 17:45 uevent

Expected Results:

The control device and video device are created for use.

Note

The kernel is Rockchip's vendor kernel. Vendor kernel is generally considered buggy so it could be actually a kernel-related issue.
Kernel source is: https://github.com/armbian/linux-rockchip/tree/rk-5.10-rkr4
Used config is: https://github.com/happyme531/armbian-h88k-images/blob/master/config

@umlaeute
Copy link
Owner

well: the mere existence of /sys/devices/virtual/video4linux/video2/ shows that v4l2loopback (or some other kernel module that provides a similar/same "virtual" interface) is loaded and working (to some extent).

i cannot currently test on a linux-5 kernel.

in any case you could try loading the module with debug=2 or some other high number to see whether it gives some additional information.

@hackermondev
Copy link

I'm experiencing this too but /sys/devices/virtual/video4linux/video2/ doesn't even exist for me.

I don't know if it's related but I have successfully loaded v4l2loopback already in the past and I removed it with modprobe -r v4l2loopback.

@umlaeute
Copy link
Owner

umlaeute commented Oct 23, 2023

@hackermondev if it doesn't exist than either

  • your test is too narrow (/sys/devices/virtual/video4linux/video2/ is created only if v4l2loopback created /dev/video2; if you only created a single device, that might as well be /sys/devices/virtual/video4linux/video0/; or some other device, if the given video-device already exists)
  • the module is not loading at all
  • (some very old module is loaded)
  • your kernel lacks sysfs support

a more robust test would be something like:

have_v4l2loopback=no
for f in  /sys/devices/virtual/video4linux/video*/name; do
  if [ -e "${f}" ]; then
    have_v4l2loopback=yes
    break
  fi
done
echo "v4l2loopback support: ${have_v4l2loopback}"

of course it always helps if you specify the

  • kernel version
  • v4l2loopback version
  • module parameters you are passing when loading the module
  • info about pre-existing video-devices

@hackermondev
Copy link

hackermondev commented Oct 23, 2023

I fixed the issue, thanks for the help.

@umlaeute
Copy link
Owner

@hackermondev it would be great if you could also say how you fixed the issue

@hackermondev
Copy link

hackermondev commented Oct 24, 2023

Yeah, sorry. I'm not sure 100% what fixed the issue but here's what I did:

  • I uninstalled the v4l2loopback-dkms apt module I had installed (Not sure why I installed that when I was also using it from the source)
  • I used modprobe to remove some other modules that referenced v4l2loopback

lsmod | grep v4l2loopback

 v4l2loopback           49152  0
videodev              225280  1 v4l2loopback

Then, I ran sudo modprobe -r v4l2loopback and sudo modprobe -r videodev.

  • I rebuilt everything from the source, reran sudo make install and sudo modprobe v4l2loopback exclusive_caps=1

@umlaeute
Copy link
Owner

I uninstalled the v4l2loopback-dkms apt module I had installed (Not sure why I installed that when I was also using it from the source)

probably because it's mentioned somewhere, that DKMS will help you with signing modules.

@umlaeute
Copy link
Owner

closing, as it has been resolved for the OP, and has become unreproducible

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

No branches or pull requests

3 participants