"Hier staunt der Laie und Fachmann wundert sich."

Donnerstag, Mai 26, 2005

Setting the CPU frequency of the Pentium M

My notebook's processor is a Pentium M. I specifically bought that notebook because the fan does not come on under normal use. This is very nice, simply because it's very quite. By setting the CPU speed to a lower frequency I might completely avoid the noise of the fan. This is what I did to be able to easily control the CPU speed from an applett in the gnome panel.

Firstly, I needed certain modules in my kernel, more specifically these:

- Power management options (ACPI, APM) --->
-- [*] Power Management support
--- CPU Frequency scaling --->
---- [*] CPU Frequency scaling
---- <*> CPU frequency translation statistics
---- Default CPUFreq governor (userspace) --->
---- 'performance' governor (1)
---- 'powersave' governor (1)
---- 'ondemand' cpufreq policy governor (1)
---- <*> CPU frequency trable helpers
---- ACPI Processor P-States driver
---- Intel Enhanced SpeedStep
---- Intel Speedstep on ICH-M chipsets (ioport interface) (2)

Notes:
(1) = Not sure if this is really needed.
(2) = You may want to adjust this if you have a different chipset.

If you're aiming for low noise (or long battery power) you will also want to change your default governor from "performance" to "userspace" as indicated above.

Mittwoch, Mai 25, 2005

Garbled German Umlaute

Some special characters, like the German umlaute äöü, were not displayed correctly. First I thought it was only some poorly programmed web-pages but today I noticed that the same happens with file-names on an NTFS volume. So I dug a little deeper.

Note that I tried this stuff in the same order I state here. I did not take the time afterwards to check which steps were actually needed to reach the results.

First I thought that some locales might be missing. So I did
dpkg-reconfigure locales

to check and re-run the configuration scripts of the locales-package. I added de-DE-UTF (or so).

As I said before: I do not know if this step was really necessary. But whatever you do: do not change the default locale or it will mess up your existing files.

After that I restarted my X-Server (just in case) and the display of the special characters actually changed. Instead of mysterious squares it now showed
? (Ungültiger Unicode)
which was even more annoying not what I had wanted at all. Next, I tried to mount the NTFS with the iocharset=utf8 and the utf8 option. Both failed (and also told me that these options are deprecated and that the nls-option should be used). That put me on the right track: I needed reconfigure (and compile) my kernel with NLS-UTF8 support. NLS seemingly stands for Natural Language Support, and this is where you'll find it in menuconfig. I decided to add NLS-UTF8 as a module and while I was at it I also changed the NLS-default-codepage to "cp850" which stands for "Europe". (It had been set to "US".)

After recompiling and installing the kernel and restarting my machine I mounted the NTFS-volume with the option nls=utf-8 -- and lo and behold: all the German umlaute showed up nicely.

One last note: Afterwards I remembered a recent problem I had when using multisync to sync my PalmOS-device with Evolution. In Evolution, all umlaute were garbled (for every original umlaut-character I had two (or was it three) other characters in its place). This problem also disappaered afterwards.

I guess (but have not confirmed it) that adding the locale for de-DE-UTF corrected the sync-problem and is probably not related to the problem with the file-names on the NTFS-volumes. This was most likely solved solely by adding the correct nls-support to the kernel and mounting with the option nls=utf-8.

Montag, Mai 23, 2005

Firefox: Force to always show menu bar

One thing that annoys me is when web-sites use pop-windows and hide the menu-bar in those pop-windows. You can tell Firefox to ignore the request to hide the menu-bar:
  • Enter "about:config" in the address bar and filter for "menu".
  • Double-click on the line that reads "dom.disable_window_open_feature.menubar", which should change the value-column from "false" to "true".

Firefox: Close tab with middle mouse-button

Coming from Windows, I was used to open and close tabs in Firefox by middle-clicking (on a link to open a new tab, on a tab-title to close the tab). This is not the default behavior under Linux. Here's how you may change that:
  • Enter "about:config" in the address bar and enter "middle" as a filter. (This brings you to Mozilla-Firefox's configuration.)
  • Double-click on the line reading "middlemouse.contentLoadURL". This should turn the value-column from "true" to "false".
That was quick. (I found this tip here.)

Samstag, Mai 21, 2005

HOWTO: Installing a USB-Scanner (Epson Perfection 1670)

Another quick step-through for Debian-linux with a >=2.6.4 kernel. Since kernel version 2.6.4 the scanner driver has been removed from the kernel and one needs to use libusb. Don't worry if libusb does not mean anything to you.
For some of this, you need to be root.

Before you begin

I'll assume that USB support is up and running. Check this by opening a shell and running "tail -f /var/log/messages". This will output the last lines of you log-file and any new log-messages (you terminate with the usual CTRL-C). Now plug-in you scanner and turn it on. The shell-window should show something like
kernel: usb 4-4: new high speed USB device using ehci_hcd and adress 4
The actual message my vary, depending on your USB-device, but essentially something should happen when you plug-in the scanner and it should not sound like an error.
Another thing you will need is the firmware-file for your scanner (some scanners don't need one, mine does). Check out this list of firmware-file-names to determine the exact name of the firmware-file. For my Epson-scanner the firmware was (under Windows) in "c:\program files\EPSON\ESCD\ESFW30.BIN". I simply copied this file to my linux-partition ("/usr/share/EPSON-firmware/ESFW30.BIN" seemed a good place). You will need this file later.

Installation step by step

  1. Use your favorite packet-manager to install the "sane" package and its dependencies. (SANE stands for "Scanner Access Now Easy" -- and it really is.) This includes "xscanimage" which can be used to, well, scan an image.
  2. Now you have to determine your scanner product and vendor-id. Have look at the output of "less /proc/bus/usb/devices". The list can be quite long if you have a lot of USB-devices. Your scanner should be somewhere among them. It looks something like this:
    [...]
    D: Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1
    P: Vendor=04b8 ProdID=011f Rev= 1.10
    S: Manufacturer=EPSON
    S: Product=EPSON Scanner
    C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
    I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
    [...]
    We are interested in the vendor- and product-id (in my case "04b8" and "011f").
  3. Open "/etc/sane.d/epson.conf" (or whatever your scanner manufacturer is) with your favoriate editor and add the following line, using your own vendor- and product-id, of course:
    usb 04b8 011f
    Save and close the file.
  4. Last thing we need to do is tell the scanner driver where it can find the firmware. For many scanners this is done in "/etc/sane.d/snapscan.conf". Change the line starting with "firmware" to point to your firmware-file. Mine looks like this:
    firmware /usr/share/EPSON-Firmware/ESFW30.BIN
  5. The scanner should work now. Try "sane-find-scanner". It outputs a whole lot of stuff, but one line should read something like "found USB scanner (vendor=0x04b8 [EPSON], product=0x011f [EPSON Scanner]) at libusb:004:004".
  6. We're almost there. You could go ahead and scan your first image -- but you will only be able to do so as root. What we need to do is set the permissions for the USB-device. This can be very tricky because the device may change everytime you plug in your scanner. Luckily, the isntallation of the sane-package has created a new user-group called "scanner" and it also makes sure that members of that group always have access to the right USB-device. (It does this by using the hotplug-mechanism.) All you have to do is add the users that should be able to scan to the scanner-group. Simply open "/etc/groups" in your favorite editor, locate the line beginning with "scanner" and add the user(s) seperated with colons (":"). Mine looks like this:
    scanner:x:109:stefan

  7. One last thing: The scanner-users also need access to the firmware-file. So you need to change the permissions approiately, in my case "chmod 666 /usr/share/EPSON/ESFW30.BIN". This allows everyone full access to the file. You could restrict this to the members of the scanner-group. This is left as an exercise.
  8. Congratulations! You're done. Start "xscanimage" to scan your first image.

Freitag, Mai 20, 2005

Kernel 2.6: Troubleshooting Mouse Troubles

With the new kernel (2.6.11.10 upgraded from 2.4) I noticed a very annoying change with the mice I use. I have a (built-in) touchpad, a (USB) trackball, and a (USB) mouse which I have all connected at the same time because I actually use them (except for the touchpad, but I can't remove that). With 2.4 I had no problem at all but with 2.6 I started to get double-clicks even though I single-clicked. This happened with any of the three input devices. I quick google search (double click single kernel 2.6) pointed me (indirectly) to the solution. If you are plagued by the same or similar symptoms and are using 2.6, have a look at the 2.6 Input drivers FAQ.
In a nutshell, this is what I did: The problem was in my /etc/X11/XF86Config-4. Starting with kernel 2.6 only one input device section is needed for all mice. So I commented out all input sections pertaining to mice except the one with /dev/input/mice. (Please note: This may break your x-configuration, which means that you may not be able to start into the gui. So make a backup of any files you change.) In that section, I added the following:
Option "CorePointer" "true"
I also commented out any "Option 'SendCoreEvents'". Then I went to the server-layout section and commented out any input devices that I had commented out earlier. This left me with only one input device for all my mice (and, of course, another one for my keyboard). I then restarted X and now everything is bold again.

Donnerstag, Mai 19, 2005

ATI Driver up and running

Following the instruction I found here, I was able to switch to the (supposedly faster) ATI driver for my video card. The output of fglrxinfo reads:

OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: FireMV 2400 PCI DDR Generic
OpenGL version string: 1.3.5010 (X4.3.0-8.12.10)

Isn't that nice? But there's one question I keep asking myself: Who needs it?

Mittwoch, Mai 18, 2005

Kein Sound nach Kernel-Upgrade

Nachdem ich auf meinem Acer Travelmate 800 den Kernel auf 2.6.11.10 aktualisiert habe ist mein Sound aus. Naja. Ich werde erstmal damit leben. (Treiber-Module scheinen geladen zu sein...)
Update: Der Linux-Flüsterer hat mir einen Tipp gegeben und jetzt klappts. Es fehlte einfach nur das Paket alsa-base (und dessen Abhängigkeiten).

HOWTO: Steps to compiling and installing a new (2.6) kernel

1) Download sources from kernel.org. Untar it using "tar -xvjf linux...bz2" in
you /usr/src directory.

2) Important: Create a symbolic link from the source-dir (you just
untared) to /usr/src/linux. This is important, because I will refer to
that dir from now on. "ln -s /usr/src/linux-2.6... /usr/src/linux"

3) If you are using a kernel-config file that you downloaded from the net, save it as ".config" in the new kernel-source dir
under /usr/src/linux

4) Run "make oldconfig" (compares old to new config. Hold the Return-key to
accept all default values.)

5) "make menuconfig" (use this to add wanted options, e.g. if you want
to support other hardware that is not selected in the given .config).
You might need to call "apt-get install ncurses-dev [not -devel] when
you start this the first time.

5.1) Here you need to select the following:
> File System
> Miscellanious Filesystem
> [*] Compresse ROM File System Support (cramfs)

-- update

5.2) If you own a palmos PDA (like a Tungsten or Zire) you'll want to enable support for that, too:

> Device Drivers
> USB Support
> USB Serial Convert Support
> [*] USB Serial Converter Support
> USB Handspring Visor / Palm m50x / Sony Clie Driver (NEW)

-- end of update
When asked, save this configuration.

6) Run "make" (pre 2.6 kernels used "make deb", "make modules" etc.)

7) "make modules_install" (installs the modules).

8) Run "mkinitrd -o destination-file kernel-version" to create the initial
ramdisk. Supply the kernel-version of the new kernel (the one you just
compiled), otherwise mkinitrd will use the currently running
kernel-version -- which you do not want.

9) copy initrd and /user/src/linux/arch/i386/boot/bzImage
to /boot/vmlinuz-2.6...

10) Add a new entry in /boot/grub/menu.lst similar to the existing ones. And you're done.
Restart to boot into your new kernel.