v4l « admiral0's blog

admiral0's blog

Linux, music and poetry

Posts Tagged ‘v4l’

Webcam trouble (Inglese)

Saturday, April 11th, 2009

My article about compiling and installing video4linux modules became relatively popular even abroad so i decided to rewrite it in english. So here we go.

What’s the purpose of this article? You’ve got a video4linux device(webcam, DVB card, etc.) but it doesn’t work so you are desperately searching a solution. The best thing one can do (and is the most simple one, instead of patching the drivers you’ve got) is to compile the latest development snapshot of video4linux prayoing and hoping that code relative to that device was added.

What do i need? You need kernel headers, mercurial, gcc related stuff and obviously gcc.
In *ubuntu and Debian that’s easy to get as a


sudo apt-get install build-essential mercurial linux-headers-`uname -r`

in the console.

First, we need a working directory.


mkdir ~/v4lhg
cd ~/v4lhg

Now we download the source from mercurial.


hg clone http://linuxtv.org/hg/v4l-dvb

N: This can take a long time if your connection is slow.
The output should be like that:


destination directory: v4l-dvb
requesting all changes
adding changesets
adding manifests
adding file changes
added 11446 changesets with 29260 changes to 1993 files
updating working directory
1429 files updated, 0 files merged, 0 files removed, 0 files unresolved

Ok now we can proceed with preparing the source for compiling.


cd v4l-dvb
cp /boot/config-`uname -r` v4l/.config

That step was necessary in order to acquire your kernel’s configuration so you can simply “make && make install” and get fresh modules.


make config

( or make oldconfig if you are sure that your kernel’s configuration has got the option relative to your hardware enabled. )
Now answer to the questions. It is a list of hardware that video4linux supports.
Next we’re going to compile


make

This will take some time depending on your computer’s CPU. Now we’ll install the modules.


sudo make install

Logitech E2500 su Kubuntu Intrepid

Monday, November 3rd, 2008

Bello il mondo linux. Molto plug’n'play. Molto semplice.
A parte per delle webcam plug’fattiglisbatti’poi’forse’play che ti fanno girare le balle.

La webcam...

La webcam...

L’ho acquistata l’ho connessa. Sono rimasto stupito. Ho letto forum e guide. Poi ho quasi pianto… Per funzionare ha bisogno di gspca v1… E su intrepid non va.

Dopo un po’ di esperimenti ho trovato la soluzione. Un po’ macchinosa per adesso ma dovrebbe andare. Migliorero la guida domani. oggi sono proprio tramortito da 3h+ di compilazioni e configurazioni varie.
prepariamo prima una working dir…
cd ~
mkdir webcam_driver
cd webcam_driver
mkdir v4l
cd v4l

1. Scarichiamo v4l
hg clone http://linuxtv.org/hg/v4l-dvb
EDIT: fate un cd v4l-dbd a questo punto. Mi hanno detto che non ci compila senza ;) Grazie vervelover per la segnalazione.
2. Configuriamolo
cp /boot/config-`uname -r` v4l/.config
make config

Quasi tutte le risposte in maiuscolo vanno bene. Quando c’è qualcosa che riguarda gspca dite o Y o M? OK?
3. facciamo le modifiche
cd v4l-dvb
kate linux/drivers/media/video/gspca/zc3xx.c

Aggiungete verso la riga 7530 la riga
{USB_DEVICE(0x046d, 0x089d), .driver_info = SENSOR_MC501CB},
4.Si salva..

5. Compiliamo!
make
6. Installiamo
sudo make install
Adesso abbiamo la nostra webcam quasi funzionante. Funziona con cheese ma non con camorama e skype perché usa v4l2 (v4l1 non è più compatibile con il kernel). Ma non preoccupatevi c’è una soluzione per tutto
Ecco qua:
cd ~/webcam
mkdir libv4l
cd libv4l
hg clone http://linuxtv.org/hg/~hgoede/v4l-dvb
cd v4l-dvb
cd v4l2-apps
mv util util-old # Passo opzionale. A me non compilava la cartella util
make
sudo make --prefix=/usr install

Le applicazioni che usano v4l1 si lanciano con:

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

In teoria quella riga si potrebbe aggiungere allo script di startup… cosa ancora da vedere e sperimentare