microdia.h errors

3 views
Skip to first unread message

Chris

unread,
Sep 1, 2008, 7:10:51 AM9/1/08
to microdia
Well I got to the second hurdle and fell straight away. I change
directory to microdia and typed make...

microdia.h:246: error: field 'buf' has incomplete type

microdia.h:287: error: field 'format' has incomplete type

microdia.h:480: error: expected declaration specifiers or '...' before
'poll table'

Then a whole bunch of errors in microdia-usb.h

I happened to have compiled the kernel from source (2.6.17-5)
with gcc-4

/lib.modules/bild is a symbolc link to my home directories'
InstallDir/linux-2.6.17-5mdvcustom

and the header files are in the include/linux subdirectories of this.
module.h kernel.h usb.h and all the others are here.
The "custom" kernel just compiles reiserfs and DOS file
systems into the kernel rather than loading them as modules.

I reckon its probably me, but I thought just typing "make" would be
it....

GWater

unread,
Sep 1, 2008, 7:12:22 AM9/1/08
to micr...@googlegroups.com
Chris schrieb:
did you use root privileges for make?

GWater

Chris

unread,
Sep 1, 2008, 9:52:52 AM9/1/08
to microdia
No, I didn't su to root at all.

JoJo jojo

unread,
Sep 1, 2008, 10:52:16 AM9/1/08
to micr...@googlegroups.com
Hi Chris

This is a custom kernel, check if videodev is working correctly.
Try to build another v4l2 driver maybe that will tell you about whats
causing this strange behaviour.

Perhaps its best theat you try 1 experiment at a time,
1st Microdia driver with a know good kernel
then
2nd Microdia driver with a custom kernel

That way you'll know which experiment to blame ;-)

-JoJo

Chris

unread,
Sep 1, 2008, 11:41:11 AM9/1/08
to microdia
OK, I have found some of the problem. The definitions in v4l2-common.h
may vary from kernel to kernel. In 2.6.17-5, v4l2_buff is defined in
an extra header file Video-buf.h so

So, in microdia.h I add

#include <media/Vidio-buf.h>

Also, I strip out any includes of v4l2-common.h in files which include
microdia.h
otherwise I get multiple definitions.

This hasn't solved the problem completely though
in microdia-usb.c and microdia-queue.c there are lines

buf=list_first_entry(queue->irqqueue, struct microdia_buffer,queue)

This function is not defined in any of my headers in linux or media,
so what I need is a header file with the correct function definition
here)

I could unpack a more recent kernel source and see whats if there is
anything there
that I can use. I shall post back later when I see whats in 2.6.26.

On Sep 1, 3:52 pm, "JoJo jojo" <onetwoj...@gmail.com> wrote:
> Hi Chris
>
> This is a custom kernel, check if videodev is working correctly.
> Try to build another v4l2 driver maybe that will tell you about whats
> causing this strange behaviour.
>
> Perhaps its best theat you try 1 experiment at a time,
> 1st Microdia driver with a know good kernel
> then
> 2nd Microdia driver with a custom kernel
>
> That way you'll know which experiment to blame ;-)
>
> -JoJo
>

Chris

unread,
Sep 1, 2008, 12:55:42 PM9/1/08
to microdia
Well, v4l2_buffer is not defined in v4l2-common in kernel-2.6.26-3
either.
Because of this I cannot see how anyone can get the code in the git
repository to compile on linux at all!

However list_first_entry certainly is defined in linux/list.h, but in
2.6.17-5 kernel
list.h doesn't have this definition, and it it isn't defined anywhere
else.
It wants (ptr, type, member)

So, I copy the 2.6.26 list.h to the microdia directory, and then put

#include "list.h" in microdia.h

however I still get the same

in function usb_microdia_isoc_handler

line 544 warning implicit definition of function list_first_entry
line 544 error expected expression before struct
line 545 warning assignment makes pointer from integer without a cast

which I had before I included the new list.h.

This I don't understand!

In list.h

#define list_first_entry(ptr, type, member) \
container_of( (ptr)->next, type, member);

container_of is defined in kernel.h

I tried stripping out the #include "list.h" from microdia.h
and putting the line below #include "microdia.h" in microdia-usb.c and
microdia-queue.h. I though the result should be identical, and it was.
So
I changed back.

My c-programming is a bit rusty, can anyone see how to fix this?

Chris

unread,
Sep 1, 2008, 3:01:04 PM9/1/08
to microdia
I thought I posted over an an hour ago, I must have closed without
actually
sending the post!

Anyway, v4l2_buffer is not defined in media/v4l2-common.h, this is the
only
media include in any of the micridia headers. This is true in
kernel 2.6.17-5 and 2.6.26-3. It is in media/video-buf.h, so I added
this
to microdia.h, but there is now another problem. This is in a direcory
called microdia-hack.

list_first_entry(ptr, type, member) is not defined in my kernels
list.h
I unpacked 2.6.26-3 and copied this list.h to the mic.

I moved my include/linux direcory to linux-2.6.17-5 and copied the
2.6.26.3
to include/linux-2.6.26.3, then copied that to linux. Back in in my
microdia-hack
directory I do make, and at last microdia-usb compiles.

Other problems arise now, but I think doing the same thing with the
media
directory will solve it. I shall post tomorrow.

Chris

unread,
Sep 2, 2008, 12:26:01 PM9/2/08
to microdia
It became obvious that the source of the problem was kernel version
2.6.17-5, so I bit the bullet and compiled linux-2.6.26.3 and
installed it.
Now the compile works with no hacks! I haven't noticed any
kernel >= notices anywhere or versions for earlier kernels?

So I got as far as
(to aboid insmod error unknown symbol)
#modprobe videodev
#modprobe compat-ioctl32

#insmod microdia.ko

and downloading camorama.

Haven't tested it yet!

GWater

unread,
Sep 2, 2008, 4:19:22 PM9/2/08
to micr...@googlegroups.com
Chris schrieb:

> It became obvious that the source of the problem was kernel version
> 2.6.17-5, so I bit the bullet and compiled linux-2.6.26.3 and
> installed it.
> Now the compile works with no hacks! I haven't noticed any
> kernel >= notices anywhere or versions for earlier kernels?
>
> So I got as far as
> (to aboid insmod error unknown symbol)
> #modprobe videodev
> #modprobe compat-ioctl32
>
> #insmod microdia.ko
>
> and downloading camorama.
>
> Haven't tested it yet!
>
>
>
Great news!

BTW the README states kernel >= 2.6.18 as a requirement.

GWater

JoJo jojo

unread,
Sep 2, 2008, 10:21:48 PM9/2/08
to micr...@googlegroups.com
On Tue, Sep 2, 2008 at 9:56 PM, Chris <sea...@hotmail.com> wrote:
>
> It became obvious that the source of the problem was kernel version
> 2.6.17-5, so I bit the bullet and compiled linux-2.6.26.3 and
> installed it.
> Now the compile works with no hacks! I haven't noticed any
> kernel >= notices anywhere or versions for earlier kernels?
>
> So I got as far as
> (to aboid insmod error unknown symbol)
> #modprobe videodev
> #modprobe compat-ioctl32
>
> #insmod microdia.ko
>
> and downloading camorama.
>
> Haven't tested it yet!
>
>
>

camorama won't work with v4l2 driver,
try mplayer instead
mplayer tv:// -tv
driver=v4l2:width=640:height=480:fps=25:device=/dev/video0 -vo x11

what is the usb ID of your webcam ?

-JoJo

Chris

unread,
Sep 3, 2008, 6:36:37 AM9/3/08
to microdia
Well, there you are, I somehow just didn't see the 2.6.18, and I just
had to have
2.6.17! But I remain mystified...


Using lsusb gives me

Bus 003 device 003: ID 093a:262a Pixart Imaging, Inc.

So far, so good?

I ls /dev and find no /dev/video0 or anything like that at all.
Now I can play video, and capture video with xvidcap so I must have
some video
device, but what is it? There are a bunch of vcs stuff at the end in /
dev followed by
zero. So no video zero, and the mplayer tv:// -tv command complains
that there is
no /dev/rtc either.

The other peculiarity is that copying the microdia.ko to /lib/modules/
2.6.26-3/..../usbvideo and depmod-a doesn't work for me. I have to
insmod it again on reboot
for lsmod to see it.





On Sep 3, 3:21 am, "JoJo jojo" <onetwoj...@gmail.com> wrote:

Chris

unread,
Sep 3, 2008, 10:28:45 AM9/3/08
to microdia
I think this might be the problem?

If I go to the kernel config file I see
#multimedia core support

CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_DEV_V4L2_COMMON=m
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO__VL1_COMPAT=y
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m

elsewhere

CONFIG_VIDEO_BT848=M

so I can insert the bttv module
but only V4L1 has been allowed?

Is that it?

Chris

unread,
Sep 3, 2008, 11:14:46 AM9/3/08
to microdia
Ih dear, I wasn't sure what all that debugfs was about, and it didn't
mount on reboot.
Not knowing much, I blindly copied the line

debugfs /sys/kernel/debug debugfs 0 0 into fstab
which should be

none /sys/kernel/debug debugfs 0 0

instead, so now I can actually do what it says in the instructions!

JoJo jojo

unread,
Sep 4, 2008, 10:02:07 PM9/4/08
to micr...@googlegroups.com
Hi Chris

Can you provide us this information?
https://groups.google.com/group/microdia/web/howto-get-information-on-your-webcam

specifically, we are looking to fins the exact bridge & sensor your webcam


Bus 003 device 003: ID 093a:262a Pixart Imaging, Inc.

is using.

For using 2.6.17, you may open the microdia.h file to add the
following two lines after the
#define MICRODIA_H line:
#define list_first_entry(ptr, type, member) list_entry((ptr)->next,
type, member)

hopefully it should compile cleanly

-JoJo

Reply all
Reply to author
Forward
0 new messages