- Sections
- Misc.
Using Mandriva 2006 with Aopen 1556 Laptop
Not wanting to pay the 'MicroSoft Tax' on a new laptop I have been looking to build my own for some time, but the prices of the 'whitebox' laptop components are usually higher than buying a ready built laptop with Windows already installed. However I was pleased to find recently Aopen 1556 'barebook' laptops being offered for only £123 at Misco as surplus stock. (They are now out of stock.)
Aopen barebooks come without memory, processor, wireless card, hard drive, DVD/CDRW drive, and keyboard. These laptops are commonly used by small computer manufacturers and so you may see them with all sorts of labels on them. Misco for some reason did not stock the DVD/CDRW drives or keyboards, which may explain why these were surplus stock since the barebook is useless without them and you cannot just use a generic product.
A source for the Aopen DVD/CDRW drive and keyboard was located at DCS . The total kit of parts for the laptop was :-
- Aopen Barebone 15" XGA,Shared Graphics,USB2,LAN,56
- Aopen COUNTRY KIT F/BAREBOOK 1556/7/8 KEYBOARD MOD/PWR CABLE UK
- Aopen CD-RW/DVD IDE SLIM F/BAREBOOK 1556/1557
- Intel PROWIRELESS LAN2915ABG MINIPCI 802.11ABG BOX
- Intel PENTIUM M 745 1.8GHZ UFCPGA FSB400 2MB CACHE BOXED
- Kingston 512MB PC2700 DDR SO DIMM VALUERAM
- Seagate MOMENTUS 40GB ATA100 2.5HH 10MS 5400RPM 2MB
The end result is a laptop with a rather better processor and more memory than an equivalent priced ready built model. I was concerned that the Intel extreme shared memory graphics may not be very good, but was pleasantly surprised with its performance. I get up to 733 fps from glxgears which is fine for tuxracer (ppracer), and given the difficulty people seem to have with the ATI drivers I am glad the 1557 model with integrated ATI graphics I wanted to buy was out of stock.
The feature list of Aopen 1556 is :-
- 15" LCD screen 1024x768 with dual head external video socket. Intel Extreme graphics
- Touchpad with up/down, left/right rocker
- 8 cell Lithium Ion approx 3 hours on battery (untested)
- Mini PCI slot for wireless card
- One cardbus slot
- SD Flash card reader
- Ethernet port
- 3 USB ports
- Built in 56kbps modem
- Printer port
- Firewire port
- 2 memory slots PC2700 SODIMM
- Plays CDs when switched off
Assembly
Assembly of the 1556 was real easy, especially after I watched these video tutorials. The hardest job was working out how to gain access to the CPU socket. At first I tried dissassembling the case, but finally I realised the plastic trim just below the screen containing the CD player controls can be levered off to reveal the CPU socket. There is a useful guide showing how to assemble the 1556/7
When installing the wireless card directly under the keyboard remove the foam under the mini PCI slot. You will never get the keyboard on otherwise. Also take care when inserting the antenna wires in the tiny coax plugs on the wireless card.
Installing Mandriva 2006 RC1
I elected to Install Mandriva (Mandrake) 2006 RC1 despite it being an unreleased product because it contains the 'laptop-tools' package. Installing Mandriva was a breeze. Just put in the CD, and boot. The installer correctly detected and installed the Ethernet, graphics, cardbus slot etc. The only hardware items not automatically configured were the Intel IPW2200 wireless card, the SD Flash card reader, and the internel Winmodem which was to be expected since IPW2200 and the Winmodem require non GPL firmware not available on the Mandriva install CDs. The SD Flash card reader did not work because there is currently no linux driver for these devices.
The installer installed the kernel-2.6.12-12mdk-i686-up-4GB
Tuning the installation
Now to get the very best out my new laptop.
Graphics
The installer correctly detected the graphics chip as i85x, and configured the screen as Generic 1024x768. Using Mandriva Control Centre I changed this to Generic Flatpanel 1024x768 24 bit colour depth. Mandriva Control Centre detected the graphics chip supports dual head and offered to set up the internal screen and the external socket as either independent or Xinerama.
In order to get the laptop to resume after suspend to RAM I had to modify /etc/X11/xorg.conf as shown here :-
Section "Device"
Identifier "device1"
VendorName "Intel Corp."
BoardName "Intel 85x"
Driver "i810"
VideoRam 65536
Screen 0
BusID "PCI:0:2:0"
Option "DRI" "on"
Option "DPMS"
Option "VBERestore" "true"
EndSection
The critical line is Option "VBERestore" "true". Without that the X server does not resume after sleep.
To enable AGP operation ensure that /etc/modprobe.preload contains the line
intel-agp
Touchpad
Mandriva correctly detected the touchpad as a Synaptics touchpad. It worked correctly, and so did the scroll rocker switch below the touchpad. However the touchpad also supported scrolling along the bottom and right hand edges, and I found it was easy to touch this area accidentally which caused focus to switch between windows in KDE. Therefore I decided to disable scrolling on the touchpad and use only the rocker switch for scrolling. The touchpad configuration in /etc/X11/xorg.conf became
Section "InputDevice"
Identifier "SynapticsMouse1"
Driver "synaptics"
Option "Protocol" "auto-dev"
Option "Device" "/dev/input/mice"
Option "MinSpeed" "0.09"
Option "MaxSpeed" "0.18"
# Disable horiz scrolling
Option "BottomEdge" "5000"
Option "SHMConfig" "on"
Option "FingerLow" "25"
Option "LeftEdge" "1700"
Option "MaxTapMove" "220"
Option "MaxTapTime" "180"
Option "FingerHigh" "30"
Option "VertScrollDelta" "100"
# Disable vert scrolling
Option "RightEdge" "6000"
Option "TopEdge" "1700"
Option "AccelFactor" "0.0015"
EndSection
Intel ProWireless 2200 Wireless Card
It was easy to get wireless working. First put the line
alias eth1 ipw2200into /etc/modprobe.conf to ensure the driver loads at boot. Also ensure the
wireless-tools package is installed.
Secondly download the firmware version ipw-2.3 for the card from http://ipw2200.sourceforge.net/firmware.php, unpack the compressed archive and put it into /usr/lib/hotplug/firmware. Enter 'modprobe ipw2200' in a root terminal to load the driver without having to reboot. The System log (tail -n 50 /var/log/syslog) will confirm that the firmware loads.
It is then possible to use Mandriva Control Centre to configure the wireless card parameters.
Note: If you have a urpmi source defined for 'Penguin Liberation Front' (plf) then you can install the firmware with the command 'urpmi ipw2200-firmware', but at the time of writing the plf repository did not have the latest ipw-2.3 version.
The built in Ethernet port was real easy. Mandriva detected it and put alias eth0 b44 in /etc/modprobe.conf. By setting the Ethernet to not start on boot, and ensuring the netplugd daemon is running, then plugging in an Ethernet cable is all that is needed to bring the interface up.
'Hot Keys'
Aopen 1556 has a row of five buttons to the left of the keyboard. Three of them have preassigned labels signifying, Wireless enable, Mail, Browser, while two buttons are labelled 'P1' and 'P2' for assignment by the user. To make these buttons work in Mandriva 2006 do the following.
In the file /etc/modprobe.conf add the line options acerhk poll=1 autowlan=1, and to /etc/modprobe.preload add the line acerhk poll=1 autowlan=1
This line will load the Acer HotKeys module which happens to also work with Aopen. The acerhk module will poll the buttons once a second, and will pass events to a listening application called lineakd. The 'autowlan=1' option will make the status of the wireless connection toggle.
Lineakd needs to be configured with two files, /etc/lineakkb.def defines the codes produced when a key is pressed, and /etc/lineakd.conf defines the action to be taken when a key is pressed.
urpmi lineakd
Lineakd is in the contrib folder on any Mandriva mirror.
Append this text to /etc/lineakkb.def
#### Aopen Laptops ####
[Aopen155x]
brandname = "Aopen"
modelname = "155x laptop series"
[KEYS]
WWW = 178
Mail = 236
AudioMute = 160
UserDefined1 = 159 #P1 key
UserDefined2 = 151 #P2 keys
Information = 245 #Fn+F1 - In Windows, shows help for hotkeys
AudioPlay|Pause = 162
AudioStop = 164
AudioPrev = 144
AudioNext = 153
[END KEYS]
[END Aopen155x]
Edit /etc/lineakd.conf as :-
CdromDevice = /dev/cdrom
Display_align = center
Display_color = 0aff00
Display_font = -adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-*
Display_hoffset = 0
Display_plugin = internal
Display_pos = bottom
Display_soffset = 1
Display_timeout = 3
Display_voffset = 50
KeyboardType = Aopen155x
MixerDevice = /dev/mixer
RAWCommands =
Screensaver =
conffilename =
keystate_capslock =
keystate_numlock =
keystate_scrolllock =
AudioMute =
AudioNext =
AudioPlay|Pause =
AudioPrev =
AudioStop =
Information =
Mail = kmail
UserDefined1 =
UserDefined2 =
WWW = /usr/bin/mozilla-firefox
The final step is to cause lineakd to run whenever a user logs in. I use KDE so I do that by creating a file :-
~/.kde/Autostart/lineakd.desktop in each users home.
[Desktop Entry] Comment=Hot Keys Comment[en_GB]=Hot Keys Encoding=UTF-8 Exec=/usr/bin/lineakd -f /etc/lineakd.conf GenericName=lineakd GenericName[en_GB]=lineakd Icon= MimeType= Name=lineakd Name[en_GB]=lineakd Path= StartupNotify=false Terminal=false TerminalOptions= Type=Application X-DCOP-ServiceType= X-KDE-SubstituteUID=false X-KDE-Username=With this configuration, on pressing the Wireless button the Wireless modem is enabled/disables, and the wireless LED indicator turns on and off accordingly. Pressing the Mail button will start kmail, and pressing the Browser button will start Firefox. I have left the other two buttons unassigned at the moment.
Note: If the modem power LED does not light when you boot, it can be forced on by placing the line
echo 1 > /proc/driver/acerhk/wirelessled
in a suitable script somewhere.
Power Management
Hard Drive
Spinning down the hard drive can save a lot of power in a laptop and extend battery life considerably. Mandriva 2006 contains a new set of scripts called laptop-mode-tools which make HD power management real easy. Mandriva installed laptop-mode-tools by default in my Aopen 1556, but just in case it was not automatically installed.
urpmi laptop-mode-tools
Configuration of laptop-mode-tools is by the file /etc/laptop-mode/laptop-mode.conf
# Configuration for Laptop Mode Tools
VERBOSE_OUTPUT=0
###############################################################################
# When to enable laptop mode
###############################################################################
# Enable laptop mode when on battery power.
ENABLE_LAPTOP_MODE_ON_BATTERY=1
# Enable laptop mode when on AC power.
ENABLE_LAPTOP_MODE_ON_AC=0
# Enable laptop mode when the laptop's lid is closed, even when we're on
# AC power? This only works on ACPI machines.
ENABLE_LAPTOP_MODE_WHEN_LID_CLOSED=1
# Disable laptop mode when the number of minutes of battery that you have left
# goes below this threshold. (Note that some batteries do not report a discharge
# rate, and this option will not have any effect on those batteries. Use the battery
# charge options instead.)
MINIMUM_BATTERY_MINUTES=7
# Automatically disable laptop mode when the remaining charge in your battery
# goes below this value. There is a configuration value in mWh and in mAh,
# the one that is used depends on how your battery reports its capacity.
MINIMUM_BATTERY_CHARGE_MAH=100
MINIMUM_BATTERY_CHARGE_MWH=500
###############################################################################
# Controlled hard drives and partitions
###############################################################################
# The drives that laptop mode controls.
# Separate them by a space, e.g. HD="/dev/hda /dev/hdb". The default is a
# wildcard, which will get you all your IDE and SCSI/SATA drives.
HD="/dev/[hs]d[abcdefgh]"
# The partitions (or mount points) that laptop mode controls.
# Separate the values by spaces. Use "auto" to indicate all partitions on drives
# listed in HD. You can add things to "auto", e.g. "auto /dev/hdc3". You can
# also specify mount points, e.g. "/mnt/data".
PARTITIONS="auto"
###############################################################################
# Hard drive behaviour settings
###############################################################################
# Maximum time, in seconds, of work that you are prepared to lose when your
# system crashes or power runs out. This is the maximum time that Laptop Mode
# will keep unsaved data waiting in memory before spinning up your hard drive.
LM_BATT_MAX_LOST_WORK_SECONDS=600
LM_AC_MAX_LOST_WORK_SECONDS=360
# Should laptop mode tools control readahead?
CONTROL_READAHEAD=1
# Read-ahead, in kilobytes. You can spin down the disk while playing MP3/OGG
# by setting the disk readahead to a reasonable size, e.g. 3072 (3 MB). Effectively,
# the disk will read a complete MP3 at once, and will then spin down while
# the MP3/OGG is playing. Don't set this too high, because the readahead is
# applied to _all_ files that are read from disk.
LM_READAHEAD=3072
NOLM_READAHEAD=128
# Should laptop mode tools add the "noatime" option to the mount options when laptop
# mode is enabled?
CONTROL_NOATIME=1
# Should laptop mode tools control the hard drive idle timeout settings?
CONTROL_HD_IDLE_TIMEOUT=1
# Idle timeout values. (hdparm -S)
# Default is 2 hours on AC (NOLM_HD_IDLE_TIMEOUT_SECONDS=7200) and 5 seconds for battery
# and for AC with laptop mode on.
LM_AC_HD_IDLE_TIMEOUT_SECONDS=60
LM_BATT_HD_IDLE_TIMEOUT_SECONDS=5
NOLM_HD_IDLE_TIMEOUT_SECONDS=3600
# Shoudl laptop mode tools control the hard drive power management settings?
CONTROL_HD_POWERMGMT=1
# Power management for HD (hdparm -B values)
BATT_HD_POWERMGMT=1
LM_AC_HD_POWERMGMT=255
NOLM_AC_HD_POWERMGMT=255
# Should laptop mode tools control the hard drive write cache settings?
CONTROL_HD_WRITECACHE=1
# Write cache settings for HD (hdparm -W values)
NOLM_AC_HD_WRITECACHE=1
NOLM_BATT_HD_WRITECACHE=0
LM_HD_WRITECACHE=0
###############################################################################
# ACPI binding
###############################################################################
# Enable this if you have a buggy ACPI implementation that doesn't send
# out AC adapter events. This will make laptop mode check the AC state
# on battery state change events as well.
ACPI_WITHOUT_AC_EVENTS=0
###############################################################################
# CPU frequency scaling and throttling
###############################################################################
# Should laptop mode tools control the maximum CPU frequency?
# (Only works on 2.6 kernels with appropriate sysfs entries.)
CONTROL_CPU_MAXFREQ=0
# Legal values are "slowest" for the slowest speed that your
# CPU is able to operate at, "highest" for the fastest speed, or a value listed in
# /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies.
BATT_CPU_MAXFREQ=slowest
LM_AC_CPU_MAXFREQ=fastest
NOLM_AC_CPU_MAXFREQ=fastest
# Should laptop mode tools control the CPU throttling? This is only useful
# on processors that don't have frequency scaling.
# (Only works when you have /proc/acpi/processor/CPU*/throttling.)
CONTROL_CPU_THROTTLING=0
# Legal values are "maximum" for the maximum (slowest) throttling level,
# "minimum" for minimum (fastest) throttling level, "medium" for a value
# somewhere in the middle (this is usually 50% for P4s), or any value listed
# in /proc/acpi/processor/CPU*/throttling. Be careful when using "maximum":
# this may be _very_ slow (in fact, with P4s it slows down the processor
# by a factor 8).
BATT_CPU_THROTTLING=medium
LM_AC_CPU_THROTTLING=minimum
NOLM_AC_CPU_THROTTLING=minimum
###############################################################################
# Syslog configuration control
###############################################################################
CONTROL_SYSLOG_CONF=0
LM_AC_SYSLOG_CONF=/etc/syslog-on-ac-with-lm.conf
NOLM_AC_SYSLOG_CONF=/etc/syslog-on-ac-without-lm.conf
BATT_SYSLOG_CONF=/etc/syslog-on-battery.conf
SYSLOG_CONF_SIGNAL_PROGRAM=syslogd
SYSLOG_CONF=/etc/syslog.conf
###############################################################################
# Settings you probably don't want to touch
###############################################################################
CONTROL_MOUNT_OPTIONS=1
LM_DIRTY_RATIO=60
NOLM_DIRTY_RATIO=40
LM_DIRTY_BACKGROUND_RATIO=1
NOLM_DIRTY_BACKGROUND_RATIO=10
DEF_UPDATE=5
DEF_XFS_AGE_BUFFER=15
DEF_XFS_SYNC_INTERVAL=30
DEF_XFS_BUFD_INTERVAL=1
DEF_MAX_AGE=30
XFS_HZ=100
LM_SECONDS_BEFORE_SYNC=2
With this configuration the hard drive will spin down after 5 seconds on battery and one hour on AC. Although laptop-mode-tools is able to adjust CPU frequency we do not enable it because another application will be doing that job for us. Ensure the laptop-mode service is running in MCC>System>Services to enable laptop mode.
CPU Frequency
The Pentium-M processor supports speedstepping. To enable speedstepping a number of modules must be loaded.
In /etc/modprobe.preload add the lines
speedstep-centrino
There are a number of applications that can monitor processor load, and set the CPU speed. After reading around I settled on powernowd from the Mandriva contrib mirror :-
cpufreq_powersave
freq_table
urpmi powernowd
chkconfig powernowd on
service powernowd start
Powernowd works reliably. My CPU spends most of its time sitting at 600MHz, but then quickly ramps up to 1.7GHz under load.
ACPI
Mandriva 2006 uses acpi by default. There is no need to enable it in the lilo boot options. To enable ACPI for Aopen 1556 ensure that /etc/modprobe.preload contains the lines
acACPI works well on the Aopen 1556 with a few exceptions.
battery
button
thermal
The battery is correctly identified, and its charge state can be read, but there are no low battery alarms. It is therefore necessary to poll the battery status to discover if it is low.
The AC adapter is correctly detected, and there are alarms when switching to or leaving AC power.
The two thermal zones are correctly detected and the temperature can be read, but there are no over temperature alarms (As far as I can tell). The fan is not detected at all by ACPI, but nonetheless the BIOS switches the fan on and off at the appropriate times and overheating is not an issue.
When reading up about ACPI I came across this Gentoo post which describes how to fix common ACPI problems by fixing compiler bugs in BIOS DSDT tables. On uncompiling the DSDT for Aopen 1556 I found there were three compiler bugs present, but I could only work out how to fix one of them. It may be that if the DSDT could be fixed then the fan reporting might work. However since the Aopen1556 works perfectly adequately as it is I did not investigate further.
A deamon called acpid monitors acpi events and performs the actions defined in scripts in /etc/acpi/events. To install the acpi daemon :-
urpmi acpid chkconfig acpid on service acpid start
A useful tool when working on ACPI is acpitool from Mandriva's contrib mirrors :-
urpmi acpitool
# acpitool -e
Kernel version : 2.6.12-12mdk-i6 - ACPI version : 20050309
------------------------------------------------------------
Battery #1 : present
Remaining capacity : 3680 mAh, 92.00%
Design capacity : 4000 mAh
Last full capacity : 4000 mAh
Present rate : unknown
Charging state : discharging
Battery type : rechargeable, Lion
Model number : Bat 8Cell
Serial number : 236
AC adapter : off-line
Fan : not available
Thermal zone 1 : ok, 45 C
Thermal zone 2 : ok, 49 C
To manage acpi events install the packages suspend-scripts and suspend-scripts-force
Battery and AC events
A list of acpi events your computer should respond to is kept in /etc/acpi/events
So for example the file lm_ac_adapter is placed there by the laptop-mode-tools package. The file contains the text :-
event=ac_adapter action=/etc/acpi/actions/lm_ac_adapter.sh %eWhenever there is a status in the AC adapter the script /etc/acpi/actions/lm_ac_adapter.sh is called which contains
#!/bin/bash test -f /usr/sbin/laptop_mode || exit 0 # ac on/offline event handler /usr/sbin/laptop_mode autoThis script tells laptop_mode to change the hard drive powerdown settings for AC mode.
Similarly /etc/acpi/events/lm_battery will call the script /etc/acpi/actions/lm_battery.sh when there is a battery event, but here we have a problem. The Aopen 1556 does not give acpi battery events so this script will never run. The solution I came up with was to write my own script /opt/bin/checkbattery to poll the battery status at regular internals. The script contains :-
#! /bin/bash
#Utility to monitor battery and alarm if less that 8% capacity
BATT_INFO=/proc/acpi/battery/*/info
BATT_STATE=/proc/acpi/battery/*/state
AC_STATUS=/proc/acpi/ac_adapter/AC/state
SLEEP="300" #Default sleep interval
WARNING_CAPACITY="440"
CRITICAL_CAPACITY="142"
while [ true ] ; do
if [ -d /proc/acpi/battery ]; then
AC=`cat $AC_STATUS | grep "state:" | sed "s/.* \([0-9][0-9]* \).*/\1/" `
if [[ $AC != "on-line" ]] ; then
REMAINING=`cat $BATT_STATE | grep "remaining capacity:" | sed "s/.* \([0-9][0-9]* \).*/\1/" `
if [[ $REMAINING -lt $CRITICAL_CAPACITY ]] ; then
echo "Remaining battery capacity CRITICAL" $REMAINING
/sbin/shutdown -h +1 "Shutting down!"
fi
if [[ $REMAINING -lt $WARNING_CAPACITY ]] ; then
echo "Low battery capacity- Please go to AC Power-" $REMAINING > /dev/pts/0
SLEEP="60"
fi
else
SLEEP="300"
fi
fi
sleep ${SLEEP}s
done
Make the script executable with chmod +x /opt/bin/checkbatteryand make it run on boot by adding
/opt/bin/checkbattery &before the last line of /etc/rc.d/rc.local
The battery status is polled every 5 minutes until it drops below the warning level after which it is polled every 60 seconds. When the critical level is reached the computer gives the user 60 seconds to close applications gracefully before it shuts itself down. A warning message will appear on all desktops and consoles when the battery drops below the warning level and will be repeated every 60 seconds.
Sensor Monitoring
I tried to install lm_sensors but the setup programme failed to detect any sensors in the Aopen 1556. Nonetheless we can still monitor the laptop by reading the contents of /proc/acpi. The popular monitoring tool gkrellm is able to monitor the two temperature readings, and the battery status, and may be configured to provide alarms. For people who prefer a monitor docked in the KDE taskbar there is akpi from the Mandriva contrib mirror. Akpi allows you to see the battery level, and to view the temperature levels, but as far as I know it does not provide alarms.
Hibernate and sleep
Hibernate
Hibernation (suspend to disc) is fairly straightforward making use of the suspend-scripts package. To enable hibernate on pressing the power button create a file /etc/acpi/events/power containing
event=button/power (PWR.|PBTN) action=/usr/local/sbin/hibernateNow run the script
/usr/share/doc/suspend-scripts-1.9.2/suspend.shThis will create the script /usr/local/sbin/hibernate.
The configuration file for the hibernate script is /etc/suspend.conf, edit it to read :-
#-*-mode: sh-*-
# Configuration of software suspension
# If your graphic device is not able to return properly from suspend
# you can switch to textconsole before suspend and return to your
# X-console after resume.
SWSUSP_LEAVE_X_BEFORE_SUSPEND="yes"
# Some services (e.g. network) may cause some hangs if they are not
# stopped before a suspend/resume cycle.
SWSUSP_RESTART_SERVICES=" network xinetd nfs pcmcia sound"
# Some services may need to be stopped before a suspend/resume cycle.
# You can set STOP_SERVICES_BEFORE_SUSPEND to a list of services to stop
# before suspend.
SWSUSP_STOP_SERVICES_BEFORE_SUSPEND=" alsa netfs usb"
# Conversely, you can set START_SERVICES_AFTER_RESUME to a list
# of services to start after resuming.
SWSUSP_START_SERVICES_AFTER_RESUME=" network usb netfs alsa ntpd"
# Those are programs that prevent from suspending. If they are
SWSUSP_NON_COMPATIBLE_PROGS="/usr/sbin/pppd"
# You can ask to killall these applications before suspend.
# Default: none
SWSUSP_STOP_PROGS_BEFORE_SUSPEND="xine mplayer glxgears gxine"
# You can ask to run some applications before suspend using this variable.
SWSUSP_START_PROGS_BEFORE_SUSPEND=""
# You can ask to run some applications after resume using this variable.
SWSUSP_START_PROGS_AFTER_RESUME=""
# If the following mount points cannot be unmounted,
# then suspension is aborted unless --force or --kill
# option is used on command line
SWSUSP_UMOUNTS="/mnt/cdrom"
# These mount points should be mounted after suspend
SWSUSP_REMOUNTS=""
# If the following interfaces cannot be stopped,
SWSUSP_DOWNIFS=""
# These interfaces should be started after suspend
SWSUSP_UPIFS="auto"
# Some modules should be unloaded before a suspend/resume cycle. You
SWSUSP_UNLOAD_MODULES_BEFORE_SUSPEND="yes"
# These modules should be unloaded after stopping services but
# before suspending.
SWSUSP_REMOVEMODS=""
# These modules should be loaded after suspend
SWSUSP_INSERTMODS="ac battery button thermal acerhk b44 ipw2200"
SWSUSP_FORCE_SUSPEND_MODE="acpi"
SWSUSP_SAVE_CLOCK_ON_SUSPEND="yes"
SWSUSP_DISABLE_HW_DISK_CACHE=""
SWSUSP_VT="6"
Finally restart the acpid service to read in the new event to monitor and pressing the power button should cause a hibernate to disc. On resuming the wireless card will be disabled. Pressing the wireless hot button twice re inintialises it.
IMPORTANT: Suspend to disc will write the entire memory contents to your swap partition. It is essential the swap is larger than your memory. Also the first time you perform hibernate can take a long time as the swap area is formatted.
IMPORTANT : When you press the power button to resume you will see the lilo menu as normal, but when you select a linux boot it will resume from the swap partition. It is VITAL you do not boot any other operating system such as Windows between hibernating and resuming or else next time you resume Linux your Windows partition will be corrupted. The way to avoid this problem is either to ensure your Windows partition is unmounted before starting the hibernate (Use SWSUSP_UMOUNTS parameter), or do as I do and never have Windows installed at all.
Sleep
I spent a lot of time trying to get sleep (suspend to RAM) working, and finally succeded. To force the computer to sleep to RAM execute the command
pmsuspend2 memory
Opening the lid will cause a resume.
To put the computer to sleep on closing the lid edit /etc/acpi/actions/lm_lid.sh to read :-
#!/bin/bash
test -f /usr/sbin/laptop_mode || exit 0
# lid button pressed/released event handler
sleep 1
/usr/sbin/laptop_mode auto
LID=`cat /proc/acpi/button/lid/LID/state | grep "closed" | cut -c 8-`
if [ -n "$LID" ] ; then
/usr/sbin/pmsuspend2 memory
fi
On opening the lid the computer resumes.
On resuming the display would appear blank, and would require powering off/on to recover, but since discovering the
Option VBERestoreoption in the X server I found the display would recover but required toggling to a console and back again after resuming.
To ensure the display always resumed the file /etc/sysconfig/suspend-scripts/suspend.d/xfree was edited.
function resume {
if [[ -n $CHANGE_VT && $CHANGE_VT != "0" ]];then
if [[ -n $(pidof X) ]];then
chvt "$CHANGE_VT"
fi
fi
chvt 1
chvt 7
}
On resuming the power LED of the wireless modem would be off. To avoid having to press the modem power button to turn it off /etc/sysconfig/suspend-scripts/suspend.d/network was edited.
function resume {
if [[ $RESTART_NETWORK == "yes" ]];then
# Turn on Wireless modem
echo 1 > /proc/driver/acerhk/wirelessled
service network start
sync
fi
if [[ $RESTART_NFS == "yes" ]];then
service netfs start
sync
fi
}
Miscellaneous
To avoid messages in the system log about being unable to load the floppy module (This laptop has no floppy drive) add the option
nofloppyto the append line in /etc/lilo.conf and then run
lilo -v
Sound
Sound worked "out of the box". The lines in /etc/modprobe.conf relating to sound were :-
alias sound-slot-0 snd-intel8x0
remove snd-intel8x0 /sbin/modprobe -r snd-pcm-oss; /sbin/modprobe --first-time -r --ignore-remove snd-intel8x0
install snd-intel8x0 /sbin/modprobe --first-time --ignore-install snd-intel8x0 && { /sbin/modprobe snd-pcm-oss; /bin/true; }
I did have one sound problem: Despite using Alsa the sound card would only play a single sound source at a time. So if amarok for example was running, but not actually playing a track, then no other device could use the sound system.
The solution was found by Googling. Copy the contents of the file /usr/share/alsa/cards/ICH4.conf to /etc/asound.conf.
#
# Configuration for the Intel ICH4/ICH5/ICH6 chips
#
<confdir:pcm/front.conf>
ICH4.pcm.front.0 {
@args [ CARD ]
@args.CARD {
type string
}
type softvol
slave.pcm {
type hw
card $CARD
device 0
}
control {
name "PCM Playback Volume"
card $CARD
}
}
# default with dmix+softvol & dsnoop
ICH4.pcm.default {
@args [ CARD ]
@args.CARD {
type string
}
type asym
playback.pcm {
type plug
slave.pcm {
type softvol
slave.pcm {
@func concat
strings [ "dmix:" $CARD ]
}
control {
name "PCM Playback Volume"
card $CARD
}
}
}
capture.pcm {
type plug
slave.pcm {
@func concat
strings [ "dsnoop:" $CARD ]
}
}
}
<confdir:pcm/surround40.conf>
ICH4.pcm.surround40.0 {
@args [ CARD ]
@args.CARD {
type string
}
type softvol
slave.pcm {
type hooks
slave.pcm {
type hw
card $CARD
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
name "Channel Mode"
preserve true
value "4ch"
lock true
optional true
}
# for old drivers
{
name "Line-In As Surround"
preserve true
value true
optional true
}
{
name "Surround Down Mix"
preserve true
value off
lock true
optional true
}
]
}
}
control {
name "PCM Playback Volume"
card $CARD
}
}
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
ICH4.pcm.surround51.0 {
@args [ CARD ]
@args.CARD {
type string
}
type softvol
slave.pcm {
type hooks
slave.pcm {
type hw
card $CARD
device 0
}
hooks.0 {
type ctl_elems
hook_args [
{
name "Channel Mode"
preserve true
value "6ch"
lock true
optional true
}
# for old drivers
{
name "Line-In As Surround"
preserve true
value true
optional true
}
{
name "Mic As Center/LFE"
preserve true
value true
optional true
}
{
name "Surround Down Mix"
preserve true
value off
lock true
optional true
}
{
name "Center/LFE Down Mix"
preserve true
value off
lock true
optional true
}
]
}
}
control {
name "PCM Playback Volume"
card $CARD
}
}
<confdir:pcm/iec958.conf>
ICH4.pcm.iec958.0 {
@args [ CARD AES0 AES1 AES2 AES3 ]
@args.CARD {
type string
}
@args.AES0 {
type integer
}
@args.AES1 {
type integer
}
@args.AES2 {
type integer
}
@args.AES3 {
type integer
}
type hooks
slave.pcm {
type hw
card $CARD
device 4
}
hooks.0 {
type ctl_elems
hook_args [
{
name "IEC958 Playback AC97-SPSA"
lock true
preserve true
value 3
optional true
}
{
name "IEC958 Playback Default"
lock true
preserve true
value [ $AES0 $AES1 $AES2 $AES3 ]
}
{
name "IEC958 Playback Switch"
lock true
preserve true
value true
}
]
}
}
Modem
I never tried to use the modem, but apparently it needs the slmodem package and the slmodem-kernel package.
Conclusion
The Aopen 1556 works just great under Mandriva 2006. The performance is really snappy. Power management works really well. The hardware of the 1556 is really good apart from the loudspeakers which are really tiny and tinny. I fail to see the point in having a facility to play CDs when the computer is switched off when the speakers are so bad.
Would I recommend Aopen 1556 to other Linux users? - Yes.
Tuesday 15th November, 2005

