All posts by msoos

How to unload the sound module

I regularly have a problem with my sound card: it simply stops working, and xine (and everything else) says that it cannot open the sound socket. So, I need to unload and reload the snd_hda_intel module. Most of the time, however, I cannot since it is in use. I try to close all possibly using sound, but most of the time it is a dead process that is using it. But, I have figured out how to find these unruly processes:

1) fuser -a /dev/snd/pcmxxxx (where try all here, xxxx can be anything)
2) for each process ID (PID) listed, do a, do “ps xa | grep PID”, so see what the process is. Close it cleanly, if possible (through the gui), or “kill” it if it is a hanged process. Most of the time, it is a program in a messed-up state – in my case it is sometimes a “kio-exec” process. Killing is simply “kill PID” or, more harshly, “kill -9 PID”.

Now issue “rmmod snd_hda_intel” and then “modprobe snd_hda_intel”. Done! :)

KDE4 composite with intel drivers

I have been having a hard time getting the composite effects running smoothly on KDE4 with my intel Mobile 945GM graphics card. But I have finally managed to get it up and running! This is how:

  1. Get the latest intel driver from your repository (I have 2.3.2)
  2. Put into xorg.conf at the driver section:
    Section "Device"
    Identifier      "Configured Video Device"
    Driver "intel"
    Option "DRI" "true"
    EndSection
  3. Put at the end of your xorg.conf:
    Section "DRI"
    Mode 0666
    EndSection
    
    Section "Extensions"
    Option "Composite" "Enable"
    Option "DAMAGE" "Enable"
    Option "RENDER" "Enable"
    Option "RandR" "on"
    EndSection
  4. Under the system settings, enable desktop effects and set in the advanced settings to use XRender! (and take out the update thumbnails and the smooth scaling).
  5. Restart X: restart the computer or just do: logout then push “ctrl+alt+backspace”, log in to the console as root, and restart kdm by issuing: “/etc/init.d/kdm restart”.

I have by the way, a Dell D430, so an extremely lightweight, small computer that probably has the worst performance among its peers, and the effects are *fast* I must say that the “coverflow” effect (not enabled by default) isn’t that great, something is wrong with it, but still: scrolling is super-fast, switching windows is super-fast, so you won’t notice any slowdown at all!

Suspend on Dell D430

I have been having problems suspending my Dell Latitude D420 for a long time, but finally, I have made it work! This is the simple howto:

  1. install guidance power manager
  2. install pm-utils
  3. install uswsusp
  4. Go to /usr/lib/pm-utils/ and edit the file “defaults”. Set ‘SLEEP_MODULE=”uswsusp””
  5. Start the guidance power manager

You are done. This solution is *very* neat in many respects. The old solution that is much worse, you can find on the internet is to compile atkbd and psmouse as modules, then remove and modprobe them before suspend and after resume. That can be done by adding atkbd and psmouse in /usr/lib/pm-utils/defaults under “USPEND_MODULES=…”, but that has a *big* drawback. First, the resume hangs about 1% of the time. Second, the synaptics driver will no longer use the defaults you gave to it in the xorg.conf or through the synclient program – effectively, you won’t be able to control how your touchpad will work.

The worst thing about this suspend problem was, by the way, that there is absolutely *no* documentation on the possible suspend modes in Linux. It took me 2 months to figure out that I wasn’t in fact using s2ram! There are many modes to suspend, by the way:

  1. powersaved does some tricks, though it seem to fail on my computer, I think it might try s2ram without the –force option (this option is given by pm-utils, in modules.d/uswsusp, have a look)
  2. acpi (/etc/acpi) stuff – never gets executed, as far as I know
  3. pm-utils
  4. s2ram
  5. tuxonice
  6. suspend2

I didn’t find any info about these, how these work, when they work, etc. And it gets worse. There are multipe utilities, too: guidance, kpowersaved, just to name two. But you can most probaby configure-on-lidclose in Gnome systemsettings, too. And what do THEY execute? No clue. I wonder how the guidance-power-manager gets to use the pm-utils at all? Cannot be set what to use, as far as I now.

Well, this much about my frustration of the suspend-stuff. BTW I would be really greatful to the package managers&developers; to make it absolutely clear what does what, and what gets executed by what, e.g. what is used by guidance? And kpowersaved? And powersaved? I would also appreciate if there weren’t 6 ways of suspending my machine, only 2, maybe 3. I know that choice is what drives linux forward, but in some cases, especially in such difficult hardware-oriented cases, I would really like to have a maximum of 2 or 3 clear choices. No random ones like: “I run guidace, it calls something when I close the lid, dunno what, but it works, maybe not even guidance called it but the powersaved that runs in the background, or whoknowswhat, but it works”. Or it doesn’t and then you are in deeeeep shit.

PS: could someone please tell me what the /etc/acpi stuff is used for, and especially when is it used? I never ever ‘heard’ it being used, but, you know, the computer doesn’t tell me what it does… I thought that Linux was special because if I dug deep enough I always knew what was happening. Not with suspend!

Synaptics

Well, well. I updated my xorg synaptics driver, and…. the damn thing stopped working. That is, the touchpad worked, but not through the synaptics driver, so it would be really badly configured. I like my touchpad to be correctly configured. As a matter of fact, I put this file into ~/.kde4/Autostart/ :

#!/bin/bash
fetchmail
synclient SingleTapTimeout=0.5
synclient   MinSpeed=0.1
synclient   MaxSpeed=1
synclient   AccelFactor=0.3
synclient   ClickTime=10
synclient   EdgeMotionMinSpeed=30
synclient   EdgeMotionMaxSpeed=150
synclient   VertScrollDelta=24
synclient   UpDownScrollRepeat=1
synclient   PressureMotionMaxFactor=2
synclient   HorizEdgeScroll=0
synclient   VertEdgeScroll=1
synclient   VertTwoFingerScroll=1
synclient   HorizTwoFingerScroll=0
synclient   PalmMinZ=30
killall syndaemon
syndaemon -i 0.6 -d -K
killall hotkeys
hotkeys -t inspiron8100

As you can see, this starts my fetchmail daemon, sets up the config of the touchpad through the synclient program, and also starts “syndaemon”, which disables the touchpad while typing – VERY helpful, mind you, since when programming, I always put my finger on the touchpad by accident, and suddenly everything gets messed up. Also, it sets up the hotkeys program, which will make my volume-up and volume-down keys working (I have a Dell D420, thanks INRIA ;) )

Anyway, I finally had a look at /var/log/Xorg.0.log and, well, synaptics didn’t find the touchpad. So, I had a look around the Internet, and apparently, others had the same issue with the new driver! So, finally, I had a look around, and I managed to cut-and-paste-and-edit the relevant section of xorg.conf to:

Section "InputDevice"
Driver      "synaptics"
#     Option "Device" "/dev/input/mice"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
Option "SHMConfig" "on"
Option "SendCoreEvents" "true"
Option "TapButton1" "1"
Option "TapButton2" "2"
Identifier  "TouchPad"
EndSection

Which finally made the thing work again through synaptics! What you have to notice here is:

  • SHMConfig is NOT “true” but “on”. Important for new Xorg servers.
  • Device is NOT given, so that Xorg can automatically find it!
  • SendCoreEvents is set to “true”

Hooraaay! :D