Re: Adding support for Benq DC E300 camera

2009-12-13 Thread Francesco Lavra
On Sun, 2009-12-13 at 09:48 +0100, Jean-Francois Moine wrote:
> On Sat, 12 Dec 2009 20:41:24 +0100
> Francesco Lavra  wrote:
> > I'm trying to get my Benq DC E300 camera to work under Linux.
> > It has an Atmel AT76C113 chip. I don't know how many Linux users would
> > benefit from a driver supporting this camera (and possibly other
> > models, too), so my question is: if/when such a driver will be
> > written, is there someone willing to review it and finally get it
> > merged? If the answer is yes, I will try to write something working.
> > 
> > This camera USB interface has 10 alternate settings, and altsetting 5
> > is used to stream data; it uses two isochronous endpoints to transfer
> > an AVI-formatted video stream (320x240) to the USB host.
> > It would be great if someone could give me some information to make
> > writing the driver easier: so far, I have only USB sniffer capture
> > logs from the Windows driver.
> 
> Hi Francesco,
> 
> gspca already handles some cameras and some Benq webcams. From a USB
> snoop, it may be easy to write a new gspca subdriver.
> 
> I join the tcl script I use to extract the important information from
> raw snoop traces. May you send me the result with your logs? Then, I
> could see if an existing subdriver could be used or if a new one has to
> be created.

Hi Jean-Francois, thanks for your interest.
In attachment my log from a video streaming session. As you can see, it
uses altsetting 5 for streaming, while all altsettings from 0 to 9 have
the same isoc endpoints. I have already tried to write a gspca subdriver
for it, but the main gspca driver sets altsetting to 9 for streaming,
which is not appropriate for this device.
But of course I may be missing something, so your help would be very
much appreciated.
Francesco



Re: Adding support for Benq DC E300 camera

2009-12-13 Thread Jean-Francois Moine
On Sat, 12 Dec 2009 20:41:24 +0100
Francesco Lavra  wrote:
> I'm trying to get my Benq DC E300 camera to work under Linux.
> It has an Atmel AT76C113 chip. I don't know how many Linux users would
> benefit from a driver supporting this camera (and possibly other
> models, too), so my question is: if/when such a driver will be
> written, is there someone willing to review it and finally get it
> merged? If the answer is yes, I will try to write something working.
> 
> This camera USB interface has 10 alternate settings, and altsetting 5
> is used to stream data; it uses two isochronous endpoints to transfer
> an AVI-formatted video stream (320x240) to the USB host.
> It would be great if someone could give me some information to make
> writing the driver easier: so far, I have only USB sniffer capture
> logs from the Windows driver.

Hi Francesco,

gspca already handles some cameras and some Benq webcams. From a USB
snoop, it may be easy to write a new gspca subdriver.

I join the tcl script I use to extract the important information from
raw snoop traces. May you send me the result with your logs? Then, I
could see if an existing subdriver could be used or if a new one has to
be created.

Regards.

-- 
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\] 
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] ] != 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 "= 0} {
		switch -regexp -- $line {
		"  URB " break
		DIRECTION_OUT {
			set out 1
		}
		TransferBufferLength {
#			set l 0x[lindex $line 3]
		}
		0..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
		}
		"  0" {
			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 "= 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
		}
		"  00" {
			if {!$nobulk} {
			if {[string length $b] == 0} {
set b [lrange $line 1 end]
			} else {
append b "\n\t  "
append b [lrange $line 1 end]
			}
			}
		}
		"  0100" {
			if {!$nobulk} {
append b "\n\t  ..."
			}
		}
		"  URB " break
		}
	}
	if {$nobulk || [string length $b] == 0} {
		return $line
	}
	puts -nonewline $deltatime
	if {$in} {
		puts "= 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 

Adding support for Benq DC E300 camera

2009-12-12 Thread Francesco Lavra
Hi,
I'm trying to get my Benq DC E300 camera to work under Linux.
It has an Atmel AT76C113 chip. I don't know how many Linux users would
benefit from a driver supporting this camera (and possibly other models,
too), so my question is: if/when such a driver will be written, is there
someone willing to review it and finally get it merged?
If the answer is yes, I will try to write something working.

This camera USB interface has 10 alternate settings, and altsetting 5 is
used to stream data; it uses two isochronous endpoints to transfer an
AVI-formatted video stream (320x240) to the USB host.
It would be great if someone could give me some information to make
writing the driver easier: so far, I have only USB sniffer capture logs
from the Windows driver.

Regards,
Francesco


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html