Archived:Development: USB based video drivers

From LinuxTVWiki
Jump to navigation Jump to search

USB Video

see Em2820 for more information about how to write an usb video driver

What we need from you to get your USB Device work

Requested Devices

Device Status
Genius TVGO u202 video/audio works (720x288 non interlaced half frames, Audio USB Audio) - no tuning yet
ALI Corp 1.3M Pixel USB 2.0 Bad quality video yet
uli-m9205 Driver is in development, quality will be good
Aiptek USB DualCam
Hauppauge WinTV USB 2.0 -- AUDIO!

Best thing would be to donate(prefered of course for the work :) or send your device to a developer for a few weeks

Working Devices

Device Status
Pinnacle PCTV USB 2.0 supported
Terratec Cinergy 250 USB 2.0 supported
MSI Vox USB 2.0 supported (res. <= 640x480)
Hauppauge WinTV USB 2.0 supported

Requirements

this site explains how to get empiatech devices or similar running with linux by applying changes which might only work with your device.

USBView output

Usbview.png


We also need the linux usbview output of your device


Get usbsnoop for windows

http://benoit.papillault.free.fr/usbsnoop/

http://benoit.papillault.free.fr/stats/get.php?location=../usbsnoop/sniff-bin-1.8.zip

if the link is down, you can also ask in IRC

Set up usbsnoop and start sniffing

Before starting to sniff start up your TV application and set it to the highest resolution (for em2820/em2840 devices the highest resolution should be 720x576 or 720x480 or 640x480?)


also tell us which resolution you used for it


attach the sniffer to your device and start logging:

Sniffer06.png


Finally start up your TV application again, everything will slow down after it's started but it's worth doing it that way hardware analyzers cost a few thousand dollars... please sniff about 200 - 300 MB! it will be easier for analyzing. after the sniffer recorded a few videoframes close the application again, compress the logfile, upload it somewhere or mail it to mrechberger@gmail.com. we'll then have a look at what's different with your device.

I wrote the parser below for generating code from the logfile,

a quick hack would be to paste the generated "em2820_write_regs_req()" codelines (which show up before UNABLE TO HANDLE ISOC TRANSFERS) at the end of the "static int em2820_config(struct em2820* dev)" function but before the return 0; line if you have any questions about it just join the #v4l on irc.freenode.org

hope everything's confusing enough now :)

    • but note usbsnoop logs aren't always useful, by experience I had to patch the usbcore for getting usable logs, vmware accesses the usb subsystem through it **

Tools for reverse engineering:

http://diginet.homelinux.org/sources/initgen.pl this tool creates a struct with
the usb data that got sent to the device
http://diginet.homelinux.org/sources/log2bin.pl extract videodata from the usbsnoop logfile
(try to play it with

mplayer(as a rawvideo, you need to figure out the raw videoformat of your device)

http://diginet.homelinux.org/sources/usbanalyze.pl convert the usbsnoop log to a human readable format for analyzing what's going on

Markus Rechberger/irc mrec