Showing posts with label r500. Show all posts
Showing posts with label r500. Show all posts

Wednesday, September 21, 2011

First impressions, redux

The R500 bit the dust over a year and a half ago. Most PC manufacturers were busy trying to crank out netbooks or a Macbook Air ripoff at the time, so there was no suitable replacement -- had to limp along with a Macbook Pro (ugh!) running Ubuntu until spring of this year.

What replaced the R500? A Thinkpad X1. It weighs twice as much, has no transreflective screen, and is a bit bulkier, but it is paradise after using that Macbook Pro for a year. Dedicated pageup/down keys! Home and End keys! A Delete key! THREE mouse buttons! A hardware kill switch for wifi and bluetooth! A freaken eSATA connector!

But why no grumpy install post detailing how to get Linux speaking to all the hardware? Because everything just works! Even the volume control buttons and the fingerprint reader. No joke. You can thank IBM's interest in Linux for that.

On top of the compatibility, it's a nice looking machine, powerful (64-bit debian runs great on a dual-core i5 with 8 GB of RAM), and tough -- GorillaGlass over the display, MILSPEC (assuming 810) shock and spill resistance (including a keyboard that drains *through* to the bottom of the laptop), the works.

The one caveat: it's best to use non-standard video drivers, as the standard debian/ubuntu Intel video driver became a bit crashy. Easily fixed, though, by adding the xorg-edgers PPA.

Saturday, May 30, 2009

Toshiba R500 Backlight Button

Keep forgetting to u/l this script for toggling the r500 backlight using toshset:

#!/bin/sh

TOSHSET=/usr/local/bin/toshset

STATE=`sudo $TOSHSET -trmode 2>/dev/null | grep -a transreflective | \
cut -f 3 -d ' '`

if [ $STATE = "on" ]
then
NEW_STATE="off"
else
NEW_STATE="on"
fi

sudo $TOSHSET -trmode $NEW_STATE


Xev shows the keycode for the backlight (and the 'i' internet/information/idiot key, so they'll both do the same thing) to be 180, which is already taken by XF86HomePage in Ubuntu. If for some reason this key is undefined (i.e. nothing shows up on `xmodmap -pke | grep '^keycode 180'`), add the following line to ~/.Xmodmap (which might need to be symlinked to ~/.xmodmaprc on non-Ubuntu Linuxes):

keycode 180 = XF86HomePage

In E17, edit the keyboard bindings using Settings-> Settings Panel -> Input -> Key Bindings. For XF86HomePage, select the Launch : Defined Command option, and point it to the above shell script (e.g. in ~/bin).

Note that the script uses sudo to launch toshset, so you will either need to change this to invoke an GUI sudo program like gtksu, or add a line like the following to /etc/sudoers:

$USER ALL=(root) NOPASSWD: /usr/local/bin/toshset

where $USER is your username. Note that this allows any toshset command to be run as root without a password from this user's session, which could be exploited if someone were sufficiently motivated.

Thursday, April 17, 2008

Hibernation

Spent the extra hour and got hibernation working last night; here are some basic notes on the experience.

The only truly working suspend-to-disk implementation is Suspend2 AKA Tux-On-Ice (TOI), available as a kernel path from http://www.tuxonice.net/downloads .

Download and path the kernel as follows:

cd /usr/src/linux-2.6.24-2
patch -p1 < /tmp/tuxonice-3.0-rc5-for-2.6.24.patch


Make config/menuconfig/xconfig and ensure the following options are set:

CONFIG_TOI_CORE=y

# Image Storage (you need at least one allocator)
CONFIG_TOI_FILE=y
CONFIG_TOI_SWAP=y
CONFIG_TOI_DEFAULT_PRE_HIBERNATE=""
CONFIG_TOI_DEFAULT_POST_HIBERNATE=""
CONFIG_TOI_CRYPTO=y
CONFIG_TOI_USERUI=y
CONFIG_TOI_USERUI_DEFAULT_PATH="/usr/lib/suspend2-userui/suspend2ui_fbsplash"
# CONFIG_TOI_KEEP_IMAGE is not set
CONFIG_TOI_REPLACE_SWSUSP=y
# CONFIG_TOI_CLUSTER is not set
CONFIG_TOI_CHECKSUM=y
CONFIG_TOI_DEFAULT_WAIT=25
CONFIG_TOI_DEFAULT_WAIT=25
# CONFIG_TOI_PAGEFLAGS_TEST is not set
CONFIG_TOI=y
...
CONFIG_CRYPTO_LZF=y


Rebuild/reinstall the kernel. If you use an initrd or initramfs, a new one must be made according to the instructions at:
http://wiki.tuxonice.net/DistroAndHardwareSetup/Ubuntu_Gutsy_Gibbon

Note that the initramfs files may exist both in /etc/initramfs-tools and /usr/share/initrafms-tools ; in this case, create the file suspend2_do_resume in /etc/initramfs-tools . I had to fill my /etc/initramfs-tools tree with files from the /usr/share/initramfs-tools tree; it now looks like this:

/etc/initramfs-tools/update-initramfs.conf
/etc/initramfs-tools/hook-functions
/etc/initramfs-tools/init
/etc/initramfs-tools/hooks/console_tools
/etc/initramfs-tools/hooks/console_setup
/etc/initramfs-tools/hooks/usplash
/etc/initramfs-tools/hooks/thermal
/etc/initramfs-tools/hooks/kernelextras
/etc/initramfs-tools/hooks/uswsusp
/etc/initramfs-tools/hooks/udev
/etc/initramfs-tools/initramfs.conf
/etc/initramfs-tools/scripts/init-premount/udev
/etc/initramfs-tools/scripts/local-premount/suspend2_do_resume
/etc/initramfs-tools/scripts/local-premount/uswsusp
/etc/initramfs-tools/scripts/nfs
/etc/initramfs-tools/scripts/functions
/etc/initramfs-tools/scripts/nfs-top/udev
/etc/initramfs-tools/scripts/local
/etc/initramfs-tools/scripts/init-top/console_setup
/etc/initramfs-tools/scripts/init-top/framebuffer
/etc/initramfs-tools/scripts/init-top/usplash
/etc/initramfs-tools/scripts/init-top/all_generic_ide
/etc/initramfs-tools/scripts/init-bottom/udev
/etc/initramfs-tools/conf.d/resume
/etc/initramfs-tools/modules

The initramfs is rebuilt with the command
update-initramfs -u -k `uname -r`

The following config settings work fine:

/etc/hibernate/suspend2.conf
UseSuspend2 yes
Reboot no
EnableEscape yes
DefaultConsoleLevel 1
Compressor lzf
Encryptor none
SuspendDevice swap:/dev/sda2
FullSpeedCPU yes


/etc/hibernate/common.conf :
Verbosity 1
LogFile /var/log/hibernate.log
LogVerbosity 4
LogTimestamp yes
HibernateVT 15
Distribution debian # (or fedora/gentoo/mandrake/redhat/slackware/suse)
XDisplay :0
SaveClock restore-only
ChangeGrubMenu yes
GrubMenuFile /boot/grub/menu.lst
AlternateGrubMenuFile /boot/grub/menu-suspended.lst
BackupGrubMenuFile /boot/grub/menu.lst.hibernate.bak
UnloadBlacklistedModules yes
LoadModules auto
SwitchToTextMode yes

Note that /boot/grub/menu.lst must be copied to menu-suspended.lst, which will be the boot menu displayed when the system is hibernating. Add the line "resume=swap:/dev/sda2" (or whatever your swap partition is) to the default kernel boot option, and add a kernel boot option with the No Resume (param is "noresume") option set for easy recovery in case of failure.

The command "hibernate -v3" should now susend the system to disk.

Apropos of nothing: Ubuntu has the default language set to require UTF-8 (e.g. en_US.UTF-8), which really screws up compiler output, man pages, and so forth (in particular, single and double quotes appear as f’s) in non-Unicode terminals (e.g. Aterm, Eterm). One could switch to a unicode terminal, e.g.
rxvt-unicode -bg black -fg orange -fade 25 -fn 'xft:Courier 10 Pitch-12'
...but setting the language to C in ~/.bashrc (export LANG=C) lets you keep using your favorite terminal.

Wednesday, April 16, 2008

toshiba_acpi, toshset, and transreflectivity

The new version of toshset (1.73, available at http://www.schwieters.org/toshset ) supports the r500 transreflective screen via the option

toshset -trmode

Usage is simple: to turn the backlight off and use the display in direct sunlight, type

toshset -trmode off

To turn the backlight back on, type

toshset -trmode on

Note that you can still use the display in direct sunlight without turning the backlight off (this works fantastically, btw). The trmode option simple saves you (much) power.

There are some caveats to getting this to work, however:

1. The toshiba kernel module must not be loaded, so remove it from /etc/modules .
2. The character device 181 must be associated with toshiba_acpi kernel module, not the toshiba kernel module. This change can be made in /etc/modprobe.d/aliases .
3. The patch toshiba_acpi-dev_toshiba_test5-linux_2.6.21.patch must be applied. This works fine with the 2.6.24 kernel :
cd /usr/src/linux-2.6.24-2
cd drivers/acpi
patch -p0 < /tmp/toshiba_acpi-dev_toshiba_test5-linux_2.6.21.patch
cd ../..
make modules
make modules_install

4. If the file /etc/modprobe.d/toshiba_acpi.modprobe exists, open it and comment out the line
options toshiba_acpi hotkeys_over_acpi=1

The fingerprint reader supposedly works with libfprint (no Ubuntu package, not bothering).
The SD card reader still cannot read cards (mmc0: error -110 whilst initialising SD card).
Hibernation (aka suspend-to-disk) still doesn't resume, probably because of Ubuntu's swap-device-UUID-changing problem.

One more fun fact: change the Xorg driver from 'i810' to 'intel' :
Driver "intel"
Helps keep X from hanging due to an illegal instruction. Isn't running Linux fun?

Friday, March 21, 2008

Systrayless Wifi

Didn't come across this last time I was playing with E17: exalt network manager.

Install:

sudo apt-get install exalt exalt-daemon emodule-exalt libexalt-dbus-dev libexalt-dev


This solves the "have to run knetworkmanager in an alternate WM' problem, as
exalt runs as a standalone app (and has an E17 widget).

Caveats: Hold the shift key (not Caps Lock!) down when entering your WEP key, and be sure to changed the mode from Ad-Hoc to Managed.

For those who are suffering with unmaintained E17 packages, use the Gos servers:

deb http://packages.thinkgos.com/gos/ reloaded main
deb-src http://packages.thinkgos.com/gos/ reloaded main

Tuesday, March 18, 2008

2.6.22 kernel and 'alps_process_byte'

On the R500 (and other laptops, apparently) kernel 2.6.22 (and a few before, and a few after) panic on resume with an oops like the following:

[113189.828000] EIP: [] alps_process_byte+0x18/0x60 [psmouse] SS:ESP 0
068:d6d27ee8
[113189.828000] <0>Kernel panic - not syncing: Fatal exception in interrupt
[113189.828000]

Recompiling without extra alps support does not help.

Adding the module 'psmouse' into the MODULES variable in /etc/default/acpi-support seems to work -- no crashes so far. (Update 3/21: still no crashes! We have a winner)

Wednesday, February 20, 2008

KNetworkManager suckage

Part of this past weekend's wifi debugging process.

Selecting 'manual configuration' in ketwork manager will cause the
wireless card to be ONLY configured manually: a list of available
wireless networks will no longer appear in knetworkmanager.

The fix is to remove all entries for the wireless card in /etc/network/interfaces .


In better news, the 2.6.24 kernel has the Intel wireless drivers for the r500 built-in.

Monday, October 8, 2007

First Impressions

It's been a month or so, and I've been using the r500 on a daily basis for work (coding, browsing, email, documentation, etc). I've had a bit of time to get used to it; here are my thoughts.

Case/Form Factor
The r500 is just about the perfect size. After the Sharp Actius, I wanted my laptops to be the size of one of those Mead composition books. The size of the display and keyboard on the r500, however, are probably ideal; if this were as thin as the Actius MM20, it would be perfect.

The weight cannot be beat. A friend held it and said "it feels like paper!", another said "haha, very funny, now where is the actual laptop." Even after the Actius, and in direct comparison to the Vaio Tz and G2, this has to be seen (and hefted) to be believed. The slightly larger size is what does it; there is almost no mass to this.

Contrary to the impression of the pre-release reviews, I find the r500 to be quite durable. There is a small bit of flex in the seam at the front of the keyboard, and the case picks up smudges somewhat easily, but I've chucked this in my backpack and hauled it all around town without a problem.

The keyboard is great: decent size, nice and responsive. The touchpad is interesting: it feels the same as the surrounding case, which gives it a bit more traction for your finger. I'd still prefer one of the nipple/eraser/trackpoint mouse jobs, though. Be nice to have those as an option again.

Display
There is a ton of light bleeding from the edge of this, which doesn't bother me, but the viewing angle is VERY bad. Only noticeable when viewing dark colors; the brights are all fine at most normal angles. Using a dark WM theme and sitting on a train seat or a couch, you certainly notice.

ACPI
Suspend-to-RAM works fine out of the box; suspend-to-disk worked with a fresh kernel compile, though I had to resume via single user mode for some reason. Suspend-to-disk is probably ideal for this machine, given the SD drive. Suspend-to-ram takes 10 seconds or more, and is as stable as every other Linux laptop that suspends to RAM (i.e. one time out of 10 it will resume incorrectly). One downside of suspend-to-ram is that it is a battery hog; I've had the
machine lose 30% of its battery when suspended for 6 hours or so.

Battery
The 3-cell battery that comes with this lasts about 3 hours; I haven't tried the 6-cell. I've made some changes to get a bit more life out of this, and may have it at 4 hours for normal usage soon (more for no net/browsing/X). Charging time is horrible, almost as long as it takes to drain the battery. Also been noticing some funny stuff when trying to run down the battery recently: when idle, the laptop will stay at 3-4% (via the 'acpi' command) with 4 or so minutes left for 10 or more minutes.

SD Drive
...is awesome. Fast, fast, fast. For those on the fence, it is well worth the price. Suspend/resume suddenly becomes less important, since booting takes only a few seconds. And suspend-to-disk is suddenly viable.

Peripherals
The wifi works great, no fuss. Ditto for audio, display, lan, usb, etc. The SD reader is one of those "known problems" that should be fixed in the kernel soon (my guess is 2.6.24). The fingerprint reader may actually work, as it is recognized by SANE. I've had no luck with bluetooth, though I've only spent a few minutes on it. And the toshiba ACPI kernel support as used by toshset seems worse with the latest patches; none of the LCD controls work any more, and there doesn't seem to be a way to turn the backlight off (which toshset should perform)
-- so no fun transreflective display.

Wednesday, September 26, 2007

R500 Fingerprint sensor, Bluetooth, and Volume Control

Coming across this page on an R500 gentoo install gave me some things to try:

http://www.pervasive-network.org/SPIP/Toshiba-Portege-R500-10N-sous

First, the command
sane-find-scanner
produces the output
found USB scanner (vendor=0x08ff, product=0x1600 [Fingerprint Sensor]) at libusb:002:003 # Your USB scanner was (probably) detected. It may or may not be supported by # SANE. Try scanimage -L and read the backend's manpage.
...so it should be possible to use.

Second, the bluetooth patch at http://www.sfires.net/toshiba/ is required. It was written for 2.6.14 and of course fails on 2.6.22. Manually applying the patch succeeds, but no HCI finds no bluetooth devices..

Third, the xmodmap entries are provided, making the Volume Control fix a no-brainer.

Changes to /.xmodmaprc:
keycode 160 = XF86AudioMute keycode 174 = XF86AudioLowerVolume keycode 176 = XF86AudioRaiseVolume
Changes to ~/.xbindkeysrc :
"amixer -c 0 set PCM 2dB+" XF86AudioRaiseVolume "amixer -c 0 set PCM 2dB-" XF86AudioLowerVolume "amixer -c 0 set PCM 0" XF86AudioMute

Tuesday, September 25, 2007

R500 Wifi and ACPI

The wireless card is an Intel 4965AGN and needs drivers from http://intellinuxwireless.org

Applying this patch to 2.6.22 from kernel.org works, but causes suspend to no longer work. Turns out Ubuntu provided the patch from http://memebeam.org in their kernel.

Initially, though, I discounted this patch because the version number did not match the one in the Ubuntu code. Attempting to build the Ubuntu kernel with the Intel wireless patch proved to be quite a challenge, which is chronicled below for the amusement of others.

In the end, I have decided to use my own build of the 2.6.22 kernel with patches for ACPI and Wifi. I just can't trust the Ubuntu kernel source after my experiences with it.

Patching Ubuntu

First, get the kernel source, unpack it, and make sure it compiles:

apt-get install linux-source-2.6.20 cd /usr/src tar -jxf linux-source-2.6.20.tar.bz2 cd linux-source-2.6.20 make menuconfig make-kpkg --initrd --append-to-version=-mkfs kernel_image

The first thing you will notice (assuming you modified the kernel config) is that Ubuntu does not ship working kernel source. I ran into the following two bugs:

https://lists.ubuntu.com/archives/ubuntu-bugs/2007-March/456610.html
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/86725

Note that Ubuntu has fixed neither of them, trivial as they are, and gives the following excuses:

We don't use this because it is marked experimental. We do not guarantee that our source compiles for users with alternate configurations from what we use to build our own kernels.

It fails because you enabled an option that is broken. We don't guarantee alternate builds of our source. (Note: the config option is not marked as broken or experimental, and is in fact in the Ubuntu Additional Drivers section.)


This is without a doubt the most mind-numbingly inane response to a bug that I have ever heard. Why ship the kernel source at all if changing a single option in the config file (to optimize for a specific process, for example) can cause the build to fail? Talk about following the letter of the law, not the spirit!

In any event, fixing those bugs as documented (one by adding a #define in C, the other my simply not using the driver) lets the kernel compile successfully. Now to for the wireless driver.

ln -s /usr/src/linux-source-2.6.20 /lib/modules/`uname -r`/source cd /usr/src/mac80211-10.0.0 make SHELL=/bin/bash patch_kernel

That went well, let's rebuild kernel...
net/built-in.o: In function `__crc_iw_handler_get_thrspy': (*ABS*+0x8f9b701d): multiple definition of `__crc_iw_handler_get_thrspy' net/built-in.o: In function `iw_handler_set_spy': (.text+0x6d810): multiple definition of `iw_handler_set_spy' ubuntu/built-in.o:(.text+0x1090): first defined here net/built-in.o: In function `__crc_wireless_send_event': (*ABS*+0xeb8cff4e): multiple definition of `__crc_wireless_send_event' net/built-in.o: In function `iw_handler_get_thrspy': ...

Oh, bitter defeat!
It looks like Ubuntu's added in MAC80211 code is conflicting with the Intel MAC80211 patch. Disabling either in the config has no effect.

Let's trust the Ubuntu MAC80211 to be the same and hope everything just works. Using an unpatched version of the kernel, apply the IWL-Wifi patch

cd iwlwifi-1.1.0 make SHELL=/bin/bash patch_kernel

Turns out this doesn't work, because the Ubuntu MAC80211 code is not where the IWL-Wifi patch expects it to be. After a bit of poking around in the IWL-Wifi scripts and Makefile, it looks like the following changes will work:

  1. In the Makefile, change the line 'export KSRC ?= /lib/modules/$(shell uname -r)/source' to 'export KSRC ?= /lib/modules/$(shell uname -r)/source/ubuntu'
  2. ln -s /lib/modules/2.6.20-16-generic/source/drivers /lib/modules/2.6.20-16-generic/source/ubuntu/
The first change causes the patch to look in the ubuntu directory for the MAC80211 code, the second causes the driver code to be installed in the correct location.

This builds successfully. Suspend-to-RAM and Wifi now work correctly. No good news on the suspend-to-disk front, which is unusual as that should be the easiest suspend option to make work (it's just a file on the swap partition fer chrissake!).

Update: The main problem with suspend-to-disk is reported here : https://bugs.launchpad.net/ubuntu/+source/udev/+bug/105490
Unfortunately, even after fixing the swap partition in /etc/fstab, the system locks up on resume unless using 'Recovery Mode'.

Some background

An interminable period of time ago (two months), I ordered one of the new Toshiba ultralights to replace my aging Sharp Actius MM20 (a fine machine).

Toshiba Protege R500
Toshiba RX1 (Dynamism)
Another owner's R500 review.

64 GB SSD, extended battery, RAM upgrade, no DVD drive. Almost no moving parts (only that pesky CPU fan, which the Actius managed to do without). Pricey.

A few weeks ago it arrived the day I left for vacation (argh!). One week ago I returned and installed Kubuntu on it. The immediate results: suspend-to-ram worked (suspend-to-disk, not so much), X worked, sounds worked, ethernet worked, touchpad worked, USB worked. Not working: SD reader, volume control, brightness button, 'i' button, fingerprint sensor, wifi.

The past few days have been spent getting e17 installed and my standard working environment set up. Time to tackle those device issues.