From danibens@terra.es 03 Feb 2002 12:13:38 +0100 Date: 03 Feb 2002 12:13:38 +0100 From: Daniel Baeyens danibens@terra.es Subject: [cpia] Video Blaster WebCam I Driver Hi! My name is Daniel Baeyens, and recently gifted me that old model of Creative Labs' webcams (they didn't want it :P). I've tried to make it work under Linux, but... wooops! There is no driver written. I have found references with a project by M.Wientapper, but the page doesn't exist. Does anyone know where is know that page? Or how to contact with Wientapper? Or where is some doc info to try to code a driver? Thanks in advance Daniel :) From sam102@crpud.net Mon, 4 Feb 2002 16:23:10 -0800 Date: Mon, 4 Feb 2002 16:23:10 -0800 From: Sam Alexander sam102@crpud.net Subject: [cpia] I Solved all the QX3 Microscope problems (2.4up) This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C1AD98.3C8B2230 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ok, download the CVS version (currently 1.2) of the cpia driver. I am = using the 2.4.7-10 (default with Red Hat linux 7.2) [root@squid source]# tar -xvzf cpia-1.2 [root@squid source]# cd cpia-1.2/module [root@squid module]# make Should get these errors: echo '# Program dependencies' >.depend gcc -M -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer = -pipe=20 -fno-strength-reduce -m486 -malign-loops=3D2 -malign-jumps=3D2 = -malign-functions=3D2 - DCPU=3D686 -fomit-frame-pointer -fno-strength-reduce -I. = -I/usr/src/linux/include=20 -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE = -DCONFIG_VIDEO_CPIA_PP_MODULE - DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia_pp.c >>.depend gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer = -pipe=20 -fno-strength-reduce -m486 -malign-loops=3D2 -malign-jumps=3D2 = -malign-functions=3D2 - DCPU=3D686 -fomit-frame-pointer -fno-strength-reduce -I. = -I/usr/src/linux/include=20 -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE = -DCONFIG_VIDEO_CPIA_PP_MODULE - DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia.c: In function `cpia_write_proc': cpia.c:652: warning: `val' might be used uninitialized in this function cpia.c: At top level: cpia.c:3906: warning: initialization from incompatible pointer type cpia.c:3907: warning: missing braces around initializer cpia.c:3907: warning: (near initialization for `cpia_template.name') cpia.c:3909: warning: initialization makes integer from pointer without = a cast cpia.c:3909: initializer element is not computable at load time cpia.c:3909: (near initialization for `cpia_template.name[2]') cpia.c:3910: warning: initialization makes integer from pointer without = a cast cpia.c:3910: initializer element is not computable at load time cpia.c:3910: (near initialization for `cpia_template.name[3]') cpia.c:3911: warning: initialization makes integer from pointer without = a cast cpia.c:3911: initializer element is not computable at load time cpia.c:3911: (near initialization for `cpia_template.name[4]') cpia.c:3912: warning: initialization makes integer from pointer without = a cast cpia.c:3913: warning: initialization makes integer from pointer without = a cast cpia.c:3914: warning: initialization makes integer from pointer without = a cast cpia.c:3914: initializer element is not computable at load time cpia.c:3914: (near initialization for `cpia_template.name[7]') cpia.c:3915: warning: initialization makes integer from pointer without = a cast cpia.c:3915: initializer element is not computable at load time cpia.c:3915: (near initialization for `cpia_template.name[8]') cpia.c:3916: warning: initialization makes integer from pointer without = a cast cpia.c:3916: initializer element is not computable at load time cpia.c:3916: (near initialization for `cpia_template.name[9]') cpia.c:3917: warning: initialization makes integer from pointer without = a cast cpia.c: In function `cpia_register_camera': cpia.c:4079: too few arguments to function `video_register_device' make: *** [cpia.o] Error 1 After a few hours research I managed to edit the source so that it will = compile with out error!=20 The problem is that cpia.c attempts to create a video_device structure = which is missing the first argument, which in turn throws off all = proceeding values (explains errors on lines 3906 through 3917) All other programs that create video_device structures have the first = argument THIS_MODULE, except for cpia.c Simply follow these steps to fix that: [root@squid module]# pico cpia.c Change this: static struct video_device cpia_template =3D { "CPiA Camera", VID_TYPE_CAPTURE, VID_HARDWARE_CPIA, cpia_open, /* open */ cpia_close, /* close */ cpia_read, /* read */ NULL, /* no write */ NULL, /* no poll */ cpia_ioctl, /* ioctl */ cpia_mmap, /* mmap */ cpia_video_init, /* initialize */ NULL, /* priv */ 0, /* busy */ -1 /* minor - unset */ }; To this: static struct video_device cpia_template =3D { THIS_MODULE, "CPiA Camera", VID_TYPE_CAPTURE, VID_HARDWARE_CPIA, cpia_open, /* open */ cpia_close, /* close */ cpia_read, /* read */ NULL, /* no write */ NULL, /* no poll */ cpia_ioctl, /* ioctl */ cpia_mmap, /* mmap */ cpia_video_init, /* initialize */ NULL, /* priv */ 0, /* busy */ -1 /* minor - unset */ }; Save and exit then remake: [root@squid module]# make You should get this output: gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer = -pipe -fno-strength-reduce -m486 -malign-loops=3D2 -malign-jumps=3D2 = -malign-functions=3D2 -DCPU=3D686 -fomit-frame-pointer = -fno-strength-reduce -I. -I/usr/src/linux/include -D__KERNEL__ -DMODULE = -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODULE = -DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia.c: In function `cpia_write_proc': cpia.c:652: warning: `val' might be used uninitialized in this function cpia.c: In function `cpia_register_camera': cpia.c:4080: too few arguments to function `video_register_device' make: *** [cpia.o] Error 1 Aha!! quite a few less errors hm? It seems that the call to = video_register_device requires three values and not two, like in cpia.c. = I worked through some more source and found that it requires the third = argument video_nr, which most modules use the value "-1". I'm not sure = about this but it works fine, you might want to see what video_nr = actually means, but every source file I found used the value -1. To fix = this: [root@squid module]# pico cpia.c change this: if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER) = =3D=3D -1) { to this: if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, -1) = =3D=3D -1) { Save exit and remake! [root@squid module]# make And it compiles succesfully! Now insert the modules into the kernel! [root@squid module]# insmod cpia.o Using the old cpia_usb.o and old videodev.o modules will work fine with = the new cpia driver! That's it! Then you can use the proc interface... = for example: [root@squid module]# echo "toplight: on" > /proc/cpia/video0 For some reason this only works if gqcam is running... hm need to fix = that, probly has to do something with it being on standby or something. [root@squid module]# cat /proc/cpia/video0 This command shows all readable/writeable entries in /proc/cpia/video0 Please reply because I want to know if this helps anyone! Thanks. --Sam Alexander ------=_NextPart_000_0005_01C1AD98.3C8B2230 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Ok, download the CVS version (currently = 1.2) of the=20 cpia driver. I am using the 2.4.7-10 (default with Red Hat linux=20 7.2)
 
[root@squid source]# tar -xvzf=20 cpia-1.2
[root@squid source]# cd=20 cpia-1.2/module
[root@squid module]# make
Should get these errors:
 
echo '# Program dependencies' = >.depend
gcc -M=20 -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer  = -pipe=20
-fno-strength-reduce -m486 -malign-loops=3D2 -malign-jumps=3D2=20 -malign-functions=3D2 -
DCPU=3D686 -fomit-frame-pointer = -fno-strength-reduce -I.=20 -I/usr/src/linux/include
-D__KERNEL__ -DMODULE = -DCONFIG_VIDEO_CPIA_MODULE=20 -DCONFIG_VIDEO_CPIA_PP_MODULE -
DCONFIG_VIDEO_CPIA_PP_DMA  = cpia.c=20 cpia_pp.c  >>.depend
gcc -c -D_CPIA_DEBUG_ -Wall=20 -Wstrict-prototypes -O2 -fomit-frame-pointer  -pipe=20
-fno-strength-reduce -m486 -malign-loops=3D2 -malign-jumps=3D2=20 -malign-functions=3D2 -
DCPU=3D686 -fomit-frame-pointer = -fno-strength-reduce -I.=20 -I/usr/src/linux/include
-D__KERNEL__ -DMODULE = -DCONFIG_VIDEO_CPIA_MODULE=20 -DCONFIG_VIDEO_CPIA_PP_MODULE -
DCONFIG_VIDEO_CPIA_PP_DMA =20 cpia.c
cpia.c: In function `cpia_write_proc':
cpia.c:652: warning: = `val'=20 might be used uninitialized in this function
cpia.c: At top=20 level:
cpia.c:3906: warning: initialization from incompatible pointer = type
cpia.c:3907: warning: missing braces around = initializer
cpia.c:3907:=20 warning: (near initialization for `cpia_template.name')
cpia.c:3909: = warning:=20 initialization makes integer from pointer without a cast
cpia.c:3909: = initializer element is not computable at load time
cpia.c:3909: (near = initialization for `cpia_template.name[2]')
cpia.c:3910: warning:=20 initialization makes integer from pointer without a cast
cpia.c:3910: = initializer element is not computable at load time
cpia.c:3910: (near = initialization for `cpia_template.name[3]')
cpia.c:3911: warning:=20 initialization makes integer from pointer without a cast
cpia.c:3911: = initializer element is not computable at load time
cpia.c:3911: (near = initialization for `cpia_template.name[4]')
cpia.c:3912: warning:=20 initialization makes integer from pointer without a cast
cpia.c:3913: = warning: initialization makes integer from pointer without a=20 cast
cpia.c:3914: warning: initialization makes integer from pointer = without=20 a cast
cpia.c:3914: initializer element is not computable at load=20 time
cpia.c:3914: (near initialization for=20 `cpia_template.name[7]')
cpia.c:3915: warning: initialization makes = integer=20 from pointer without a cast
cpia.c:3915: initializer element is not=20 computable at load time
cpia.c:3915: (near initialization for=20 `cpia_template.name[8]')
cpia.c:3916: warning: initialization makes = integer=20 from pointer without a cast
cpia.c:3916: initializer element is not=20 computable at load time
cpia.c:3916: (near initialization for=20 `cpia_template.name[9]')
cpia.c:3917: warning: initialization makes = integer=20 from pointer without a cast
cpia.c: In function=20 `cpia_register_camera':
cpia.c:4079: too few arguments to function=20 `video_register_device'
make: *** [cpia.o] Error 1
After a few hours research I managed to = edit the=20 source so that it will compile with out error!
The problem is that cpia.c attempts to = create a=20 video_device structure which is missing the first argument, which in = turn throws=20 off all proceeding values (explains errors on lines 3906 through=20 3917)
All other programs that create = video_device=20 structures have the first argument THIS_MODULE, except for = cpia.c
Simply follow these steps to fix = that:
[root@squid module]# pico = cpia.c
 
Change this:
static struct video_device = cpia_template =3D=20 {
        "CPiA=20 Camera",
       =20 VID_TYPE_CAPTURE,
       =20 VID_HARDWARE_CPIA,
       =20 cpia_open,          &nb= sp;  =20 /* open */
       =20 cpia_close,          &n= bsp; =20 /* close */
       =20 cpia_read,          &nb= sp;  =20 /* read */
       =20 NULL,           &n= bsp;      =20 /* no write */
       =20 NULL,           &n= bsp;      =20 /* no poll */
       =20 cpia_ioctl,          &n= bsp; =20 /* ioctl */
       =20 cpia_mmap,          &nb= sp;  =20 /* mmap */
       =20 cpia_video_init,        /* initialize = */
       =20 NULL,           &n= bsp;      =20 /* priv */
       =20 0,            = ;         =20 /* busy */
       =20 -1            = ;         =20 /* minor - unset */
};
 
To this:
static struct video_device = cpia_template =3D=20 {
       =20 THIS_MODULE,
        "CPiA=20 Camera",
       =20 VID_TYPE_CAPTURE,
       =20 VID_HARDWARE_CPIA,
       =20 cpia_open,          &nb= sp;  =20 /* open */
       =20 cpia_close,          &n= bsp; =20 /* close */
       =20 cpia_read,          &nb= sp;  =20 /* read */
       =20 NULL,           &n= bsp;      =20 /* no write */
       =20 NULL,           &n= bsp;      =20 /* no poll */
       =20 cpia_ioctl,          &n= bsp; =20 /* ioctl */
       =20 cpia_mmap,          &nb= sp;  =20 /* mmap */
       =20 cpia_video_init,        /* initialize = */
       =20 NULL,           &n= bsp;      =20 /* priv */
       =20 0,            = ;         =20 /* busy */
       =20 -1            = ;         =20 /* minor - unset */
};

Save and exit then remake:
[root@squid module]# make
You should get this = output:
 
gcc -c -D_CPIA_DEBUG_ -Wall = -Wstrict-prototypes -O2=20 -fomit-frame-pointer  -pipe -fno-strength-reduce -m486 = -malign-loops=3D2=20 -malign-jumps=3D2 -malign-functions=3D2 -DCPU=3D686 -fomit-frame-pointer = -fno-strength-reduce -I. -I/usr/src/linux/include -D__KERNEL__ -DMODULE=20 -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODULE=20 -DCONFIG_VIDEO_CPIA_PP_DMA  cpia.c
cpia.c: In function=20 `cpia_write_proc':
cpia.c:652: warning: `val' might be used = uninitialized in=20 this function
cpia.c: In function = `cpia_register_camera':
cpia.c:4080: too=20 few arguments to function `video_register_device'
make: *** [cpia.o] = Error=20 1
Aha!! quite a few less errors hm? It = seems that the=20 call to video_register_device requires three values and not two, like in = cpia.c.=20 I worked through some more source and found that it requires the third = argument=20 video_nr, which most modules use the value "-1". I'm not sure about this = but it=20 works fine, you might want to see what video_nr actually means, but = every source=20 file I found used the value -1. To fix this:
[root@squid module]# pico=20 cpia.c
change this:
        if=20 (video_register_device(&camera->vdev, VFL_TYPE_GRABBER) =3D=3D = -1)=20 {
to this:
        if=20 (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, -1) = =3D=3D -1)=20 {
 
Save exit and remake!
[root@squid module]# make
And it compiles succesfully!
Now insert the modules into the kernel!
[root@squid module]# insmod cpia.o
Using the old cpia_usb.o and old videodev.o modules will work fine = with the=20 new cpia driver! That's it! Then you can use the proc interface... for=20 example:
[root@squid module]# echo "toplight: on" > = /proc/cpia/video0
For some reason this only works if gqcam is running... hm need to = fix that,=20 probly has to do something with it being on standby or something.
[root@squid module]# cat /proc/cpia/video0
This command shows all readable/writeable entries in=20 /proc/cpia/video0
 
Please reply because I want to know if this helps anyone!=20 Thanks.
 
--Sam = Alexander
------=_NextPart_000_0005_01C1AD98.3C8B2230-- From sama102@hotmail.com Mon, 04 Feb 2002 16:28:03 -0800 Date: Mon, 04 Feb 2002 16:28:03 -0800 From: Sam Alexander sama102@hotmail.com Subject: [cpia] I Solved all the QX3 Microscope problems (2.4up) Fixed!!!
Ok, download the CVS version (currently 1.2) of the cpia driver. I am using the 2.4.7-10 (default with Red Hat linux 7.2)
[root@squid source]# tar -xvzf cpia-1.2
[root@squid source]# cd cpia-1.2/module
[root@squid module]# make
Should get these errors:
echo '# Program dependencies' >.depend
gcc -M -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe
-fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -
DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/linux/include
-D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODULE -
DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia_pp.c >>.depend
gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe
-fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -
DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/linux/include
-D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODULE -
DCONFIG_VIDEO_CPIA_PP_DMA cpia.c
cpia.c: In function `cpia_write_proc':
cpia.c:652: warning: `val' might be used uninitialized in this function
cpia.c: At top level:
cpia.c:3906: warning: initialization from incompatible pointer type
cpia.c:3907: warning: missing braces around initializer
cpia.c:3907: warning: (near initialization for `cpia_template.name')
cpia.c:3909: warning: initialization makes integer from pointer without a cast
cpia.c:3909: initializer element is not computable at load time
cpia.c:3909: (near initialization for `cpia_template.name[2]')
cpia.c:3910: warning: initialization makes integer from pointer without a cast
cpia.c:3910: initializer element is not computable at load time
cpia.c:3910: (near initialization for `cpia_template.name[3]')
cpia.c:3911: warning: initialization makes integer from pointer without a cast
cpia.c:3911: initializer element is not computable at load time
cpia.c:3911: (near initialization for `cpia_template.name[4]')
cpia.c:3912: warning: initialization makes integer from pointer without a cast
cpia.c:3913: warning: initialization makes integer from pointer without a cast
cpia.c:3914: warning: initialization makes integer from pointer without a cast
cpia.c:3914: initializer element is not computable at load time
cpia.c:3914: (near initialization for `cpia_template.name[7]')
cpia.c:3915: warning: initialization makes integer from pointer without a cast
cpia.c:3915: initializer element is not computable at load time
cpia.c:3915: (near initialization for `cpia_template.name[8]')
cpia.c:3916: warning: initialization makes integer from pointer without a cast
cpia.c:3916: initializer element is not computable at load time
cpia.c:3916: (near initialization for `cpia_template.name[9]')
cpia.c:3917: warning: initialization makes integer from pointer without a cast
cpia.c: In function `cpia_register_camera':
cpia.c:4079: too few arguments to function `video_register_device'
make: *** [cpia.o] Error 1
After a few hours research I managed to edit the source so that it will compile with out error!
The problem is that cpia.c attempts to create a video_device structure which is missing the first argument, which in turn throws off all proceeding values (explains errors on lines 3906 through 3917)
All other programs that create video_device structures have the first argument THIS_MODULE, except for cpia.c
Simply follow these steps to fix that:
[root@squid module]# pico cpia.c
Change this:
static struct video_device cpia_template = {
"CPiA Camera",
VID_TYPE_CAPTURE,
VID_HARDWARE_CPIA,
cpia_open, /* open */
cpia_close, /* close */
cpia_read, /* read */
NULL, /* no write */
NULL, /* no poll */
cpia_ioctl, /* ioctl */
cpia_mmap, /* mmap */
cpia_video_init, /* initialize */
NULL, /* priv */
0, /* busy */
-1 /* minor - unset */
};
To this:
static struct video_device cpia_template = {
THIS_MODULE,
"CPiA Camera",
VID_TYPE_CAPTURE,
VID_HARDWARE_CPIA,
cpia_open, /* open */
cpia_close, /* close */
cpia_read, /* read */
NULL, /* no write */
NULL, /* no poll */
cpia_ioctl, /* ioctl */
cpia_mmap, /* mmap */
cpia_video_init, /* initialize */
NULL, /* priv */
0, /* busy */
-1 /* minor - unset */
};
Save and exit then remake:
[root@squid module]# make
You should get this output:
gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/linux/include -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODULE -DCONFIG_VIDEO_CPIA_PP_DMA cpia.c
cpia.c: In function `cpia_write_proc':
cpia.c:652: warning: `val' might be used uninitialized in this function
cpia.c: In function `cpia_register_camera':
cpia.c:4080: too few arguments to function `video_register_device'
make: *** [cpia.o] Error 1
Aha!! quite a few less errors hm? It seems that the call to video_register_device requires three values and not two, like in cpia.c. I worked through some more source and found that it requires the third argument video_nr, which most modules use the value "-1". I'm not sure about this but it works fine, you might want to see what video_nr actually means, but every source file I found used the value -1. To fix this:
[root@squid module]# pico cpia.c
change this:
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER) == -1) {
to this:
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, -1) == -1) {
Save exit and remake!
[root@squid module]# make
And it compiles succesfully!
Now insert the modules into the kernel!
[root@squid module]# insmod cpia.o
Using the old cpia_usb.o and old videodev.o modules will work fine with the new cpia driver! That's it! Then you can use the proc interface... for example:
[root@squid module]# echo "toplight: on" > /proc/cpia/video0
For some reason this only works if gqcam is running... hm need to fix that, probly has to do something with it being on standby or something.
[root@squid module]# cat /proc/cpia/video0
This command shows all readable/writeable entries in /proc/cpia/video0
Please reply because I want to know if this helps anyone! Thanks.
--Sam Alexander


Join the world’s largest e-mail service with MSN Hotmail. Click Here
From sam102@crpud.net Mon, 4 Feb 2002 17:11:26 -0800 Date: Mon, 4 Feb 2002 17:11:26 -0800 From: Sam Alexander sam102@crpud.net Subject: [cpia] I Solved all the QX3 Microscope problems (2.4up) Fixed!!! REALLY! Ok, download the CVS version (currently 1.2) of the cpia driver. I am using the 2.4.7-10 (default with Red Hat linux 7.2) [root@squid source]# tar -xvzf cpia-1.2 [root@squid source]# cd cpia-1.2/module [root@squid module]# make Should get these errors: echo '# Program dependencies' >.depend gcc -M -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -p ipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions =2 - DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/linux/incl ude -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODU LE - DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia_pp.c >>.depend gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -p ipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions =2 - DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/linux/incl ude -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_CPIA_PP_MODU LE - DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia.c: In function `cpia_write_proc': cpia.c:652: warning: `val' might be used uninitialized in this function cpia.c: At top level: cpia.c:3906: warning: initialization from incompatible pointer type cpia.c:3907: warning: missing braces around initializer cpia.c:3907: warning: (near initialization for `cpia_template.name') cpia.c:3909: warning: initialization makes integer from pointer without a cast cpia.c:3909: initializer element is not computable at load time cpia.c:3909: (near initialization for `cpia_template.name[2]') cpia.c:3910: warning: initialization makes integer from pointer without a cast cpia.c:3910: initializer element is not computable at load time cpia.c:3910: (near initialization for `cpia_template.name[3]') cpia.c:3911: warning: initialization makes integer from pointer without a cast cpia.c:3911: initializer element is not computable at load time cpia.c:3911: (near initialization for `cpia_template.name[4]') cpia.c:3912: warning: initialization makes integer from pointer without a cast cpia.c:3913: warning: initialization makes integer from pointer without a cast cpia.c:3914: warning: initialization makes integer from pointer without a cast cpia.c:3914: initializer element is not computable at load time cpia.c:3914: (near initialization for `cpia_template.name[7]') cpia.c:3915: warning: initialization makes integer from pointer without a cast cpia.c:3915: initializer element is not computable at load time cpia.c:3915: (near initialization for `cpia_template.name[8]') cpia.c:3916: warning: initialization makes integer from pointer without a cast cpia.c:3916: initializer element is not computable at load time cpia.c:3916: (near initialization for `cpia_template.name[9]') cpia.c:3917: warning: initialization makes integer from pointer without a cast cpia.c: In function `cpia_register_camera': cpia.c:4079: too few arguments to function `video_register_device' make: *** [cpia.o] Error 1 After a few hours research I managed to edit the source so that it will compile with out error! The problem is that cpia.c attempts to create a video_device structure which is missing the first argument, which in turn throws off all proceeding values (explains errors on lines 3906 through 3917) All other programs that create video_device structures have the first argument THIS_MODULE, except for cpia.c Simply follow these steps to fix that: [root@squid module]# pico cpia.c Change this: static struct video_device cpia_template = { "CPiA Camera", VID_TYPE_CAPTURE, VID_HARDWARE_CPIA, cpia_open, /* open */ cpia_close, /* close */ cpia_read, /* read */ NULL, /* no write */ NULL, /* no poll */ cpia_ioctl, /* ioctl */ cpia_mmap, /* mmap */ cpia_video_init, /* initialize */ NULL, /* priv */ 0, /* busy */ -1 /* minor - unset */ }; To this: static struct video_device cpia_template = { THIS_MODULE, "CPiA Camera", VID_TYPE_CAPTURE, VID_HARDWARE_CPIA, cpia_open, /* open */ cpia_close, /* close */ cpia_read, /* read */ NULL, /* no write */ NULL, /* no poll */ cpia_ioctl, /* ioctl */ cpia_mmap, /* mmap */ cpia_video_init, /* initialize */ NULL, /* priv */ 0, /* busy */ -1 /* minor - unset */ }; Save and exit then remake: [root@squid module]# make You should get this output: gcc -c -D_CPIA_DEBUG_ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -p ipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-funct ions=2 -DCPU=686 -fomit-frame-pointer -fno-strength-reduce -I. -I/usr/src/li nux/include -D__KERNEL__ -DMODULE -DCONFIG_VIDEO_CPIA_MODULE -DCONFIG_VIDEO_ CPIA_PP_MODULE -DCONFIG_VIDEO_CPIA_PP_DMA cpia.c cpia.c: In function `cpia_write_proc': cpia.c:652: warning: `val' might be used uninitialized in this function cpia.c: In function `cpia_register_camera': cpia.c:4080: too few arguments to function `video_register_device' make: *** [cpia.o] Error 1 Aha!! quite a few less errors hm? It seems that the call to video_register_device requires three values and not two, like in cpia.c. I worked through some more source and found that it requires the third argument video_nr, which most modules use the value "-1". I'm not sure about this but it works fine, you might want to see what video_nr actually means, but every source file I found used the value -1. To fix this: [root@squid module]# pico cpia.c change this: if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER) == -1) { to this: if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, -1) == -1) { Save exit and remake! [root@squid module]# make And it compiles succesfully! Now insert the modules into the kernel! [root@squid module]# insmod cpia.o Using the old cpia_usb.o and old videodev.o modules will work fine with the new cpia driver! That's it! Then you can use the proc interface... for example: [root@squid module]# echo "toplight: on" > /proc/cpia/video0 For some reason this only works if gqcam is running... hm need to fix that, probly has to do something with it being on standby or something. [root@squid module]# cat /proc/cpia/video0 This command shows all readable/writeable entries in /proc/cpia/video0 Please reply because I want to know if this helps anyone! Thanks. --Sam Alexander From Nick.Holloway@pyrites.org.uk 5 Feb 2002 08:04:23 -0000 Date: 5 Feb 2002 08:04:23 -0000 From: Nick Holloway Nick.Holloway@pyrites.org.uk Subject: [cpia] I Solved all the QX3 Microscope problems (2.4up) sam102@crpud.net (Sam Alexander) writes: > Change this: > static struct video_device cpia_template = { > "CPiA Camera", > VID_TYPE_CAPTURE, > VID_HARDWARE_CPIA, [...] > > To this: > static struct video_device cpia_template = { > THIS_MODULE, > "CPiA Camera", > VID_TYPE_CAPTURE, > VID_HARDWARE_CPIA, [...] A better fix would be to used the named initialisers for the structure. This is how the cpia_template would be initialised: static struct video_device cpia_template = { module: THIS_MODULE, name: "CPiA Camera", type: VID_TYPE_CAPTURE, hardware: VID_HARDWARE_CPIA, open: cpia_open, /* open */ close: cpia_close, /* close */ read: cpia_read, /* read */ ioctl: cpia_ioctl, /* ioctl */ mmap: cpia_mmap, /* mmap */ initialize: cpia_video_init, /* initialize */ minor: -1 /* minor - unset */ }; This means you are protected from new members being added. This is the approach being used elsewhere in the kernel. -- `O O' | Nick.Holloway@pyrites.org.uk // ^ \\ | http://www.pyrites.org.uk/ From nena95424@yahoo.com Wed, 13 Feb 2002 00:10:28 -0800 (PST) Date: Wed, 13 Feb 2002 00:10:28 -0800 (PST) From: nermin su nena95424@yahoo.com Subject: [cpia] usb interface Hi! I am a student working on image compression. My instructor wants me to compress video on linux. We have Creative webcam 3 .. it is a usb camera.. I have no idea how i can take data from usb interface.. Is there anybody who can help me? __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com From steve.miller@st.com Wed, 13 Feb 2002 09:02:59 -0500 Date: Wed, 13 Feb 2002 09:02:59 -0500 From: Steve Miller steve.miller@st.com Subject: [cpia] usb interface nena95424@yahoo.com wrote: > > Hi! > I am a student working on image compression. My > instructor wants me to compress video on linux. We > have Creative webcam 3 .. it is a usb camera.. I have > no idea how i can take data from usb interface.. Is > there anybody who can help me? > You don't take data from the usb interface. This camera uses the OV511 driver. You need to write an application that reads data from the driver. You'll have to investigate how to do that, although it probably uses the video4linux api. Use google to find what you need. Steve -- Steve Miller Software Engineer STMicroelectronics phone (602) 485-2014 From G.M.REYNOLDS@bham-eee-fs4.bham.ac.uk Mon, 18 Feb 2002 19:58:48 -0000 Date: Mon, 18 Feb 2002 19:58:48 -0000 From: J114(G.M.REYNOLDS) G.M.REYNOLDS@bham-eee-fs4.bham.ac.uk Subject: [cpia] IEEE 1284 Negotiation and Termination Hi, I am trying to connect a Creative Video Blaster II to a Mitsubishi M16C microcontroller. So far I have got as far as receiving the ID string in nibble mode. I then try to negotiate ECP mode. This appears to work (all the status lines change accordingly). I then send the GetCameraStatus command to the camera. This appears to clock through (all data lines change accordingly). I then terminate the 1284 mode. One of the status lines does not change here. I have included by code below. Any help is really appreciated. /* end the 1284 nibble mode transfer - works up to here!! */ Camera_End1284(); /* now take the camera into ECP transfer mode */ Camera_GotoECPMode(); Camera_SendECPCommand(GET_CAMERA_STATUS); /* doesn't get passed this bit */ Camera_End1284(); Definitions of my functions: void Camera_GotoECPMode(void) { ECP_DATA_OUT; ECP_DATA = REQUEST_ECP; ECP_SELECTIN_ON; ECP_AUTOFEED_OFF; while( ECP_ACK == true ); while( ECP_PE == false ); while( ECP_ERROR == false ); while( ECP_SELECT == false ); ECP_STROBE_OFF; sleep(PULSE_DELAY); ECP_AUTOFEED_ON; ECP_STROBE_ON; while( ECP_PE == true ); while( ECP_ERROR == true ); while( ECP_SELECT == false ); while( ECP_ACK == false ); /* we are now in ECP transfer mode for forward and backward direction */ g_ECPMode = true; } /* send a command to the camera - does all IEEE 1284 overhead when sending command */ void Camera_SendECPCommand(unsigned char ucCommand) { assert( g_ECPMode == true ); ECP_DATA_OUT; ECP_AUTOFEED_ON; ECP_SELECTIN_ON; ECP_INIT_ON; ECP_AUTOFEED_OFF; //sleep(10000); while ( ECP_PE == false ); while ( ECP_ACK == true ); ECP_STROBE_OFF; sleep(PULSE_DELAY); ECP_STROBE_ON; ECP_AUTOFEED_ON; while( ECP_ACK == false ); ECP_AUTOFEED_OFF; // while ( ECP_PE == false ); sleep(PULSE_DELAY); ECP_AUTOFEED_ON; ECP_STROBE_OFF; while( ECP_BUSY == true ); // got here so ok to send command ECP_DATA = ucCommand; ECP_STROBE_ON; sleep(PULSE_DELAY); ECP_STROBE_OFF; } -- end of code -- The information for sending the ECP command comes from the data sheet. Perhaps I have interpreted it incorrectly. I have also tried to correlate it to the source for the DOS driver. If you can see what's wrong, or can give me a summary of the process of negotation, sending, termination and receiving I would be appreciative. Cheers. Greg. From G.M.REYNOLDS@bham-eee-fs4.bham.ac.uk Fri, 22 Feb 2002 15:58:36 -0000 Date: Fri, 22 Feb 2002 15:58:36 -0000 From: J114(G.M.REYNOLDS) G.M.REYNOLDS@bham-eee-fs4.bham.ac.uk Subject: [cpia] ECP transfer of data Hi, I have written code to send and receive ECP commands to the camera. I am trying to read back image data from the camera. I have negotiated in the same that the DOS driver has to ECP upload mode. When I send GrabFrame, GetCameraStatus responds by putting STREAM_READY in the appropriate element of its structure. After getting that value, I negotiate to ECP upload mode. I then attempt to clock data in from the camera. All control lines change appropriately and it appears that data is coming in. However, the only value on the port is 0xFF. Answers to the following questions would help me: 1. Is the initialisation sequence critical? I have followed it according to datasheet. 2. I have attempted to use the StartDummyStream command to get back data. It also sends 0xFFs. Is the bad data I am getting back from the camera a result of my poor ECP read in process - or as a result of bad camera setup. Are there any more datasheets for the camera available? Cheers. Greg. From Peter_Pregler@email.com Sun, 24 Feb 2002 13:38:08 +0100 Date: Sun, 24 Feb 2002 13:38:08 +0100 From: Peter Pregler Peter_Pregler@email.com Subject: [cpia] ECP transfer of data On Fri, Feb 22, 2002 at 03:58:36PM -0000, J114(G.M.REYNOLDS) wrote: > > I then attempt to clock data in from the camera. All control lines change > appropriately and it appears that data is coming in. However, the only value > on the port is 0xFF. > > Answers to the following questions would help me: > 1. Is the initialisation sequence critical? I have followed it according to > datasheet. > 2. I have attempted to use the StartDummyStream command to get back data. It > also sends 0xFFs. I have never used the dummy-stream. But the 0xFF rings some bell. IIRC, the chip will _always_ provide you with 0xFF if you read and there is no data available. So double-check if you really have done the initialisation correctly. Sequence and even timings between sending commands does matter. Just have a look at the stream-read (i.e. the non-dma code) in cpia_pp.c. > Are there any more datasheets for the camera available? There is full chip documentation including the windows driver available at webcam.sourceforge.net. What more do you want?! Good luck, Peter -- Feeling amorous, she looked under the sheets and cried, "Oh, no, it's Microsoft!" ------------------------------- Email: Peter_Pregler@email.com From j114@bham-eee-fs4.bham.ac.uk Sun, 24 Feb 2002 13:37:41 -0000 Date: Sun, 24 Feb 2002 13:37:41 -0000 From: Greg Reynolds j114@bham-eee-fs4.bham.ac.uk Subject: [cpia] ECP transfer of data Hi, Thanks for the info. I got it working eventually. The problem was the negotiation to ECP/Upload mode (status of autofeed). I am confused as to where the UPLOAD_FLAG 0x08 is defined other than by CPiA. In all the documentation I have come across it only shows as 'reserved'. The DOS driver doesn't appear to implement the IEEE 1284.3/MS ECP spec. properly (the bit on the ECP command read does not have the 'correct' status of autofeed). Interestingly my implementation works with the correct status... In the end I solved the problem with an educated trial and error approach :). Personally I wouldn't call it "full chip documentation" - leaves a bit to the imagination maybe. If anyone is interested, I am interfacing the camera to an M16C for a line-following robot project. I will make source available for driver when it's finished. Cheers. Greg. ----- Original Message ----- From: "Peter Pregler" To: "J114(G.M.REYNOLDS)" Cc: Sent: Sunday, February 24, 2002 12:38 PM Subject: Re: [cpia] ECP transfer of data > On Fri, Feb 22, 2002 at 03:58:36PM -0000, J114(G.M.REYNOLDS) wrote: > > > > I then attempt to clock data in from the camera. All control lines change > > appropriately and it appears that data is coming in. However, the only value > > on the port is 0xFF. > > > > Answers to the following questions would help me: > > 1. Is the initialisation sequence critical? I have followed it according to > > datasheet. > > 2. I have attempted to use the StartDummyStream command to get back data. It > > also sends 0xFFs. > > I have never used the dummy-stream. But the 0xFF rings some bell. IIRC, > the chip will _always_ provide you with 0xFF if you read and there is > no data available. So double-check if you really have done the > initialisation correctly. Sequence and even timings between sending > commands does matter. Just have a look at the stream-read (i.e. the > non-dma code) in cpia_pp.c. > > > Are there any more datasheets for the camera available? > > There is full chip documentation including the windows driver available > at webcam.sourceforge.net. What more do you want?! > > Good luck, Peter > > -- > Feeling amorous, she looked under the sheets and cried, "Oh, no, > it's Microsoft!" > ------------------------------- > Email: Peter_Pregler@email.com