From: "hardycheng(鄭易昕)" <hardycheng@msi.com>
To: 'Ricardo Ribalda' <ribalda@chromium.org>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: RE: UVCIOC_CTRL_MAP not work
Date: Fri, 28 Apr 2023 08:50:52 +0000 [thread overview]
Message-ID: <f1f6c629d5184119b8bf1bb8172c5ac7@msi.com> (raw)
In-Reply-To: <CANiDSCtRp2DZQ4=FCDp+BGMO6S4=-ukkL7bKFUF5Hp36m4aSog@mail.gmail.com>
Hi Ricardo,
Thank you for such a quick reply.
Follow your advice, but I just got few logs in dmesg
[ 9452.677337] usb 1-1: uvc_v4l2_open
[ 9452.725254] usb 1-1: Resuming interface 0
[ 9452.725258] usb 1-1: Resuming interface 1
[ 9452.751971] usb 1-1: uvc_v4l2_release
[ 9455.236973] usb 1-1: Suspending interface 1
[ 9455.236977] usb 1-1: Suspending interface 0
Is there any way to get more debug message about this issue?
Best Regards,
Hardy#2374
-----Original Message-----
From: Ricardo Ribalda <ribalda@chromium.org>
Sent: Friday, April 28, 2023 4:45 PM
To: hardycheng(鄭易昕) <hardycheng@msi.com>
Cc: linux-media@vger.kernel.org
Subject: Re: UVCIOC_CTRL_MAP not work
Hi Hardy
try running:
echo 0xffffffff > /sys/module/uvcvideo/parameters/trace
and then your program
and then dmesg
It will tell you where it got stock
Regards!
On Fri, 28 Apr 2023 at 10:38, hardycheng(鄭易昕) <hardycheng@msi.com> wrote:
>
> Hi Ricardo,
>
> So I modify the `uvc_xu_control_mapping` struct as follows:
> (full code reference attachment `uvc_xu_v4l_mapping_demo.c`) struct
> uvc_xu_control_mapping mapping = {
> .id = 0x01,
> .name = "My Extension Unit",
> .entity = {0x10, 0xbc, 0x46, 0xba, 0x28, 0x5a, 0x4d, 0x7b, 0x97, 0x0e, 0xfd, 0x91, 0x46, 0xa5, 0x2f, 0x2d},
> .selector = 0x01,
> .size = 32,
> .offset = 0,
> .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
> .data_type = UVC_CTRL_DATA_TYPE_UNSIGNED,
> .menu_info = NULL,
> .menu_count = 0,
> .reserved = {0},
> };
>
> And I got difference error message `UVCIOC_CTRL_MAP: No such file or
> directory` Please check attachment `strace_20230428_2.log` for strace
> output
>
>
> Best Regards,
> Hardy
>
>
> -----Original Message-----
> From: Ricardo Ribalda <ribalda@chromium.org>
> Sent: Friday, April 28, 2023 4:26 PM
> To: hardycheng(鄭易昕) <hardycheng@msi.com>
> Cc: linux-media@vger.kernel.org
> Subject: Re: UVCIOC_CTRL_MAP not work
>
> 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/tre
> e/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@msi.com> 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@chromium.org>
> > Sent: Friday, April 28, 2023 4:04 PM
> > To: hardycheng(鄭易昕) <hardycheng@msi.com>
> > Cc: linux-media@vger.kernel.org
> > 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@msi.com> 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
>
>
> *****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.
next prev parent reply other threads:[~2023-04-28 8:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 7:04 UVCIOC_CTRL_MAP not work hardycheng(鄭易昕)
2023-04-28 8:04 ` Ricardo Ribalda
2023-04-28 8:20 ` hardycheng(鄭易昕)
2023-04-28 8:25 ` Ricardo Ribalda
2023-04-28 8:38 ` hardycheng(鄭易昕)
2023-04-28 8:44 ` Ricardo Ribalda
2023-04-28 8:50 ` hardycheng(鄭易昕) [this message]
2023-04-28 8:57 ` Ricardo Ribalda
2023-04-28 9:10 ` hardycheng(鄭易昕)
[not found] ` <72f03a2b961f462f89fe592d684121d8@msi.com>
2023-04-28 12:06 ` hardycheng(鄭易昕)
2023-04-28 12:11 ` Ricardo Ribalda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1f6c629d5184119b8bf1bb8172c5ac7@msi.com \
--to=hardycheng@msi.com \
--cc=linux-media@vger.kernel.org \
--cc=ribalda@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox