Skip to contentSkip to conversation

Not able to capture video frames

DISCUSSION Sudhindra Nayak 2 participants 3 messages Jul 30, 2010 – Aug 4, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm using the 'Omnivision' ov538 camera bridge processor along with an ov10620 CMOS sensor. I'm using a driver which I got from the following link:

http://lwn.net/Articles/308358/

I've modified the driver by inserting printk statements in the driver code to understand the flow of control between functions. I've also changed the arguments passed to the 'sccb_reg_write' function to values corresponding to the ov10620 sensor.

I'm using a v4l2 example code as my application along with the above mentioned driver. The example code can be found at the below link:

http://v4l2spec.bytesex.org/spec/capture-example.html

When I run the application after inserting the driver, it calls the open_device(), init_device() and start_capturing() functions and then enters the mainloop() function. In the mainloop() function, the select() function call times out after 2 seconds and I'm not able to capture any video frames.

I'm also receiving some errors like:

gspca: ISOC data error: [3] len=56, status=-71
gspca: ISOC data error: [4] len=12, status=-71

This repeats with different values for 'len' and the value in [ ].

Any solutions??

-----
Regards,

Sudhindra Nayak

Signature · 7 lines
View this message in context: http://video4linux-list.1448896.n2.nabble.com/Not-able-to-capture-video-frames-tp5354598p5354598.html
Sent from the video4linux-list mailing list archive at Nabble.com.

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
#1 lore raw
Quoted 22 lines · On Fri, 30 Jul 2010 04:30:51 -0700 (PDT) Sudhindra Nayak…

I'm using the 'Omnivision' ov538 camera bridge processor along with an ov10620 CMOS sensor. I'm using a driver which I got from the following link:

http://lwn.net/Articles/308358/

I've modified the driver by inserting printk statements in the driver code to understand the flow of control between functions. I've also changed the arguments passed to the 'sccb_reg_write' function to values corresponding to the ov10620 sensor.

I'm using a v4l2 example code as my application along with the above mentioned driver. The example code can be found at the below link:

http://v4l2spec.bytesex.org/spec/capture-example.html

When I run the application after inserting the driver, it calls the open_device(), init_device() and start_capturing() functions and then enters the mainloop() function. In the mainloop() function, the select() function call times out after 2 seconds and I'm not able to capture any video frames.

Quoted 6 lines

I'm also receiving some errors like:

gspca: ISOC data error: [3] len=56, status=-71
gspca: ISOC data error: [4] len=12, status=-71

This repeats with different values for 'len' and the value in [ ].

Hi Sudhindra,

First, the mailing list for linux video is now
[email protected].

Then, the ov534 which appeared in lwn is rather old. The last gspca stable version may be found at LinuxTv.org, and there is a test version as a tarball in my home page (see below).

The error in the ISOC messages are set by the webcam. It means that the initialization is not complete/correct. To facilitate your job, I join a Tcl script which parses the output of sniffbin (USB sniffer on ms-win) giving a more compact and readable trace.

BTW, I could include your driver in the Linux kernel as soon as it will work...

Best regards.

Signature · 2 lines
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

#!/bin/sh
# -*- tcl -*- \
exec tclsh "$0" ${1+"$@"}

proc usage {} {
puts "Parse a ms-win USB snoop
Usage:
parsnoop \[options\] <usbsnoop file>
Options:
-nb Don't display the Bulk/Interrupt messages
-ni Don't display the Isochronous messages
-t Display the delta time between exchanges"
exit
}

proc isoc {fd} {
	global deltatime noisoc
	set in 0
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    "  URB " break
		    StartFrame {
			if {[string compare [lindex $line 2] 00000000] != 0} {
				set in 1
			}
		    }
		    TransferBufferLength {
			set l [lindex $line 2]
		    }
		    NumberOfPackets {
			set n [lindex $line 2]
		    }
		}
	}
	if {!$in || $noisoc} {
		return $line
	}
	puts -nonewline $deltatime
	puts [format "<isoc \[%d\] l:%d" 0x$n 0x$l]
	return $line
}

proc vendor {fd} {

# outgoing message
	global deltatime
	set out 0
	set b {}
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    "  URB " break
		    DIRECTION_OUT {
			set out 1
		    }
		    TransferBufferLength {
#			set l 0x[lindex $line 3]
		    }
		    00000..0: {
			if {$out} {
				if {[string length $b] != 0} {
					append b "\n\t\t  "
				}
				append b [lrange $line 1 end]
			}
		    }
		    "Request" {
			set r [format %02x 0x[lindex $line 2]]
		    }
		    "Value" {
			set v [format %04x 0x[lindex $line 2]]
		    }
		    "Index" {
			set i [format %04x 0x[lindex $line 2]]
		    }
		}
	}
	if {$out} {
		puts -nonewline $deltatime
		puts " SET $r $v $i $b"
	}
	return $line
}

proc ctrl {fd} {

# incoming message
	global deltatime
	set in 0
	set b {}
	set setup 0
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    "  URB " break
		    DIRECTION_IN {
			set in 1
		    }
		    SetupPacket {
			set setup 1
		    }
		    "  00000" {
			if {!$in} continue
			if {!$setup} {
				if {[string length $b] == 0} {
					set b [lrange $line 1 end]
				} else {
					append b "\n<\t\t  "
					append b [lrange $line 1 end]
				}
			} else {
				set r [lindex $line 2]
				set v [lindex $line 4][lindex $line 3]
				set i [lindex $line 6][lindex $line 5]
			}
		    }
		}
	}
	if {$in} {
		puts -nonewline $deltatime
		puts "<GET $r $v $i $b"
	}
	return $line
}

proc interf {fd} {

# select interface
	global deltatime
	set i {??}
	set a {??}
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    "  URB " break
		    InterfaceNumber {
			set i [format %02x 0x[lindex $line 3]]
		    }
		    AlternateSetting {
			set a [format %02x 0x[lindex $line 3]]
		    }
		}
	}
	puts -nonewline $deltatime
	puts " intf $i alt $a"
	return $line
}
proc feature {fd} {
	global deltatime
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    "  URB " break
		}
	}

puts -nonewline $deltatime
puts "feature"
return $line
}

proc transf {fd} {

# bulk or interrupt transfer
	global deltatime nobulk
	set in 0
	set b {}
	while {[gets $fd line] >= 0} {
		switch -regexp -- $line {
		    DIRECTION_IN {
			set in 1
		    }
		    "  000000" {
			if {!$nobulk} {
			    if {[string length $b] == 0} {
				set b [lrange $line 1 end]
			    } else {
				append b "\n\t      "
				append b [lrange $line 1 end]
			    }
			}
		    }
		    "  00000100" {
			if {!$nobulk} {
				append b "\n\t      ..."
			}
		    }
		    "  URB " break
		}
	}
	if {$nobulk || [string length $b] == 0} {
		return $line
	}
	puts -nonewline $deltatime
	if {$in} {
		puts "<Bulk/Int IN  $b"
	} else {
		puts " Bulk/Int OUT $b"
	}
	return $line
}
proc main {argv} {
	global nowtime prevtime withtime deltatime nobulk noisoc
	set withtime 0
	set nobulk 0
	set noisoc 0
	set deltatime {}
	set fn {}
	foreach a $argv {
		switch -- $a {
		    -t {
			set withtime 1
		    }
		    -nb {
			set nobulk 1
		    }
		    -ni {
			set noisoc 1
		    }
		    default {
			if {[string length $fn] != 0} usage
			set fn $a
		    }
		}
	}
	if {[string length $fn] == 0} usage
	if {[catch {open $fn r} fd]} {
		puts "cannot open '$fn'"
		exit 1
	}
	set nowtime 0
	set prevtime 0
	set nisoc 0
	while {[gets $fd line] >= 0} {
		set isoc 0
		switch -regexp -- $line {
		    URB_FUNCTION_ISOCH_TRANSFER {
			set line [isoc $fd]
			set isoc 1
			incr nisoc
		    }
		    URB_FUNCTION_VENDOR {
			set line [vendor $fd]
		    }
		    URB_FUNCTION_CONTROL_TRANSFER {
			set line [ctrl $fd]
		    }
		    URB_FUNCTION_SELECT_INTERFACE {
			set line [interf $fd]
		    }
		    URB_FUNCTION_SET_FEATURE_TO_DEVICE {
			set line [feature $fd]
		    }
		    URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER {
			set line [transf $fd]
		    }
		}
		if {!$noisoc && !$isoc && $nisoc != 0} {
			puts -nonewline $deltatime
			puts "$nisoc isoc"
			set nisoc 0
		}
		if {[regexp {\[([0-9]+) ms\]} $line dum ntime]} {
			set prevtime $nowtime
			set nowtime $ntime
			if {[string first down $line] > 0} {
				if {$withtime} {
					set deltatime [format "%4d " \
						[expr {$nowtime - $prevtime}]]
				} elseif {$nowtime > $prevtime + 2} {
					puts "== +[expr {$nowtime - $prevtime}] ms"
				}
			}
			if {$nowtime > $prevtime + 200} {
				puts "== \[$nowtime ms\]"
			}
		}
	}
}

main $argv

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw

Hi Jean,

First of all, thanks for the response.

I'm using the above mentioned driver and the test application on an AT91SAM9G45-EKES evaluation kit and not on the PC. Does your solution hold good for the ARM9 based kit too?

I downloaded the test version of the 'gspca' driver from your home page as you mentioned in your previous mail. I'm now using the new gspca driver , header files and the new ov534 driver. I've changed the arguments in the 'sensor_init' array to correspond to the OV10620 sensor values.

But when I run the application, I get the following:

gspca: [a.out] open
gspca: frame alloc frsz: 614400
gspca: reqbufs st:0 c:4
gspca: mmap start:4013e000 size:614400
gspca: mmap start:401d4000 size:614400
gspca: mmap start:4026a000 size:614400
gspca: mmap start:40300000 size:614400
gspca: qbuf 0
gspca: qbuf 1
gspca: qbuf 2
gspca: qbuf 3
gspca: no transfer endpoint found VIDIOC_STREAMON error 5, Input/outgspca: [a.out] close
pgspca: frame free
ut error
gspca: close done

I'm getting an I/O error here. The usb interface seems to be working fine since I tested it with a pen drive. Can you please help me out. I'm including the 'strace' ouput below for your reference:

execve("./a.out", ["./a.out"], [/* 13 vars */]) = 0
brk(0) = 0x13000
uname({sys="Linux", node="at91sam9g45ekes", ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or
directory)
open("/var/run/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l/fast-mult/half", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/v5l/fast-mult", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/tls/v5l/half/libc.so.6", gspca: [a.out] open O_RDONLY) = -1 ENOENT (No such file or directory)
sgspca: frame alloc frsz: 614400
tat64("/lib/tls/v5l/gspca: reqbufs st:0 c:4
half", 0xbee35220) = -1 ENOENT (No such file or directory)
gspca: mmap start:4013e000 size:614400 open("/lib/tls/v5l/libc.so.6", O_RDONLY) = -1 ENOENT (gspca: mmap start:401d4000 size:614400
No such file or directory)
stat64("/lib/tls/v5l", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/tls/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/fast-mult/half", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/tls/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/fast-mult", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/tls/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/tls/half", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/tls", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/v5l/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/fast-mult/half", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/v5l/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/fast-mult", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/v5l/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/v5l/half", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/v5l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/v5l", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/fast-mult/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/fast-mult/half", 0xbee35220) = -1 ENOENT (No such file or directory)
open("/lib/fast-mult/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/lib/fast-mult", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/half/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/half", 0xbee35220) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220K\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1111536, ...}) = 0 mmap2(NULL, 1147328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40025000
mprotect(0x40130000, 32768, PROT_NONE) = 0
mmap2(0x40138000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x10b) = 0x40138000 mmap2(0x4013b000, 8640, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4013b000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000
syscall_983045(0x4001d090, 0x4001d090, 0x68c, 0x4001d768, 0x40024060, 0x40024000, 0, 0xf0005, 0x60, 0xffff565c, 0, 0xbee35aec, 0, 0xbee357e8, 0x40010e24, 0x40001fc4, 0x20000010, 0x4001d090, 0xb575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
mprotect(0x40138000, 8192, PROT_READ) = 0
mprotect(0x40023000, 4096, PROT_READ) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 64), ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
write(1, "Opening Device\n", 15Opening Device
) = 15
stat64("/dev/video", {st_mode=S_IFCHR|0660, st_rdev=makedev(81, 0), ...}) = 0
open("/dev/video", O_RDWR|O_NONBLOCK) = 3
write(1, "Initializing Device\n", 20Initializing Device
) = 20
ioctl(3, VIDIOC_QUERYCAP or VT_OPENQRY, 0xbee35bec) = 0
ioctl(3, VIDIOC_CROPCAP, 0xbee35bc0) = -1 EINVAL (Invalid argument)
ioctl(3, VIDIOC_S_FMT or VT_RELDISP, 0xbee35ae0) = 0
ioctl(3, VIDIOC_REQBUFS or VT_DISALLOCATE, 0xbee35aac) = 0
brk(0) = 0x13000
brk(0x34000) = 0x34000
ioctl(3, VIDIOC_QUERYBUF or VT_RESIZE, 0xbee35a68) = 0 mmap2(NULL, 614400, PROT_READ|PROT_WRITgspca: mmap start:4026a000 size:614400
E, MAP_SHARED, 3, 0) = 0x4013e000
ioctl(3, VIDIOC_QUERgspca: mmap start:40300000 size:614400
YBUF or VT_RESIZE, 0xbee35a68) = 0
mmap2(NULL, 614400, Pgspca: qbuf 0
ROT_READ|Pgspca: qbuf 1
ROT_WRITE,gspca: qbuf 2
MAP_SHARED, 3, 0x96) = 0x40gspca: qbuf 3
1d4000
iogspca: no transfer endpoint found
ctl(3, VIDIOC_QUERYBUF or VT_RESIZE, 0xbee35a68) = 0
mmapgspca: [a.out] close
2gspca: frame free
(NULL, 614400,gspca: close done
PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x12c) = 0x4026a000
ioctl(3, VIDIOC_QUERYBUF or VT_RESIZE, 0xbee35a68) = 0 mmap2(NULL, 614400, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x1c2) = 0x40300000 write(1, "Capturing Frames\n", 17Capturing Frames
) = 17

ioctl(3, VIDIOC_QBUF, 0xbee35c0c)       = 0
ioctl(3, VIDIOC_QBUF, 0xbee35c0c)       = 0
ioctl(3, VIDIOC_QBUF, 0xbee35c0c)       = 0
ioctl(3, VIDIOC_QBUF, 0xbee35c0c)       = 0
ioctl(3, VIDIOC_STREAMON, 0xbee35c50)   = -1 EIO (Input/output error)

write(2, "VIDIOC_STREAMON error 5, Input/o"..., 44VIDIOC_STREAMON error 5, Input/output error
) = 44
io_submit(0x1, 0x1, 0xfbad2088 <unfinished ... exit status 1> Process 1053 detached

-----
Regards,

Sudhindra Nayak

Signature · 7 lines
View this message in context: http://video4linux-list.1448896.n2.nabble.com/Not-able-to-capture-video-frames-tp5354598p5372108.html
Sent from the video4linux-list mailing list archive at Nabble.com.

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list