There is a problem with this driver which causes it to chirp when the driver
is loaded. This is noted in the driver source code as something the author
intends to fix with a later version, but as of kernel 2.4.20, it hasn't been
fixed.
8x/8x/24x CDRW / 8X DVD Combo
I had a lot of trouble writing to CD-RWs, ie. it didn't work at all.
Cdrecord
would die with an error message while trying to blank the disks. This seemed
odd since it was able to write to CD-Rs just fine. It turns out that the QSI
drive needs to be passed the -immed flag. I was unable to write to
CD-RWs for months until I figured out how to solve this problem.
The rest of this section is obsolete, the problem described
below has been fixed with 2.6.x kernels. Simply use the
-dev "ATA:/dev/hdc" option to cdrecord, and stop using the SCSI
emulation.
Another problem that I struggled with is how to automatically view a DVD after
trying to write to a CD. When you try to write to a CD, Linux loads the SCSI
emulation and SCSI CDROM modules. When you want to watch a DVD, you need to
unload these modules. The problem is that there is no way to get Linux to
figure out that you want to use the DVD drive by simply starting your DVD
player. This is because your DVD player (I use
ogle) accesses /dev/hdc
to read the DVD, but the kernel can't distinguish between this access and the
normal access from the SCSI emulation layer. This isn't a problem when going
the other way because your CD writing software accesses the SCSI layer, thus
loading the driver automatically. The good news is that the next major
release of the Linux kernel will be able to write to CDs without the SCSI
emulation layer, so with kernel 2.6.x, this will no longer be an issue.
I added a bunch of directives to my /etc/modules.conf to allow me to read a normal CD regardless of which set of modules was loaded.
alias block-major-11 sr_mod
add above sr_mod ide-scsi # initialize IDE->SCSI so CDRW will exist
add above sg ide-scsi # initialize IDE->SCSI so CDRW will exist
pre-install ide-cd /sbin/modprobe -r sg ide-scsi;:
pre-install ide-scsi /sbin/modprobe -r cdrom ide-cd;:
post-install ide-cd /bin/ln -fs hdc /dev/cdrom
post-install ide-scsi /bin/ln -fs scd0 /dev/cdrom
| |
The first line simply ties the /dev/scdX (these names could be different on
your distribution) devices to the SCSI CDROM driver. Thus, any time /dev/scd0
is accessed, it will cause the SCSI CDROM driver to load, and that in turn
will load the SCSI emulation layer (see below).
The next two lines set up what (I think) is the correct loading order for the
SCSI emulation modules. Obviously there is no real SCSI on this machine, so
I set things up so that any access to the ide-scsi module would load all the
others.
The next two lines were my attempt to make the modules unload the incompatible
set, and install the required ones. Only the second line actually works for
reasons stated above.
The last two lines are paired with the ones above and change /dev/cdrom to point
to whichever driver has been most recently loaded, but for the same reasons as
above, only the second one is actually ever activated.
Finally, you will need to adjust your /etc/fstab so that when you mount a CD,
mount uses /dev/cdrom instead of /dev/hdc.
PCMCIA Weirdness
This section is obsolete, the problem is not present
with 2.6.x kernels.
The only weird thing that still confuses me is that my PCMCIA card slot only
works every other insertion. It is really weird, the first time I insert my
PCMCIA modem or wireless card, the system doesn't recognise it. If I pull it
out and reinsert it, the card is found and works normally. If, on the first
insertion, when the card is not found, one runs the "cardctl insert", the
card is found instantly.
This is very odd behavior, and I can't explain why it does this, but I'll try
anyway. My guess is that this happens so regularly it must be by design; the
manufacturers decided that some people might want to keep their cards in the
slot for storage, but not have them suck down the battery. So, when I finish
with my modem card, I can pull it out, and put it back in again, and just
store the card right there in the side of my computer.
Tips and Tricks
The new laptop_mode
With Linux 2.6.1, you can apply the
"laptop_mode" patch.
Which also comes built into 2.4.23 and later kernels. This feature can be
turned on by writing to /proc/sys/vm/laptop_mode, and changes how agressively
the kernel writes to the disk. The upshot is that with this mode enabled
your laptop will last quite a bit longer on battery power.
You will need to give the "commit=600" option to every ext3 filesystem that
you may have in /etc/fstab (add it right after "defaults" (don't forget the
comma to separate them)). This tells ext3 to sync every 600 seconds (ten
minutes). You will also have to tweek the values of a few /proc files (see
my script below, or the laptop_mode.txt in the kernel source code
documentation). The end result is that the drive will spin up every ten
minutes, then spin down after 20 seconds of inactivity.
Although I haven't tested it, my battery life was extended by about 40 minutes
using the older method, and I assume it would be about the same.
I use this script in conjunction with
acpid so that I can switch to
laptop mode when the external power is disconnected. I would like to point
out, by the way, that on this particular laptop model, ACPI doesn't report
an "ac_adapter" event. Instead, I use the "battery" events which seem to
be triggered by removal/insertion and charging/discharding of the battery.
Infact, the laptop seems to flip back and forth so much between charging and
discharding (while the power is plugged in), that I have to check the
ac_adapter state.
Finally, you will need to add this script to your acpid boot scripts so that
your laptop will go into the correct power saving mode when it is first booted.
#!/bin/sh --
# This value must be identical to the commit inverval for the filesystem
FLUSH_INTERVAL=60000 # 10 minutes (measured in 0.01 seconds)
DIRTY_RATIO=40 # (percent)
AC_POWER=$(grep -c on-line /proc/acpi/ac_adapter/ACAD/state)
SPINDOWN=$(cat /proc/sys/vm/laptop_mode)
if [ $AC_POWER = 0 ]
then
if [ $SPINDOWN = 0 ]
then
# spindown after 20 seconds
hdparm -S 4 /dev/hda
echo 1 > /proc/sys/vm/laptop_mode
echo "$FLUSH_INTERVAL" > /proc/sys/vm/dirty_writeback_centisecs
echo "$FLUSH_INTERVAL" > /proc/sys/vm/dirty_expire_centisecs
echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_ratio
echo "$DIRTY_RATIO" > /proc/sys/vm/dirty_background_ratio
fi
else
if [ $SPINDOWN != 0 ]
then
# spinup
hdparm -S 0 /dev/hda
# reset kernel defaults
echo 0 > /proc/sys/vm/laptop_mode
echo 500 > /proc/sys/vm/dirty_writeback_centisecs
echo 3000 > /proc/sys/vm/dirty_expire_centisecs
echo 40 > /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_background_ratio
fi
fi
| |
Noflushd and ext3
This section is obsolete,
see above
If you want to use the ext3 filesystem, which is just like ext2 except that
it provides journaling (which means that you won't have to wait for a
filesystem check every time your computer crashes (I leave my laptop on
because hardware suspend mode doesn't work, and I sometimes forget to plug it
in)). I use noflushd to allow my
hard disk to spin down. The problem is that the ext3 filesystem keeps syncing
it's journal to disk, and this keeps noflushd from working.
Fortunately, this problem is easy to get around, simply add the "commit=600"
option to every ext3 filesystem in /etc/fstab (right after "defaults" (don't
forget the comma to separate them)). This tells ext3 to sync every 600
seconds, or ten minutes. The end result is that the drive will spin up every
ten minutes, then spin down after a minute of inactivity (this is my setting
for noflushd). My battery life was extended by about 40 minutes using this
method.
When picking the timeouts, keep in mind that the disk draws a lot more power
when spinning up than it normally does while just spinning, so you want the
period of time to be great enough to allow you some power savings, otherwise,
you could shorten your battery life.
In the future, I plan to hack noflushd so that it will remount the ext3
filesystem with a larger commit time after, say, nine minutes of inactivity.
Turning off the Fan
If you were wondering why I made this page despite the fact that there are
several already out there, it was for this section right here. The general
solution to this problem is to make some stupid shell script that checks the
temperature and manually activates/deactivates the fan. This is the
wrong way to do it. You see, since you already went through the hassle
of installing the latest ACPI patch, you can make use of the kernel's ability
to do this for you!
Add this to the earliest boot script you can find, like rc.sysinit under Redhat.
The idea is that you want to turn off the fan before you start fsck'ing your
disk so that you can squeeze the most out of your battery life.
echo 100:90:85:80:80 > /proc/acpi/thermal_zone/THRM/trip_points
echo 30 > /proc/acpi/thermal_zone/THRM/polling_frequency
# It's safe to turn the fan off now.
echo -n 3 > /proc/acpi/fan/FAN0/state
| |
WARNING These numbers represent the temperature in Celsius at
which each state should be triggered. The numbers you should inject into
"/proc/acpi/thermal_zone/THRM/trip_points" may be different for your computer.
Before you set these numbers, check what the current values are set to by
using cat /proc/acpi/thermal_zone/THRM/trip_points. Note that while
some fields may be omitted when you read this file (on my machine the Hot
field is not shown), all fields must be set when you write to it. The
correct order is Critical:Hot:Passive:Active0:Active1 (note colon seperation).
Alternatively, you can use this shell script which I wrote to do the same
thing in a more user friendly manner. This script only changes the fields
which you mean to change, and not any others. I highly recommend that
you use this script (below) because it has the least chance of melting your
processor.
function reset_trip_points
{
if [ -f /proc/acpi/thermal_zone/THRM/trip_points -a -f /proc/acpi/thermal_zone/THRM/polling_frequency ]
then
ifs=$IFS
IFS="
"
for i in `cat /proc/acpi/thermal_zone/THRM/trip_points`
do
j="${i%% C*}"
j="${j##* }"
i=${i%%[ :]*}
i=${i//[][]/}
case "$i" in
critical|hot|passive|active0|active1)
eval "[ \"x\$$i\" = x0 ] && $i=\$j"
;;
esac
done
IFS=$ifs
echo $critical:$hot:$passive:$active0:$active1 > /proc/acpi/thermal_zone/THRM/trip_points
# Activate the kernel's temperature control system
echo 30 > /proc/acpi/thermal_zone/THRM/polling_frequency
# It's safe to turn the fan off now.
echo -n 3 > /proc/acpi/fan/FAN0/state
fi
}
# Set the new value for the temperature you would like to change, or leave it
# at zero to get the default.
critical=0
hot=0
passive=0
active0=0
active1=80
# Make the Kernel handle CPU temperature management.
# Do this before the filesystem checks so that the fan will turn off and stop
# draining the battery.
reset_trip_points
| |
|