Skip to content

Video capture from stk1160 device fails #620

Closed
@hungerburg

Description

@hungerburg

The r-pi is a Model B made in UK running up to date raspbian. No monitor or keyboard attached, just logged in with ssh, still booted into graphical shell. Overclocking is set to 'modest'. The easycap is the only external USB device. The SDCard is a type 10. Below how to reproduce the error:

$ uname -a
Linux raspberrypi 3.12.21+ #689 PREEMPT Wed Jun 11 21:45:12 BST 2014 armv6l GNU/Linux
$ v4l2-ctl --set-standard=5
$ v4l2-ctl --get-fmt-video
Format Video Capture:
    Width/Height  : 720/576
    Pixel Format  : 'UYVY'
    Field         : Interlaced
    Bytes per Line: 1440
    Size Image    : 829440
    Colorspace    : Broadcast NTSC/PAL (SMPTE170M/ITU601)
$ avconv -v verbose -f video4linux2 -i /dev/video0 -b 5M -y /tmp/KK.flv
[…]
avconv version 0.8.10-6:0.8.10-1+rpi1, Copyright (c) 2000-2013 the Libav developers
[…]
[video4linux2 @ 0xcaa720] [4]Capabilities: 85000001
[video4linux2 @ 0xcaa720] Querying the device for the current frame size
[video4linux2 @ 0xcaa720] Setting frame size to 720x576
[video4linux2 @ 0xcaa720] The v4l2 frame is 828416 bytes, but 829440 bytes are expected
[…]
Press ctrl-c to stop encoding
[video4linux2 @ 0xcaa720] The v4l2 frame is 826906 bytes, but 829440 bytes are expected
frame=    0 fps=  0 q=0.0 Lsize=       0kB time=10000000000.00 bitrate=   0.0kbits/s    
video:0kB audio:0kB global headers:0kB muxing overhead nan%
$ dmesg
[…]
[81714.038072] usb 1-1.3.2: New device Syntek Semiconductor USB 2.0 Video Capture Controller @ 480 Mbps (05e1:0408, interface 0, class 0)
[…]
[81283.278685] stk1160: streaming started
[81283.431336] URB packet 0, status -63 [Buffer error (overrun)].
[81283.460993] stk1160: killing 8 urbs...
[…]

Capture stops at the first frame by itself. PAL or NTSC (smaller image size but higher framerate, so possibly not much bandwidth change) does not matter. It seems not connected to power draw; I get the same results with the easycap plugged into the pi or a powered hub.

The first value in the avconv output (bytes received) is only ever slightly below the second value (bytes expected), but its not always the same. There are two video4linux messages in avconv output but there is only one buffer overrun in dmesg. If the fault is bandwidth based, probably the device can be set to capture in another resolution?

Curiously, streaming video4linux to file works somehow, although the dump file is of different size each time:

$ sudo dmesg -c
$ v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=/tmp/KK.dat
<<<<<<<<<<<<<<<<<<<<<<<<<< 25 fps
<<<<<<<<<<<<<<<<<<<<<<<< 23 fps
<<<<<<<<<<<<<<<<<<<<<<<<<< 25 fps
<<<<<<<<<<<<<<<<<<<<<<<<

$ du /tmp/KK.dat 
80732   /tmp/KK.dat
$ dmesg | grep -c overrun
9

I read a lot about grabbing video on the r-pi, some people seem to have success with the stk1160 module (I remember to have seen a picture from avplay when connected in xrdp before the rpi-update from 3.10 to 3.12), some seem to be lucky with the easycap driver.

Kind regards

Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions