Description
The frame interval reported by VIDIOC_G_PARM does not match the actual
capture timing.
The default timeperframe is 1001/30000 seconds, approximately
33.367 ms per frame. However, reading 61 consecutive frames produces an
average interval of approximately 29.989 ms.
Environment
- vcam commit:
1b02973
- Kernel: Linux 6.17.0-35-generic
- Format: 640x480 RGB24
Result
Format: 640x480 RGB3
Stride/bytesperline: reported=1920 expected=1920 [PASS]
Sizeimage: reported=921600 expected=921600 [PASS]
Frame interval: reported=33.367 ms measured=29.989 ms error=10.1% [FAIL]
Expected behavior
The actual capture interval should be close to the value reported by
VIDIOC_G_PARM.
Cause
dev->output_fps stores a V4L2 timeperframe value in seconds per frame,
despite its name suggesting frames per second.
submitter_thread() currently calculates:
timeout_ms = dev->output_fps.denominator /
dev->output_fps.numerator;
For 1001/30000, this produces approximately 29.97 frames per second, but
the result is subsequently treated as milliseconds. This causes the actual
capture speed to differ from the configured and reported frame interval.
The variable should be renamed to reflect its actual meaning, and the timing
calculation should be corrected so that the configured value, reported value,
and observed capture speed are consistent.
Description
The frame interval reported by
VIDIOC_G_PARMdoes not match the actualcapture timing.
The default
timeperframeis1001/30000seconds, approximately33.367 ms per frame. However, reading 61 consecutive frames produces an
average interval of approximately 29.989 ms.
Environment
1b02973Result
Expected behavior
The actual capture interval should be close to the value reported by
VIDIOC_G_PARM.Cause
dev->output_fpsstores a V4L2 timeperframe value in seconds per frame,despite its name suggesting frames per second.
submitter_thread()currently calculates:For 1001/30000, this produces approximately 29.97 frames per second, but
the result is subsequently treated as milliseconds. This causes the actual
capture speed to differ from the configured and reported frame interval.
The variable should be renamed to reflect its actual meaning, and the timing
calculation should be corrected so that the configured value, reported value,
and observed capture speed are consistent.