vineri, 29 aprilie 2011

[arch] Configure CPU frequency scaling

You don't usually use your CPU at it's maximum frequency. When you install Arch, being such a malleable distribution, you don't get a CPU frequency scaler by default.

Modern CPU have frequency scaling, which means that you can configure the OS to speed up the CPU only when it needs to. This saves power and your CPU won't produce unnecessary heat.

In this article I will show you how to configure CPU Frequency scaling as a daemon, so that it starts at boot time. Note that you won't have GUI controls like gnome applets. For those please consult the link at the end of the article.

To enable frequency scaling in Arch you need to install cpufreq-utils
pacman -S cpufrequtils
After that you need to load the appropriate driver for you hardware:

  • acpi-cpufreq for Intel CPU's 
  • powernow-k10 for AMD
If these don't work for you (probably older hardware, please consult the Arch wiki for further details).

So as root:
modprobe acpi-cpufreq
Now CPU frequency scaling is enabled in you system.

Next you need to select a scaling governor. Most people go for ondemand and this is the one I will use:
modprobe cpufreq_ondemand

Just loading the kernel module isn't enough. You need to activate it in the cpufreq daemon's configuration. For this edit /etc/conf.d/cpufreq and enable your desired CPU scaling governor.

After this start the cpu scaling daemon with:
/etc/rc.d/cpufreq start

CPU scaling is now configured.

To retain these settings after a reboot edit your
/etc/rc.conf and add your  CPU scaling driver and governor to MODULES so it looks like this:

MODULES=(acpi-cpufreq cpufreq_ondemand fuse [other kernel modules])

and activate the cpufreq daemon:

DAEMONS(dbus networkmanager [other daemons] @cpufreq )

Hope this helped !

CPU Frequency Scaling [Arch Wiki]

joi, 28 aprilie 2011

[arch] Fix upside down camera in Skype

On my laptop(an Asus K52F)  the integrated webcam works out of the box in applications such as Cheese.
But when it comes to Skype, the image is upside down.

To fix this you need to install lib32-libv4l from AUR.

yaourt -S lib32-libv4l
After this create /usr/local/bin/skype with the following contents:

exec /usr/bin/skype
exit 0
And now you can launch Skype from your desktop environment and use your webcam properly.

Why it works? It has to do with the PATH environment variable.
 As /usr/local/bin precedes /usr/bin, when the system looks for "skype" it finds it in /usr/local/bin.

In the script above we specified the absolute path to the skype executable so that it knows it's not the same file ( if you would only put skype in there it would enter an infinite cycle)

miercuri, 27 aprilie 2011

Moving to Arch

After almost 4 years with Ubuntu (or other spins such as Kubuntu) and with the upcoming horror named Unity I've decided to move to ArchLinux.

Everyday I was finding myself typing in a
sudo apt-get update && sudo apt-get upgrade -y
and had a lot of PPAs so moving to a rolling release distro made sense.

I've installed  Arch x64 on my laptop and have only good things to say.
Arch detected all my hardware ( integrated webcam and microphone (which didn't work in Ubuntu 10.10!) wireless card and so on) and worked like a charm.

I am currently using GNOME3 as my desktop environment.