forked from marfrit/libva-v4l2-request-fourier
iter3 DEBUG: S_EXT_CTRLS EINVAL diagnostic in v4l2_ioctl_controls
When VIDIOC_S_EXT_CTRLS returns -EINVAL, log num_controls, error_idx,
and per-control id+size. Lets iter3+ debug "Unable to set control(s):
Invalid argument" failures by naming exactly which control set was
rejected — previously the request_log line in v4l2_set_controls just
printed strerror(errno) with no specificity.
Used in iter3 Phase 7 to confirm the frame-11 EINVAL is request-level
("error_idx == num_controls" sentinel = kernel rejected but couldn't
pinpoint a single field) rather than a single-control size mismatch.
To remove at iter4 DEBUG sweep alongside iter1 ENTER/CAPTURE-dump
instrumentation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -433,6 +433,7 @@ static int v4l2_ioctl_controls(int video_fd, int request_fd, unsigned long ioc,
|
|||||||
unsigned int num_controls)
|
unsigned int num_controls)
|
||||||
{
|
{
|
||||||
struct v4l2_ext_controls controls;
|
struct v4l2_ext_controls controls;
|
||||||
|
int rc;
|
||||||
|
|
||||||
memset(&controls, 0, sizeof(controls));
|
memset(&controls, 0, sizeof(controls));
|
||||||
|
|
||||||
@@ -444,7 +445,16 @@ static int v4l2_ioctl_controls(int video_fd, int request_fd, unsigned long ioc,
|
|||||||
controls.request_fd = request_fd;
|
controls.request_fd = request_fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ioctl(video_fd, ioc, &controls);
|
rc = ioctl(video_fd, ioc, &controls);
|
||||||
|
if (rc < 0 && errno == EINVAL && ioc == VIDIOC_S_EXT_CTRLS) {
|
||||||
|
request_log("S_EXT_CTRLS EINVAL: num_controls=%u error_idx=%u\n",
|
||||||
|
num_controls, controls.error_idx);
|
||||||
|
for (unsigned int i = 0; i < num_controls; i++) {
|
||||||
|
request_log(" ctrl[%u]: id=0x%08x size=%u\n",
|
||||||
|
i, control_array[i].id, control_array[i].size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int v4l2_get_controls(int video_fd, int request_fd,
|
int v4l2_get_controls(int video_fd, int request_fd,
|
||||||
|
|||||||
Reference in New Issue
Block a user