Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: asclepix on July 02, 2010, 10:10:46 AM

Title: Xorg and touchscreen
Post by: asclepix on July 02, 2010, 10:10:46 AM
Hello

I need to use a touchscreen with Tiny Core Linux 2.11.5

On my machine Xvesa is good, but "touch" mouse has X and Y axis inverted.
I try to load usbtouchscreen kernel module with swap_xy=1, but with no results.

So I think I need Xorg and evtouch_drv.so (using it I was able to use touchscreen under Ubuntu 8.04).

I've downloaded Xorg-7.4 and its deps. I log out to prompt and I install Xorg using tce-load -i Xorg-7.4.
When I start X using Xorg I obtain only a black screen, with no mouse and I can do nothing else.
If I try with "sudo Xorg -configure" and than "sudo Xorg -config corg.conf.new", but I have the same result.

Can anyone help me?

Thanks in advance
Title: Re: Xorg and touchscreen
Post by: Juanito on July 02, 2010, 10:25:43 AM
There a significant chance that you'll have to manually make a touch screen section in xorg.conf

As for the other problems, what does /var/log/Xorg.0.log say? Maybe you could google on "xorg.conf" and your graphics chipset for pointers.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 02, 2010, 10:30:48 AM
Yes, I need to modify xorg.conf, but I want to see Xorg on before modify xorg.conf.

How can I get /var/log/Xorg.0.log if I can't remove the black screen? I've tried to insert DontZap option in xorg.conf.new, but Ctrl-Alt-Backspace doesn't work
Title: Re: Xorg and touchscreen
Post by: Juanito on July 02, 2010, 11:05:27 AM
How can I get /var/log/Xorg.0.log if I can't remove the black screen? I've tried to insert DontZap option in xorg.conf.new, but Ctrl-Alt-Backspace doesn't work

You can symlink /var/log to somewhere permanent like a hd or usb stick
Title: Re: Xorg and touchscreen
Post by: asclepix on July 02, 2010, 11:43:46 AM
It seems a good idea, but on the next boot I have:

ls -l
ls: ./Xorg.0.log: Stale NFS file handle
ls: ./Xorg.0.log.old: Stale NFS file handle
total 0

What does it mean?? I've used /mnt/hda1/log and I do a "sudo chmod a+w /mnt/hda1/log"
Title: Re: Xorg and touchscreen
Post by: Juanito on July 02, 2010, 12:13:26 PM
It worked for me using a usb stick a couple of weeks back.

I started emelfm as root, copied /var/log to somewhere, deleted the original and then created the symlink - all with emelfm
Title: Re: Xorg and touchscreen
Post by: curaga on July 02, 2010, 12:17:00 PM
Use the -retro option to enable zapping in Xorg 7.4, or just change back to the terminal with ctrl-alt-f1 and kill X with ctrl-c.

The evtouch module isn't included, so you'll need to compile it.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 02, 2010, 04:55:14 PM
I'll try -retro option on Monday (until then I'm faraway from my test machine  :( )

thanks and good week end  ;)
Title: Re: Xorg and touchscreen
Post by: asclepix on July 05, 2010, 04:30:53 AM
Hi.

Xorg works, thanks to the -retro option.

I've tried a precompiled version of evtouch, but it says:
"module ABI major version (2) doesn't match the server's version (4)"

So, which is the best way to recompile evtouch?

I've installed compiletc and Xorg-7.4-dev, but it does'nt seem enough :-/
Title: Re: Xorg and touchscreen
Post by: curaga on July 05, 2010, 04:40:50 AM
7.4-dev is enough. IIRC evtouch is fairly old, so you should probably apply patches from Ubuntu or other distro that ships it.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 05, 2010, 05:29:59 AM
Yes, it's old :-(

Is it overcome by something else?

Why the  swap_xy=1 usbtouchscreen in kernel module doesn't work? Perhapse a module with rotation and calibration would be enough  :-\
Title: Re: Xorg and touchscreen
Post by: curaga on July 05, 2010, 05:45:50 AM
The evdev Xorg driver has invertX and invertY params. I don't think swap_xy does what you think it does, I believe it makes X coordinates go to Y axis and vice versa.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 05, 2010, 06:38:04 AM
Yes, it is what I need. In fact if I move my finger up and down the cursor goes right and left.

I've patched evtouch with some code find in Debian repository and now Xorg load the evtouch module, but I still have the axis rotated. I'll try again in the afternoon.
Title: Re: Xorg and touchscreen
Post by: curaga on July 05, 2010, 06:48:38 AM
OK, in that case is evtouch pointed to the usbtouchscreen device, and not a mouse one?
Title: Re: Xorg and touchscreen
Post by: asclepix on July 05, 2010, 09:41:43 AM
Good job! It works  :D!!

Many thanks!

How can I launch "Xorg -retro" as default X? (I've tried to modify /etc/sysconfig/Xserver, but it does't work).


I write here my xorg.conf. I hope it can be useful for someone else.

Section "InputDevice"
    Identifier "touchscreen"
    Driver "evtouch"
    Option "Device" "/dev/input/event4"
    Option "DeviceName" "touchscreen"
    Option "MinX" "225"
    Option "MinY" "165"
    Option "MaxX" "3905"
    Option "MaxY" "3980"
    Option "ReportingMode" "Raw"
    Option "Emulate3Buttons"
    Option "Emulate3Timeout" "50"
    Option "SendCoreEvents" "On"
    Option "SwapX" "On"
    Option "Rotate" "CCW"
EndSection

Section "InputDevice"
    Identifier "dummy"
    Driver "void"
    Option "Device" "/dev/input/mice"
EndSection

Section "ServerLayout"
   Identifier "defsult layout"
   InputDevice "touchscreen" "CorePointer"
   #InputDevice "dummy"
EndSection
Title: Re: Xorg and touchscreen
Post by: maro on July 05, 2010, 06:01:46 PM
I believe the X server configuration is controlled by '/usr/bin/xsetup.sh'. This contains the line XCOMMAND="$XSERVER -nolisten tcp &" (which controls the 'Xorg' parameters). Adding your option to that line should do the trick.

For the problem to ensure persistence I see two ways:
Whether the first option will work depends on the timely restoration of the changed file from the backup. I believe that 'xsetup.sh' gets called "late" enough during start-up so that it should work. If my assumption is wrong you still have the second option, which is sure to succeed.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 03:36:24 AM
I've modified xsetup.sh and it create a ~/.xsession with "/usr/local/bin/Xorg -retro -nolisten tcp &".
However if I launch startx I obtain a black screen and it is not possible to give more command (even CAPS LOCK doesn't turn on/off the relative keyboard led...)

Even if I launch only .xsession I obtain the black screen. On the other side, the only "/usr/local/bin/Xorg -retro -nolisten tcp &" from prompt works.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 03:53:55 AM
I suppose the problem is that I run out of memory. Is it possible?

In fact if I launch manually Xorg, then flwm_topside, then wbar, when I try to set a background Linux kill Xorg because there is no free memory.

If I don't set a background, but use aterm, the system freezes itself.
Title: Re: Xorg and touchscreen
Post by: curaga on July 06, 2010, 04:34:15 AM
How much ram is there? Any swap?
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 05:00:43 AM
I've got 128MB of RAM.
On boot 58MB is free. So I've decided for no swap.
After I install Xorg and its dependeces I've got only 9MB free  :(

How can I save RAM? Hybrid mode? If I understand correctly, this mode will not mount file in a loopback file and so I save RAM, is it right?

Other solutions?

Title: Re: Xorg and touchscreen
Post by: curaga on July 06, 2010, 05:16:33 AM
If you're going with no swap, the 3.x series is better at that due to ramzswap. Otherwise, yeah PPI would help.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 05:58:33 AM
I've tried to boot with local=hda2.
It seems great. When I load Xorg, TC put it on my disk, and I save RAM.

However, when I launch Xorg, it returns immediately, with no output neither a /var/log/Xorg.0.log file
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 06:32:43 AM
I suppose that not all the components of Xorg go in /usr/local.

Which is the right way to use PPI? where can I find documentation?

Thanks
Title: Re: Xorg and touchscreen
Post by: curaga on July 06, 2010, 07:04:08 AM
Docs on PPI/hybrid mode are a bit scarce. Core Concepts is the main doc.

startx filters errors out, anything if you launch Xorg manually?
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 08:34:42 AM
There's no message if I launch Xorg manually
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 09:07:42 AM
As you can guess I've got low hardware resources. My HD is in fact a Disk OnModule of 64 MB. When I install Xorg with "tce-load -i Xorg-7.4" I have a "Xorg-7.4.tcz: OK".
If I do a ll of /usr/local/bin then I see that I have a lot of file with 0 byte length.

So, now I'll try to find a DOM of 256 MB.
Title: Re: Xorg and touchscreen
Post by: curaga on July 06, 2010, 10:35:50 AM
I think it would be cheaper to use the normal tcz mode, and double the ram.
Title: Re: Xorg and touchscreen
Post by: asclepix on July 06, 2010, 11:32:11 AM
I don't know, but I have problem to find RAM while we have some 256MB DOM.

Now I've rebuilt everything with such a DOM. I have not understood why, but I have more free memory.

I've installed input-2.6.29.1-tinycore and Xorg-7.4 manually (before input-2.6.29.1-tinycore was installed on boot).
I have enough memory for run Xorg -retro (manually, not with startx), flwm_topside, wbar and setting a little image as background.

Then I've seen I have more than 40MB of free RAM, so I've installed xvkbd and qt-3.3.8b, because my software need that library. I am now able to test my software with touchscreen  :D :D

Ok, When I poweroff the machine every go away, but I now know it can work. I'll make it working automatically.

Thank you for your support.

Do you know why I have so many more free memory changing only the DOM?
Title: Re: Xorg and touchscreen
Post by: curaga on July 06, 2010, 11:35:32 AM
No, no idea :)