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

[Bug]: Device lose video capture capability! #600

Open
1 task done
GreatAg opened this issue Nov 5, 2024 · 6 comments
Open
1 task done

[Bug]: Device lose video capture capability! #600

GreatAg opened this issue Nov 5, 2024 · 6 comments
Assignees
Labels

Comments

@GreatAg
Copy link

GreatAg commented Nov 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Detail

I am using v4l2loopback for webcam as a virtual device in container for chrome application.
Here is the scenario:
1- i build the source and load the devices with exclusive_caps
2- i run the container and map the device into container using --device flag
3- open the webcam test in chrome and everything is fine
4- delete the container and run again
5- that device no longer known as a webcam or capture device!!

I run v4l2-ctl device=/dev/video2 --all before and after using it in container and find out after destroy the container the device lose it's capture device capability!!

Here is the log before i run container at fresh loading:

root@dmz:/var/modules/v4l2# v4l2-ctl --device=/dev/video2 --all
Driver Info:
	Driver name      : v4l2 loopback
	Card type        : test
	Bus info         : platform:v4l2loopback-002
	Driver version   : 5.4.255
	Capabilities     : 0x85200002
		Video Output
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x05200002
		Video Output
		Read/Write
		Streaming
		Extended Pix Format
Priority: 2
Video output: 0 (loopback in)
Format Video Output:
	Width/Height      : 0/0
	Pixel Format      : 'BGR4' (32-bit BGRA/X 8-8-8-8)
	Field             : None
	Bytes per Line    : 0
	Size Image        : 0
	Colorspace        : sRGB
	Transfer Function : Default (maps to sRGB)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Full Range)
	Flags             : 
Streaming Parameters Video Capture:
	Frames per second: 30.000 (30/1)
	Read buffers     : 2
Streaming Parameters Video Output:
	Frames per second: 30.000 (30/1)
	Write buffers    : 2

User Controls

                    keep_format 0x0098f900 (bool)   : default=0 value=0
              sustain_framerate 0x0098f901 (bool)   : default=0 value=0
                        timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0
               timeout_image_io 0x0098f903 (bool)   : default=0 value=0

And this is after i remove the container:

root@dmz:/dev# v4l2-ctl --device=/dev/video2 --all
Driver Info:
	Driver name      : v4l2 loopback
	Card type        : test
	Bus info         : platform:v4l2loopback-002
	Driver version   : 5.4.255
	Capabilities     : 0x85200000
		Read/Write
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps      : 0x05200000
		Read/Write
		Streaming
		Extended Pix Format
Priority: 2

User Controls

                    keep_format 0x0098f900 (bool)   : default=0 value=0
              sustain_framerate 0x0098f901 (bool)   : default=0 value=0
                        timeout 0x0098f902 (int)    : min=0 max=100000 step=1 default=0 value=0
               timeout_image_io 0x0098f903 (bool)   : default=0 value=0

What is wrong? what is modifying the device? how can i resolve this?

v4l2loopback version

0.12.5

kernel version

Linux dmz 5.4.0-200-generic #220-Ubuntu SMP Fri Sep 27 13:19:16 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

OS Version

Ubuntu 20.04

Which CPU are you using?

amd64/x86_64 ("64bit Intel")

@umlaeute
Copy link
Owner

umlaeute commented Nov 5, 2024

  1. Please check with the latest release of v4l2loopback (at the time of writing this is 0.13.2)
  2. If this doesn't help, please provide actual commands to reproduce the problem on a pristine machine (eg rather than "run the container" I would expect something like docker run --rm -ti alpine:latest bash

@GreatAg
Copy link
Author

GreatAg commented Nov 5, 2024

Thanks for the replay,
I run my container using this command:
docker run -d --device=/dev/video2 ubuntu:20:04
which i have chrome installed in that image and i want to use webcam in container.

@GreatAg
Copy link
Author

GreatAg commented Nov 5, 2024

also i checked the latest version and the problem still there.
This is really weird.

@umlaeute
Copy link
Owner

umlaeute commented Nov 5, 2024

I run my container using this command:

that was really just an example.
i would need all commands you run, and I need know where you run each of them (within the container, or outside).

e.g. in your example there is no a producer anywhere.

@GreatAg
Copy link
Author

GreatAg commented Nov 13, 2024

You can take a look at kasm application (https://kasmweb.com/)
I am doing pretty much the same thing in my app
Also kasm using v4l2loopback

@umlaeute
Copy link
Owner

sorry, I don't think i will (find the time to) checkout kasm, just to reproduce this issue.

please try to provide a minimal reproducible example.

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

No branches or pull requests

2 participants