After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698825 - v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-25 10:46 UTC by Michael Olbrich
Modified: 2013-05-01 13:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1016 bytes, patch)
2013-04-25 10:46 UTC, Michael Olbrich
committed Details | Review

Description Michael Olbrich 2013-04-25 10:46:20 UTC
Created attachment 242398 [details] [review]
patch

Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl
is not implemented. With this patch, GStreamer handles both cases.
Comment 1 Sebastian Dröge (slomo) 2013-04-25 10:48:04 UTC
ENOTTY seems semantically wrong for this, and wasn't this only in a single kernel version and this change was reverted again later?
Comment 2 Tim-Philipp Müller 2013-04-25 10:56:51 UTC
I think that was ENOENT for VIDIOC_QUERYCTRL, bug #691098 ?
Comment 3 Michael Olbrich 2013-04-25 13:17:10 UTC
You're right this patch is bogus.
Comment 4 Michael Olbrich 2013-04-30 09:28:58 UTC
I couldn't find the code path in the kernel that caused this issue so I dropped the patch. Now I came across the issue again. It exists in v3.9 and has existed for some time.
What happens is basically this:

drivers/media/v4l2-core/v4l2-ioctl.c:
__video_do_ioctl(...)
{
[...]
 	long ret = -ENOTTY;
[...]
  if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) ...)
    goto done;
[...]
done:
[...]
  return ret;
}
Comment 5 Sebastian Dröge (slomo) 2013-05-01 13:35:21 UTC
commit 4d3f6850cac63145b119ffe60cfb197e5d7e77cd
Author: Philipp Zabel <p.zabel@pengutronix.de>
Date:   Thu Jul 5 18:02:27 2012 +0200

    v4l2: handle return value -ENOTTY for unimplemented VIDIOC_G_PARM
    
    Newer kernels return -ENOTTY, older kernels return -EINVAL if the ioctl
    is not implemented. With this patch, GStreamer handles both cases.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698825