uvc-gadget created with configfs sets all bFrameIndex to 1

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

 



I am currently working on an application for my master thesis that does
transparent inline modification of  frames received from a uvc webcam
which are served to the actual host through a uvc gadget mimicking the
underlying webcam. I recently noticed that the host side v4l2 driver
would only ever request bFrameIndex 1, no matter the requested format.


So I used usbmon to take a closer look (pcap is attached ). Take a look
at the Video Streaming interface descriptor in packet no. 6: All 19
different framesizes have their bFrameIndex set to 1. This makes
requesting any framesize but the actual first one impossible.


I took a quick look at drivers/usb/gadget/function/uvc_configfs.c and
noticed that the bFrameIndex attribute of a frame is set to 1 per
default in "uvcg_frame_make"**, but the attribute is neither made
accessible through configfs nor could I see any mechanism by which the
indices are set automatically.


As I am new to kernel development, I wanted ask for comment first before
I start brewing up a possible patch for this bug. Currently I see three
solutions:

1) Expose bFrameIndex through ConfigFs, to be set by the user

2) Assign an unused bFrameIndex during "uvcg_frame_make"

3) Once framesizes of a format are finalized, iterate through frames and
assign ascending indices


There is also obviously the possibility that I gravely misconfigured my
gadget through configfs, if so please point me in the right direction.


Regards,

Joel

Attachment: bFrameIndex_bug.pcapng
Description: application/pcapng


[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