Topic: Debian Squeeze on Chumby8

Hey all,

I am trying to get Debian squeeze on a Chumby8 running off an SD card.

I started with these instructions
http://forum.chumby.com/viewtopic.php?id=6411

I have got to the point where I have X11 running but I can't get ts_calibrate to run correctly

using these TSLIB environment variables:

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/ttyS0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal

with this ts.conf

# Uncomment if you wish to use the linux input layer event interface
#module_raw input

# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
#module_raw collie

# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
#module_raw corgi

# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00

# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600

# Uncomment if you're using a Hitachi Webpad
# module_raw mk712

# Uncomment if you're using an IBM Arctic II
# module_raw arctic2

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

and this /etc/X11/xorg.conf

Section "Device"
    Identifier    "Chumby Video Device"
    Option        "UseFBDev"        "true"
    Driver        "fbdev"
        #Option        "fbdev"   "/dev/fb0"
EndSection

Section "InputDevice"
        Identifier      "Touchscreen"
        Driver          "tslib"
        Option          "CorePointer"           "true"
        Option          "SendCoreEvents"        "true"
        Option          "TslibDevice"           "/dev/input/event0"
        Option          "Protocol"              "Auto"
        Option          "Width"                 "800"
        Option          "Height"                "600"
         #Option          "EmulateRightButton"    "1"
EndSection

Section "ServerLayout"
        Identifier      "Base layout"
        Screen          "Chumby Screen"
        InputDevice     "Touchscreen"
EndSection

Section "Monitor"
        Identifier      "Chumby Monitor"
        DisplaySize 600 800
EndSection

Section "Screen"
        Identifier      "Chumby Screen"
        Device          "Chumby Video Device"
        Monitor         "Chumby Monitor"
EndSection

I get these results

Couldnt load module input
No raw modules loaded.
ts_config: Success

and in case it helps here is what I get with startx:

root@chumby:/# startx

X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.32 armv5tel Debian
Current Operating System: Linux chumby 2.6.28-M2.1.8.12 #5 Thu Jul 7 13:09:56 PDT 2011 armv5tejl
Kernel command line: root=/dev/mmcblk0p2 rootfstype=ext3 rootwait console=ttyS0,115200 mem=128M uart_
dma init=/linuxrc sysrq_always_enabled brandnum=1000 ro logo.brand=chumby
Build Date: 30 October 2011  09:07:45PM
xorg-server 2:1.7.7-14 (Julien Cristau <jcristau@debian.org>) 
Current version of pixman: 0.16.4
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Apr  3 02:27:10 2012
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(EE) FBDEV(0): FBIOBLANK: Invalid argument
SELinux: Disabled on system, not enabling in X server
ts_open failed (device=(null))
(EE) PreInit returned NULL for "Touchscreen"
(EE) FBDEV(0): FBIOBLANK: Invalid argument

(matchbox-desktop:1534): GLib-GObject-CRITICAL **: g_type_class_add_private: assertion `private_size > 0' failed

I thought it may be the patch that was previously needed in Lenny (the min screen size was hardcoded to 1024) but looking at the source it seemed to be patched in the latest version from apt-get

Any help is appreciated - trying to get openFrameworks (http://openFrameworks.cc) going on the device as we have a few of these smile

Re: Debian Squeeze on Chumby8

You're almost there -- I have such a setup running.
  Fix the plugin path:
export TSLIB_PLUGINDIR=/usr/lib/ts0 line (add the 0)
Fix the  option:
Option          "Device"                "/dev/input/event0"
Or better yet, use the id (event# may change under some conditions)
Option          "Device"                "/dev/input/by-id/soc-noserial-event-ts"
I use tty0 for the console (not sure that matters)
export TSLIB_CONSOLEDEVICE=/dev/tty0
Added kb to serverlayout and someoptions (again not sure they're needed)
Section "ServerLayout"
        Identifier      "Base layout"
        Screen          "Chumby Screen"
        InputDevice     "Touchscreen"
        InputDevice     "Generic Keyboard"
EndSection

Section "ServerFlags"
        Option          "BlankTime"     "0"
        Option          "StandbyTime"   "0"
        Option          "SuspendTime"   "0"
        Option          "OffTime"       "0"
         Option          "AutoAddDevices"  "false"
EndSection

The ts_calibrate runs without X, so that should be tested first.
Good Luck

Re: Debian Squeeze on Chumby8

thanks kcsaychum! I just got this as I had a forgotten filter for chumby email smile

I actually got ts_calibrate working shortly after posting (of course) I think with the TSLIB_PLUGINDIR=/usr/lib/ts0 fix

However I kept going and hosed something on the way sad

So I am trying again tonight (also trying to keep better notes)

So far I had no luck with tslib from apt-get but I did get ts_calibrate to work with the version of tslib on github(https://github.com/kergoth/tslib)  with this config

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CALIBFILE=/etc/pointercal

/usr/lib/ts0 segfaults for some reason with this version

Re: Debian Squeeze on Chumby8

Ok - now ts0 no longer segfaults it was this fix

http://gentoo.mindzoo.de/index.cgi/wiki/X
Q: Xorg complains that "ts_open failed (device=(null))" even though Option "TslibDevice?" is set
A: Some HAL patch renamed "TslibDevice?" to just "Device" recently. Just change the line in xorg.conf contrary to what man tslib says (for example Option "Device" "/dev/input/event1") and you're good to go.

going to shut up for  a while - keeping notes here
http://piratepad.net/quaszPHMSg

Re: Debian Squeeze on Chumby8

@kcsaychum

Ok - I had this working for a while but something has gone astray as I can't successfully run ts_calibrate anymore sad

If I run ts_calibrate without using first using "rmmod silvermoon_tsb" I  get "Segmentation fault".

I am guessing this is because something still is using /dev/input/by-id/soc-noserial-event-ts

If I DO run rmmod silvermoon_tsb I get "No such device". I am guessing this is because "mmod silvermoon_tsb" makes "/dev/input/by-id/soc-noserial-event-ts" go away (confirmed with ls)

Sort of a chicken/egg problem

Re: Debian Squeeze on Chumby8

ok - restarted the process this gets me to where ts_calibrate works - apparently I need to stay away from rmmod silvermoon_tsb

#4GB SD card/Mint 11

sudo apt-get install debootstrap 
mkdir ~/debian-armel-bootstrap
sudo debootstrap --foreign --arch armel squeeze ~/debian-armel-bootstrap
cd ~/debian-armel-bootstrap
sudo tar cvzf ../debian-armel-bootstrap.tar.gz *


ssh root@192.168.200.15
/usr/chumby/scripts/stop_control_panel
cd /mnt/sd



cp -a /dev/fb* /mnt/sd/dev/ 
cp -a /dev/tty* /mnt/sd/dev/
cp -a /dev/pts* /mnt/sd/dev/
mkdir -p /mnt/sd/dev/input/
cp -a /dev/input/* /mnt/sd/dev/input/

mount -o bind /proc /mnt/sd/proc 
mount -o bind /sys /mnt/sd/sys 
mount -o bind /dev/pts /mnt/sd/dev/pts 
chroot /mnt/sd /bin/hostname chumby
chroot /mnt/sd /bin/bash

root@chumby:/# nano /etc/resolv.conf

domain home
search home
nameserver 192.168.200.1
nameserver 8.8.8.8
nameserver 4.2.2.1

root@chumby:/# nano /etc/apt/sources.list
deb http://ftp.us.debian.org/debian squeeze main contrib
deb-src http://ftp.us.debian.org/debian squeeze main contrib
deb http://backports.debian.org/debian-backports squeeze-backports main

apt-get update
apt-get install git 
apt-get install autotools-dev
apt-get install automake g++ 
apt-get install libtool  make

root@chumby:/# cd
root@chumby:~# mkdir DEPS  
root@chumby:~# cd DEPS/
root@chumby:~/DEPS# git clone git://github.com/kergoth/tslib.git
root@chumby:~/DEPS# cd tslib/
root@chumby:~/DEPS/tslib# ./autogen.sh 
root@chumby:~/DEPS/tslib# ./configure --enable-debug --enable-static --prefix=/usr
root@chumby:~/DEPS/tslib# make
root@chumby:~/DEPS/tslib# make install 



touch /usr/etc/pointercal

export DISPLAY=:0.0
export TSLIB_TSDEVICE=/dev/input/by-id/soc-noserial-event-ts
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CONSOLEDEVICE=/dev/tty
export TSLIB_CONFFILE=/usr/etc/ts.conf
export TSLIB_CALIBFILE=/usr/etc/pointercal



nano /usr/etc/ts.conf

# Uncomment if you wish to use the linux input layer event interface
module_raw input

# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
# module_raw collie

# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
# module_raw corgi

# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00

# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600

# Uncomment if you're using a Hitachi Webpad
# module_raw mk712

# Uncomment if you're using an IBM Arctic II
# module_raw arctic2

module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

CTRL+D

cp -a /dev/fb* /mnt/sd/dev/ 
cp -a /dev/tty* /mnt/sd/dev/
cp -a /dev/pts* /mnt/sd/dev/
mkdir -p /mnt/sd/dev/input/
cp -a /dev/input/* /mnt/sd/dev/input/

cp -a /dev/fb* /mnt/sd/dev/ 
cp -a /dev/tty* /mnt/sd/dev/
cp -a /dev/pts* /mnt/sd/dev/
mkdir -p /mnt/sd/dev/input/
cp -a /dev/input/* /mnt/sd/dev/input/
mount -o bind /proc /mnt/sd/proc 
mount -o bind /sys /mnt/sd/sys 
mount -o bind /dev/pts /mnt/sd/dev/pts 
chroot /mnt/sd /bin/hostname chumby
chroot /mnt/sd /bin/bash

root@chumby:/# ts_calibrate
Loading module input
Loading module pthres
Loading module variance
Loading module dejitter
Loading module linear
Linear calibration constants: 1 0 0 0 1 0 1 
xres = 800, yres = 600
RAW---------------------> 232 801 2014 161.940079
TS_READ_RAW----> x = 232, y = 801, pressure = 2014
RAW---------------------> 234 802 1989 162.87
TS_READ_RAW----> x = 234, y = 802, pressure = 1989
RAW---------------------> 0 0 0 162.30054
TS_READ_RAW----> x = 0, y = 0, pressure = 0
Took 2 samples...
Top left : X =  233 Y =  801
RAW---------------------> 848 803 1615 163.410215
TS_READ_RAW----> x = 848, y = 803, pressure = 1615
RAW---------------------> 846 802 1583 163.470075
TS_READ_RAW----> x = 846, y = 802, pressure = 1583
RAW---------------------> 845 800 1510 163.530076
TS_READ_RAW----> x = 845, y = 800, pressure = 1510
RAW---------------------> 0 0 0 163.560052
TS_READ_RAW----> x = 0, y = 0, pressure = 0
Took 3 samples...
Top right : X =  846 Y =  802
RAW---------------------> 845 261 1733 164.740077
TS_READ_RAW----> x = 845, y = 261, pressure = 1733
RAW---------------------> 846 257 2054 164.800074
TS_READ_RAW----> x = 846, y = 257, pressure = 2054
RAW---------------------> 849 256 1987 164.860075
TS_READ_RAW----> x = 849, y = 256, pressure = 1987
RAW---------------------> 0 0 0 164.870068
TS_READ_RAW----> x = 0, y = 0, pressure = 0
Took 3 samples...
Bot right : X =  846 Y =  257
RAW---------------------> 214 267 1634 165.820075
TS_READ_RAW----> x = 214, y = 267, pressure = 1634
RAW---------------------> 214 264 1682 165.880073
TS_READ_RAW----> x = 214, y = 264, pressure = 1682
RAW---------------------> 0 0 0 165.940054
TS_READ_RAW----> x = 0, y = 0, pressure = 0
Took 2 samples...
Bot left : X =  214 Y =  265
RAW---------------------> 517 554 1503 166.820075
TS_READ_RAW----> x = 517, y = 554, pressure = 1503
RAW---------------------> 517 554 1534 166.880068
TS_READ_RAW----> x = 517, y = 554, pressure = 1534
RAW---------------------> 517 550 1507 166.940077
TS_READ_RAW----> x = 517, y = 550, pressure = 1507
RAW---------------------> 517 544 1470 167.79
TS_READ_RAW----> x = 517, y = 544, pressure = 1470
RAW---------------------> 0 0 0 167.10212
TS_READ_RAW----> x = 0, y = 0, pressure = 0
Took 4 samples...
Center : X =  517 Y =  552
-186.864258 1.123368 -0.018432
797.806213 -0.006008 -0.923823
Calibration constants: -12246336 73621 -1207 52285028 -393 -60543 65536