Saturday, March 12, 2011

so far so good with Ubuntu

so far I'm finding Ubuntu a lot nicer to deal with, I know I promised to explain how to get twofing to work...I'll get to it soon. I actually haven't found it so useful. In fact what turned out to be really great was the Okular reader. it allows you to drag the pages with the left mouse button and opens pdfs, cbz, cbr...you name it. And to install it you just use the ubuntu package center.

you may also want to make sure you're running with the ubuntu desktop setup and not the netbook layout because that was torture...to get that done you must logout and select a user to login as and at the bottom there should be a selection box to switch to the regular old ubuntu interface.
Rotating the screen as described in one of my earlier posts makes the reading experience better, except the hardware leaves a lot to be desired where the display is concerned.

You will likely find the mouse pointer a pain...i've changed that with a little bullseye png i made and turned into a cursor using xgencursor:



just create a file called target.cursor and add the following:

32 16 16 target.png

to make the hotspot of the cursor be the center. Now run:

$>xcursorgen target.cursor default

you should end up with a file called default containing your new cursor, it took a bit of time to figure out where to put it to get it picked up. I can't recall exactly where i placed it but what i did was i found the folder containing the files for my current theme, backed up the cursor file. replaced it and restarted.

Cheers from the midst of the Cairo revolution!

Thursday, March 3, 2011

Upgrading the touchscreen firmware to 1.006h

So I've been having some really ugly experiences with the touchscreen where it doesn't regsiter my touch in a lot of instances. I've just upgraded the firmware to 1.006h following the details described here:

http://www.wetab-community.com/index.php?/topic/12962-neuste-firmware-des-touchscreens-unter-weos-installieren/page__st__20

You will have to do this from inside the WeOs because I'm not sure where to get the eUpgrade tool, maybe it comes with the egalax drivers...anyhow that's not our concern at this point.

First, make sure you have a USB Keyboard and Mouse handy.

Now, open up a shell and

$>cd Downloads
$>wget http://www.exopc.com/backstage/download/Support/TouchPanel_YFO_v1006h.zip
$>sudo  unzip TouchPanel_YFO_v1006h.zip -d /usr/share/tiitoo/firmware/
$>eUpgrade -f /usr/share/tiitoo/firmware/YoungFast_11p6_24x43_72A1v1006h_f04_dsab_ASG.EGXP

Now you will see something like:

*) EETI firmware upgrade tool version: 1.03.1011

 **** DO NOT TOUCH THE SCREEN DURING RUNNING!! ****

 (I) Found a PCAP device on /dev/hidraw0
 (I) Model: PCAP72A1
 (I) Type: PCAP7200 Series
 (I) Version: 1.005f

 (I) Image file [/usr/share/tiitoo/firmware/YoungFast_11p6_24x43_72A1v1006h_f04_dsab_ASG.EGXP]: Opened
 (I) Load image file: OK
 (I) Waiting............
 
 
and then pinnwand will restart. DO NOT PANIC IF THE TOUCHSCREEN DOES NOT REACT TO YOUR TOUCH. Just do the eupgrade one more time, this is what happened with me,

eUpgrade -f /usr/share/tiitoo/firmware/YoungFast_11p6_24x43_72A1v1006h_f04_dsab_ASG.EGXP

If fortune does not side with you then you can always revert to the older firmware which you should find under the same folder:  /usr/share/tiitoo/firmware/YoungFast_11p6_24x43_72A1v1005...

Best of luck, if you worried about doing this wait for the official update...!

Sunday, February 27, 2011

More about the touchsceen and multitouch

Hey everybody,
 So for the longest time I had things a bit switched up in my mind, I talked about multitouch and enabling the touchcreen as though they were one and the same...but they're not. Merely enabling the touchscreen allows the OS to register the "touch" events, mainly where you clicked and a mouse click...multitouch says that you've used more than one finger and thus two/three locations would be registeted instead.

In my post about installing ubuntu I don't make much of a distinction, in fact I used the terms interchangeably. All that changed when my friend Reiner told me about twofing, which basically captures multitouch events and does special things with particular windows such as scroll forward in evince if you swipe two fingers acoss the screen.

Well first off et me describe how to get the multitouch driver installed. Please note that if you had gotten the touchscreen to work using the method described in the Ubuntu installation post, you will need to undo these changes...namely remove the usbhid.quirks changes to the GRUB file and remove the 99-calibration.conf file rom /etc/X11/xorg.conf.d/

Next you will need to make sure you have added the utouch-team repository to the ubuntu packager (you may not need the unstable repo anymore)

sudo add-apt-repository ppa:utouch-team/utouch
sudo add-apt-repository ppa:utouch-team/unstable

sudo apt-get upgrade
sudo apt-get update


Next, download the egalax drivers:


sudo apt-get install hid-egalax-dkms


You should now be good to go. Restart the machine. For some reason I was getting weird behavior on my first restart and had to manually shut down the machine by holding down the power button. But the next time it loaded up it was fine...so in case you run in to any problems...restart again, if it persists across more restarts then you have a different issue.


Now if you recall, we had rotation scripts...well those won't work anymore, atleast not the way they are at the moment. Instead your files should now look like so:



#normal.sh

#!/bin/sh

xrandr -o normal
xinput set-int-prop 9 "Evdev Axes Swap" 8 0
xinput set-int-prop 9 "Evdev Axis Calibration" 32 0 32760 0 32760
xinput set-int-prop 10 "Evdev Axes Swap" 8 0
xinput set-int-prop 10 "Evdev Axis Calibration" 32 0 32760 0 32760

 -----------------------------------------------


# rot.sh
#!/bin/sh

xrandr -o left

xinput set-int-prop 9 "Evdev Axes Swap" 8 1
xinput set-int-prop 9 "Evdev Axis Calibration" 32 32760 0 0 32760
xinput set-int-prop 10 "Evdev Axes Swap" 8 1
xinput set-int-prop 10 "Evdev Axis Calibration" 32 32760 0 0 32760


It took me a bit to figure out the settings, but basically it looks like the hid-egalax driver granulates the screen differently (and possibly with different scales depending on what axis).

You should now be running with multitouch support and at the same point where the ubuntu installation post left off.

The next bit just explains where the coordinates above came from. If you're not interested in that, well then you're done and can go enjoy!

If you run xinput_calibrator you will get some output that looks like:

Warning: multiple calibratable devices found, calibrating last one (eGalax Inc. USB TouchController)
    use --device to select another one.
Calibrating EVDEV driver for "eGalax Inc. USB TouchController" id=10
    current calibration values (from XInput): min_x=0, max_x=32760 and min_y=0, max_y=32760

Doing dynamic recalibration:
    Setting new calibration data: -29, 32920, 387, 32606

 Now I'm mainly interested in the bolded line, it tells us what the default values for the perfectly functional landscape setup is. The new calibration is ok, but you will find that it isn't perfect.

Ok so let's cut that up, it seems to say that in landscape mode, the lower left corner of the screen is at coordinates (min_x,min_y) which is (0,0).

What about the max? That's our upper right corner of the screen, (max_x,max_y) which is (32760,32760).

So the calibration string with min_x, max_x, min_y, max_y will be:
0 32760 0 32760

Ok, well what happens when we rotate the screen. Well we need to set the new lower left corner of our screen but using the same coordinate system as before. So our screen's origin (new lower-left corner) is now where (32760,0) used to be and the new upper right corner is at (0,32760) thus the new calibration string  with min_x, max_x, min_y, max_y will be:
32760 0 0 32760

Well that's all folks. Next time I will explain how I got twofing to work.
Cheers!

Saturday, February 26, 2011

Screen Rotation with Ubuntu on WeTab

Update 26 OCT 2011:
If you're running Ubuntu 11+ please check out this post instead: http://wetabz.blogspot.com/2011/06/rotating-wetab-screen-on-natty-narwhal.html

======================================

So holding up the WeTab for long periods of time can be a pain. Sometimes it seems that holding it up on it's side might be more comfortable, especially when you're lying down in bed and trying to read something.

well as it so happens, you can rotate the screen using xrandr. You might not like what you see but atleast you have the option.

Well first do an xinput -list to see the devices you can interact with to fix up calibration through a script:

xinput -list
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ eGalax Inc. USB TouchController             id=9    [slave  pointer  (2)]
⎜   ↳ eGalax Inc. USB TouchController             id=10    [slave  pointer  (2)]
⎜   ↳ eGalax Inc. USB TouchController             id=11    [slave  pointer  (2)]

⎜   ↳ ImPS/2 Generic Wheel Mouse                  id=15    [slave  pointer  (2)]
⎜   ↳ Microsoft Mouse                             id=16    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ Power Button                                id=6    [slave  keyboard (3)]
    ↳ Video Bus                                   id=7    [slave  keyboard (3)]
    ↳ Power Button                                id=8    [slave  keyboard (3)]
    ↳ USB 2.0 Camera                              id=12    [slave  keyboard (3)]
    ↳ Asus Laptop extra buttons                   id=13    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=14    [slave  keyboard (3)]
    ↳ Microsoft Keyboard                          id=17    [slave  keyboard (3)]

Note the ids for "eGalax Inc. USB TouchController" 


As a quick test to check which device really is the one we need to calibrate we can take each of the ids and plug it in to the following command and then touch the screen with a finger, if the Axes seem to be inverted, we know we have the right device:

xinput set-int-prop 9 "Evdev Axes Swap" 8 1
xinput set-int-prop 10 "Evdev Axes Swap" 8 1
xinput set-int-prop 11 "Evdev Axes Swap" 8 1


Once you know which device id is the right one (mine was 10), you can restore the proper axes by switching the 1 to a 0:

 xinput set-int-prop 10 "Evdev Axes Swap" 8 0

you should now create the following scripts that will help you rotate and restore your view.


#rot.sh
#!/bin/sh

xrandr -o left
xinput set-int-prop 10 "Evdev Axes Swap" 8 1
xinput set-int-prop 10 "Evdev Axis Calibration" 32 4052 36 35 4156



#norm.sh
#!/bin/sh

xrandr -o normal
xinput set-int-prop 10 "Evdev Axes Swap" 8 0
xinput set-int-prop 10 "Evdev Axis Calibration" 32 -5 4100 59 4100



* remember to change the device id 10 to whatever works for you. I describe next what to do about the calibrations.


Finally make sure you download and install xinput_calibrator: http://www.freedesktop.org/wiki/Software/xinput_calibrator (the debian package should do).



Now do a xrandr -o left and run the xinput_calibrator. The output should be the calibration parameters that you place on the last command of both scripts (evdev  axis calibration).


Finally run the scripts and enjoy the proper calibrations of both landscape and portrait viewing on your WeTab!


UPDATE 26 FEB 2011:
---------------------------------------
The above instructions will work only if you are running with single-touch, to enable multitouch and have rotation work correctly please see: http://wetabz.blogspot.com/2011/02/more-about-touchsceen-and-multitouch.html