Bug 531234

Summary: QuickCam Express driver "gives error dequeuing buf"
Product: [Fedora] Fedora Reporter: Tom Chiverton <bugzilla.redhat.com>
Component: kernelAssignee: Hans de Goede <hdegoede>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: dmitry, dougsland, gansalmon, hdegoede, itamar, kernel-maint
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-31 10:14:40 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Tom Chiverton 2009-10-27 08:53:03 EDT
I have a
Bus 005 Device 002: ID 046d:0840 Logitech, Inc. QuickCam Express
that worked fine with older Fedora kernels using the qc-usb driver.

I understand Fedora now ship the gspca_stv06xx driver (handy as the qc-usb is barely maintained and doesn't compile !), and indeed I get this at boot:

Oct 26 23:21:39 bookcase klogd: STV06xx: Initializing camera
Oct 26 23:21:39 bookcase klogd: gspca: probe ok
Oct 26 23:21:39 bookcase klogd: usbcore: registered new interface driver STV06xx
Oct 26 23:21:39 bookcase klogd: STV06xx: registered
Oct 26 23:21:40 bookcase fail2ban.actions: WARNING [SMTP] Unban 61.52.156.47
Oct 26 23:22:29 bookcase ntpd[1345]: synchronized to 212.23.8.6, stratum 2
Oct 26 23:23:51 bookcase fail2ban.actions: WARNING [SMTP] Unban 61.16.254.114

v4l seems happy:
# v4l-info

### v4l2 device info [/dev/video0] ###
general info
VIDIOC_QUERYCAP
driver : "STV06xx"
card : "Camera"
bus_info : "usb-0000:00:1d.3-1"
version : 2.5.0
capabilities : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

however, I get an odd error when capturing an image:
# v4lctl -v 1 webcam a
vid-open: trying: v4l2...
v4l2: open
v4l2: device info:
STV06xx 2.5.0 / Camera @ usb-0000:00:1d.3-1
vid-open: ok: v4l2
freq: reading /usr/share/xawtv/Index.map
cmd: "webcam" "a"
v4l2: new capture params (360x296, RGB3, 319680 byte)
setformat: 24 bit TrueColor (BE: rgb) (360x296): ok
v4l2: new capture params (360x296, RGB3, 319680 byte)
libv4l2: error dequeuing buf: Input/output error
v4l2: read: Input/output error
v4l2: close

The 'webcam' application reports the same error:
#  rpm -qf /usr/bin/webcam ; /usr/bin/webcam /etc/webcamrc
xawtv-3.95-11.fc11.x86_64
reading config file: /etc/webcamrc
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr
grabber config:
  size 320x240 [none]
  input (null), norm (null), jpeg quality 75
  rotate=0, top=0, left=0, bottom=240, right=320
write config [ftp]:
  local transfer /home/drupal/images/tmp.jpg => /home/drupal/images/cam.jpg
libv4l2: error dequeuing buf: Input/output error
v4l2: read: Input/output error
capturing image failed
# grep dev /etc/webcamrc
device = /dev/video0
Comment 1 Dmitry Butskoy 2009-10-27 09:38:13 EDT
It seems libv4l-related bug.

Could you rebuild xawtv on your system without libv4l patch? (ie.
rpmbuild --without libv4l xawtv.spec
etc...)
Comment 2 Hans de Goede 2009-10-27 09:58:16 EDT
Just because libv4l happens to catch and report the error does not make this a libv4l error. Given the "Input/output error" message, I suspect this is an issue
with the kernel driver. There are 2 different versions of the 046d:0840 Logitech, Inc. QuickCam Express, one using the pb0100 sensor and one using a HDCS sensor, the output of dmesg should contain the type of sensor detected right above this line:

STV06xx: Initializing camera

I think that you probably have a cam with the HDCS sensor, as there recently have been some fixes to the HDCS sensor support.

I myself have such a cam with a pb0100 sensor, and that has been working fine for
a while now.
Comment 3 Tom Chiverton 2009-10-27 10:14:46 EDT
Hope this is right:
# yum install xawtv-source
# rpm -q xawtv
xawtv-3.95-11.fc11.x86_64
# wget ftp://download.fedora.redhat.com/pub/fedora/linux/releases/11/Everything/source/SRPMS/xawtv-3.95-11.fc11.src.rpm
# cd ......
# rpmbuild --without libv4l -ba xawtv.spec 
# rpm -Uvh --force ............./xawtv-3.95-11.fc11.x86_64.rpm

Repeat my v4lctl test:

# v4lctl -v 1 webcam a
vid-open: trying: v4l2...
v4l2: open
v4l2: device info:
  STV06xx 2.5.0 / Camera @ usb-0000:00:1d.3-1
vid-open: ok: v4l2
freq: reading /usr/share/xawtv/Index.map
cmd: "webcam" "a"
setformat: 24 bit TrueColor (BE: rgb) (0x0): failed
setformat: 24 bit TrueColor (LE: bgr) (0x0): failed
setformat: 32 bit TrueColor (BE: -rgb) (0x0): failed
setformat: 16 bit YUV 4:2:2 (packed, YUYV) (0x0): failed
setformat: 16 bit YUV 4:2:2 (planar) (0x0): failed
setformat: 12 bit YUV 4:2:0 (planar) (0x0): failed
setformat: MJPEG (AVI) (0x0): failed
setformat: JPEG (JFIF) (0x0): failed
no way to get: 0x0 24 bit TrueColor (BE: rgb)
v4l2: close

I shouldn't need to reload the modules or anything, right ?
Comment 4 Tom Chiverton 2009-10-27 10:18:19 EDT
@Hans de Goede :

# grep STV /var/log/messages
Oct 26 23:03:43 bookcase klogd: usbcore: deregistering interface driver STV06xx
Oct 26 23:03:43 bookcase klogd: STV06xx: Disconnecting the stv06xx device
Oct 26 23:03:43 bookcase klogd: STV06xx: Disconnecting the sensor
Oct 26 23:03:43 bookcase klogd: STV06xx: deregistered
Oct 26 23:03:50 bookcase klogd: STV06xx: Probing for a stv06xx device
Oct 26 23:03:50 bookcase klogd: STV06xx: Configuring camera
Oct 26 23:03:50 bookcase klogd: STV06xx: HDCS-1000/1100 sensor detected
Oct 26 23:03:50 bookcase klogd: STV06xx: Initializing camera
Oct 26 23:03:50 bookcase klogd: usbcore: registered new interface driver STV06xx
Oct 26 23:03:50 bookcase klogd: STV06xx: registered
Oct 26 23:17:19 bookcase klogd: usbcore: deregistering interface driver STV06xx
Oct 26 23:17:19 bookcase klogd: STV06xx: Disconnecting the stv06xx device
Oct 26 23:17:19 bookcase klogd: STV06xx: Disconnecting the sensor
Oct 26 23:17:19 bookcase klogd: STV06xx: deregistered
Oct 26 23:21:39 bookcase klogd: STV06xx: Probing for a stv06xx device
Oct 26 23:21:39 bookcase klogd: STV06xx: Configuring camera
Oct 26 23:21:39 bookcase klogd: STV06xx: HDCS-1000/1100 sensor detected
Oct 26 23:21:39 bookcase klogd: STV06xx: Initializing camera
Oct 26 23:21:39 bookcase klogd: usbcore: registered new interface driver STV06xx
Oct 26 23:21:39 bookcase klogd: STV06xx: registered
Comment 5 Hans de Goede 2009-10-28 06:38:44 EDT
Ok, so you indeed have an HDCS sensor using version, I think the issue you are seeing has been fixed upstream. I'll try to create a fixed Fedora-12 kernel for you (there are other fixes upstream worthwhile backporting too), but this may
have to wait until F-12 goes gold, as we are currently deeply frozen.
Comment 6 Tom Chiverton 2009-10-28 13:53:59 EDT
Is it not possible to back-port the updates to Fedora 11 ?
Though I wouldn't see a problem running a F12 kernel (+ dependencies) on F11...
Comment 7 Tom Chiverton 2009-11-06 14:04:32 EST
The most recent F11 update 2.6.30.9-96.fc11.x86_64 appears to have fixed this issue, though I didn't see anything in the changelog of relevance.
Comment 8 Tom Chiverton 2009-11-06 14:10:18 EST
Oh, scratch that - it worked for a few minutes (right after reboot to install the updates), and I was able to capture a few images, and now it's gone back to 

libv4l2: error dequeuing buf: Input/output error
v4l2: read: Input/output er

again :-(
Comment 9 Tom Chiverton 2009-12-03 14:04:19 EST
With the latest kernel:
# uname -a ;rpm -q kernel
Linux bookcase 2.6.30.9-99.fc11.x86_64 #1 SMP Tue Nov 17 21:30:38 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
kernel-2.6.30.8-64.fc11.x86_64
kernel-2.6.30.9-90.fc11.x86_64
kernel-2.6.30.9-96.fc11.x86_64
kernel-2.6.30.9-99.fc11.x86_64

'webcam' runs for a bit longer (around 30 minutes) but the image is just coloured static, and evenutaly refuses to restart as before:
# webcam /etc/webcamrc                 
reading config file: /etc/webcamrc                      
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr      
grabber config:                                         
  size 320x240 [none]                                   
  input (null), norm (null), jpeg quality 75            
  rotate=0, top=0, left=0, bottom=240, right=320        
write config [ftp]:                                     
  local transfer /home/drupal/images/tmp.jpg => /home/drupal/images/cam.jpg
^C                                                                         
# webcam /etc/webcamrc                                    
reading config file: /etc/webcamrc                                         
video4linux webcam v1.5 - (c) 1998-2002 Gerd Knorr                         
grabber config:                                                            
  size 320x240 [none]                                                      
  input (null), norm (null), jpeg quality 75                               
  rotate=0, top=0, left=0, bottom=240, right=320                           
write config [ftp]:                                                        
  local transfer /home/drupal/images/tmp.jpg => /home/drupal/images/cam.jpg
libv4l2: error dequeuing buf: Input/output error                           
v4l2: read: Input/output error                                             
capturing image failed                                                     
# 

'v4lctl' seems happier:
# v4lctl -v 1 show
vid-open: trying: v4l2...
v4l2: open
v4l2: device info:
  STV06xx 2.5.0 / Camera @ usb-0000:00:1d.3-1
vid-open: ok: v4l2
freq: reading /usr/share/xawtv/Index.map
cmd: "show"
norm: (null)
input: STV06xx
Whitebalance (software): on
Gamma (software): 1000
exposure: 222003
Auto Gain (software): on
gain: 166
Horizontal flip (sw): off
Vertical flip (sw): off
v4l2: close

# v4l-info                                                         

### v4l2 device info [/dev/video0] ###
general info                          
    VIDIOC_QUERYCAP                   
        driver                  : "STV06xx"
        card                    : "Camera" 
        bus_info                : "usb-0000:00:1d.3-1"
        version                 : 2.5.0               
        capabilities            : 0x5000001 [VIDEO_CAPTURE,READWRITE,STREAMING]

standards

inputs
    VIDIOC_ENUMINPUT(0)
        index                   : 0
        name                    : "STV06xx"
        type                    : CAMERA   
        audioset                : 0        
        tuner                   : 0        
        std                     : 0x0 []   
        status                  : 0x0 []   

video capture
    VIDIOC_ENUM_FMT(0,VIDEO_CAPTURE)
        index                   : 0 
        type                    : VIDEO_CAPTURE
        flags                   : 0            
        description             : "BA81"       
        pixelformat             : 0x31384142 [BA81]
    VIDIOC_G_FMT(VIDEO_CAPTURE)                    
        type                    : VIDEO_CAPTURE    
        fmt.pix.width           : 360              
        fmt.pix.height          : 296              
        fmt.pix.pixelformat     : 0x31384142 [BA81]
        fmt.pix.field           : NONE             
        fmt.pix.bytesperline    : 360              
        fmt.pix.sizeimage       : 106560           
        fmt.pix.colorspace      : SRGB             
        fmt.pix.priv            : 1                

controls

### video4linux device info [/dev/video0] ###
general info                                 
    VIDIOCGCAP                               
        name                    : "Camera"   
        type                    : 0x1 [CAPTURE]
        channels                : 1            
        audios                  : 0            
        maxwidth                : 360          
        maxheight               : 296          
        minwidth                : 48           
        minheight               : 32           

channels
    VIDIOCGCHAN(0)
        channel                 : 0
        name                    : "STV06xx"
        tuners                  : 0        
        flags                   : 0x0 []   
        type                    : CAMERA   
        norm                    : 0        

tuner
ioctl VIDIOCGTUNER: Invalid argument

audio
    VIDIOCGAUDIO
        audio                   : 0
        volume                  : 0
        bass                    : 0
        treble                  : 0

picture
    VIDIOCGPICT
        brightness              : 0
        hue                     : 0
        colour                  : 0
        contrast                : 0
        whiteness               : 0
        depth                   : 8
        palette                 : unknown

buffer
ioctl VIDIOCGFBUF: Invalid argument

window
    VIDIOCGWIN
        x                       : 0
        y                       : 0
        width                   : 360
        height                  : 296
        chromakey               : 0
        flags                   : 0
Comment 10 Tom Chiverton 2009-12-03 14:08:36 EST
v4lctl's snap shot mode fails too

# v4lctl -v 1 webcam t
vid-open: trying: v4l2...
v4l2: open
v4l2: device info:
  STV06xx 2.5.0 / Camera @ usb-0000:00:1d.3-1
vid-open: ok: v4l2
freq: reading /usr/share/xawtv/Index.map
cmd: "webcam" "t"
v4l2: new capture params (360x296, RGB3, 319680 byte)
setformat: 24 bit TrueColor (BE: rgb) (360x296): ok
v4l2: new capture params (360x296, RGB3, 319680 byte)
libv4l2: error dequeuing buf: Input/output error
v4l2: read: Input/output error
v4l2: close
# ls -lah t
ls: cannot access t: No such file or directory

There is a second or two's pause after the 2nd 'new capture params' is outputed.
Comment 11 Hans de Goede 2009-12-04 03:04:38 EST
That there is no improvement is expected, as I have not updated the kernel's webcam stack. When I get around to creating a kernel with an updated webcam stack I'll post a request in this bug to test it.
Comment 12 Tom Chiverton 2009-12-04 09:35:53 EST
Didn't mean to imply that I expected any, just reporting.
Comment 13 Tom Chiverton 2010-01-16 12:15:54 EST
Did you get these info FC12 yet ? If so, I can just upgrade the server to it.
Comment 14 Tom Chiverton 2010-01-29 10:12:46 EST
Well, this is odd. The latest F11 kernel (kernel-2.6.30.10-105.2.4.fc11.x86_64)  seems to work fine now !

Unfortunately the package announce list archives at https://www.redhat.com/archives/fedora-package-announce/2010-January/date.html have stopped for the last few weeks, so I can't see the change log for the latest build to know if it was deliberate or not.
Comment 15 Tom Chiverton 2010-01-29 10:30:03 EST
Sorry for bug spam, but it seems just when I think it's stable, it keels over again :-/
Comment 16 Hans de Goede 2010-01-29 10:34:36 EST
No problem. This reminds me I wanted to ask you to test the
2.6.32 update we've been preparing, that has all the latest upstream bits
for your cam. So if that does not fix it, then we need to get the upstream driver author involved.

You can download the kernel I'm talking about here:
http://koji.fedoraproject.org/koji/buildinfo?buildID=152968

Before you boot into this kernel, make sure you have all
libdrm xorg and mesa updates installed, as the modesetting ABI has
seen some changes.

So first do:
yum update 'libdrm*' 'xorg*' 'mesa*'

Thanks,

Hans
Comment 17 Tom Chiverton 2010-01-29 14:09:28 EST
This might take a while - I can't update to the FC12 kernel without taking the whole system to FC12 too :-(

rpm claims (amongst other deps.)
 xorg-x11-drv-ati-firmware is needed by kernel-2.6.32.6-36.fc12.x86_64
and that's not in the FC11 repos according to yum :-(
Comment 18 Hans de Goede 2010-01-29 14:21:51 EST
Oh you are still at Fedora 11 I didn't get that. Anyways putting this back in need info (so it disappears from my to do list) until you get around to upgrading to F-12. I don't see the relevant kernel getting into F-11 any time soon, and I really need you to test with that before we can move forward with this bug.
Comment 19 Tom Chiverton 2010-01-31 09:39:58 EST
I've upgraded to FC12.

Good news, works out of the box.

I tested the newer kernel you suggested, that's fine too. It might be taking a little longer to settle on the correct white balance (i.e. the picture starts off whited out, then improves), but this was hit and miss with the alt. driver under FC11 too.
Comment 20 Hans de Goede 2010-01-31 10:14:40 EST
Hi,

Thanks for testing. Closing this based on the test results.

Regards,

Hans