umlaeute / v4l2loopback

v4l2-loopback device
GNU General Public License v2.0
3.61k stars 515 forks source link

Devices limited to 8 even with KCPP flag #558

Closed xeon826 closed 9 months ago

xeon826 commented 9 months ago

Steps to reproduce:

  1. lxc launch images:ubuntu/22.04/desktop ubuntu --vm -c limits.cpu=4 -c limits.memory=4GiB my host operating system is running the same OS with v4l2loopback installed in the same way and still has this same issue, maybe it's a recent OS update?
  2. lxc exec ubuntu -- su - ubuntu
  3. sudo apt install -y gcc make build-essential linux-modules-extra-$(uname -r) linux-headers-$(uname -r) git
  4. cd Documents; git clone https://github.com/umlaeute/v4l2loopback
  5. cd v4l2loopback
  6. make KCPPFLAGS="-DMAX_DEVICES=20";
  7. sudo make install;
  8. sudo depmod -a;
  9. sudo modprobe v4l2loopback devices=11 or any number higher than 8 I've also tried increasing the MAX_DEVICES define in the v4l2loopback.c script itself.

    Observed Results:

I have 8 total video devices in /dev/ and there's an error in dmesg that says number of devices is limited to: 8,

Expected Results:

11 video devices should appear in /dev/

Relevant Code:

I tried looking for this string in the v4l2loopback source code grep -rnw '.' -e 'limited to' but I only find number of initial devices is limited to not number of devices is limited to

umlaeute commented 9 months ago

that's because you are loading an old module that is still lying around on your disk and which takes precedence over what got install by make install.

remove the other module instance. make sure to load the newly-built module.

a simple way (to test) is to specify the module file directly when loading via insmod:

insmod ./v4l2loopback.ko devices=11