V4L2 driver can't access stream from /dev/video; I/O or ioctl error
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
V4L2 driver can't access stream from /dev/video; I/O or ioctl error
I have a Hauppauge DVR at /dev/video0. The device is correctly identified and labeled by V4L2 information utils, but it is unable to pass video. When opened with the qV4L2 utility, I get these two errors:
"VIDIOC_CROPCAP returned -1 (Inappropriate ioctl for device)"
and
"VIDIOC_G_SELECTION returned -1 (Inappropriate ioctl for device)"
edit: and of course the error from ffmpeg:
"[video4linux2,v4l2 @ 0x7f526c000920] The device does not support the streaming I/O method.
/dev/video0: Function not implemented"
I have verified that the device works and that I can read it by using ffplay file:/dev/video0, or cat /dev/video0 > video.ts. The video seems to play fine at least and even cooperates with the video paramaters I have tried it with.
And ffplay -i /dev/video0 spits out the V4L2 error, thus giving it trouble with a lot of ffmpeg's capabilities.
I know nothing about drivers so I'm at a dead end here, thanks
Last edited by tempo-namee; 09-14-2017 at 04:52 PM.
You have chosen not to tell us what card model you have. All we can do is suggest you inspect the dmesg.
I have a GeForce GTX 650 Ti. There is nothing from the hdpvr in dmesg.
Sorry, but what does that have to do with this? I have already verified that I can view video from this device. It is only when interacting with the V4L2 drivers (and therefore most of ffmpeg) that it becomes a problem.
Last edited by tempo-namee; 09-15-2017 at 03:27 PM.
GeForce GTX 650 Ti is not a PVR card. Use a pastebin site to post your dmesg if you have difficulties interpreting its contents.
I'm sorry, I have no idea what you are asking. I know how to read dmesg and there is no message relating to operation of the DVR.
I have a Hauppauge DVR. It is a standalone device and not a capture card in my computer. It has its own fricking kernel module (modinfo hdpvr)... My device is correctly identified by the computer and by V4L2. Again, I can view the raw video stream and record it, but nothing beyond that that requires the V4L2 driver (which is a lot of stuff)
Last edited by tempo-namee; 09-15-2017 at 04:22 PM.
Hauppauge DVR has PCI ID if it is a PCI device, or USB ID - if it is a USB device. We need to identify the hardware, then we can diagnose how kernel is handling it. If you are unable to provide this information then nobody can help you. For instance here is my device:
Code:
04:00.0 Multimedia video controller [0400]: Conexant Systems, Inc. CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb [14f1:8880] (rev 04)
Hauppauge DVR has PCI ID if it is a PCI device, or USB ID - if it is a USB device. We need to identify the hardware, then we can diagnose how kernel is handling it.
Here is the output for that device from lsusb -v:
Code:
Bus 001 Device 006: ID 2040:4902 Hauppauge HD PVR
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x2040 Hauppauge
idProduct 0x4902 HD PVR
bcdDevice 0.00
iManufacturer 1 AMBA
iProduct 2 Hauppauge HD PVR
iSerial 3 00A3AD35
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 4mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 2
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered
Reloading the kernel module should be seen in dmesg, did it load properly?
Yes.. I already set modprobe to load the appropriate drivers at boot anyway. When I run the sample script again this is the confirmation dmesg gives me:
Edit: by the way, I would not have been able to view video from the device if the kernel module weren't properly loaded. I appreciate your help but I am not starting from the complete beginning of troubleshooting. There is either something wrong with the device or the V4L2 driver. It is not a basic thing like whether the USB device is recognized or not
Last edited by tempo-namee; 09-16-2017 at 12:04 PM.
I'm starting to think there is a module missing/not loaded. Below is a snippet from kernel config, you can see there are special drivers to handle USB video. This is just a snippet, there is much more in Linux kernel. I do not have this hardware to experiment with. You could load a live version of some specialized multimedia distro and see if it can handle it, then compare lsmod output.
Code:
│ XXX *** Digital TV USB devices *** │
│ XXX Support for various USB DVB devices │
│ XXX Enable extended debug support for all DVB-USB devices │
│ XXX DVB_USB_DIB3000MC │
│ XXX AVerMedia AverTV DVB-T USB 2.0 (A800) │
│ XXX DiBcom USB DVB-T devices (based on the DiB3000M-B) (see help for device list) │
│ XXX Support faulty USB IDs │
│ XXX DiBcom USB DVB-T devices (based on the DiB3000M-C/P) (see help for device list) │
│ XXX DiBcom DiB0700 USB DVB devices (see help for supported devices) │
│ XXX HanfTek UMT-010 DVB-T USB2.0 support │
│ XXX Conexant USB2.0 hybrid reference design support │
│ XXX Uli m920x DVB-T USB2.0 support │
│ XXX Nebula Electronics uDigiTV DVB-T USB2.0 support │
│ XXX TwinhanDTV Alpha/MagicBoxII, DNTV tinyUSB2, Beetle USB2.0 support │
│ XXX TwinhanDTV StarBox and clones DVB-S USB2.0 support │
│ XXX GENPIX 8PSK->USB module support │
│ XXX Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support │
│ XXX Pinnacle 400e DVB-S USB2.0 support │
│ XXX WideView WT-200U and WT-220U (pen) DVB-T USB2.0 support (Yakumo/Hama/Typhoon/Yuan) │
│ XXX Opera1 DVB-S USB2.0 receiver │
│ XXX Afatech AF9005 DVB-T USB1.1 support │
│ XXX Afatech AF9005 default remote control support │
│ XXX Pinnacle PCTV HDTV Pro USB device/TT Connect S2-3600 │
│ XXX DvbWorld & TeVii DVB-S/S2 USB2.0 support │
│ XXX Terratec CinergyT2/qanu USB 2.0 DVB-T receiver │
│ XXX AME DTV-5100 USB2.0 DVB-T support │
│ XXX Friio ISDB-T USB2.0 Receiver support │
│ XXX Azurewave DVB-S/S2 USB2.0 AZ6027 support │
│ XXX Technisat DVB-S/S2 USB2.0 support │
│ XXX Support for various USB DVB devices v2 │
│ XXX Afatech AF9015 DVB-T USB2.0 support │
│ XXX Afatech AF9035 DVB-T USB2.0 support │
│ XXX Anysee DVB-T/C USB2.0 support │
│ XXX Alcor Micro AU6610 USB2.0 support │
│ XXX AzureWave 6007 and clones DVB-T/C USB2.0 support │
│ XXX Intel CE6230 DVB-T USB2.0 support │
│ XXX E3C EC168 DVB-T USB2.0 support │
│ XXX Genesys Logic GL861 USB2.0 support │
│ XXX LME DM04/QQBOX DVB-S USB2.0 support │
│ XXX MxL111SF DTV USB2.0 support │
│ XXX Realtek RTL28xxU DVB USB support │
│ XXX DVBSky USB support │
│ XXX ZyDAS ZD1301 │
│ XXX Technotrend/Hauppauge Nova-USB devices │
│ XXX Technotrend/Hauppauge USB DEC devices │
│ XXX Siano SMS1xxx based MDTV receiver │
│ XXX Technisat/B2C2 Air/Sky/Cable2PC USB │
│ XXX Enable debug for the B2C2 FlexCop drivers │
│ XXX Abilis AS102 DVB receiver │
There is only one kernel module (hdpvr) mentioned in every documentation for this device. There is only one module needed for V4L2 and it is videodev, which I have already loaded.
Last edited by tempo-namee; 09-17-2017 at 11:35 AM.
You are not listening. Did you or did you not try with a specialized Linux multimedia distro?
Code:
Multimedia video controller: Conexant Systems, Inc. CX23887/8 PCIe Broadcast Audio and Video Decoder with 3D Comb (rev 04)
Subsystem: Hauppauge computer works Inc. WinTV-quadHD
I have this ^^.
All articles I found about it tell me all I need is cx23885 module. Wrong. When I installed the card it did not work at all. I started experimenting and found out I also need si2157, lgdt3306a, cx2341x, tda18271, m88ds3103, lgdt330x.
You are not listening. Did you or did you not try with a specialized Linux multimedia distro?
Well since you insisted, I went out and installed virtualbox and tried two mainstream multimedia linux distros (Ubuntu Studio and AV Linux) and both gave the exact same error and symptoms I described in my above post.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.