Tag Archives: gstreamer

Webcam, Cheese, GStreamer and UVCVideo problems in Intrepid

I bought a new webcam, a Logitech E 3500 and it works great on Skype. Unfortunately, on my Ubuntu Intrepid box, Cheese and other GStreamer based programs are not able to make the webcam work.

At the beginning, since it was working with Skype and not working with GStreamer, it seemed a GStreamer bug. It is not. It is a bug with the uvcvideo module loaded in the kernel. As soon as you compile the SVN version of uvcvideo the webcam start working with all the programs which can interface with Video4Linux2.

Here a few steps to make it working.
First of all: you need to install some build tools and the kernel headers:
sudo apt-get install linux-headers-`uname -r` build-essential subversion

Create a folder on which you will work (let’s say it’s in your home, but you can change it):
mkdir ~/uvcvideo
cd ~/uvcvideo

Now download the latest source from the SVN server:
svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk
cd trunk

and build it:
make

Now you are ready to load the brand-new module, but first unload the old one:
sudo rmmod uvcvideo
sudo insmod ./uvcvideo.ko

Now start Cheese and smile! In my case the resolution selection is still not working, but that’s a minor problem.

Please note that now you are using a module that is hand-loaded. If you want your kernel to load the new uvcvideo module automatically instead of the old one, enter the following commands:
sudo cp ./uvcvideo.ko /lib/modules/`uname -r`/kernel/drivers/media/video/uvc/uvcvideo.ko
sudo rmmod uvcvideo
sudo modprobe uvcvideo

This will overwrite the old module. The classic make install won’t work, since it will install the module in a different folder from the default tree of the kernel in Ubuntu Intrepid.

Personally I hope Ubuntu will soon provide a correct patch: even this worked for me, I don’t really like quick&dirty ways

L’uso frustrante di Gstreamer e Sound Juicer

VioloncellistaSound Juicer è il lettore CD di Gnome, nonché programma adibito all’estrazione dei CD e alla trasformazione delle tracce in un formato compresso: installando tutti i plugin brutti e cattivi di gstreamer si riesce a usare molti formati: MP3, AAC (quello dell’iPod), Ogg Vorbis, Flac e Wave.

I problemi iniziano già subito: in Sound Juicer non è possibile modificare alcuni dettagli delle informazioni che verranno scritte nei file. Non è possibile aggiungere le note, l’autore, l’anno del disco. Ci si può limitare solo a quello che compare nella finestra principale: autore, titolo del brano, album e genere. Se a voi basta, a me certamente no. Per la musica classica, ad esempio, è mia consuetudine aggiungere l’elenco degli esecutori (orchestra, direttore, ecc.) nelle note. Inoltre, se si decide di usare il formato AAC, a mio modesto parere è quello che si sente meglio, su Ubuntu non esiste un solo programma in grado di modificarne i tag (correggetemi se sbaglio): quindi bisogna accontentarsi, e se si sbaglia occorre importare nuovamente il brano. A questo si può rimediare se si usa RhythmBox, che lascia all’utente un po’ più di spazio nella gabbia dell’(in)usabilità.

Detto questo è meglio usare l’MP3, che almeno funziona un po’ dappertutto. Una rapida sbirciata alla documentazione e si diventa in grado di modificare le chain di Gstreamer utilizzate da Sound Juicer per convertire i file. Infatti l’MP3 a 128 Kb/s non è un granché, ed è meglio codificare usando il Variable BitRate (VBR). Teoricamente, sarebbe sufficiente modificare nella chain Audio MP3 la parte relativa a lame in questo modo:

lame vbr=new vbr-mean-bitrate=192 vbr-quality=0

tutte opzioni documentate a cui si può accedere tramite

gst-inspect lame | less

Peccato che così facendo il file risultante avrà una lunghezza dichiarata cinque o sei volte maggiore del reale, colpa di Gstreamer. Meglio spiegare: Gstreamer per codificare gli MP3 utilizza la libreria liblame, che non è altro che il motore di Lame, LAME Ain’t an Mp3 Encoder, uno dei migliori encoder MP3 sulla piazza. Lame, però, con le stesse opzioni crea il file senza che si presenti alcun problema: le stesse opzioni usate tramite Gstreamer portano inesorabilmente ad un file che si sente bene, ma la cui durata è errata. Che, per quanto l’esperienza sonora resti, intatta può essere abbastanza seccante.

La cosa che fa più riflettere è che questo baco è noto almeno dal 16 marzo 2006 (un anno e mezzo fa) e che da allora nulla si è fatto per risolverlo. Magari gli sviluppatori erano troppo impegnati a vendere plugin proprietari tramite Fluendo.

E pazienza se Sound Juicer ha tre pulsanti in meno, ma io pur usando Gnome i CD me li carico usando KAudioCreator, che non usa Gstreamer, ma direttamente Lame. E funziona.
Sarò paziente: il quarto drago è vicino e ci brucerà tutti.