Archive

Archive for July, 2011

Increasing battery working time on Lenovo W500

I’m a happy user of a Lenovo W500 but I had a very hard time getting anything more than 1h30 battery time, even with a brand new 9-cell battery (this one got me just 1h45 when using low screen brightness and minimum CPU). Then through a conversation with a friend and colleague, he suggested I disable the ATI graphics card and use the motherboard’s… This means disabling it in the system’s BIOS (not inside whatever operating system you use).

Since I tried that, I get up to 4h45 on my 9-cell (with the minimum energy usage configuration in Ubuntu 10.10 64bit). Just thought I should write this down in case it helps other people.

HOWTO Build your own binaries of PHP Xapian bindings for Debian

July 6, 2011 9 comments

Due to a licensing issue, the PHP bindings for Xapian were removed from Debian Squeeze. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513796 for more information about this.

Though, it is not really hard to build your own package from source.

Here is how:

sudo apt-get build-dep xapian-bindings
sudo apt-get install php5-dev php5-cli
apt-get source xapian-bindings
cd xapian-bindings-1.2.*
rm debian/control
env PHP_VERSIONS=5 debian/rules maint
debuild -e PHP_VERSIONS=5 -us -uc
cd ..
sudo dpkg -i php5-xapian_*.deb

Be careful: the extracted source directory (xapian-bindings-1.2.*) has to be absolutely clean, so if you tried a first time and it failed, remove the whole directory before trying again.

Of course, the same procedure holds true for Ubuntu as well.

2012-12-23 edit: if you’re using PHP 5.4, you need to modify the debuild line. Check the update article on Xapian’s wiki

To enable the extension, don’t forget to create a xapian.ini  (or 20-xapian.ini for the latest Ubuntu with PHP 5.4) containing “extension = xapian.so” in /etc/php5/apache2/conf.d/, then restart your web server.

Adobe Flash and V4L2 webcams

July 2, 2011 1 comment

Many new videoconference systems nowadays are Flash-based. Of course, the main input for them is some sort of video device (e.g. a webcam).

Under Linux, the framework responsible for this is Video4Linux (V4L), of which version 2 (aka V4L2) is current. That means that most recent webcams drivers are supported only by V4L2.

Alas, some proprietary editors (of which Skype and Adobe with Flash) still only support V4L1. If you’ve got a webcam with V4L2-only driver, you’re out of luck.

Recently, Adobe announced, Flash’s support of V4L2 on Linux beginning with 10 Beta, but they got something wrong. On my Philips SPC 315NC as an example, it is detected (in Flash’s Settings), but does not work (not activated), while it works perfectly with other programs (of which Cheese). On my Logitech QuickCam Express, it is not even detected by Flash.

Some complicated solutions are available on the Net, some based on some Gstreamer loopback-conversion from V4L2 to V4L1. Example: http://www.jtolds.com/newsletter/2008/7/27/how-to-get-v4l2-devices-to-work-with-flash

Though, there is a simpler solution I just found out: V4L2 is shipped with a compatibility-layer library. On my Ubuntu, it is to be found in /usr/lib/libv4l/v4l1compat.so.

So, using the mechanism to force loading this library, you will get your V4L2 webcam supported by Flash in your browser.

Example with Firefox:

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

And of course, probably any other software suffering the same kind of flaw.

Enjoy!

%d bloggers like this: