Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
s3c2440, Xorg-server, tslib & touchscreen -> won't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
Gucky_der_Mausbiber
Guru
Guru


Joined: 10 Apr 2005
Posts: 359
Location: Wetzlar, Hessen

PostPosted: Wed Jul 15, 2009 12:22 pm    Post subject: s3c2440, Xorg-server, tslib & touchscreen -> won't wo Reply with quote

Hello,

I've a problem with an embbeded-arm-device (s3c2440) and the attached 4-Wire-Touchscreen - it won't work with xorg-server and twm/matchbox as window-manager.

I will give you all information I have found about this problem and perhaps somebody can tell me what to do to get it working.
First of all two Download-Links to get datasheets of the device itself and the attached touchscreen:


To get gentoo running i used a 2GB sd-card with gentoo-rootfs. There are only few small problems to get it working, so after a few days i see gentoo booting on the touchscreen - very nice. :D

Next step was to compile and install the X-Window-System on the device.
So, i emerged "xorg-server" with the USE-Flag "tslib"
Code:
USE="tslib" emerge -av xorg-server
and with
Code:
INPUT_DEVICES="tslib"
in the "/etc/make.conf" ... damm, it takes about 6 hours to compile xorg-server on the 400MHz device (cross-compiling X doesn't work), and altogether (all other packages) it takes about 12 hours to compile the entire xorg-server ... but after all, it works.

I tested the X-Windows with "startX"-command ... X is comming up and running twm als window-manager.
Perfect for the first days of work. :D

Okay, now i want to see if the touchscreen works in X & twm, so i tried to select an window in twm with touching the display - nothing. Tried to move the mouse with touching the display - nothing.
So I tried another window-manager, called "matchbox" (special wm for small-devices). But after a sucessfull start the touchscreen doesn't work. Matchbox itself will run fine.

Okay, bad, touchsreen doesn't work "out-of-the-box". :(

So, i googled the web about tslib, 4-wire-touchscreens and xorg-server (because matchbox is altough using X-Window-System) and found some interesting things.

First was to apply "/dev/input/ts" with "mknod" , seems to be a kind of symlink from "/sys/devices/virtual/input/input0". After this, I export 5-6 tslib-variables so that tslib knows which interface to use and where the conf-file is saved.

First test was an simple
Code:
cat /dev/input/ts
if i touch the display know, there appears different kinds of characters. Fine, seems to work. :D

Next I want to calibrate my touchscreen
Code:
ts_calibrate /etc/ts.calib
Now a black screen appears with a cross alternating in each corner. Afters touching the crosses the tool quit sucessfully.

So, i can say, touchscreen is working, and tslib has recognized the touchscreen and works with it. :D

After this I tried to start twm/matchbox again to see if the touchscreen is working now (because tslib works fine now and USE-Flags are set), but nothing. In both wm's (matchbox/twm) the touscreen do not reacted on any inputs.

So, I don't know what i did wrong?
I use the tslib and it seems to work great. I put in the tslib USE-Flag and set "tslib" as an input_device in the make.conf. I calibrated my touchscreen sucessfully with tslib-tool. But in my wm's, nothings works. :(

Here are now some technical infos about the device, first an extract of the dmesg, showing that the kernel recognized the touchscreen
Code:
s3c2410 TouchScreen successfully loaded
input: s3c2410 TouchScreen as /devices/virtual/input/input0


here is a look at the input-devices
Code:

mini2440 ~ # cat /proc/bus/input/devices
I: Bus=0013 Vendor=dead Product=beef Version=0101
N: Name="s3c2410 TouchScreen"
P: Phys=
S: Sysfs=/devices/virtual/input/input0
U: Uniq=
H: Handlers=event0
B: EV=b
B: KEY=0
B: ABS=1000003



PS: If i try to auto-configure the xorg-conf with "Xorg -configure" it ends up with an error "No devices found", so i must use the internal-autobuild xorg.conf. But i don't know how to create a xorg.conf for that device "by-hand", because i don't what to fill in for the graphic-device or the screen-section.
_________________
intel quad core, nvidia 8800gts, intel hd audio+sb live, gnome 2.24
Back to top
View user's profile Send private message
dmmgentoo
n00b
n00b


Joined: 16 Jun 2002
Posts: 38

PostPosted: Fri Jul 31, 2009 12:26 am    Post subject: Reply with quote

I have the same development board (Mini 2440), and have also installed Gentoo on it. Except, mine has the 3.5" touchscreen. I need the 320x200 mode. I used xorgconfig, and selected "Linux frame buffer device" for my video driver. Maybe you could share some hints about how to set up xorg.conf, or maybe post your xorg.conf file. Seems it can't get the correct mode for 320x200, as xorg.conf doesn't have an option for that mode. Otherwise, Gentoo runs just fine.

I also used a 2GB SD Card. Initially, I tried using an 8GB, but mmcinit would error out every time. For compiling, I bought an external USB hard drive, and created two Linux partitions, ext3: one is mounted on /usr/portage, the other on /var/tmp. I had a large swap partition (like 50GB) on that same USB drive, and the Linux kernel was able to swap from it just fine. From the "mini2440#" uboot prompt, I could not get "usb start" to recognize the external drive. So mounting a root partition from a USB hard drive will probably not work.

I did nothing special, other than to create an ext2 partition on the SD card, and untar the stage3 tarball to it. Since there was no dhcp client, I copied one from the Debian Grip distribution to /sbin. IMO they really ought to include a dhcp client in the stage3 tarball. It seems like a bad decision to omit this.

BTW, I tried to get startx to work, but I need to tweak in a 320x200 mode. The console text is readable, but it would be nice to be able to rotate the console text 90 degrees in order to increase column width at the expense of the number of rows. Luckily, "less" has that "scroll to the right" feature, handy for viewing the ifconfig and modprobe -l output.

When I get setup at my other computer, I'll post more details.

BTW, have you tried running "qemu"? I don't think all the mini 2440 functionality is there yet, so I'm looking forward to that day long recompile of Xorg in order to get tslib working. :) But first, I need to get my 320x200 working. xorgcfg and X -configure will not work with fbdev AFAIK.

The kernel I am running is from the GIT repository. I see ext3 is the default filesystem, so I had to hand-edit my Linux kernel configuration file to include

Code:

CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=m


According to http://code.google.com/p/mini2440/wiki/Emdebian, they suggest using ext3 on the SD card, but that doesn't make sense to me. Maybe it's OK if the wear leveling is able to move the journal around, but I'd think that ext2 mounted noatime or maybe "noatime,async" would be the best choice for running a root filesystem on SD.

I'm moving my LInux installation to a different computer. Once I'm finished getting set up, I will play around more with the mini 2440, and post my Xorg.0.log.

So did you use NFS to do your compiling or an external USB hard drive? I've noticed that when I plug in my hard drive with the board on, the high inrush current (if that is the cause) causes the board to reset. If I plug in the hard drive first and THEN power on, the hard drive works out. Hard drive access causes my screen to flicker.

More details coming...
Back to top
View user's profile Send private message
sera
Retired Dev
Retired Dev


Joined: 29 Feb 2008
Posts: 1017
Location: CET

PostPosted: Fri Jul 31, 2009 7:36 am    Post subject: Reply with quote

If input devices are working in terminal but not in X the first thing to try is to add hald and dbus to the default runlevel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum