Persistent camera switch

07.09.2011 22:04

In case someone else has been wondering why the integrated camera on the EeePC mysteriously gets switched on sometimes. It's not a sign that someone is spying on you through your netbook's webcam. It turns out it's a feature of the eeepc-laptop module in the recent versions of Linux kernel. I've been noticing this since I upgraded to Debian Squeeze with the 2.6.32 kernel.

The eeepc-laptop: enable camera by default thread on LKML pretty much explains it. The kernel module that provides access to the laptop's power switches for various peripherals got patched so that it unconditionally turns on the camera each time it's loaded. This usually happens at boot, but it took me a while to find that out since I mostly put my computer to sleep and only occasionally reboot it.

Now in my humble opinion it was a pretty bad decision to include this patch in the mainline kernel. Leaving paranoia aside for the moment, turning camera on increases power consumption. The LKML thread addresses that but it appears they didn't get to any certain conclusions about the impact to battery life.

I also find the practice of fixing broken userland in the kernel questionable. The rationale for this patch was that people get confused when the camera is turned off and software reports no cameras on the system. Why is that a problem? If the camera is turned off, it's not there. Period. If a particular userland distribution isn't happy with a camera that is turned off it can fix this with a one-liner in a boot script.

Also the state of the hardware power switches is persistent over reboots. So if someone likes to have a camera switched on at all times, he can switch it on once and it will stay that way. This weird crutch of turning the camera on at boot just makes it confusing when one switch fails to retain its state while all others do.

Reverting this patch is simple, but I'm not going to maintain a custom-compiled kernel just for this - I'm still too happy that Squeeze removed the need for five custom kernel patches for various quirks of this laptop. So now I have a one-liner in a boot script that switches off the camera after the module has been loaded.

Posted by Tomaž | Categories: Code

Add a new comment


(No HTML tags allowed. Separate paragraphs with a blank line.)