ShayBox / Mon2Cam

Workaround for multi-monitor Discord screensharing
MIT License
337 stars 33 forks source link

After installing, error when running #51

Closed isaacsa51 closed 3 years ago

isaacsa51 commented 3 years ago

Just as the title says, when I run the program just pop an error, I have already installed all the dependencies, restarted my machine and just to say, I install the program from AUR using yay so, don't know why the issue.

The error is: PANIC Failed to create V4L2 device with id 50

botiapa commented 3 years ago

Please run the command with the -v flag, and post the output.

isaacsa51 commented 3 years ago

Output:

isaac@manjaro-sa:~
> sudo mon2cam -v
[sudo] password for isaac: 
DEBUG Starting Mon2Cam with the following options: Options {
  framerate: 60,
  device: 50,
  resolution: "",
  ffmpeg: [],
  border: false,
  sound: false,
  wayland: false,
  loggerOptions: { verbose: true },
  execOptions: { verbose: true, output: 3 }
}
DEBUG Checking if V4L2 device exists
DEBUG V4L2 device not found with id 50, creating it

Exec Context: c02b0541-f32d-478e-9120-5e2ef36f62c2
    Exec Options:  { verbose: true, output: 3 }
    Exec Command: sudo modprobe -r v4l2loopback
    Exec Command Splits:  [sudo,modprobe,-r,v4l2loopback]
    Exec Result:  { code: 1, success: false },
 output: "modprobe: FATAL: Module v4l2loopback not found."
Exec Context: c02b0541-f32d-478e-9120-5e2ef36f62c2

Exec Context: 464bd7ff-d869-49b6-973b-839ec6f58e75
    Exec Options:  { verbose: true, output: 3 }
    Exec Command: sudo modprobe v4l2loopback video_nr=50 'card_label=Mon2Cam'
    Exec Command Splits:  [sudo,modprobe,v4l2loopback,video_nr=50,'card_label=Mon2Cam']
    Exec Result:  { code: 1, success: false },
 output: "modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.8.16-2-MANJARO"
Exec Context: 464bd7ff-d869-49b6-973b-839ec6f58e75

DEBUG Exiting
DEBUG V4L2 device created with id 50
PANIC Failed to create V4L2 device with id 50
botiapa commented 3 years ago

The V4l2loopback device is not installed correctly on your system. It should have been installed when you used yay, but it wasn't as it seems. The log clearly states: modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.8.16-2-MANJARO

Install the v4l2loopback module, and then mon2cam should work correctly.

isaacsa51 commented 3 years ago

The V4l2loopback device is not installed correctly on your system. It should have been installed when you used yay, but it wasn't as it seems. The log clearly states: modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/5.8.16-2-MANJARO

Install the v4l2loopback module, and then mon2cam should work correctly.

Welp, I have installed all the modules of v4l2loopback founded by yay and nothing has been fixed haha

andrew103 commented 3 years ago

@isaacsa51 @botiapa I had the same issue and it got resolved after recompiling v4l2loopback from source and installing it again in the steps outlined here. I assume the issue occurs when the system is restarted, but I haven't tested it yet. If that is the case, then the fix is likely running either sudo depmod -a in the v4l2 directory or sudo modprobe v4l2loopback or doing both.

ShayBox commented 3 years ago

You have to install the kernel headers for your kernel to get dkms modules to work on archlinux

You also don't compile from source on archlinux, you use a pkgbuild always, otherwise the package manager doesn't track the files and keep them up to date.

andrew103 commented 3 years ago

Ah my bad. I missed that he was using manjaro. I run ubuntu 18.04 so I need to build from source.

ShayBox commented 3 years ago

Did you get this working?

isaacsa51 commented 3 years ago

Did you get this working?

Sadly not, I just have the program installed but nothing got working still

GamerGuy95953 commented 3 years ago

Having the same problem too but on Manjaro Cinnamon.

PalanixYT commented 3 years ago

guys have you installed your kernel headers?

Tursh commented 3 years ago

I had the same error on Arch which is pretty much the same as Manjaro. I fixed it by installing from pacman the linux headers and v4l2loopback-dkms and then rebooted. For me, a reboot was the solution so let me know if it works for you.

rlad78 commented 3 years ago

For those of you running into this on Arch, not knowing how to do this:

You have to install the kernel headers for your kernel to get dkms modules to work on archlinux

Find the linux kernel you're using: uname -r

Then, using yay (or pacman -S with the specific package name), install the package that matches your kernel version: yay linux-headers should give you something like:

8 core/linux59-headers 5.9.16-1 (9.7 MiB 48.3 MiB) 
    Header files and scripts for building modules for Linux59 kernel
7 core/linux54-headers 5.4.97-1 (9.4 MiB 46.9 MiB) 
    Header files and scripts for building modules for Linux54 kernel
6 core/linux511-headers 5.11.rc7.d0207.g92bf226-1 (9.6 MiB 48.7 MiB) 
    Header files and scripts for building modules for Linux511 kernel
5 core/linux510-headers 5.10.15-1 (9.5 MiB 47.7 MiB) 
    Header files and scripts for building modules for Linux510 kernel
4 core/linux49-headers 4.9.257-1 (7.4 MiB 37.0 MiB) 
    Header files and scripts for building modules for Linux49 kernel
3 core/linux44-headers 4.4.257-1 (6.7 MiB 33.8 MiB) 
    Header files and scripts for building modules for Linux44 kernel
2 core/linux419-headers 4.19.175-1 (8.8 MiB 44.3 MiB) 
    Header files and scripts for building modules for Linux419 kernel
1 core/linux414-headers 4.14.221-1 (8.1 MiB 41.0 MiB) 
    Header files and scripts for building modules for Linux414 kernel
==> Packages to install (eg: 1 2 3, 1-3 or ^4)

Since I'm using 5.10, I chose linux510-headers. Installed the package and mon2cam worked perfectly afterwards.

Thanks @ShayBox !

isaacsa51 commented 3 years ago

Yep, the problem was the linux-headers, I'm not a superuser at all in linux but installed the headers and logging out finally worked, thanks @ShayBox @rlad78