Le dimanche 30 décembre 2007 18:56, Jérémy Lal a écrit :
> at least i got "something" this time (kernel 2.6.23) :
> i got some very dark, black and white picture, "interlaced" and repeated
> like five times horizontally. i played around with the pitch to get
> vertical alignment better.
>
Hello,
from my original source(tm) driver,
for the ali5603 and any sensor,
the SOF if based on this:
int ali5603c_sofdetect(struct Cam *cam, char *data, int *skip, int
*datalength)
{
if (*datalength == 0)
{
if(cam->ali5603c.AwbCounter++ >50)
{
/* enqueue a defered call to SetAwb */
/* in IRq context, no synchronous call ! */
/*AsyncUsbSetIndex(spca50x, xbAwbMinB, 1);*/
}
}
if (cam->ali5603c.DSPCtrlBit60Cleared == 0)
{
cam->ali5603c.DSPCtrlBit60Cleared = 1;
/* enqueue a defered call to with the last known state for DSPCtrl*/
AsyncUsbSetIndex(spca50x,xbDSPCTRL,cam->ali5603c.DSPCtrl & 0x9F);
}
*skip = 0;
switch (cam->ali5603c.SofState)
{
case SOF_Wait: /*0*/
if (*datalength == 0)
{
cam->ali5603c.SofState = SOF_Start;
cam->ali5603c.FrameAcquiringOffset = 0;
}
break;
case SOF_Start:/* 1 Sof if a non empty packet follow SOF_Wait*/
if (datalength == 0)
break; /*not now*/
//falltrougth, First packet of data!
cam->ali5603c.SofState = SOF_Acquiring;
case SOF_Acquiring: /* 2 */
if (*datalength != 0) /*have data*/
{
if (cam->ali5603c.FrameAcquiringOffset == 0) /* beginning*/
{
//DecrementLevels(); /* to discover purpose */
/* strangely, no 4 bytes skipped.... */
}
else
{
/*allways remove usb header (FF,FF,FF,FF)*/
*skip = 4;
*datalength -= 4;
}
#define ABS_MAXFRAME 0xE1006
/* check it is not too big */
if (cam->ali5603c.FrameAcquiringOffset + *datalength >
ABS_MAXFRAME)
{
cam->ali5603c.FrameAcquiringOffset = ABS_MAXFRAME;
cam->ali5603c.SofState = SOF_Wait;
return 1; /* it is a sof! */
}
else
cam->ali5603c.FrameAcquiringOffset += *datalength;
}
else /*end of frame also =SOF*/
{
cam->ali5603c.SofState = SOF_Start;
cam->ali5603c.FrameAcquiringOffset = 0;
return 1;
}
}/*end case*/
return 0;
}
Franck
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
M560x-driver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/m560x-driver-devel