Hi all,

        Thanks for the help and suggestions in dealing with my oops problem
from the usb_control_msg(...) statements. I have that problem solved,
and am now communciating with the camera. I can get the number of
pictures, buf size, width, height, etc. and put the camera in video
(continuous) mode. 

        FYI: The main suggestion was to use ksmyopps to decode the oops text. I
have a compressed kernel (Mandrake 8.0, kernel 2.4.3) and decided to
upgrade to a much faster processor and disk to recompile; this forced me
to upgrade to kernel 2.4.8, and I made one other change that separately
or together got me past this point. The other change was in the request
type in usb_control_msg(dev, pipe, request, request_type, ..). The
output from the Windows usb sniff program gives (e.g.) a request type of
0xc1 for vendor specific commands (0xc1 0x8d .. returns the number of
pictures in the buffer), which should be "USB_DIR_IN | USB_TYPE_VENDOR |
USB_RECIP_INTERFACE" (=0xc1), but which works with "... |
USB_RECIP_ENDPOINT" instead, which computes to 0xc2, according to the
definitions in usb.h. Either that or upgrading the kernel fixed the
problem. I will investigate more later; I still have computers with
2.4.3.

        My current problem is with allocating buffer space. I use kmalloc for a
small buffer (40 bytes) to get some info from the camera, and also used
kmalloc for a much larger buffer to store the raw data from the camera
(in the 320x240 mode, this buffer is ~77kbytes; data are in raw Bayer
form). Still OK, but now I have to get a buffer big enough to hold the
RGB data, since I don't think the video4linux routines are going to
convert the raw data (haven't really started on the v4l stuff yet; I
still need to clean up a few things on the video part of the driver).
When I try to allocate a buffer 3 times bigger for the simple 
bayer->RGB conversion routine I get out of memory errors using kmalloc:

pic = kmallloc(3*bufsize, GFP_KERNEL)
if (pic === NULL) {
  infor("Out of memory for pic buffer");
  goto error;
}

where bufsize is ~ 77KB and error is a routine to exit gracefully, and I
get "Out of memory for pic buffer" in dmesg. The old version of Linux
Device Drivers tells me that the max size for kmalloc is 128KB, so I
have to use some other method. Vmalloc looks like the simplest way, or
do I have to use get_free_page routines, or some other method?

        Also (sorry if this is a dumb question, the last time I did anything
serious C programming was with DOS), before I start trying to interface
to the v4l routines, I would like to examine the data (either from the
raw or pic buffers) to make sure it is actual picture data (I only want
to do this for temporary debugging purposes; I don't intend this to be
part of the final code). To do this I would like to write the buffer
contents to disk. The method used in the command line (user space)
progam to download pictures from the camera uses fopen, fprintf, fwrite,
fclose routines to write to the disk, but these don't work from the
kernel driver, or I don't have the right library linked in (if I
#include <stdio.h> the program compiles ok but I get unresolved symbol
messages for these  when I run depmod -a or try to load the driver). Is
there a relatively simple way to dump the buffer contents to disk? If
not, can somebody point me to a how-to, book, etc, that will tell me how
to do this?  Thanks again,

        Kevin


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to