Getting the HP Pavilion 6314 in-built webcam working on Linux

Posted at 08:04:26 pm by hari under Tutorials and HOWTOs (1418 views)

I have just discovered how to get the in-built webcam on my HP Pavilion laptop (webcam model: Microdia) to work in Linux. Since I haven't found a single clear tutorial on this particular model anywhere on the web (and knowing that such obscure topics do require to be documented), I wanted to write this tutorial and to create a record for my personal future reference as well as for the benefit of others with a similar issue.

This tutorial works with Debian. For other distributions that don't have module-assistant, simple compile the driver source as you would normally do: make, make install and copy the module output file to the directory /lib/modules/2.6.x/ (substitute 2.6.x for your kernel version).

Get the kernel headers

You should first install the kernel headers package. On my system this is currently the package named linux-headers-2.6.22-3. Usually the package is named kernel-headers or linux-headers along with the version number. Choose the correct headers package matching your running kernel.

The command is

apt-get install linux-headers-2.6.22-3

Get the source code for uvcvideo

On Debian this package is named linux-uvc-source. If you cannot find that package simply download the uvc sources from this website: http://linux-uvc.berlios.de/ and compile the driver like you would compile any other application.

On Debian (or Debian-like systems, e.g. Ubuntu) run:

apt-get install linux-uvc-source

This will automatically install module assistant and other necessary tools to simplify compiling and installing this driver.

Install the driver module

Login or su as root and then run the following commands.

m-a prepare
m-a a-i linux-uvc

That's it! This will automatically compile and install the kernel module required for this device. Then run modprobe to load the driver:

modprobe uvcvideo

If you didn't get any error messages at this stage, you've successfully installed the driver! Otherwise check whether your compilation failed and why it did. module-assistant works 99.99% of the time on Debian since it automatically takes care of the necessary dependencies.

Now check the video output

To check whether video works, you can use ffmpeg. Install ffmpeg (if you haven't already) using apt-get. Then to test whether recording works via the webcam run something like this:

ffmpeg -f video4linux2 -s pal -i /dev/video0 temp.mpg

It won't show anything while recording, but the blue LED near your webcam's lens show now glow. After you have recorded for a few seconds, quit ffmpeg and play back the temp.mpg file to check the video output. Obviously audio wouldn't have been captured in this case. But I can confirm the the built-in microphone on this laptop also works with ALSA, so you should merely have to specify the audio input parameter in ffmpeg.

That's all. If I have missed out any steps or you have any questions regarding this HOWTO, just feel free to drop a comment here! :)

4 comments

GravatarComment from: Ramshankar [Visitor] · http://the-teknomancer.blogspot.com
Tip: to get the proper version of linux headers use `uname -r`.

Friday Dec 21, 2007 @ 11:06
GravatarComment from: hari [Member] · http://literaryforums.org
Ram, that's a good idea.
Friday Dec 21, 2007 @ 11:29
GravatarComment from: shadow.seeker [Visitor]
***--
It worked for me too, thanks a lot :) But I had to install udev and reload the modules (can also do a restart).
Tuesday Apr 1, 2008 @ 10:14
GravatarComment from: hari [Member] · http://literaryforums.org
Shadow.skeer, I assumed that most people using Linux have switched to udev. At least Debian users should have, by now. :yes:
Tuesday Apr 1, 2008 @ 10:23

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
:!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( :'( |-| :>> :yes: ;D :P :)) 88| :. :no: XX( :lalala: :crazy: >:XX
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)