Driver for Trust Computer Products Framegrabber, version 0.5.7
------ --- ----- -------- -------- ------------  ------- - - -

- ZORAN ------------------------------------------------------
 Author: Pauline Middelink <middelin@polyware.nl> 
   Date: 22 Juni 1999
Version: 0.5.7

- Description ------------------------------------------------

Video4Linux compatible driver for an unknown brand framegrabber
(Sold in the Netherlands by TRUST Computer Products)

The card contains a ZR36120 Multimedia PCI Interface and a Philips
SAA7110 Onechip Frontend video decoder. There is also an DSP of
which I have forgotten the numbers, since i will never get that thing
to work without specs from the card itself.

I have some reports of other cards working with the mentioned
chip sets. Namely: the 'Internet Video Kit' from Genius (this
card needs the USEGIRQ1 flag unset!)

After some testing, I discovered that the carddesigner messed up
on the I2C interface. The Zoran chip includes 2 lines SDA and SCL
which (s)he connected reversely. So we have to clock on the SDA
and r/w data on the SCL pin. Life is fun...

Another problems of contingious capturing data with a Zoran chip
is something nasty inside the chip. It effectively halves the
fps we ought to get... Here is the scenation: capturing frames
to memory is done in the so-called snapshot mode. In this mode
the Zoran stops after capturing a frame worth of data and wait
till the program set GRAB bit to indicate readyness for the next
frame. After detecting a set bit, the chip neetly waits till the
start of a frame, captures it and it goes back to off. Smart
ppl will notice the problem here. Its the waiting on the _next_
frame each time we set the GRAB bit... Oh well, 12,5 fps is still
plenty fast for me.

The SAA is capable of processing 6 different video inputs, CVBS1..6 and
Y1+C1, Y2+C2, Y3+C3.  all in 50/60Hz, NTSC, PAL or SECAM and delivering
a YUV datastream.  On my card the input 'Composite' corresponds to
channels CVBS2 and 'SHVS' to Y2+C2.

For pointers I used the specs of both chips. Below are the URLs:
	http://www.zoran.com/ftp/download/devices/pci/ZR36120/36120data.pdf
	http://www-us.semiconductor.philips.com/acrobat/datasheets/SAA_7110_A_1.pdf

The documentation has very little on absolute numbers or timings
needed for the various modes/resolutions, but there are other
programs you can borrow those from.

------ Install --------------------------------------------
Read the file called TODO.  Note its long list of limitations.

Build a kernel with VIDEO4LINUX enabled. Activate the
BT848 driver; we need this because we have need for the
other modules (i2c and videodev) it enables.

To install this software, extract it into a suitable directory.
Examine the makefile and change anything you don't like.  Type "make".

After making the modules check if you have the much needed
/dev/video devices. If not, execute the following 4 lines:
	mknod /dev/video c 81 0
	mknod /dev/video1 c 81 1
	mknod /dev/video2 c 81 2
	mknod /dev/video3 c 81 3
	mknod /dev/video4 c 81 4

After makeing/checking the devices do:
	modprobe i2c
	modprobe videodev
	modprobe saa7110
	modprobe zoran

And you are ready to test the framegrabber with your favorite
video4linux compatible tool

------ Application ----------------------------------------

This device works with all Video4Linux compatible applications,
given the limitations in the TODO file.

------ API ------------------------------------------------

This uses the V4L interface as of kernel release 2.1.116, and in
fact has not been tested on any lower version.  There are a couple
of minor differences due to the fact that the amount of data returned
with each frame varies, and no doubt there are discrepancies due to my
misunderstanding of the API.  I intend to convert this driver to the
new API when it has stabilized more.

------ Current state --------------------------------------

The driver is capable of overlaying a video image in screen, and
even capable of grabbing frames. It uses the BIGPHYSAREA patch
to allocate lots of large memory blocks...
The driver uses a double buffering scheme, which should realy
be an n-way buffer, depending on the size of allocated framebuffer
and the requested grab-size/format.
This current version also fixes a dead-lock situation during irq
time, which really, really froze my system... :)

Good luck.
  Pauline
