Re: [linux-uvc-devel] metadata device file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Moritz,

On 15/02/2019 08:45, Moritz Dötterl wrote:
> Hello
> 
> Recently we updated the Kernel on our Ubuntu machines from 4.15 to 4.18
> because the OS was randomly freezing. However with the new Kernel we ran
> into a problem regarding our two webcams. We had two /dev/video device
> files per camera of which only one seemed to work.

Yes, a new device node has been added to represent the meta-data from
the device.

You should be able to enumerate the devices, and you should
verify/validate the capabilities of the device after you open it.

A UVC capture device will expose the V4L2_CAP_VIDEO_OUTPUT capability flag.

> The problem was that
> our application would just randomly open one of those two device files

Is this an application you have control over the source code for?
or some external application?

> and then crashed if it opened the wrong one. After some search i figured
> out that the second device file is for meta data (which might not be
> provided by our camera i guess...). However i also found the line in the
> uvc_driver.c which generates the device file
> (https://elixir.bootlin.com/linux/v4.18/source/drivers/media/usb/uvc/uvc_driver.c#L2005)
> that line including the whole uvc_metadata.c was added when comparing
> 4.15 and 4.18 Kernel. I took that line out, recompiled the Kernel and
> ended up with having only one /dev/video device file per camera. I also
> found it is using the exact same function to register the device node
> that the uvc_driver.c is using and also using the same vfl_devnode_type
>  (VFL_TYPE_GRABBER) and therefore ending up as a /dev/video device. Was
> that move on purpose?

Yes, this addition was on purpose. It was added by the following patch:

https://www.spinics.net/lists/linux-media/msg125681.html

I've added the linux-media mailing list on Cc where you will be able to
find better support if this topic causes further problems.


> Why was it split up in two device files, or is
> that just added functionality?

I believe it is just added functionality - not split.

> I would rather like this device file to
> have a different name because in this setup it is not easily decidable

Perhaps some different naming might have continued to hide this issue
for you but it would only have hidden a potential bug.

Even with a different name, you can not expect that all /dev/video*
nodes are capture devices. They can be output devices or M2M devices for
example. Your application should always check the device capabilities
using the V4L2 API's as applicable.


> if a /dev/video device is the "real" webcam or just the meta data... So
> i would prefer that to end up as something like /dev/metavideo or so (
> or maybe easier: change the type to VFL_TYPE_SUBDEV so it will end up as
> a v4l-subdev device, that sounds more suitable for me...)

I think in this instance it has to be a full video node and not a subdev
so that data can be captured from the device node.


> What are the plans for this in future kernel versions? Should it stay
> like it is now or are there plans to change/evolve the meta data
> handling again?

This is in mainline now - so I would expect it to continue to be supported.

> 
> 
> Thanks very much.
> 
> 
> Best regards / Mit freundlichen Grüßen
> *Moritz Dötterl*
> 
> Pentland Firth Software GmbH
> 
> Hofmannstr. 61
> 81379 München, Germany
> 
> Mobile: +49 17655389056
> 
> moritz.doetterl@xxxxxxxxxxxxxxxxx <mailto:aron.borbath@xxxxxxxxxxxxxxxxx>
> 
> ----------------------------------------------------------------------------------------------------------------------------------
> Pentland Firth is *Microsoft Gold Partner*
> 
> Brands we own:  www.whiz-cart.com <http://www.whiz-cart.com/>
> ----------------------------------------------------------------------------------------------------------------------------------
> Sitz der Gesellschaft: München, Handelsregister München, HRB 155 786,
> Geschäftsführer: Frank Heinrich
> 
> 
> 
> 
> _______________________________________________
> Linux-uvc-devel mailing list
> Linux-uvc-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
> 

-- 
Regards
--
Kieran



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux