Re: UVCIOC_CTRL_MAP not work

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

 



Hi Hardy

Seems like you can only add mappings for  V4L2_CTRL_TYPE_INTEGER,
V4L2_CTRL_TYPE_BOOLEAN:V4L2_CTRL_TYPE_BUTTON  and V4L2_CTRL_TYPE_MENU.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/usb/uvc/uvc_v4l2.c#n130

You are trying to add a map for a V4L2_CTRL_TYPE_STRING

Regards

On Fri, 28 Apr 2023 at 10:20, hardycheng(鄭易昕) <hardycheng@xxxxxxx> wrote:
>
> Hi Ricardo,
>
> Thanks for reply,
>
> I replace `_IOWR('u', 0x20, struct uvc_xu_control_mapping)` to ` UVCIOC_CTRL_MAP` and got the same error,
> Please check attachment for command output `strace -f ./uvc_xu_v4l_mapping_demo`
>
> Best Regards,
> Hardy
>
> -----Original Message-----
> From: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> Sent: Friday, April 28, 2023 4:04 PM
> To: hardycheng(鄭易昕) <hardycheng@xxxxxxx>
> Cc: linux-media@xxxxxxxxxxxxxxx
> Subject: Re: UVCIOC_CTRL_MAP not work
>
> Hi Hardy
>
> Why are you using:
>
> result = ioctl(fd, _IOWR('u', 0x20, struct uvc_xu_control_mapping), &mapping);
>
> instead of
>
> result = ioctl(fd, UVCIOC_CTRL_MAP, &mapping);
>
> Can you return the output of:
>
> strace -f  uvc_xu_v4l_mapping_demo
>
> Thanks!
>
> On Fri, 28 Apr 2023 at 09:15, hardycheng(鄭易昕) <hardycheng@xxxxxxx> wrote:
> >
> > Hi,
> >
> > # Environment:
> >
> > OS = Ubuntu 22.04 LTS (Linux version 5.19.0-41-generic) Program
> > Language = C Language
> >
> > # Overview:
> >
> > We plug in our UVC camera to PC, and try to use `UVCIOC_CTRL_MAP`
> > function on PC to create the v4l2 control mapping, but we got error
> > `UVCIOC_CTRL_MAP: Inappropriate ioctl for device` Development with `C
> > language` in `Ubuntu 22.04 LTS`
> >
> > # Description:
> >
> > We have a custom UVC camera and we can modify the extension unit(XU)
> > by ourself. (USB descriptions reference attachments
> > `uvc_xu_descriptor.PNG` & `usb_decriptions.txt`)
> >
> > We make sure that UVCIOC_CTRL_QUERY is work to control our XU item
> > (demo code in attachment `uvc_xu_ioctl_demo.c`)
> >
> > but UVCIOC_CTRL_MAP function fail with error message `UVCIOC_CTRL_MAP:
> > Inappropriate ioctl for device` (demo code in attachment
> > `uvc_xu_v4l_mapping_demo.c`)
> >
> > # Problems:
> >
> > 1.      Is UVCIOC_CTRL_MAP function using in the PC host?
> > 2.      Can you found any syntax problem in our demo code `uvc_xu_v4l_mapping_demo.c`?
> > 3.      Is there any sample code about struct `uvc_xu_control_mapping` using?
> >
> > Looking forward to your reply,
> > Best Regards,
> > Hardy#2374
> >
> > *****CONFIDENTIAL INFORMATION*****
> >
> > This email is intended only for the use of the person or entity to
> > whom it is addressed and contains information that may be subject to
> > and/or may be restricted from disclosure by contract or applicable
> > law. If you are not the intended recipient of this email, be advised
> > that any disclosure, copy, distribution or use of the contents of this message is strictly prohibited.
> > If you are not the intended recipient of this email, please notify the
> > sender that you have received this in error by replying to this
> > message. Then, please delete it from your system. Our Privacy Policy
> > is available here https://www.msi.com/page/privacy-policy. Thank you.
>
>
>
> --
> Ricardo Ribalda
>
>
> *****CONFIDENTIAL INFORMATION*****
>
> This email is intended only for the use of the person or entity to whom it is
> addressed and contains information that may be subject to and/or may be
> restricted from disclosure by contract or applicable law. If you are not the
> intended recipient of this email, be advised that any disclosure, copy,
> distribution or use of the contents of this message is strictly prohibited.
> If you are not the intended recipient of this email, please notify the sender
> that you have received this in error by replying to this message. Then,
> please delete it from your system. Our Privacy Policy is available here
> https://www.msi.com/page/privacy-policy. Thank you.



-- 
Ricardo Ribalda




[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