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:20:03 +0000 [thread overview]
Message-ID: <c19a2cb8f0d04f19bcc884f13b185261@msi.com> (raw)
In-Reply-To: <CANiDSCsvuA4f8Kjzp27ncy+HXHft+chMeR5REFAjpj-G4Pc-JA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3508 bytes --]
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.
[-- Attachment #2: strace_20230428.log --]
[-- Type: application/octet-stream, Size: 3290 bytes --]
root@ubuntu22:/ms5548_test# strace -f ./uvc_xu_v4l_mapping_demo
execve("./uvc_xu_v4l_mapping_demo", ["./uvc_xu_v4l_mapping_demo"], 0x7fff9c969de8 /* 76 vars */) = 0
brk(NULL) = 0x55baa8504000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc59064f70) = -1 EINVAL (Invalid argument)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb94c41f000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=65987, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 65987, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb94c40e000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\237\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
pread64(3, "\4\0\0\0 \0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0"..., 48, 848) = 48
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0i8\235HZ\227\223\333\350s\360\352,\223\340."..., 68, 896) = 68
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=2216304, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 2260560, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb94c000000
mmap(0x7fb94c028000, 1658880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7fb94c028000
mmap(0x7fb94c1bd000, 360448, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7fb94c1bd000
mmap(0x7fb94c215000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x214000) = 0x7fb94c215000
mmap(0x7fb94c21b000, 52816, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb94c21b000
close(3) = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb94c40b000
arch_prctl(ARCH_SET_FS, 0x7fb94c40b740) = 0
set_tid_address(0x7fb94c40ba10) = 6285
set_robust_list(0x7fb94c40ba20, 24) = 0
rseq(0x7fb94c40c0e0, 0x20, 0, 0x53053053) = 0
mprotect(0x7fb94c215000, 16384, PROT_READ) = 0
mprotect(0x55baa6c47000, 4096, PROT_READ) = 0
mprotect(0x7fb94c459000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7fb94c40e000, 65987) = 0
openat(AT_FDCWD, "/dev/video0", O_RDWR) = 3
ioctl(3, UVCIOC_CTRL_MAP, 0x7ffc59064fb0) = -1 ENOTTY (Inappropriate ioctl for device)
dup(2) = 4
fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
getrandom("\x87\xd1\x7a\x35\xc1\x4e\xa8\x44", 8, GRND_NONBLOCK) = 8
brk(NULL) = 0x55baa8504000
brk(0x55baa8525000) = 0x55baa8525000
newfstatat(4, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0), ...}, AT_EMPTY_PATH) = 0
write(4, "UVCIOC_CTRL_MAP: Inappropriate i"..., 48UVCIOC_CTRL_MAP: Inappropriate ioctl for device
) = 48
close(4) = 0
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++
next prev parent reply other threads:[~2023-04-28 8:20 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(鄭易昕) [this message]
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(鄭易昕)
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=c19a2cb8f0d04f19bcc884f13b185261@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