[cpia] USB works... a bit...
Jochen Scharrlach
Jochen.Scharrlach@schwaben.de
Tue, 25 Jan 2000 18:23:53 +0100 (MET)
Hi,
ok, my rvmalloc-problem *might* be caused by my SMP-system, my shiny
and new UP-2.3.40 works fine B-)
Well, at least it works better. But I am still not able to feed the
highlevel-code correctly. My readStream() looks like this:
static int cpia_usb_streamRead(void *privdata, u8 *frame, int noblock)
{
struct usb_cpia *cpia = (struct usb_cpia *) privdata;
cpia->buffer = frame;
cpia->buffer_length = 0;
cpia->buffer_maxlength = CPIA_MAX_IMAGE_SIZE;
DBG ("waiting...\n");
interruptible_sleep_on(&cpia->wq_stream);
DBG("read done, %d bytes\n", cpia->buffer_length);
if (cpia->buffer_length == 0 || cpia->buffer == NULL)
return 0;
cpia->buffer = NULL;
DBG("Header: %x/%x, Footer: %x%x%x%x\n", frame[0], frame[1],
frame[cpia->buffer_length-4], frame[cpia->buffer_length-3],
frame[cpia->buffer_length-2], frame[cpia->buffer_length-1]);
return cpia->buffer_length;
}
And I get as result in dmesg (I added some debugging to parse_picture):
cpia_usb.c(237495):cpia_usb_streamRead(322):waiting...
cpia_usb.c(237518):cpia_usb_complete(115):Let's get it on!
cpia_usb.c(237518):cpia_usb_complete(115):Let's get it on!
cpia_usb.c(237518):cpia_usb_complete(115):Let's get it on!
cpia_usb.c(237518):cpia_usb_complete(115):Let's get it on!
cpia_usb.c(237518):cpia_usb_streamRead(326):read done, 203684 bytes
cpia_usb.c(237518):cpia_usb_streamRead(336):Header: 19/68, Footer: ffffffff
cpia.c(237519):parse_picture(1865):Start
cpia.c(237519):parse_picture(1922):params
cpia.c(237519):parse_picture(1994):loop done
cpia.c(237519):fetch_frame(2189):parse frame failed
Do I have to prepare the received data somehow?
BTW, the loop where you are waiting for a "STREAM_READY" from the
camera before you call readStream() should go into the lowlevel-PP
driver, because it doesn't work this way with an USB-cam.
Bye,
Jochen
--
new signature coming RSN (tm)