Sunday, April 28, 2013

5.2 amd64 X200: xorg.conf to get Trackpoint to behave properly.

Heyya. One of the thing that I like about X200, is the lack of touchpad. I don't quite like touchpads. It's a nuisance at best. Surely some OS can disable the touchpad when external mouse is connected but then, what's the point? Most of the time I'll be ignoring the touchpad.

For X200, it only comes with Trackpoint with 3 buttons. The left and right buttons are the standard left-right click, and the middle button is for scrolling. In Windows, pressing the middle-button then using the Trackpoint will scroll to the desired point (Right, left, up, down). But that's for Windows, I want it for my 5.2.

Surely, what's the point of having the best documentations if I didn't use it, right? So, man xorg.conf. Then I notice something. In the INPUTDEVICE SECTION, it's stated that:

"It is usually not necessary to provide InputDevice sections in the xorg.conf if hotplugging is in use (i.e. AutoAddDevices is enabled). If hotplugging is enabled, InputDevice sections using the mouse, kbd and vmmouse driver will be ignored."

Now that's different from what I used to remember. Previously I just alter my /etc/X11/xorg.conf like this:

Section "InputDevice"
    Identifier    "Trackpoint"
    Driver        "mouse"
    Option        "Protocol"    "Auto"
    Option        "Device"    "/dev/wsmouse"
    Option        "Emulate3Buttons"    "False"
    Option        "EmulateWheel"    "True"
    Option        "EmulateWheenButton"    "2"
    Option        "XAxisMapping"    "6 7"
    Option        "YAxisMapping"    "4 5"
EndSection


But now that won't work. It doesn't do anything. My USB Mouse's wheel is working fine, but Trackpoint does nothing as I wanted. So I alter the SERVERLAYOUT section:

Section "ServerLayout"
    ...snip...
    Option        "AutoAddDevices"    "False"
EndSection


But then both the Trackpoint and USB Mouse is not working. At all. This is not good. After re-reading the relevant xorg.conf manual, I found the answer. It lies in the INPUTCLASS SECTION. This is the working snippet of my /etc/X11/xorg.conf files.

Section "InputDevice"
    Identifier    "Trackpoint"
    Driver        "mouse"
    Option        "Protocol"    "Auto"
    Option        "Device"    "/dev/wsmouse"
EndSection


Section "InputClass"
    Identifier    "Trackpoint"
    MatchIsPointer    "True"
    Option        "Emulate3Buttons"    "False"
    Option        "EmulateWheel"        "True"
    Option        "EmulateWheelButton"    "2"
    Option        "XAxisMapping"        "6 7"
    Option        "YAxisMapping"        "4 5"
EndSection


Basically the INPUTCLASS can be used to add different function to different input devices (eg: Trackpoint, USB Mouse with Scroller etc) if configured correctly. In my case, I managed to get the Trackpoint's scrolling function using the middle button and the paste buffer function is also working as needed. But then my USB Mouse is also inheriting the same function. Ah well I will try to alter the INPUTCLASS SECTION so that the Trackpoint and USB Mouse have distint function.

So in the end, I got my Trackpoint working as I wanted. Take note that I'm using cwm and scrolling is tested and working in vim, Firefox and other programs. Great.

Oh, before I forget. I had problem generating my xorg.conf as there's error when I use X -configure. X -configure exited with error. But in the end the xorg.conf file did got generated. Current status is:

- Trackpoint scrolling function now working.
- intel (4) is working fine.
- Video display is 1280x800.
- VGA Out is not tested yet.
- Ultrabase's DisplayPort & VGA Out is not yet tested.

Here's my current /etc/X11/xorg.conf.

# /etc/X11/xorg.conf Alsemo - Thinkpad X200
Section "ServerLayout"
Identifier "Thinkpad X200"
Screen 0 "Screen0" 0 0
#Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Trackpoint" "CorePointer"
InputDevice "Keyboard" "CoreKeyboard"
EndSection
Section "ServerFlags"
Option "DRI2" "True"
EndSection
Section "Files"
ModulePath "/usr/X11R6/lib/modules"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
FontPath "/usr/X11R6/lib/X11/fonts/OTF/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
EndSection
Section "Module"
Load "dbe"
Load "dri"
Load "dri2"
Load "extmod"
Load "glx"
Load "record"
EndSection
Section "InputDevice"
Identifier "Keyboard"
Driver "kbd"
EndSection
Section "InputDevice"
Identifier "Trackpoint"
Driver "mouse"
Option "Protocol" "Auto"
Option "Device" "/dev/wsmouse"
EndSection
Section "InputClass"
Identifier "Trackpoint"
MatchIsPointer "True"
Option "Emulate3Buttons" "False"
Option "EmulateWheel" "True"
Option "EmulateWheelButton" "2"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
Section "Monitor"
Identifier "LCD Panel"
VendorName "Lenovo"
ModelName "X200 LCD"
Option "DPMS" "on"
EndSection
Section "Monitor"
Identifier "VGA-Out"
VendorName "LCD Panel"
ModelName "X200 VGA"
Option "DPMS" "on"
Option "enable" "False"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "DRI" # [<bool>]
#Option "ColorKey" # <i>
#Option "VideoKey" # <i>
#Option "ModeDebug" # [<bool>]
#Option "FallbackDebug" # [<bool>]
#Option "LVDS24Bit" # [<bool>]
#Option "FramebufferCompression" # [<bool>]
#Option "Tiling" # [<bool>]
#Option "LinearFramebuffer" # [<bool>]
#Option "Shadow" # [<bool>]
#Option "SwapbuffersWait" # [<bool>]
#Option "LVDSFixedMode" # [<bool>]
#Option "ForceEnablePipeA" # [<bool>]
#Option "XvMC" # [<bool>]
#Option "XvPreferOverlay" # [<bool>]
#Option "DebugFlushBatches" # [<bool>]
#Option "DebugFlushCaches" # [<bool>]
#Option "DebugWait" # [<bool>]
Identifier "GM45"
Driver "intel"
BusID "PCI:0:2:0"
Option "monitor-LVDS" "LCD Panel"
Option "monitor-VGA" "VGA-Out"
EndSection
Section "Screen"
Identifier "Screen0"
Device "GM45"
Monitor "LCD Panel"
DefaultDepth 24
SubSection "Display"
Modes "1280x800"
Viewport 0 0
Depth 24
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "GM45"
Monitor "VGA-Out"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
view raw xorg.conf hosted with ❤ by GitHub

Thursday, April 25, 2013

5.2 amd64 X200: Current experiences and dmesg.

Here's the dmesg for my (not so) new Lenovo Thinkpad X200. So far this is the current status:

- Thinkpad buttons working great like increase/decrease sound, mute/unmute sound, increase/decrease LCD brightness etc.
- intel GM45 display is working out of the box. Crisp 1280x800 automatically. Played some HD (720p) and (1080p) movies via mplayer and no stuttering unlike my K43U's radeon.
- LAN is working fine.
- Wireless LAN needs additional downloadable firmware iwn. Not tested yet but seems to be working.
- Trackpad is working, no touchpad in this model. Managed to get the scrolling function using Trackpad working using xorg.conf (Will upload this file later).
- Ultrabase docking is detected and working via acpidock. Eject button & function is working fine.
- Using apmd_flags="-A" is working great. Enhanced Speedstep working fine.
- SDCard Reader is working fine. Opened up my Lumix DMC GH-1 sdcard and can mount properly.

OpenBSD 5.2 (GENERIC.MP) #368: Wed Aug 1 10:04:49 MDT 2012
deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 2037059584 (1942MB)
avail mem = 1960521728 (1869MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version "6DET72WW (3.22 )" date 10/25/2012
bios0: LENOVO 745AU5L
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET SLIC BOOT ASF! SSDT TCPA SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4) USB0(S3) USB3(S3) USB5(S3) EHC0(S3) EHC1(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.42 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: apic clock running at 266MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz, 2394.00 MHz
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG,LAHF
cpu1: 3MB 64b/line 8-way L2 cache
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus -1 (EXP2)
acpiprt5 at acpi0: bus 5 (EXP3)
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpipwrres0 at acpi0: PUBS
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 104 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibat0 at acpi0: BAT0 model "42T4650" serial 8341 type LION oem "Panasonic"
acpibat1 at acpi0: BAT1 not present
acpiac0 at acpi0: AC unit offline
acpithinkpad0 at acpi0
acpidock0 at acpi0: GDCK not docked (0)
cpu0: Enhanced SpeedStep 2394 MHz: speeds: 2401, 2400, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x07
vga1 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x07
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 1 int 16
drm0 at inteldrm0
"Intel GM45 Video" rev 0x07 at pci0 dev 2 function 1 not configured
"Intel GM45 HECI" rev 0x07 at pci0 dev 3 function 0 not configured
puc0 at pci0 dev 3 function 3 "Intel GM45 KT" rev 0x07: ports: 1 com
com2 at puc0 port 0 apic 1 int 17: ns16550a, 16 byte fifo
com2: probed fifo depth: 15 bytes
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi, address 00:1f:16:0c:9d:56
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 21
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 22
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801I HD Audio" rev 0x03: msi
azalia0: codecs: Conexant CX20561
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801I PCIE" rev 0x03: msi
pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 "Intel 82801I PCIE" rev 0x03: msi
pci2 at ppb1 bus 3
iwn0 at pci2 dev 0 function 0 "Intel WiFi Link 5300" rev 0x00: msi, MIMO 3T3R, MoW, address 00:21:6a:18:0c:5c
ppb2 at pci0 dev 28 function 3 "Intel 82801I PCIE" rev 0x03: msi
pci3 at ppb2 bus 5
uhci3 at pci0 dev 29 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 16
uhci4 at pci0 dev 29 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 17
uhci5 at pci0 dev 29 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 18
ehci1 at pci0 dev 29 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 19
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x93
pci4 at ppb3 bus 13
pcib0 at pci0 dev 31 function 0 "Intel 82801IEM LPC" rev 0x03
ahci0 at pci0 dev 31 function 2 "Intel 82801I AHCI" rev 0x03: msi, AHCI 1.2
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, HITACHI HTS72323, EC2Z> SCSI3 0/direct fixed naa.5000cca6d5c57bed
sd0: 305245MB, 512 bytes/sector, 625142448 sectors
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x03: apic 1 int 23
iic0 at ichiic0
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
aps0 at isa0 port 0x1600/31
mtrr: Pentium Pro MTRR support
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (6dbd1ba38f84ab48.a) swap on sd0b dump on sd0b
view raw dmesg hosted with ❤ by GitHub

5.2 amd64 X200: Goodbye Asus K43U, hello Lenovo Thinkpad X200.

Hola. It's been quite some time since I last put anything in here. What's new? Well, I sold my Asus K43U laptop via mudah.my. The official warranty is still valid until October 2013, I upgraded the RAM to 8Gb, 500Gb HDD.

I posted the asking price of RM1000, then got an offer of RM850. The chap was desperate for a laptop as he told me his old laptop died on him. He insisted to test my laptop that night, when the time was around 18:00. He was a Windows XP guy, and as my K43U is dual-boot of OpenBSD & Win 7 x64, he kept on telling me what his "IT-guy" friend think about the instability of Win 7 64-Bit. I told him, for Windows, my fav was XP x64 before I had to install Win 7 x64 for my K43U because of the lack of device drivers, then after I tried Win 7, I never turn back to XP anymore.

Not to mention that I had to entertain his questions of how's the performance of AMD APU of my K43U, how it stack up with intel processors bla bla. I happily responded to all his queries until I felt it was taking too much of my time (I was out shopping with my family) and gave a respond "I think you better research what application you use then decide what type of laptop you want".

He said that he's interested in buying my K43U but can only give RM850 for it as there's another ads for that same price but with warranty until June 2013 with lower HDD capacity & RAM. Heck. What a comparison. But then, I need to sell the laptop. So I agreed. He want it urgently, but I need to get my hundred Gbs worth of data out from it first. He said ok.

After that my buddy called me, chat a bit, told him about me going to sell my lappy for RM850 and got a "Oh what didn't you tell me because I was looking to buy one" kind of answer. Yeah right. I even put the ads in my Facebook.

We met later that night, quite late. Around 22:00 I think. He wanted to test the machine at a cafe that have WiFi, and I gladly oblige. So we went to a restaurant with free WiFi access, he started to test the laptop. Asking me to play HD (720p) movie while he browse internet, working with a few MS Accel(?, what's the name of that MS Office spreadsheet program?), opening 2-3 batch of file transfer windows from his external drive into the laptop, while also watching HD youtube video. All while he's actively seeking a sign of slow-response or suffering from the laptop and talking about it.

In the end, the youtube video did stutter. Heck it's only AMD E-450 APU, a low-to-mid spec laptop. Not a "core i"bla bla machine! And he opened so many programs. He looked worried about the youtube video stuttering under heavy load, which then I asked him "Do you use the machine like this every time?" and "Can your previous laptop work under this load" and received a double "no" for answer. Case closed. I nearly bailed out from the deal as I have a buddy who's also interested in the lappy.

So then he paid me, I gave him the laptop + bag + receipts + manual + CDs + downloaded updated device drivers + box. And I remind him to utilise the warranty on any hardware issue. Then we parted ways.

The next day, I received a phone call by the chap. He's having problem with his external drive which have password. ARGHHHH! Told him to refer to the external drive's documentation as I don't use any. Then the next day he called me about the DVD-RW drive kept on resetting. By the symptoms described to me, probably device driver issue. I told him I never had any of the issues during the 1 year++ I spent my time with the laptop, so I told him to install whatever OS he desired and go to Asus service center on any hardware issue. To be honest, I was tired. Eventually the problem resolved by itself, to my relief. If not then I might take back the laptop and refund it as it's too much of a hassle.

Was it worth it now? Well, recently I used the money from the sale, add another RM50 and got myself a Lenovo Thinkpad X200 laptop + Ultrabase docking. The guy asked for Rm1000, got negotiated to RM900. intel P8600 2.4Ghz dual-core, 320Gb HDD and 2Gb RAM. We met near the guy's place, at a restaurant, I booted the machine, entered Win 7, shut it down then pay the money and left the place.

Why Thinkpad? Because I heard many OpenBSD devs uses Thinkpad. Then the replacement parts are plenty. Then the build quality is great. Along with Panasonic Toughbooks, Thinkpads are the models of laptop I don't mind having intel inside. Mind you I also considered AMD's version of Thinkpad Edge, but like other laptop makers, they make half-baked AMD machines that didn't do justice for AMD's great potentials.

I'll update my experiences on running OpenBSD with this X200, and I'll tell you something, the legend about Thinkpad's keyboard is true. And OpenBSD on X200 is a joy! Later.

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...