pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 9:20 am

My first post…..<eek>

Had my Pi a couple of days now – same sort of reaction as others, amazing device – so tiny, the whole SD card thing is excellent and to see such a small device driving a 40” LCD TV (I just had to connect it to this beast on first boot) is awesome. Have now settled down and am running it headless, SSH in – works like a champ – have installed ruby on rails on it, works great! Many ideas…but anyway back to topic….

I found a very old USB webcam in the loft (well it wasn’t actually in the loft but it always sounds better with this sort of thing) – of course in the spirit of great British tinkering, frugality not to mention the challenge I absolutely *must* get this thing working with my Pi and ultimately serving up images to a ruby on rails application, so many ideas on this front, but first I have to get the hardware working!

So I think I understand the general principle, try it and see what happens is my first instinct. So I did, reading around lsusb is a good place to start. This gives the following output (only the webcam plugged in, am running without keyboard and mouse).

pi@raspberrypi:~$ lsusb
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 041e:400d Creative Technology, Ltd Webcam PD1001 Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@raspberrypi:~$

FYI – am running stock Debian
So it’s there, great I thought. I know what it is, apparently “041e:400d” is a unique identifier and it’s also referred to as a PD1001. So googled around and found what appear to be linux drivers…

Creative WebCam PD1001 Linux driver
http://sourceforge.net/project.....les/epcam/

I used wget to grab the latest file and unpacked to a folder, to get me to this point…

pi@raspberrypi:~/webcam$ ls -alh
total 52K
drwxr-xr-x  3 pi pi 4.0K May 10 08:18 .
drwxr-xr-x 13 pi pi 4.0K May 10 08:11 ..
-rw-r–r–  1 pi pi 3.6K Mar 12  2011 CHANGELOG
drwxr-xr-x  3 pi pi 4.0K May 10 08:15 drivers
-rw-r–r–  1 pi pi  20K Mar 12  2011 epcam-src-1.3.2.tar.gz
-rw-r–r–  1 pi pi  601 Aug 24  2010 INSTALL
-rw-r–r–  1 pi pi 4.8K Mar 12  2011 Makefile
-rw-r–r–  1 pi pi  874 Mar 12  2011 README
pi@raspberrypi:~/webcam$

Now I’m stuck – I think I need to compile this on the Pi and “modprobe” or similar to get it seen by the system, but I’m struggling to know how. Any chance anyone could help me with advice on the next steps and maybe bring this old chugger back to life on the Pi?

Say cheese.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26695
Joined: Sat Jul 30, 2011 7:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 9:33 am

These are the instructions from the README ansd INSTALL files that are in the compressed file you downloaded.

INSTALL To install epcam linux driver follow this:

1. Download the source files that are included in epcam-src-<version>.tar.gz
2. Open a terminal
3. Go the directory where you downloaded epcam-src-<version>.tar.gz
4. Make sure you have kernel development packages installed, otherwise you won't be able to build the driver from source files.
5. Type in your terminal each of the following commands:

tar xfvz epcam-src-<version>.tar.gz
make
sudo make install
sudo modprobe epcam

To deinstall the driver:

sudo rmmod epcam
sudo make uninstall

To clean up files created during the build:

make clean 
 
READMEFollow instructions from INSTALL file to build and install epcam linux driver.

If you want to use your camera with zoneminder surveilance application edit file /usr/bin/zmdc.pl,
(path could be different) and add following line right before "my @daemons = ...." (line 64 in my case):

$ENV{LD_PRELOAD} = '/usr/lib/libv4l/v4l2convert.so';

Restart zoneminder (sudo service zoneminder restart) and it should work.

Run skype or camorama from command line with following commands:

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype

or

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so camorama

Add colour correction effect in camorama (camorama doesn't detect BGR24 format properly)
Run mplayer from command line with following command:

LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so mplayer -tv driver=v4l2:fps=15:device=/dev/video0 tv://
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 9:43 am

Thanks - unfortunately Computer Says No.

pi@raspberrypi:~/webcam$ make

Building EPCAM driver for 2.5/2.6 kernel.

Remember: you must have read/write access to your kernel source tree .

make -C /lib/modules/`uname -r`/build  M=/home/pi/webcam modules

make: *** /lib/modules/3.1.9+/build: No such file or directory.  Stop.

make: *** [default] Error 2

I tried sudo, same result.

What's error 2 when it's at home - special sauce required?

Pirx-Danford
Posts: 62
Joined: Thu Oct 06, 2011 2:05 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 9:44 am

I assume "make" will throw some errors, if you don"t find the solution then post the messages here.

Or if its a lot in messages then use http://pastebin.com/ and post the link here.

Edit: oh you are quick – lets see what the cause is.

Edit 2: you are quite probably missing the kernel headers, check if you installed the appropriate linux-headers package.

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 9:55 am

Sorry but how do I install the appropriate linux-headers package?

sudo apt-get install foo

I guess, but what is foo?

Pirx-Danford
Posts: 62
Joined: Thu Oct 06, 2011 2:05 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 10:01 am

Well I dunno the exact appropriate package name, but I know a way to get you there.

Do a "sudo apt-get install dselect", dselect is a usefull package manager that I find easier to use than the dpkg and apt console tools.

After installing dselect start it with "sudo dselect" .

At the package overview you can search with the slash "/" key.

Search for the installed kernel (package should begin with linux-image as name) and then search for linux-headers and select to install the appropriate package.

Oh and if you got X running maybe you wanna use "synaptic" and not dselect...

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 10:18 am

OK - thanks... installed deselect, and I see lots of stuff - have to be honest I'm not certain what the installed kernel is (this is a stock debian SD image - the most recent), does uname -a give me the answer.

I'm actually SSH'd in to the box (no X) from an iPhone, yip for real! makes the dselect screen pretty trick unfortunately.. Can you shed any more light on this linux-headers package I might need, I can then apt-get install it and make, are those really the only steps I need, I was thinking that I might need to rebuild the kernel with video for linux support as well or something like that - but hopefully not.

Pirx-Danford
Posts: 62
Joined: Thu Oct 06, 2011 2:05 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 10:21 am

pi-man-uk said:


OK - thanks... installed deselect, and I see lots of stuff - have to be honest I'm not certain what the installed kernel is (this is a stock debian SD image - the most recent), does uname -a give me the answer.

I'm actually SSH'd in to the box (no X) from an iPhone, yip for real! makes the dselect screen pretty trick unfortunately.. Can you shed any more light on this linux-headers package I might need, I can then apt-get install it and make, are those really the only steps I need, I was thinking that I might need to rebuild the kernel with video for linux support as well or something like that - but hopefully not.


Right lets try another way to get you there.

Do a "cat /proc/version" and post the output here.
From there we should be able to find the matching linux-headers!

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 10:37 am

thanks for bearing with me ! am feeling positive (maybe false hope, unsure at this stage)...

pi@raspberrypi:~$ cat /proc/version
Linux version 3.1.9+ (grayg@dc4-arm-01) (gcc version 4.5.1 (Broadcom-2708) ) #90 Wed Apr 18 18:23:05 BST 2012
pi@raspberrypi:~$

Pirx-Danford
Posts: 62
Joined: Thu Oct 06, 2011 2:05 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 11:23 am

Oha evil trap - there is no Debian package as of yet, but fear not there is a way.

In another thread where JamesH had the same problems with the header files he was directed towards this

http://www.raspberrypi.org/archives/574

Maybe we can persuade JamesH to provide step by step directions on how to correctly set the header files up.

Pretty please James?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26695
Joined: Sat Jul 30, 2011 7:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 12:01 pm

You sure that was me? Don't remember needing kernel header files. And the kernel version has changed since that thread linked, so probably out of date anyway.

I'll try and find header stuff out...

James
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Max

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 12:24 pm

pi-man-uk said:

   Building EPCAM driver for 2.5/2.6 kernel.

I hate to spoil the fun, but I doubt this Linux driver that was written for 2.5 is going to work with the modern kernel rPi uses.

I think they were using the video4linux version 1 back then, and only version 2 is available in modern kernels.

That said, to get an environment suitable for building modules:


sudo apt-get install git
git clone --depth 1 https://github.com/raspberrypi/linux.git
sudo mv linux /lib/modules/3.1.9+/build
cd /lib/modules/3.1.9+/build
make mrproper
gzip -dc /proc/config.gz > .config
make modules_prepare


pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 1:22 pm

Tried it for the hell of it!

alas...

pi@raspberrypi:/lib/modules/3.1.9+/build$ cd
pi@raspberrypi:~$ cd webcam/
pi@raspberrypi:~/webcam$ make
Building EPCAM driver for 2.5/2.6 kernel.
Remember: you must have read/write access to your kernel source tree .
make -C /lib/modules/`uname -r`/build  M=/home/pi/webcam modules
make[1]: Entering directory `/lib/modules/3.1.9+/build'

WARNING: Symbol version dump /lib/modules/3.1.9+/build/Module.symvers
is missing; modules will have no dependencies and modversion s.

CC [M]  /home/pi/webcam/drivers/usb/epcam.o
In file included from /home/pi/webcam/drivers/usb/epcam.c:89:0:
/home/pi/webcam/drivers/usb/epcam.h:5:28: fatal error: linux/videodev.h
: No such file or directory
compilation terminated.
make[2]: *** [/home/pi/webcam/drivers/usb/epcam.o] Error 1
make[1]: *** [_module_/home/pi/webcam] Error 2
make[1]: Leaving directory `/lib/modules/3.1.9+/build'
make: *** [default] Error 2
pi@raspberrypi:~/webcam$

Guess I need to find a more modern/alternative driver or back to the "loft" to look for another webcam.

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 1:27 pm

Maybe I'll give the Arch Linux distro a try - was planning to anyway.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26695
Joined: Sat Jul 30, 2011 7:41 pm

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 1:37 pm

Given that a modern USB webcam is not a very expensive bit of kit, you might find that a better option. That said, the aim of the board is to teach, and it would be a worthwhile effort to fix the driver up!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Max

Re: say cheese (boring title - compiling device drivers for old hardware)

Thu May 10, 2012 1:39 pm

pi-man-uk said:

/home/pi/webcam/drivers/usb/epcam.h:5:28: fatal error: linux/videodev.h
: No such file or directory



Confirms that the driver was developed for video4linux version 1.

Version 2 uses videodev2.h

Think Arch is using the same kernel, so you will have the same problem.

pi-man-uk
Posts: 62
Joined: Tue May 08, 2012 1:41 pm

Re: say cheese (boring title - compiling device drivers for

Tue May 29, 2012 8:18 am

I've taking the cowards way out - purchased logitech cam C250 from Robert Dyas - £5.99.
It's UVC I believe which is apparently a good thing from a driver point of view.

I'll try it with Arch tonight.

User avatar
cowpat
Posts: 90
Joined: Sat Apr 14, 2012 12:13 pm
Location: London
Contact: Website

Re: say cheese (boring title - compiling device drivers for

Wed May 30, 2012 8:10 pm

how did you get on with the C250?

I've been using a modified microsoft lifecam cinema - which works - but I'm not running it at anything near the 1280x720 it purports to be capable of, so i'm thinking i might save myself a few quid if the C250 is half decent.

cheers,

Michael

redfury
Posts: 3
Joined: Thu May 31, 2012 8:56 pm

Re: say cheese (boring title - compiling device drivers for

Sun Jun 10, 2012 8:47 pm

Yup, stuck with the same 'o crap ;)

Got a Creative PD1001 lying around, and a Philips SPC900NC, both not working on Debian or Arch.
Kernel too new, drivers too old. I'm not good at porting drivers to v4l2.. somebody got a tutorial ;)

poliveira1978
Posts: 17
Joined: Sun Jul 22, 2012 8:42 pm
Location: Covilhã, Portugal
Contact: Website

Re: say cheese (boring title - compiling device drivers for

Sun Jul 22, 2012 8:47 pm

i've got a similar problem here:
my webcam seems to be detected, dmesg says:
  • [ 3719.767116] usb 1-1.3: Product: Camera
    [ 3719.953955] Linux video capture interface: v2.00
    [ 3719.970943] gspca: v2.13.0 registered
    [ 3719.986964] STV06xx: st6422 sensor detected
    [ 3720.266320] input: STV06xx as /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/input/input0
    [ 3720.297077] usbcore: registered new interface driver STV06xx
    [ 3720.405749] usbcore: registered new interface driver snd-usb-audio
and lsusb:
  • Bus 001 Device 005: ID 046d:08f6 Logitech, Inc. QuickCam Messenger Plus
The device /dev/video0 was created.
I've tried to setup motion and i always get a grey image with the text "Unable to access /dev/video0".

Is there any solution to this?

Thanks in advance.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13115
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: say cheese (boring title - compiling device drivers for

Sun Jul 22, 2012 9:10 pm

pi-man-uk wrote:Sorry but how do I install the appropriate linux-headers package?

sudo apt-get install foo

I guess, but what is foo?
For interested parties;

Foo is a "hacker term" short for "foobar", its the term used for a variable where you can fill in an appropriate value.

See:
http://en.wikipedia.org/wiki/Foobar

In this case foo means the name of the package you want to install.

poliveira1978
Posts: 17
Joined: Sun Jul 22, 2012 8:42 pm
Location: Covilhã, Portugal
Contact: Website

Re: say cheese (boring title - compiling device drivers for

Mon Jul 23, 2012 11:09 pm

problem solved... with vgrabbj i can take pictures.

leona-pi
Posts: 18
Joined: Thu Nov 15, 2012 3:03 pm

Re: say cheese (boring title - compiling device drivers for

Tue Jan 15, 2013 10:14 pm

I came across this thread as I have that creative cam and can not get it working, its listed in dmesg and lsusb but no /dev/ entry.
Is this a non starter? Should I go look for another cam?
Kind Regards
--------------------
Leona

User avatar
Cancelor
Posts: 777
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: say cheese (boring title - compiling device drivers for

Wed May 14, 2014 9:21 pm

Ha! had the same question as above, I guess this is dead in the water .... interesting thread though :))

Even when it was new I never seemed to get it working!!! lmao, good ole Creative Labs.
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

Return to “Troubleshooting”