--- layout: post status: publish published: true title: 64bit GNU/Linux and Webcams (Logitech Quickcam Express) wordpress_id: 1505 wordpress_url: https://www.martineve.com/2011/09/25/64bit-gnulinux-and-webcams-logitech-quickcam-express/ date: !binary |- MjAxMS0wOS0yNSAwNzoyODowOSArMDIwMA== date_gmt: !binary |- MjAxMS0wOS0yNSAwNzoyODowOSArMDIwMA== categories: - Technology - Linux tags: - Linux comments: [] ---
I've just been playing around with my webcam, which I haven't hooked up in ages, and was unable to get it working under my 64bit Fedora installation. Having done a bit of reading, and having found that some applications can use the camera, I worked out the solution.
32bit applications need to have the 32bit library put into their LD_PRELOAD environment variable.
This will work only if your camera is being correctly detected, but doesn't seem to work in certain apps. To check, run dmesg and look for the following output:
{% highlight bash %} [ 2.878055] usb 2-4: New USB device found, idVendor=046d, idProduct=0928 [ 2.878261] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 2.878458] usb 2-4: Product: Camera [ 2.878649] usb 2-4: Manufacturer: {% endhighlight %}I tried doing this via .bashrc originally, but the problem was that 64bit applications then continually churned out garbage. The eventual solution was as follows:
For each application that uses a 32bit component for which you want webcam access (Firefox/Flash, Skype) create a file called program-cam-fix in /usr/bin/.
Here's my firefox-cam-fix file:
{% highlight bash %} #! /bin/sh LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so firefox $1 {% endhighlight %}My skype-cam-fix file doesn't have the $1 at the end as the launcher doesn't pass any arguments.
Next, modify the files /usr/share/applications/mozilla-firefox.desktop and /usr/share/applications/skype.desktop so that the exec lines point to your new scripts (/usr/bin/skype-cam-fix or /usr/bin/firefox-cam-fix). You'll need to use sudo.
Now, when you start skype, or firefox, you should be able to use the webcam.