Dienstag, November 14, 2006

Linux on Toshiba Tecra S3



Linux On Laptops


TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones


I finally decided that it is time to switch to linux completely on my work laptop. The distribution of choice was kubuntu edgy eft (6.10), but I think most infos also works for ubuntu or other distros.

My Toshiba Tecra S3 has a 60GB SATA HD, Nvidia GeForce Go 6600 graphics card, bluetooth, wlan, gigabit lan, internal lcd 1400x1050 and an external lcd screen of 1280x1024.

As I was afraid of the raid-0 configuration, I made a backup of the complete hd to an external hard disk using dd. Just to be sure :-) I shrinked the existing windows xp partition with partition magic to 30GB, but left the service partition (of 24MB) at the end of the hard disk. I left the space empty for kubuntu and kubuntu installation created a 1GB swap and the rest for /.

Installation was smooth:
  • the internal lcd was perfectly supported with the correct resolution
  • lan worked out of the box (module sky2)
  • wlan works (modules ieee80211 and ipw2200 were loaded automatically) after using the wifi assistent and entering the WEP key. Yes, I am using WEP, because my other laptop at home does not support WPA. The assistant first said, "connection refused", but it worked nevertheless.
  • the touchpad and the blue mouse stick worked
  • sound was perfect (module snd-hda-intel, module snd-intel8x0 did NOT work!)
  • special keys: mute/unmute and lcd brighter/dimmer work, all others do not work
  • hibernate works (suspend to disk)
  • suspend to ram works as well
  • SD-Card reader: works, nothing to do
  • firewire: untested
  • softmodem: untested
  • bluetooth: works. The only problem is that it needs to be enabled via an acpi call. As the toshiba_acpi module does not support bluetooth, other ways have to be found:
    • The simpler method ist by using the toshset tool (install the package toshset) and calling (as root or by sudo) toshset -bluetooth on. I added the lines toshset -bluetooth on and toshset -bluetooth off to the start/stop/restart sections in the /etc/init.d/bluetooth startscript and now bluetooth is automatically recognized on startup.
    • the other way is by using an additional module from http://0bits.com/?q=node/6 (Thanks to mitch!): compile and install (make, make install) the little module and insert it with modprobe toshbt (as root) or add the module into /etc/modules to be autoloaded. I needed the module hci_usb as well (loaded before toshbt).

Some problems occured when I wanted my external lcd in a dual screen configuration: it stayed black, whatever I did. The kde configuration application for the x-server was not very helpful, as it refused cooperation whenever I changed something manually in /etc/X11/xorg.conf.

The BIOS-settings for the external display (always on) was the solution. So at boot time both (internal and extenal) display the same information. I finally found two possible solutions for a dual screen configuration:
  1. configure the x-server for two screens
  2. let the closed source nvidia driver do the work (much simpler)
Strange but unchangable: the external monitor is always the primary monitor for the x-server.

My prefered configuration (as it is simpler) is the following:
  1. change the BIOS settings (press esc when switching the laptop on) to use LCD and RGB
  2. boot into linux
  3. configure the x server in the system control of kde. Switch to proprietary nvidia driver (need to install nvidia-glx package first with
    sudo aptitude install nvidia-glx)
  4. change the /etc/X11/xorg.conf and add the following lines to the Device section:
    Option "TwinView" "yes"
    Option "TwinViewOrientation" "CRT-0 LeftOf CRT-1"

    My external monitor is right of my laptop.
  5. If you want to show the same content on the internal and external display (for presentation), use "Clone" instead of "LeftOf". Additionally I set the "MetaModes" to tell the driver the resolution of the connected displays:
    Option "MetaModes" "1024x768,1400x1050"
    Please note that the second setting must be 1400x1050 (for the internal display), as otherwise it will not work. The first setting matches the resolution of the external display. Like this, the internal resolution is 1400 x 1050, but if a window is maximized, it maximizes to 1024 x 768, which works quite well with my beamer.
  6. On the next boot, the nvidia logo (from the proprietary nvidia driver) should appear across both screens.
  7. If the internal LCD is your main work screen, move the kde taskbar to the second (internal) screen (right click on taskbar, configure, ...)
  8. If no external monitor is connected, the x-server just uses the internal lcd as the primary screen, so booting with or without external display gives perfect results for me (either in dual screen config, or in single screen)
The complete xorg.conf is here:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 1.0 (buildmeister@builder3) Mon Oct 16 22:13:07 PDT 2006

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Default Screen" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
EndSection

Section "Files"

# path to defoma fonts
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "extmod"
Load "freetype"
Load "int10"
Load "type1"
Load "vbe"
Load "glx"
Load "v4l"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "de"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection


Section "Monitor"
Identifier "Laptop Monitor"
Option "DPMS"
HorizSync 28-70
VertRefresh 43-60
EndSection


Section "Monitor"
Identifier "Generic Monitor"
ModelName "Custom 1"
Gamma 1
ModeLine "640x480@60" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
ModeLine "800x600@56" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
ModeLine "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
ModeLine "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
ModeLine "1152x768@54" 65.0 1152 1178 1314 1472 768 771 777 806 +hsync +vsync
ModeLine "1280x854" 80.0 1280 1309 1460 1636 854 857 864 896 +hsync +vsync
ModeLine "1280x960@60" 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
ModeLine "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
ModeLine "1400x1050@60" 122.6 1400 1488 1640 1880 1050 1051 1054 1087 -hsync +vsync
EndSection

Section "Device"
Identifier "NVIDIA Corporation NV43 [GeForce Go 6600]"
Driver "nvidia"
VendorName "NVIDIA"
BoardName "NVIDIA GeForce FX (generic)"
BusID "PCI:1:0:0"
Screen 0
Option "TwinView" "yes"
# Option "SecondMonitorHorizSync" ""
# # Option "SecondMonitorVertRefresh" "50.0 - 130.0"

# Double Width Screen:
Option "TwinViewOrientation" "CRT-0 LeftOf CRT-1"

# For Clone mode use "Clone" and the metamodes to configure the resolution
# of the external display (the first setting is for external display,
# the second must be 1400x1050, otherwise the internal lcd wont work)
# Option "TwinViewOrientation" "CRT-0 Clone CRT-1"
# Option "MetaModes" "1024x768,1400x1050;1024x768,1024x768;800x600,800x600"
#
EndSection

Section "Screen"
Identifier "Default Screen"
Device "NVIDIA Corporation NV43 [GeForce Go 6600]"
# Monitor "Generic Monitor"
Monitor "Laptop Monitor"
DefaultDepth 24
SubSection "Display"
# Virtual 1400 1050
Depth 24
Modes "1400x1050@60" "1280x1024@60" "1280x960@60" "1280x854" "1152x768@54" "1024x768@60" "800x600@60" "800x600@56" "640x480@60"
EndSubSection
EndSection


I mentioned a seconds configuration above: configure the x-server to use two screens in xinerama mode or clone. This should also work with the open source nv driver (untested). Here is my second xorg.conf:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 1.0 (buildmeister@builder3) Mon Oct 16 22:13:07 PDT 2006

# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type "man /etc/X11/xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section "Files"
# path to defoma fonts
FontPath "/usr/share/X11/fonts/misc"
FontPath "/usr/share/X11/fonts/cyrillic"
FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/X11/fonts/Type1"
FontPath "/usr/share/X11/fonts/100dpi"
FontPath "/usr/share/X11/fonts/75dpi"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "extmod"
Load "freetype"
Load "int10"
Load "type1"
Load "vbe"
Load "glx"
Load "v4l"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "de"
Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "ServerFlags"
# Option "DefaultServerLayout" "Clone"
Option "DefaultServerLayout" "Xinerama"
EndSection

Section "ServerLayout"
Identifier "Clone"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
Option "Xinerama" "on"
Option "Clone" "on"
EndSection

Section "ServerLayout"
Identifier "Xinerama"
Screen 0 "Screen0" LeftOf "Screen1"
Screen 1 "Screen1" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "Synaptics Touchpad"
Option "Xinerama" "on"
Option "Clone" "off"
EndSection

Section "Monitor"
Identifier "Monitor0"
# DisplaySize 370 300
HorizSync 28-70
VertRefresh 43-60
Option "dpms"
EndSection

Section "Monitor"
Identifier "Monitor1"
HorizSync 24.0 - 80.0
VertRefresh 49.0 - 75.0
EndSection

Section "Device"
# external monitor
Identifier "Videocard0"
Driver "nvidia"
VendorName "Videocard vendor"
BoardName "nVidia Corporation NV43 [GeForce 6600/GeForce 6600 GT]"
# Option "ModeValidation" "NoEdidModes"
# Option "UseEdidFreqs" "FALSE"
# Option "UseEdidDPI" "FALSE"
# Option "DPI" "87 x 86"
Screen 0
EndSection

Section "Device"
# laptop intenal
Identifier "Videocard1"
Driver "nvidia"
VendorName "Videocard Vendor"
BoardName "nVidia Corporation NV43 [GeForce 6600/GeForce 6600 GT]"
# Option "ModeValidation" "NoEdidModes"
# Option "UseEdidFreqs" "FALSE"
# Option "UseEdidDPI" "FALSE"
# Option "DPI" "87 x 86"
Screen 1
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "VideoCard1"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1400x1050" "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

The kernel kubuntu installed is:

~>uname -a
Linux hostname 2.6.17-10-generic #2 SMP Fri Oct 13 18:45:35 UTC 2006 i686 GNU/Linux


For the completeness the output of lspci:

~>lspci
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03)
00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
00:1f.1 IDE interface: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce Go 6600] (rev a2)
02:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller (rev 15)
05:05.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)
05:0b.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller
05:0b.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller
05:0b.4 Class 0805: Texas Instruments PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Secure Digital (SD) Controller