Hey everyone,
I have an unusual issue with two touchscreen based MD's. One of them uses a penmount panel (with latest 8.10 ubuntu drivers) and the other is a TSHARC panel (again with latest drivers)
The issue is the following, If I boot the MD's into the orbiter (either with reboot, or by a a killall xinit && /usr/pluto/bin/Start_X.sh command) the touch screens will not function properly unless I touch the panel the moment X starts before the oribiter starts to load. As long as I register a click before the orbiter appears they work fine... but I haven't been able to figure out why...
Anyone have any thoughts and or ideas on a workaround (maybe script that simulates a click event before the orbiter loads??)
Thanks
~jw
I expect some sort of modprobe would handle it.
Not sure what specifically to probe or where to probe it.
Solved:
Problem was the savage driver on the penmount display, I changed in xorg.conf under "Device" section
Section "Device"
Driver "savage"
# ...
Option "SWcursor" "on" # [<bool>]
Option "HWCursor" "off"
# ...
EndSection
Forcing it to use the SW cursor fixes the problem with the penmount panel.... EDIT: No it doesn't... it just makes sure the cursor is under my finger when I touch the screen, the issue of having to touch the panel before the orbiter loads is still there...
On the TSHARC panel, the issue was actually that modprobe (thx l3mce for the advice to look into this :) ), or more specifically KMS was detecting a monitor port that didn't exist, and hence cycling a connect/disconnect from a monitor that didn't exist. (The chipset supports the extra VGA output, but the panel computer doesn't have an actual VGA out port on it, this is actually a bug in the intel driver used in ubuntu 810). But either way to circumvent the issue I added the following to xorg.conf
Section "Monitor"
Identifier "foo"
Option "Ignore" "true"
EndSection
Section "Device"
#...
Driver "intel"
#...
Option "monitor-VGA" "foo"
Option "monitor-LVDS" "Monitor0"
#...
EndSection
The "Ignore" directive tells xorg not to load the monitor into xrandr, and hence it won't attempt to detect any dynamic connect/disconnect events on that monitor, which is assigned to the "monitor-VGA" output of the chip.
Now xrandr only outputs the LVDS monitor as being present... SUCCESS!!
Thanks,
~jw
Jwelch:
What kind of touchscreen controller does it have,... an internal PS/2 serial or USB???
Also, could you post your xorg.conf???
With serial touchscreen controllers in some newer versions of Linux, there is a problem with the /udev system grabbing the serial port for a mouse pointer. I'm not so convinced that that is the problem with a system based on Ubuntu 8.10. Another issue is that some of the touch drivers want to be primary. that would be set in the mouse pointer area of your xorg.conf.
As far as doing a modprobe or insmod, etc., is that most of the driver installation scripts will do that for you...
Please post the text file output of the command:
lsmod > installed_modules.txt
Thanks,...
Quote from: jwelch1324 on February 28, 2012, 12:32:04 AM
Solved:
...
The "Ignore" directive tells xorg not to load the monitor into xrandr, and hence it won't attempt to detect any dynamic connect/disconnect events on that monitor, which is assigned to the "monitor-VGA" output of the chip.
Now xrandr only outputs the LVDS monitor as being present... SUCCESS!!
Thanks,
~jw
I was a little late with my help...
Glad you fixed it.
JaseP,
Actually the problem wasn't completely solved as I previously thought, it turns out on reboot, the penmount device still wasn't working without first touching the screen prior to the orbiter loading.
So to answer some of your questions,
The interface is serial, on /dev/ttyS2
the output from lsmod doesn't have any kernel modules for the penmount device loaded (it is only loaded as module by Xorg), but just for the sake of curiosity in case it gives you some insight as to the source of the issue here is the lsmod output
root@moon158:~# lsmod
Module Size Used by
sco 18308 2
bridge 56980 0
stp 10628 1 bridge
bnep 20352 2
rfcomm 44432 0
l2cap 30464 6 bnep,rfcomm
bluetooth 62180 6 sco,bnep,rfcomm,l2cap
nfsd 231024 13
auth_rpcgss 42528 1 nfsd
exportfs 12544 1 nfsd
ppdev 15748 0
lp 17156 0
autofs4 27780 1
ipv6 264356 10
longhaul 17896 0
cpufreq_stats 13188 0
cpufreq_powersave 9856 0
cpufreq_ondemand 14988 1
freq_table 12672 3 longhaul,cpufreq_stats,cpufreq_ondemand
cpufreq_conservative 14600 0
cpufreq_userspace 11396 0
container 11520 0
ac 12292 0
video 25488 0
output 11008 1 video
pci_slot 12680 0
sbs 19464 0
sbshc 13440 1 sbs
wmi 14504 0
battery 18436 0
joydev 18368 0
evdev 17696 4
button 14224 0
i2c_viapro 15764 0
i2c_core 31892 1 i2c_viapro
pcspkr 10624 0
parport_pc 39332 1
shpchp 38036 0
via_agp 16256 1
pci_hotplug 34976 1 shpchp
parport 42604 3 ppdev,lp,parport_pc
via686a 21004 0
agpgart 42184 1 via_agp
af_packet 25856 0
nfs 269416 2
lockd 71976 2 nfsd,nfs
nfs_acl 11264 2 nfsd,nfs
sunrpc 196960 23 nfsd,auth_rpcgss,nfs,lockd,nfs_acl
usbhid 35712 0
hid 50560 1 usbhid
sd_mod 42392 0
crc_t10dif 9984 1 sd_mod
sg 39732 0
ata_generic 12932 0
pata_acpi 12160 0
pata_via 16260 0
libata 178336 3 ata_generic,pata_acpi,pata_via
uhci_hcd 30864 0
8139too 31616 0
floppy 64644 0
scsi_mod 155468 3 sd_mod,sg,libata
8139cp 27520 0
mii 13440 2 8139too,8139cp
usbcore 149616 3 usbhid,uhci_hcd
dock 16656 1 libata
raid10 30464 0
raid456 135184 0
async_xor 11520 1 raid456
async_memcpy 10112 1 raid456
async_tx 15312 3 raid456,async_xor,async_memcpy
xor 23688 2 raid456,async_xor
raid1 30080 0
raid0 15488 0
multipath 15104 0
linear 13440 0
md_mod 94108 6 raid10,raid456,raid1,raid0,multipath,linear
thermal 23708 0
processor 42156 2 thermal
fan 12548 0
nbd 19088 0
fuse 60956 1
fbcon 47648 0
tileblit 10880 1 fbcon
font 16512 1 fbcon
bitblit 13824 1 fbcon
softcursor 9984 1 bitblit
My xorg.conf is
Section "ServerLayout"
Identifier "XFree86 Configured"
Screen 0 "Screen0" 0 0
# InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Penmount" "CorePointer"
EndSection
Section "Files"
# RgbPath "/usr/X11R6/lib/X11/rgb"
ModulePath "/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/CID/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "record"
Load "xtrap"
Load "speedo"
# Load "type1"
Load "glx"
Load "int10"
Load "v4l"
Load "dri"
# Load "penmount"
EndSection
#Section "InputDevice"
# Identifier "Mouse0"
# Driver "void"
# Option "Device" "/dev/input/mice"
#EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "XkbLayout" "us"
Option "XkbVariant" "basic"
Option "XkbModel" "pc105"
EndSection
Section "InputDevice"
Identifier "Penmount"
Driver "penmount"
Option "Device" "/dev/ttyS2"
Option "Protocol" "PM9000"
Option "BaudRate" "19200"
Option "ADBit" "10"
Option "ConfigFile" "/etc/penmount.dat"
Option "Button2" "3" # 1=left, 2=middle, 3=right
Option "PenDownMode" "0" # 0=stream mode, 1=point mode
Option "HoldTime" "2000" # how long ms to launch the 2nd button
Option "ScreenScale" "0" # screen scale enable/disable
Option "LockWindowRange" "32" # range for press and hold
Option "CalibHoldTime" "1000" # hold time for calibration
Option "XMinOffset" "10" # edge compensation
Option "XMaxOffset" "10"
Option "YMinOffset" "10"
Option "YMaxOffset" "10"
Option "StdXMin" "30" # standard calibration
Option "StdXMax" "990"
Option "StdYMin" "30"
Option "StdYMax" "990"
Option "Beep" "1" # 0=off, 1=down, 2=up, 3=down+up
Option "PressVol" "100" # 0 = slience
Option "PressPitch" "880" # freq. (Hz)
Option "PressDur" "15" # duration (1~255)
Option "ReleaseVol" "0" # 0 = slience
Option "ReleasePitch" "1200" # freq. (Hz)
Option "ReleaseDur" "10" # duration (1~255)
Option "AveragePoint" "0" # average point (0,4,8)
Option "Rotation" "1" # rotation (1,2,4,8)
Option "RandR" "0" # RandR enable/disable)
Option "DebugLevel" "0" # debug
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown Monitor Vendor"
ModelName "Unknown Monitor Model"
HorizSync 20-500
VertRefresh 59-61
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
### [arg]: arg optional
#Option "NoAccel" # [<bool>]
Option "SWcursor" "on" # [<bool>]
Option "HWCursor" "off"
#Option "ColorKey" # <i>
#Option "CacheLines" # <i>
#Option "Dac6Bit" # [<bool>]
#Option "DRI" # [<bool>]
#Option "NoDDC" # [<bool>]
#Option "ShowCache" # [<bool>]
#Option "XvMCSurfaces" # <i>
Identifier "Card0"
Driver "savage"
VendorName "Unknown Vendor Name"
BoardName "Unknown Board Name"
Option "LinearAlloc" "16384"
#BusID "PCI:0:2:0"
# Option "NoDDC" "true"
Option "XvmcUsesTextures" "true"
Option "renderAccel" "true"
Option "NoDDCValue"
Option "UseEDID" "true"
Option "ExactModeTimingsDVI" "true"
Option "NoLogo" "true"
Option "NoBandWidthTest" "true"
Option "ModeValidation" "NoDFPNativeResolutionCheck, NoEdidMaxPClkCheck, NoMaxPClkCheck, AllowInterlacedModes, AllowNon60HzDFPModes, NoEdidModes"
Option "DynamicTwinView" "false"
Option "UseEvents" "true"
Option "ConnectedMonitor" "CRT"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Modes "640x480"
Virtual 640 480
EndSubSection
Option "XvmcUsesTextures" "true"
Option "renderAccel" "true"
Option "NoDDCValue"
Option "UseEDID" "true"
Option "ExactModeTimingsDVI" "true"
Option "NoLogo" "true"
Option "NoBandWidthTest" "true"
Option "ModeValidation" "NoDFPNativeResolutionCheck, NoEdidMaxPClkCheck, NoMaxPClkCheck, AllowInterlacedModes, AllowNon60HzDFPModes, NoEdidModes"
Option "DynamicTwinView" "false"
Option "UseEvents" "true"
Option "TVStandard" "640x480 (4:3)"
EndSection
Section "ServerFlags"
Option "AllowEmptyInput" "true"
Option "AllowMouseOpenFail" "true"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
Option "AIGLX" "Off"
Option "AutoAddDevices" "False"
EndSection
Section "Extensions"
Option "RENDER" "true"
EndSection
I added the lines "AllowEmptyInput" and "AutoAddDevices" since in my Xorg log it was attempting to add a default pointer even though I had one setup. I thought this might be the issue... sadly it didn't help.
What I do notice that is odd (or maybe not?) is in the Xorg log it looks like it is adding the penmount device twice
(II) penmount: PreInit
(**) Option "CorePointer"
(**) Penmount: always reports core events
(**) Option "XMinOffset" "10"
(**) Option "XMaxOffset" "10"
(**) Option "YMinOffset" "10"
(**) Option "YMaxOffset" "10"
(**) Option "StdXMin" "30"
(**) Option "StdXMax" "990"
(**) Option "StdYMin" "30"
(**) Option "StdYMax" "990"
(**) Option "ScreenScale" "0"
(**) Option "Rotation" "1"
(**) Option "RandR" "0"
(**) Option "AveragePoint" "0"
(**) Option "Beep" "1"
(**) Option "PressVol" "100"
(**) Option "PressPitch" "880"
(**) Option "PressDur" "15"
(**) Option "ReleaseVol" "0"
(**) Option "ReleasePitch" "1200"
(**) Option "ReleaseDur" "10"
(**) Option "HoldTime" "2000"
(**) Option "CalibHoldTime" "1000"
(**) Option "LockWindowRange" "32"
(**) Option "Button2" "3"
(**) Option "PenDownMode" "0"
(**) Option "ADBit" "10"
(**) Option "DebugLevel" "0"
(**) Option "ConfigFile" "/etc/penmount.dat"
(II) penmount chip : 9000
(**) Option "Device" "/dev/ttyS2"
(**) Option "BaudRate" "19200"
(**) Option "StopBits" "1"
(**) Option "DataBits" "8"
(**) Option "Parity" "None"
(**) Option "Vmin" "3"
(**) Option "Vtime" "1"
(**) Option "FlowControl" "None"
This one contains all the proper options as set in the xorg.conf file. However just a few lines below that
(II) evaluating device (Penmount)
(II) XINPUT: Adding extended input device "Penmount" (type: TOUCHSCREEN)
(II) penmount: min_x=0, max_x=2047, min_y=0, max_y=2047
(**) Option "Device" "/dev/ttyS2"
(**) Option "BaudRate" "19200"
(**) Option "StopBits" "1"
(**) Option "DataBits" "8"
(**) Option "Parity" "None"
(**) Option "Vmin" "3"
(**) Option "Vtime" "1"
(**) Option "FlowControl" "None"
Which doesn't contain all the necessary options (like the calibration file for example). I am not sure if this is normal and XINPUT is just evaluating the device after the server has loaded all the config data, or if it is actually trying to add it as a second device. The fact that I have AutoAddDevices turned off suggests that it is normal behavior but nonetheless the issue is still there. I have to touch the screen before the orbiter progressbar finishes filling up for it to work properly.
Another thing to note is that once I get the touchscreen working properly, I can run killall xinit && /usr/pluto/bin/Start_X.sh and not have to do anything and the touchscreen works fine. It's only if I reboot that the problem shows up again.
Any thoughts are much appreciated...
Can you post to me the contents of the ReadMe file and the install script that came with the penmount driver???
Note:
I found this,... use at your own risk;
https://launchpad.net/ubuntu/intrepid/i386/xserver-xorg-input-penmount/1:1.3.0-1build1
I'm not sure if the build is compatible or provides anything better than what you can get in the Intrepid repositories.
There's also Penmount's download page, which appears to be more up-to-date drivers,...
http://www.penmount.com/Download/Driver/PenMount/
Again, I'm not sure if you want to try them, or just plow through the documentation for clues on how to fix your problem.
I am using the Driver for Ubuntu 8.10 from the penmount site. The xorg-input package I tried as well it doesn't work period (i am not sure if there is a discrepancy in the xorg version used by LMCE and the one in the official 8.10 release. Though I can't imagine why it would be)
I will look through all the documentation and see if i can find something about it... I really think it is coming down the SDL renderer used by the orbiter. Because if I reboot the MD and let it load without touching the screen the mouse gets stuck on the left side of the screen. If I then kill xserv and restart it using the pluto script (again without touching the screen) it still gets stuck.
However, if I kill the xserv and then do a normal startx to boot into KDE it works fine.
Furthermore, if I start the MD, touch the screen before the orbiter finishes loading, then kill the xserv and restart using the pluto script it still works fine. However if I then do a quick reload on the router and let it load without touching the screen, it goes back to having the cursor stuck to the left side of the screen.
Most odd...
I was thinking of looking at the padorbiter source to see how it is configured since it uses a penmount screen as well, but can't find it anywhere in the SVN (perhaps it isn't public?).
Do me a favor and do an lsmod 1st when it's working and then when it isn't...
I'm thinking that you will eventually have to force the penmount driver to load as part of the init script... but I would really like to see the difference between the running modules in the two instances...
Attached is the lsmod output when it is working and when it is not working... sadly they appear to be the same (#diff lsnotworking.txt lsworking.txt gives no changes). The penmount module is not loaded as a kernel module, the driver package from the penmount site doesn't include a kernel module.
I did find a way around the router reload issue, though its a nasty hack. I essentially cron the following script to run every minute to see if there was a request from the router to reload.
#!/bin/bash
logfile=/var/log/pluto/LaunchManager.log
timefile=/var/run/reqres
pidfile=/var/run/plutoX0.pid
result=""
RestartXServ() {
sudo killall xinit
sleep 5
service hal restart
. /usr/pluto/bin/Start_X.sh
WriteTimeFile
}
WriteTimeFile() {
if [ -f $timefile ]; then
rm $timefile
fi
ctime=$(date +"%D %T")
echo "$ctime" > $timefile
}
#First see if a timefile even exists
if [ ! -f $timefile ]; then
#Clearly we have rebooted, so we need to restart the xserv to get the penmount working
#Make sure that the LMCE services have been started and are currently running before we do this
if [ -f $pidfile ]; then
ps -A | grep $(cat $pidfile )>/dev/null
err=$?
if [ $err -eq 0 ]; then
RestartXServ
fi
fi
else
#Otherwise, lets check to see if there has been a restart request since the last time we checked
if [ -f $logfile ]; then
#Search the logfile for the last restart request
result=$(cat $logfile | grep "Got a reload command" | tail -n 1 | cut -f 2 )
#Get epoch versions of the timestamp
t1=$(date -d"$result" +%s)
#Get epoch version of timestamp in timefile
result=$(cat $timefile)
t2=$(date -d"$result" +%s)
if [ $t1 -gt $t2 ]; then
#We have a new request so restart the xserver
echo "Restarting X"
RestartXServ
fi
fi
fi
The key to fixing the problem on a router reload was restarting the hal daemon. Sadly the problem resurfaces on a reboot. The only way to fix it is to first let the system load, touch the screen (where the mouse pointer gets stuck to the left side of the window -- i.e. not working) then reload the xserv. After that, any subsequent reloads from the router works fine.
My next guess is then that the system doesn't know to listen on the serial port until it registers some sort of input first, then restarting hal (i presume) defaults to listening on that port and hence reloads work fine.
I can't figure out where or what in the hal daemon is changing when I first touch the screen that registers the serial port as active. If there were a way to force it to listen on the port (or inject an event to make it look like data came in on the port during init) that might work too...
Otherwise I might need to find a way to compile a kernel driver for the penmount to load at boot and I presume that will open the serial port by itself.
Thoughts?
EDIT: Forgot to attach files, they are there now
There's almost got to be a kernel module for the driver, or a patch of the psmouse driver to do the same...
A common fix on systems is the setserial command, using it in the init script to prevent the psmouse driver from grabbing the ps2 serial port away from the touch driver. Most of the touch screen drivers are egalax derivatives. They mostly work the same way. The newer the Ubuntu Linux version, the harder it is to get the touch screen drivers, connected to ps2 ports, to work,... up until a couple of fixes introduced from Ubuntu 10.10 on,... The udev rules for ps2 touchscreens weren't there, and the touch screen drivers all required a static serial port assignment. Udev would assign port IDs pretty much randomly, which screwed up the driver's ability to communicate. One time you'd boot with the device assigned to /dev/ttys04, and the next time it'd be /dev/ttys05,... And when you did finally get it recognized, you didn't have any calibration utility...
From your description of the problem, it seems like the device is attaching only when the udev system realizes that there's something attached to that port assignment and grabs the right port the driver is meant to look at...
So there's probably one of two fixes for the issue,... Either use setserial in the init script to force the system to assign that serial port for touch driver use (maybe loading a kernel module to that process), or,... write a udev rule that recognizes that penmount device, and sets the right serial port environment for it...or some combination of the two...
By the way,... when you have a choice,... you always want a USB based controller chipset for touch screens in Linux. They're just easier (not always your choice, I know).