Debian GNU/Linux on a Thinkpad T42p

William Stein

Configuration

I received a Thinkpad T42p at the end of July, 2004.

  • Thinkpad T42p 2373
  • 15 inch 1600x1200 flexview display
  • 1.8Ghz "Dothan" Pentium-M 745 processor
  • 1.5GB RAM internal (1GB internal, 512MB external)
  • 128MB ATI Mobility FireGL T2
  • 802.11 a/b/g
  • Two USB 2.0 ports
  • Gigabit ethernet
  • 60GB 7200RPM drive, but I've replaced it with a 100GB 5400RPM Seagate drive.
  • Nine-cell long-life battery

I've owned a 2Ghz Thinkpad T30, a 1.6Ghz T40, and now this T42p. The T42 weighs less than the T30, and in size is somewhere between the T40 and T30. It's thinner than the T30, but wider. The T42p is definitely noticeably larger than the T40, but not much heavier (I think it's just over a half pound heavier). After two weeks experience, I think the T42p is the best laptop I've ever owned, and I recommend it without reservation (except regarding quality issues, which were repaired by IBM under warranty).

This page records some of my thoughts and experiences using the T42p with Linux. It is not a systematic Debian installation guide, but rather a collection of tips and tricks they might help you once you've already installed Debian (or any other variant of Linux). Note: In December 2005 I switched to kubuntu, which is a Debian-ish distro that works on thinkpads very nicely "out of the box". Search google for more on installing Ubuntu on thinkpads. Some of the comments below still apply, of course.

My T42p is currently running the standard Linux Kernel 2.6.9 (not a special Debian version). Here is the kernel configuration file I'm using.

Other Pages

There are several other web pages on installing Linux on the T42p:

Update to Kernel 2.6.9

Full cpu frequency (speedstep-centrino) support for the Dothan 1.8Ghz processor is now available by default.

The synaptics mouse driver in the Linux kernel has the following new "feature", according to the change long:

[email protected]:
	Input: mousedev - implement tapping for touchpads working in absolute
	       mode, such as Synaptics
	
	Signed-off-by: Dmitry Torokhov ([email protected])
This is extremely annoying to me, because it is almost impossible to move the mouse using the touchpad without accidently clicking! The tap time doesn't seem to be user-configurable, and the Thinkpad already has enough mouse buttons (5)! Fortunately Linux is open source, and with some work I found that
  linux-2.6.9/drivers/input/mousedev.c
defines the touchpad behavior. To turn off tapping, I commented out some of the function mousedev_touchpad_touch.
static void mousedev_touchpad_touch(struct mousedev *mousedev, int value)
{
	if (!value) {
		if (mousedev->touch &&
		    time_before(jiffies, mousedev->touch + msecs_to_jiffies(tap_time))) {
			/*
			 * Toggle left button to emulate tap.
			 * We rely on the fact that mousedev_mix always has 0
			 * motion packet so we won't mess current position.
			 */
/*
			set_bit(0, &mousedev->packet.buttons);
			set_bit(0, &mousedev_mix.packet.buttons);
			mousedev_notify_readers(mousedev, &mousedev_mix.packet);
			mousedev_notify_readers(&mousedev_mix, &mousedev_mix.packet);
			clear_bit(0, &mousedev->packet.buttons);
			clear_bit(0, &mousedev_mix.packet.buttons);
*/
		}
		mousedev->touch = mousedev->pkt_count = 0;
	}
	else
		if (!mousedev->touch)
			mousedev->touch = jiffies;
}
I did that, recompiled, etc., and now tapping is off, thankfully. Alternatively, a reader wrote to report that:
  I know it's kinda old now, and you probably know already, but you
  should be able to do modprobe mousedev tap_time=0 and that should
  turn off the touchpad and you won't have to recompile.

  Jeff 

Swapping the Hard Drive

The first thing I did when I got the T42 was physically swap its 60GB 7200RPM drive with the 80GB 4800RPM drive in my old T40. I did this by removing one screw that holds each hard drive in place, flipping the laptops upright, sliding the drives out, swapping the mounting brackets, and reinserting. Note that the mounting brackets look like they are screwed on, but are not; you just pop them on and off. I swapped the drives because I had Debian Linux already installed on the 80GB drive, and I prefer 80GB to 60GB. The output of hdparm says that the 80GB drive is plenty fast
      sh-3.00# /sbin/hdparm -t /dev/hda1
      /dev/hda1:
      Timing buffered disk reads:   92 MB in  3.06 seconds =  30.08 MB/sec

I recently bought a 100GB Seagate hard drive at Fry's and put it in my T42p. It has a 8MB cache and is even faster:

was@form:~/install/t42$ su
Password:
sh-3.00#  /sbin/hdparm -t /dev/hda1

/dev/hda1:
 Timing buffered disk reads:  136 MB in  3.05 seconds =  44.63 MB/sec

Very Informal Benchmarks

I ran some benchmarks that matter to me with the computer algebra system MAGMA doing the sort of calculations I do in my research.
  1.8Ghz T42p ......   18 seconds to complete
  Opteron 248 ......   12 seconds to complete
  G5 XServe ........   24 seconds to complete
I also ran some small Python benchmarks and a simple C program and had similar results. This is one incredibly fast laptop for certain CPU-bound computations, probably partly because of the 2MB L2 Cache.

Battery

Using the 9-cell battery, with the video brightness set at minimum and "normal usage", gives me about 4 hours battery life (at least when I boot up on battery power, so the processor is at its slowest speed). This is about an hour less than my 1.6Ghz T40 would get with exactly the same battery. I get just over one hour from 10-month-old my old 6-cell battery, which suggests the 6-cell battery is "worn out". (Note: Before I got speedstep-centrino working my laptop would always be at slowest speed when booted from battery, and fastest when booted while plugged in. Wolfgang Schober sent me an email about this:
Your T42 Speedstep...
From: Wolfgang Schober 
To: [email protected]
Date: 2004-09-02 08:30 am
Hi,
I was reading your page on the T42 (searching for a solution to my 
mouse-events resolution problem under X) and saw your speedstep "locking".
I have a T40p (running SUSE 9.1) and had a similar effect (locked to 600 on 
battery, and to 1600 on line).
I got the full speedstep-automatism after I turned the setting under XP back 
to "automatic" (somewhere under "settings?", "energy?") where I might have 
been playing before... (if you're interested I could look for the exact place)
Maybe this is turned off by IBM somewhere in the BIOS as a "factory default" 
and will only be turned on when you first start XP? But that doesn't really 
help you, if you want to stay away from XP...
Wolfgang

P.S.
Just to add the path in XP (in German, with a guessed translation):
Start, Systemsteuerung (system control), Energieoptionen (energy options)
Card: Erweiterte Einstellungen (Extended settings)
Option: Stromverbrauchssteuerung f�r CPU (CPU energy consumption control)
choose from: "Automatisch" (Automatic) or "Inaktiv" (Deactivated)
)

Ethernet Interface and Suspend

I first compiled e1000 as a module in the kernel. However, after swsusp2 suspending the laptop and resuming, the e1000 ethernet card wouldn't work, and the syslog messages would look like this:
Aug  8 21:14:49 localhost kernel: Intel(R) PRO/1000 Network Driver - version 5.2.39-k2
Aug  8 21:14:49 localhost kernel: Copyright (c) 1999-2004 Intel Corporation.
Aug  8 21:14:49 localhost kernel: PCI: Found IRQ 11 for device 0000:02:01.0
Aug  8 21:14:49 localhost kernel: PCI: Sharing IRQ 11 with 0000:00:1d.0
Aug  8 21:14:49 localhost kernel: PCI: Sharing IRQ 11 with 0000:01:00.0
Aug  8 21:14:49 localhost kernel: PCI: Sharing IRQ 11 with 0000:02:00.0
Aug  8 21:14:49 localhost kernel: e1000: probe of 0000:02:01.0 failed with error -5
Removing (by using "modprobe -r e1000") first sometimes fixed the problem, but only if I immediately resumed the laptop. If I waited for a few hours I would get the above error message. Solution: Instead of compiling e1000 as a module, I compiled it into the kernel. Now the ethernet interface always works fine after suspending.

Speedstep

I compiled the vanilla Linux kernel 2.6.9, and it includes speedstep-centrino support for the Dothan 1.8Ghz processor in my T42p, which works well.

I think no previous vanilla kernel includes support and the remarks below might be interesting to you if you wish to get support working in a previous kernel. Also, somebody named Oliver wrote to me and shared the following experience:

Date: 2004-09-13 05:43 pm
I'm sure I don't have the speedstep module because I had the same error. 
Some googeling revealed that I needed
<*> ACPI Processor P-States driver
below that I have nothing enabled. Neither as module nor built in.

I think all you need besides that is actuall CPU Frequency scaling (duh) 
and CPU frequency table helpers.

that's all I got (with modules for the performance powersave and 
userspace gov's

I'm running gentoo's 2.6.8 r4 kernel

William Stein wrote:
>>I am wondering what it is with the speedstep-centrino module. I have the
>>T42 (1.7ghz dothan) and am not even using this module and can throttle
>>without a problem.
>>
>
>Are you sure you don't have the module compiled into your kernel?  When I 
>remove the speedstep-centrino module using "modprobe -r", the cpufreq
>subdirectory of /sys/devices/system/cpu/cpu0/ completely disappears, and I 
>have no file to echo a number into.    
>
>Are you using a different speedstep module that I'm not aware of?
>
>>I simply echo 1 or 99999999 into scaling_max_freq and 
>>scaling_setspeed (not sure witch one actually changes it but this seems
>>to work). So what does the speed step module do? in menuconfig it's
>>refered as intel enhanced speedstep, thus it would suggest there is some
>>extra optimaztion in there.

----

Hey, some guy named oliver again  : )

Well i'm sure now. As I said, none of the speedstep modules compiled.
And to clarify, I only have to echo values into scaling_setspeed. not 
into min, not into max. just setspeed. I'll keep you up to date whenever 
2.6.8-r5 or 2.6.9 comes out. I'll experiment some more then.
The following explains how I used to get speedstep to work. I read some of the code of
/usr/src/linux-2.6.6/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
and rewrote it so that it would work with my processor. After Michael sent his patch (which is only to 2.6.7), I corrected the voltages in my 2.6.6 version of speedstep-centrino.c. My 2.6.6 version only adds support for 1.8GHz Dothan, and nothing else. (see below for info about 2.6.8.1)

For whatever reason cpufreqd doesn't seem to work for me. However, directly echo'ing speeds into /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq and /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq does work for me, and that's enough because it means I have control (I can make a command or icon that speeds up or slows down my computer). For example, to set the computer at maximum:

echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
And, to set it at minimum speed:
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
Here are some earlier remarks I had about issues with using speedstep.

So far I have not been able to get speedstep_centrino working at all. If I start the T42p not plugged in, then it runs at 600Mhz, and will not change speed not matter what unless it is rebooted (or hibernated). If I start it up plugged in, then it runs at 1.8Ghz no matter what, even if I subsequently unplug it. This is the error I get when trying to use speedstep-centrino:

  modprobe -v speedstep-centrino
  insmod /lib/modules/2.6.6/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.ko
  FATAL: Error inserting speedstep_centrino (/lib/modules/2.6.6/kernel/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.ko): No such device
This web page discusses a fix. Here's a verbatim copy of the relevant section of that web page:
With the kernel 2.6.6 provided by Fedora Core 2 the "speedstep-centrino" module exits with error "Found unsupported speedstep CPU". I downloaded the last kernel from Fedora and too downloaded the last sources (2.6.7) from kernel.org but I had same results. Next I email to people that contribute to do this module, but they didn't give me any immediatly solution. The problem was that without this module is impossible to throttle the CPU frequency, an important feature on a mobile system.

A month later, googling, I found a message in a forum about a person that had the same problem and that had correct it changing from the file speedstep-centrino.c of the linux kernel the ".x86mask" assigned for Dothan CPU. In this file the mask assigned is 1, but according to the information of /proc/cpuinfo the mask would be 6. This is my CPU info:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 13
model name : Intel(R) Pentium(R) M processor 1.70GHz
stepping : 6
cpu MHz : 1698.751
cache size : 64 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov pat clflush
dts acpi mmx fxsr sse sse2 ss tm pbe tm2 est bogomips : 3375.10

Using 2.6.7 kernel sources I modified the "speedstep-centrino.c". This is the original code:

static const struct cpu_id cpu_id_dothan_a1 = {
.x86_vendor = X86_VENDOR_INTEL,
.x86 = 6,
.x86_model = 13,
.x86_mask = 1,
};

And the modified code:

static const struct cpu_id cpu_id_dothan_a1 = {
.x86_vendor = X86_VENDOR_INTEL,
.x86 = 6,
.x86_model = 13,
.x86_mask = 6,
};

Then I recompiled the linux kernel and the "speedstep-centrino" recognized my CPU and permits to throttle it's frequency, and therefore saves up battery and reduce temperature.

Someone with a hardware problem related to speedstep

From: "James Laros" 
To: [email protected]
Date: 2004-10-21 01:44 pm

Hello William,
We spoke before about some problems I was having with my t42p
relating to system hangs. Turns out that I had a hardware problem.
My best guess based on my testing is that the cpu had a problem
with scaling that caused the hang. If I turned off scaling I could
avoid the intermittent hangs. After the cpu was replaced
all is well. I thought I would let you know since it seems that
you get a bunch of people writing you, just in case someone 
experiences intermittent hangs like I have. 

Take Care and thanks, Jim

Video

Here's an email from Jason Jenkins:
From: Jason Jenkins 
To: [email protected]
CC: [email protected], [email protected]
Date: 2004-12-15 07:00 pm

So here's what I figured out.  If you're looking for easy X
installation on a T42 (I. e., no kernel compiles, no driver downloads,
etc) I've got an XF86Config file that
works on Debian Sarge right out of the box.

That is, I can install a vanilla Debian Sarge system, then put in
this config file, and run startx.  (nothing else to do)
I recently switched to the X.org XFree86 server. As of 2004-09-15, there are no Debian packages for xorg, so I compiled from source. The open source ati driver included with xorg works very well with my system, except I have no 3D direct rendering, so GL is very slow, which isn't a problem for me since I never use 3D anyways. The ati drivers work very well with suspend/resume via ACPI, and don't require any special tricks.

I used to use the closed-source fglrx module directly from ATI. Here is some information about how I installed the fglrx modules. This seems to work for me:

  1. Download this RPM directly from ATI for XFree 4.3.0 (that is, if you use XFree 4.3.x like I do).
  2. Use alien to make this deb package.
       alien fglrx-4.3.0-3.11.1.i386.rpm
    
  3. Install the deb.
       dpkg -i fglrx_4.3.0-4.11_i386.deb
    
  4. Build the (tainted) kernel modules:
     cd /lib/modules/fglrx/build_mod
     source make.sh
     cd ..
     source make_install.sh
    
    This build works for me with kernel 2.6.6 and 2.6.8.1.
  5. But here's where it was really complicated for me personally. I had install some sort of xfree86 dri trunk, which makes copies of all the modules and puts them in /usr/X11R6/lib/modules-dri-trunk/... instead of /usr/X11R6/lib/modules, which is where the the ATI package puts them. Also, for some reason I had fglrx modules in my dri-trunk version, but those were too old and didn't support my laptop's very new display. Not knowing all this, I kept getting tons of errors when trying to start X (no device found). So I moved modules-dri-trunk to modules-dri-trunk.orig and made a symlink from modules to modules-dri-trunk. Really I should track down the config file that points to modules-dri-trunk
  6. Run fglrxconfig to get an XF86Config file.
  7. It works wonderfully. I have very very very fast 3d graphics, etc.
  8. However, swsusp or changing to a text console freeze the computer when 3d acceleration is enable. I commented out the following lines in XF86Config-4 and swsusp works again, but of course I have no 3d graphics. Until this is resolved, if I need 3d graphics, I'll restart X with these extensions enabled.
    #    Load        "dbe"  	# Double buffer extension
    #    Load        "glx"   # libglx.a
    
    (Note: I don't know if turning off dbe was necessary.)
**BIG WARNING**: With Xfree4.3.x, the free open source (GATOS) radeon driver "works" with this laptop. However, while using it I had dozens of "random" complete freezes of my laptop. The GATOS web page says that using the wrong drm kernel module with their driver can result in random freezes, which might have been the source of this problem. The free drivers do work fine for me with the xorg server.

Simultaneous internal and external display

It was surprisingly difficult for me to get my T42p to display an image both on its internal display and on an external display at the same time. The automatic fglrxconfig program would not correctly configured X for this (for me), no matter how many times I tediously ran it. I eventually stumbled upon the following trick. In the "ATI Graphics Adapter" Device section of my /etc/X11/XF86Config-4 file, I have the following under "Screen Management":
# === Screen Management ===
    Option "DesktopSetup"               "0x00000100" 
    Option "MonitorLayout"              "AUTO, AUTO"
    Option "IgnoreEDID"                 "off"
    Option "HSync2"                     "unspecified" 
    Option "VRefresh2"                  "unspecified" 
    Option "ScreenOverlap"              "0" 
Note the AUTO, AUTO. I also have an additional Screen section:
Section "Screen"
    Identifier   "VGA"
    Device       "ATI Graphics Adapter"
    Monitor      "External Monitor"
    DefaultDepth 24
    Subsection   "Display"
        Depth    24
	Modes    "1600x1200" "1280x1024" "1024x768" "800x600" "640x480"
	ViewPort 0 0
    EndSubsection
EndSection
And the server layout is:
Section "ServerLayout"
    Identifier  "Server Layout"
    Screen "LCD"
    Screen "VGA"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection
If I start X11 with an external display plugged in, the same image will appear on both the internal and external display. The image on the external display should apear at the highest resolution supported by the external display, and "virtually" at the same resolution as the internal display. I say "should", because I have an external LCD that is capable of 1280x1024 resolution, but it only displays images at 1024x768 using this method (frustating!). For a presentation, I set the laptop LCD panel resolution to 1024x768 (using KDE Control center), so both internal and external displays are the same.

Power Management

I am using APM instead of ACPI. (Update: In fact, I'm currently using ACPI -- see the bottom of this page.) I would like to use ACPI since APM is quickly becoming legacy, but I've had serious issues I couldn't resolve with swsusp2 and ACPI. For example, removing the usb_uhci module during swsusp2 suspend crashes the system. Etc. Pressing Fn-F4, which is for apm suspend, causes the laptop to sort of suspend. However, the moon light blinks and the laptop sort of just sits there. I wish there were a way to disable suspend on Fn-F4, since I might accidently hit it. Pressing Fn-F3 to blank the screen works perfectly (as long as I don't accidently bump Fn-F4).

Linux Suspend to Disk (Hibernate): swsusp2

I have APM and swsusp2 working well, and am able to suspend and resume even under X11 while using the ATI drivers (but only with 3d acceleration support off, by removing the glx option from XF86Config). I have 1GB RAM and a smallish 1GB swap partition, so I'm happy this actually works, but it does work, and well.
  1. Installed plain vanilla kernel 2.6.6, so I could patch it, since the swsusp2 patch didn't work for me with Debian kernel 2.6.6.
  2. I installed swsusp2 for kernel 2.6.6
  3. I had to remove the CONFIG_REGPARM from kernel config file, so my .config now says
               # CONFIG_REGPARM is not set
    
    If I didn't do this, then I got errors about stuff not matching on resume from hibernate. I also had this problem:
    5.16 I've suspended and resumed and now I can't open new X
    applications and my /tmp directory is empty (on Debian)
           
    A recent version of the initscripts package decided to blow
    away temporary directories when calling mountnfs.sh (See Bug
    #227112). The simple solution is to remove mountnfs.sh from your
    SWSUSP_STOP_SERVICES_BEFORE_SUSPEND in /etc/suspend.conf and add your
    extra NFS mounts into SWSUSP_UMOUNTS.
    
Timing: Suspending to disk is very fast (maybe 15 seconds). Resuming from disk takes my setup 1 minute in the best (right after a fresh boot). Though slow, it is very robust and flexible.

Getting Software to suspend to work with kernel 2.6.7

So far I haven't succeeded. Here are some notes about my attempts.

I patched kernel 2.6.7 with

software-suspend-2.0.0.102-for-linux-2.6.7.tar.bz2
When I first tried to compile, I had configured the swsusp2 to not include debugging print support, since I thought I didn't want that. I could not get the kernel to compile; there were many small problems I fixed, but they all were related to avoiding the debug output. So I included debug support (by setting that option in "make xconfig"), and the kernel compiled.

All that said, I still had problems trying to compile. There was an error compiling

/usr/src/linux/arch/i386/power/suspend2.c
but I was able to fix it by putting
#ifdef CONFIG_SMP
at the beginning of smp_suspend2_lowlevel(void* info) and #endif at the end of that function. I don't understand why smp_suspend2_lowlevel has to be defined if CONFIG_SMP is not set.

Anyway I can compile as modules, but it cancels suspend. If I use an initrd (as instructed), then it fails on boot. If I compile swsusp2 into the kernel (not as a module), then the kernel crashes on boot.

Wireless Networking

I installed the madwifi drivers from CVS source:
cvs -z3 -d:pserver:[email protected]:/cvsroot/madwifi co madwifi
cd madwifi
make
(as root) make install
These don't work for me, in sense that freezes at ifconfig ath0 up. However, I got it to work by using this remark. The ifplugd was causing a kernel fault! So I had to turn of ifplugd for the ath0 interface:
form:~# more /etc/default/ifplugd    (after I edited it!)
INTERFACES="eth0"
#HOTPLUG_INTERFACES="all"
HOTPLUG_INTERFACES=""
ARGS="-q -f -u0 -d10 -w -I"
SUSPEND_ACTION="stop"
Notice that now I'll need to explicitly add any hotplug interfaces I might use.

If you're having ath0 lockups after suspend, the following observation might be helpful to you:

Addendum to Debian on Thinkpad T42p
From: Ryan Nowakowski 
To: [email protected]
Date: 2004-09-28 12:28 am
William,
I had problems with the wireless interface (ath0) locking up after
waking up after suspend to ram.  I went into the BIOS and set all the
IRQs for PCI from 11 to 'auto'.  That fixed it. Just thought you might
be interested.

Thinkpad Buttons

I installed the tpb package:
   apt-get install tpb
   chmod a+rw /dev/nvram
To start it I use this script:
#!/bin/bash
exec tpb --osd=on --verbose --thinkpad="/usr/bin/konqueror" --wireless="/usr/bin/konsole -e /home/was/bin/hibernate" &
I have a script with those lines in my .kde/Autostart folder.

Sound

I use the OSS drivers built as kernel modules: i810_audio, ac97_codec. These come with the kernel.
Shaya Potter asks:
> Just wondering if you can play more than one sound stream at once?  On
> mine, it seems to only allow one alsa stream to play at once, and any
> other app just blocks until the original app releases the device.
>
> do you see the same behavior?
My Thinkpad T42 under Linux is only able to play one stream at a time through /dev/dsp. I had this same issue using Linux with my Thinkpad T30 and T40, and was also not able to resolve it. Here's another note from Shaya Potter, who is using ALSA:
that was an issue I had, for instance I'd be playing an mp3, a program
would try to make a sound, but would block until the mp3 stopped
playing.

anyways, I sort of fixed it by figuring out how to use alsa's dmix
(software muxing) plugin

here's my .asoundrc, could probably use some work.

spotter@dent:~$ cat ~/.asoundrc
pcm.ossmix {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192        # buffer size < 6653, but pow(x, 2)
        rate 48000              # we want to play CDs only

    }

    bindings {
        0 0
        1 1
    }
}

# Everything shall be dmixed, so redefine "default":
pcm.!default {
    type plug
    slave.pcm "ossmix"
}

# OSS via aoss should d(mix)stroyed:
pcm.dsp0 {
    type plug
    slave.pcm "ossmix"
}

ctl.mixer0 {
    type hw
    card 0
}

Software

Freezing ssh shells when using Comcast

I have a Comcast cable modem, and my ssh shells freeze regularly, without lots of network activity. This is extremely annoying, and I have this problem with many computers. Anyway, the following is a workaround for an openssh2 client. Add to /etc/ssh/ssh_config
   ServerAliveInterval 20
   ForwardX11 yes  #also useful
Here's a reader comment (from: Otto Vox)
This is a shot in the dark, but most of the cable modem
implementations I've seen use PPPoE with a fairly small MTU.  I use
openvpn and have a problem with my connection freezing when the pipe
goes through some cable modem connections unless I reduce the MTU, and
openvpn has a testing mode that identifies that maximum MTU.  There
are probably other ways to test this too.

My Sprint USB Sanyo 4900 Phone

  1. Compiled CONFIG_USB_ACM=m the acm.o module. (Selected this in the USB section, near the middle.)
  2. modprobe acm
  3. Plugin phone:
    May 29 16:40:01 localhost kernel: Product: SANYO USB Phone
    May 29 16:40:01 localhost kernel: SerialNumber: Serial Number
    May 29 16:40:01 localhost kernel: ttyACM0: USB ACM device
    May 29 16:40:01 localhost default.hotplug[3190]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/003/003 PRODUCT=474/701/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)
    May 29 16:40:01 localhost default.hotplug[3190]: invoke /etc/hotplug/usb.agent ()
    May 29 16:40:01 localhost default.hotplug[3191]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/003/003 PRODUCT=474/701/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)
    May 29 16:40:01 localhost default.hotplug[3191]: invoke /etc/hotplug/usb.agent ()
    May 29 16:40:05 localhost usb.agent[3190]: Setup acm for USB product 474/701/0
    May 29 16:40:05 localhost usb.agent[3191]: Setup acm for USB product 474/701/0
    May 29 16:40:05 localhost usb.agent[3190]:      acm: already loaded
    May 29 16:40:05 localhost usb.agent[3191]:      acm: already loaded
    
    The following configuration steps are copied this web page, and they work perfectly for me. Now that you've got an ACM device, you just need to create a dialup connection. Note that the ACM device name may vary - just search through /dev for the proper device. On my (default) Debian install, it's /dev/ttyACM0. On RedHat 7.3, it's /dev/input/ttyACM0. Once you've found that, the number to dial to get a connection to the Vision network is '#777' (which is #PPP on the keypad). So, use whatever method you prefer to create a dialer that will dial #777. On my Debian box, I'm using the standard 'pon' scripts. Here are the config files I use:
    /etc/ppp/peers/sprint:
    
     # You usually need this if there is no PAP authentication
     noauth
     # The chat script (be sure to edit that file, too!)
     connect "/usr/sbin/chat -v -f /etc/chatscripts/sprint"
     # Set up routing to go through this PPP link
     defaultroute
     # Use remote DNS
     usepeerdns
     # Default modem
     /dev/ttyACM0
     # Connect at high speed
     230400
     local
     novj
    
    
    /etc/chatscripts/sprint:
    
    TIMEOUT         5
    ABORT           '\nBUSY\r'
    ABORT           '\nERROR\r'
    ABORT           '\nNO ANSWER\r'
    ABORT           '\nNO CARRIER\r'
    ABORT           '\nNO DIALTONE\r'
    ABORT           '\nRINGING\r\n\r\nRINGING\r'
    ''              \rAT
    TIMEOUT         12
    OK              ATD#777
    TIMEOUT         22
    CONNECT         ""
    
    

Canon USB 2.0 LIDE 20 CanoScan scanner

It worked in about one minute.
  1. apt-get install sane xsane
  2. Run xsane as root.
  3. It just works!
This page was helpful. I added was to the scanner group (changed /etc/group). That should fix the permissions problems.

PCMCIA

  • After swsusp2 hibernate the pcmcia system doesn't work. Restarting it with
    /etc/init.d/pcmcia restart
    
    as root fixes the problem.

    Playing DVD's

    My Thinkpad T42p has never run Windows XP, so it was necessary for me to set the DVD region from Linux before being able to play DVD's. Before I did that, I received error messages like:
      libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_01_0.VOB (0x00007d21)
    
    To set the region, I installed regionset:
      apt-get install regionset
    
    then ran it and set the region to 1 (the other region codes are at the regionset homepage).

    Writing CD's and DVD

    Writing CD-R's and DVD's works, but I can't erase DVD's from K3B. I have only tried writing data DVD's, not DVD's to play on a DVD player. It takes over 20 minutes to write a full 4.3GB data DVD.
    1. I followed this advice: "To get CD burning working all you need in kernel 2.6.x is to have IDE-CD (CONFIG_BLK_DEV_IDECD) enabled and edit /etc/cdrecord/cdrecord to say ?CDR_DEVICE=/dev/cdrom?."
    2. Install k3b and cdrdao:
             apt-get install k3b
             apt-get install cdrdao
      
    3. modprobe ide-cd
    4. Run k3b (which will fix necessary permissions)
    5. Burned and verified a sample CD-RW while compiling kernel...
    6. Created desktop shortcut: modprobe ide-cd; k3b
    7. When I started k3b with a DVD writer, it asked me to install a few other packages and I did (using apt-get). Unfortunately, I don't remember exactly what their names were. They were standard dvd authoring packages.

    Upgrading to Kernel 2.6.8.1

    Update: I'm now using the vanilla Linux kernel 2.6.9-rc2 with this config file. The following documents my upgrade to 2.6.8.1 from 2.6.6. Here are some problems that I fixed when upgrading to 2.6.8.1 and switching to ACPI:

    GPS

    I have used GPS extensively with my T40 and T42 for navigation while driving in cars on trips. Unfortunately, I'm not aware of any substantial mapping and navigation software for Linux that compares to the programs available for Windows (e.g., MS Streets and Trips or Street Atlas 2004). Thus I install those programs under VMware, which I'm running under Linux; I then connect the GPS device to VMware. The following remarks address my experience using
            VMware 4.5.2 with Win XP, Linux Kernel 2.6.8.1, Debian
            and both Thinkpad T40 and T42p.
    
    1. I was *never* able to get the USB Earthmate GPS that I bought at Staples for $120 to work with VMware. It would either crash vmware or the USB device would be detected but not "work". When I used to boot Windows directly (no VMware), the Earthmate USB GPS worked fine.
    2. I was able to get the Garmin eTrek Vista with a Keyspan (P/N:USA-19HS) serial-->USB adapter to work with VMware and either MS Streets and Trips or Street Atlas 2004. I was also able to use some (relatively primitive) Linux GPS software. There was nothing tricky here, except to add the Keyspan USB adapter option when compiling the linux kernel.
    3. I was *not* able to get the Garmin GPSMAP 60CS with included USB adapter to work with VMware, though it was detected as a USB device. It just didn't work, and I could get no debuging info from windows or vmware that were helpful.
    4. I was able to get the Garmin GPSMAP 60Cs with a serial adapter to work, by connecting it to a Keyspan (P/N:USA-19HS) serial-->USB adapter. I could then use it from VMware.

    Other Remarks

    > Here is the block from my XF86Config file
    >
    > Section "Device"
    >   BoardName    "RV350 NT"
    >   BusID        "1:0:0"
    >   Driver       "radeon"
    >   Identifier   "Device[0]"
    >   Screen       0
    >   Option       "Rotate" "off"
    >   VendorName   "ATI"
    > EndSection
    >
    >
    > You say you are using the fglrx driver?
    
    You are definitely using the open source GATOS radeon driver, and in
    my experience it DEFINITELY randomly completely freezes the machine.
    This doesn't imply with certainty that this is your problem, but I
    think it's likely.  You could try leaving the machine on for a while
    without using X-windows, and see if it crashes; if not, that increases
    the chances your problem is with the X drivers.
    
    Your options include:
      
    1. Try to get it to work somehow using 
         http://gatos.sourceforge.net/overview.php
    I failed at this, but do recall seeing that they acknowledge
    stability issues with their drivers.
    
    2. Switch to xorg:
        http://www.x.org/
    That comes with a radeon driver (from GATOS), and in my experience
    it does work without hangs.  I don't use this though, because I can't
    get the GATOS driver to do simultaneous internal and external display
    of video, which is crucial for me, since I do a lot of presentations.
    
    3. Install the fglrx drivers.  I discuss this at
    http://modular.fas.harvard.edu/t42/
    and their are surely other sources of info.  This is what I'm currently
    using.   Here are there are two additional options:
         a -- with DRI, which boils down to 3D acceleration
              Then suspend/resume will not work, but 3d is VERY FAST.
    
         b -- without DRI -- suspend/resume works great, but
              3d is slow.    
    
    You can switch between a) and b) easily at the expense of a reboot.
    
    William
    

    Re: debian linux on my thinkpad t42
    From: William Stein   (Harvard University)
    To: Stephanie Yang
    Date: 2004-09-29 11:59 pm
    
    On Wednesday 29 September 2004 09:52 pm, you wrote:
    > Hi.  I just got a thinkpad t42 last week---very similar to yours, but not
    > exactly the same (bigger hard drive and weaker video card, but same
    > network hardware). 
    
    Congratulations, it's an awesome computer, and VERY fast at
    computations for a laptop.
    
    > I've installed debian, but I can't get it to network
    > at all.  I'd love to have some help with this; if you can see what I'm
    > missing it would make me very happy!
    > In a nutshell:
    >
    > (1) I downloaded cd images and installed debian from cd.  Woody 3.0r2
    > comes with a 2.2.20 kernel, I think.
    >
    > (2) I downloaded the debian kernel 2.6.6 package (seeing as you had luck
    > with that version, from your web page), make blah blah, installed the
    > kernel with the option `intel pro/1000 gb ethernet support' added, so it
    > should load the driver automatically, right?
    
    I'm currently using the vanilla linux kernel 2.6.8.1 from
    www.kernel.org, and my .config is on my webpage.  However for
    networking 2.6.6 should be fine.  
    
    The driver should be loaded automatically when the machine boots.
    It's not compiled as a module, so there's nothing extra that
    you have to do.  One thing is that in my .config I have
    
    CONFIG_E1000_NAPI=y
    
    and you don't.  I don't know what that does, but you might
    try changing it and re-compiling and installing your kernel.
    
    > have the e1000 driver already installed.  As I missing something basic?
    > Is there some nice user friendly script for dhcp that will make this all
    > work?
    
    To configure dhcp for eth0 under Debian, you should edit the file
    /etc/network/interfaces, so it looks like this:
    
    ------------------------------------
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # This entry denotes the loopback (127.0.0.1) interface.
    auto lo
    iface lo inet loopback
    
    # This entry was created during the Debian installation
    #auto eth0
    
    iface eth0 inet dhcp
    ------------------------------------
    
    The crucial line is "iface eth0 inet dhcp", and that should be the
    only line that contains eth0 and is not commented out.   
    
    The following command run as root should start up your eth0 
    interface and connect:
    
    /etc/init.d/networking restart
    
    If that doesn't work try this:
    
    /sbin/ifup eth0
    
    Then type /sbin/ifconfig to see what interfaces are activated.
    Hopefully you will see one called "eth0".   To tell if it's
    connected via DHCP, type /sbin/route. 
    
    Please let me know if the above comments help or not.  If they
    are helpful, I'll add them to my web page.
    
     -- William
    
    -----------------
    Hey, it's working now, as of one minute ago!  Thanks for your help, it was
    everything I needed except one extra thing.  When I originallly tried
    ifconfig, I got the error message "unrecognized kernel version", with the
    aid of google I found this web page:
    
       http://kszk.sch.bme.hu/net/dhcp/settingsenlin.php
    
    which says, in a nutshell, to modify /sbin/dhclient to avoid this.
    
    This whole laptop-setup process (resizing the windows partition and then
    installing debian on the rest of the hard drive) took one week, but I had
    to do it again I think I could do it in an afternoon, provided I have the
    CDs already burned.  At least I think I learned a few things about linux
    along the way.
    
    Of course your comments were immensely helpful.  Thanks a million for the
    e-mail.
    
    cheers,