Zum Inhalt wechseln


Foto

[Ubuntu] (K)Ubuntu 10.10 screen-rotate und dbus...


  • Please log in to reply
17 Antworten in diesem Thema

#1 Falbert

Falbert

    Haudegen

  • Members
  • PIPPIPPIP
  • 50 Beiträge

Geschrieben 01 November 2010 - 13:47 Uhr

Hallo an alle!

ich habe gestern Kubuntu eingerichtet...
Läuft alles soweit gut, incl Touch und linker Maustaste.
(Noch nicht ausprobiert: GPS, 3G, Helligkeitssensor :( )

Was mich am meisten gestört hat, war (ist) die fehlende screen rotation.
Also Script gebastelt:
(Es gibt bei mir mehrere eGalax-devices, deshalb nutz ich die ID 10)

#!/bin/bash

function left() {
			xrandr -o left
			xinput --set-prop 10 "Evdev Axis Inversion" 1 0
			xinput --set-prop 10 "Evdev Axes Swap" 1
}

function right() {
			xrandr -o right 
			xinput --set-prop 10 "Evdev Axis Inversion" 0 1
			xinput --set-prop 10 "Evdev Axes Swap" 1
}

function normal() {
			xrandr -o normal 
			xinput --set-prop 10 "Evdev Axis Inversion" 0 0
			xinput --set-prop 10 "Evdev Axes Swap" 0
}
function inverted() {
			xrandr -o inverted 
			xinput --set-prop 10 "Evdev Axis Inversion" 1 1
			xinput --set-prop 10 "Evdev Axes Swap" 0
}

case "$1" in
'normal')
normal;
;;
'invert')
inverted;
;;
'left')
left;
;;
'right')
right;
;;
esac

Läuft soweit gut.
Jetzt würde ich aber gerne das Rotieren über den Bescheunigungssensor laufen lassen, damit's auch automatisch dreht.

Meine bisherige Recherche ergibt, daß 4tiitoo hier den dbus nutzt. Da kenne ich mich aber wirklich nicht mehr aus!!!
Versuche jetzt raus zu kriegen, wie man so etwas sauber hinbekommt.
(Kann doch nicht so schwer sein, oder ? :) )

Hat jemand Vorschläge / Ideen oder sonstirgendwas zu dem Thema, kennt sich mit dbus aus, oder weiß wo eine VERSTÄNDLICHE Anleitung zu finden ist. (Für die Infos auf freedesktop.org, bin ich wohl noch zu klein ...)

Danke und Grüßles vom Bodensee,

Falbert.
  • 0
... don't feed the trolls ...

#2 Falbert

Falbert

    Haudegen

  • Members
  • PIPPIPPIP
  • 50 Beiträge

Geschrieben 01 November 2010 - 18:56 Uhr

Nachtrag:

Momentan hängt's bei mir im Verständnis, wie ich die Verbindung zwischen dbus und der H/W herstelle.

Am Beispiel der tiito-Scripte:
Woher weiß dbus wo es "com.tiitoo.Accelerometer" findet?

Danke für alle Hinweise!
  • 0
... don't feed the trolls ...

#3 ihagon

ihagon

    Mitglied

  • Members
  • PIPPIP
  • 12 Beiträge

Geschrieben 01 November 2010 - 20:35 Uhr

As always sorry for the English on a German language board, hopefully this is some use to you.

I've looked at this and I asked for the GPL stuff to be asked about which I believe it was and a positive response was given.

Basically how this works is

/user/bin/tiitoo-g-sensor-daemon is a python script that keeps an eye on com.tiitoo.Accelerometer using dbus and when it notices a change it checks to see if the sensor indicates a rotated state and runs /usr/bin/tiitoo-rotate.sh with one of the options normal, inverted, left or right and since your rotate script is the same as that I'm guessing you already found that one.

Now the question is how does the data get into dbus
Well looking around you can find that
/usr/bin/tiitoo-g-sensor.sh uses /usr/bin/pegaap to check the g-sensor and then it writes that into the dbus
but this never seems to run from what I can see. That said if you remove either of those files it stops rotating so it must be being run by something but I don't know what or when.

The pegaap binary is quite useful in itself.

pegaap -m XLRX:1
returns the X value of the g-sensor
same for XLRY and XLRZ for the respective axis

pegaap uses the module pega-ext.ko

[root@localhost 2.6.35.3-9965.1.1-wetab]# modinfo pega_ext
filename: /lib/modules/2.6.35.3-9965.1.1-wetab/kernel/drivers/char/pega-ext.ko
license: GPL
description: Pega Laptop Extension Support
author: Pegatron Corp.
depends:
vermagic: 2.6.35.3-9965.1.1-wetab SMP preempt mod_unload PENTIUMM

Which as you can see is GPL so the first thing you need is the source code for that and for pegaap but I'm guessing with the kernel source you could probably figure out how to write a replacement pegaap but source for that would be cool too.

pegaap also lets you change the hardware a bit so it seems it's the interface to the whole EC

pegaap -m ALED:0
[RESULT] LED OFF
pegaap -m ALED:1
[RESULT] LED ON

pegaap -m ENPR:0
Switching WIFI ON

pegaap -m ENPR:1
Switching Bluetooth ON

pegaap -m ENPR:2
Switching 3G ON

DAPR does the opposite and switches them off

pegaap -m LSON:0

will turn the light sensor off and

pegaap -m LSON:1

will turn it back on again.

pegaap -m LVEL:1
returns the brightness level
  • 0

#4 Falbert

Falbert

    Haudegen

  • Members
  • PIPPIPPIP
  • 50 Beiträge

Geschrieben 01 November 2010 - 21:28 Uhr

Hey ihagon!

Many thanks for your reply and explanations!
You've helped a lot! (Once again, after the touchscreen ...) ;)

I've been wondering where to find or how to implement the pegaap command used in the script.

I've found a rpm called pega-driver-wetab-0... (3versions) at the wetab repository. (But It's a rpm...)
http://178.63.180.29... ... /packages/

I didn't do anything with them till now.

But i will try tommorow and keep you informed...

Greetings from germany!

Falbert.

Update:
I tried to convert the *.rpm to *.deb using alien.
But there are only errors when trying to install the *.deb ...

Update on Update:
I tried the wrong way... :mrgreen:
If I simple double click on teh *.deb icon it installs...
Before that I copied the command from WeTabOS to Kubuntu.
But I get an error message like Folder not found if I try to use the command pegaap...
It has also been this way before I installed the *dep package.
/Update on Update

/Update

  • 0
... don't feed the trolls ...

#5 Falbert

Falbert

    Haudegen

  • Members
  • PIPPIPPIP
  • 50 Beiträge

Geschrieben 03 November 2010 - 12:39 Uhr

I called 4tiitoo yesterday and asked for the sources.

Today, I recieved an Email, that they will contact me next week for the sources...

I will keep you informed.
  • 0
... don't feed the trolls ...

#6 SCOOTER

SCOOTER

    Haudegen

  • Members
  • PIPPIPPIP
  • 75 Beiträge

Geschrieben 22 Dezember 2010 - 14:10 Uhr

Hallo an alle!

ich habe gestern Kubuntu eingerichtet...
Läuft alles soweit gut, incl Touch und linker Maustaste.
(Noch nicht ausprobiert: GPS, 3G, Helligkeitssensor ;) )


Hi Falbert,

wie hast Du die linke Maustaste gelöst und was macht 3G bei Dir?
Wegen 3G werde ich den Gnome Netzwerkmanager mal testen.
http://wiki.kubuntu-...ubuntu_benutzen
  • 0

"Unfortunately, the human brain is not expandable."
WeTab 3G 32GB - 1 GB - WeTab OS - Ich will 6h Laufzeit, deswegen eingeschickt
Asus EEEPC 1215N - 2 GB - Win 7
iWhat - HTC HD2 NAND


#7 Guest__*

Guest__*
  • Guests

Geschrieben 23 Dezember 2010 - 20:37 Uhr

Hallo an alle!

ich habe gestern Kubuntu eingerichtet...
Läuft alles soweit gut, incl Touch und linker Maustaste.
(Noch nicht ausprobiert: GPS, 3G, Helligkeitssensor :) )


Hi Falbert,

wie hast Du die linke Maustaste gelöst und was macht 3G bei Dir?
Wegen 3G werde ich den Gnome Netzwerkmanager mal testen.
http://wiki.kubuntu-...ubuntu_benutzen


Funktioniert beides bei mir nicht....
  • 0

#8 Falbert

Falbert

    Haudegen

  • Members
  • PIPPIPPIP
  • 50 Beiträge

Geschrieben 30 Dezember 2010 - 14:23 Uhr

Hallo Scooter, hallo Streifi89 !
(habs eben erst gesehen...)

Für den Touchscreen ich benutze die Quirks-Variante (http://wetab-communi...tic&staticID=19). Da funktioniert die rechte Maustaste nach der Installation automatisch. (Gedrückt halten)

Bei der Version mit den Treibern per ppa:utouch-team/utouch habe ich auch keine rechte Maustaste zum laufen bekommen und auch nicht herausgefunden wie ich die unter Kubuntu einstellen könnte.
Ansonsten wäre es wohl der bessere Weg, weil der Touchscreen dann auch als solcher erkannt wird ...
(Bei Quirks ist er ein Joystick.)

3G via T-Mobile geht bei mir nur ohne Pin. Hab mal dran rumgespielt, aber noch keine Lösung gefunden. Muss ich nochmal ausprobieren.

Hoffe das hilft & Grüßles vom See,
Falbert.
  • 0
... don't feed the trolls ...

#9 neocron

neocron

    Mitglied

  • Members
  • PIPPIP
  • 34 Beiträge

Geschrieben 12 Januar 2011 - 14:50 Uhr

hey rechte mousetaste hab ich mit twofing geloest, laeuft super trotz der utouch treiber!
meine frage waere, wie kann man das touch dann rotieren !?

das obige script fuehrt bei mir zwar zur rotation des bildschirms, die touchoberfläche beibt aber ... und ist somit nutzlos ...jemand ne idee?
  • 0

#10 Guest__*

Guest__*
  • Guests

Geschrieben 13 Januar 2011 - 08:18 Uhr

Hallo Scooter, hallo Streifi89 !

3G via T-Mobile geht bei mir nur ohne Pin. Hab mal dran rumgespielt, aber noch keine Lösung gefunden. Muss ich nochmal ausprobieren.

Hoffe das hilft & Grüßles vom See,
Falbert.


Dann hilft hier nur - die wvdial.conf usw. zu prüfen, ob 42 hier besondere Befehle an das Modem schickt
  • 0

#11 neocron

neocron

    Mitglied

  • Members
  • PIPPIP
  • 34 Beiträge

Geschrieben 17 Januar 2011 - 16:43 Uhr

ach shit, kaum hat man die richtige device id drin, schon geht's auch ...
lesen lernen hilft ... problem ist nun aber eher ne kalibrierung, ... die rotation des inputs hat funktioniert, jedoch scheint er das ratio nicht ganz einzuhalten ...
hmmmm ... sprich nun hat der cursor hoch und runterzu nur die haelfte des spielraums, in der horizontalen dafuer aber knapp das doppelte ... grrrrr
man ist sooo knapp dran ... :/
  • 0

#12 debb1046

debb1046

    Foren-As

  • Members
  • PIPPIPPIPPIPPIP
  • 373 Beiträge

Geschrieben 17 Januar 2011 - 21:45 Uhr

Bei mir tut's so wie es soll. Vielleicht immer noch die falsche id?

xinput list

und dann nach der Zeile
eGalax Inc. USB TouchController         	id=9	[slave  pointer  (2)]
suchen (hab' utouch Treiber)

dann
xrandr -o left
xinput --set-prop 9 "Evdev Axis Inversion" 1 0
xinput --set-prop 9 "Evdev Axes Swap" 1

  • 0

#13 neocron

neocron

    Mitglied

  • Members
  • PIPPIP
  • 34 Beiträge

Geschrieben 18 Januar 2011 - 11:02 Uhr

ok, twofing darf NICHT laufen ... bzw muss neugestartet werden nach jeder rotation ... dann scheint es zu laufen! riesen dank!!!
  • 0

#14 debb1046

debb1046

    Foren-As

  • Members
  • PIPPIPPIPPIPPIP
  • 373 Beiträge

Geschrieben 18 Januar 2011 - 11:38 Uhr

Hmm, bei mir kein Problem mit twofing und Rotation. Hast Du noch mousetweaks laufen? Das musste ich abschalten, kam dem twofing in die Quere.
  • 0

#15 Phantomal

Phantomal

    Diplomator

  • Administrator
  • 5.154 Beiträge
  • Ich besitze:WeTab 3G 32GB & 2GB RAM
  • Betriebssystem:Windows 10
  • Modifikationen:120 GB OCZ Noctis SSD

Geschrieben 18 Januar 2011 - 11:42 Uhr

Salve,

wie gut rotiert der denn eigentlich? Bild aus, 10 Sekunden warten, bild an? Oder in etwa wie beim aktuellen WeTabOS oder wie muss ich mir das vorstellen?


Grüße,

André
  • 0
Apparate von Menschen für Menschen gemacht... können Fehler haben.

#16 neocron

neocron

    Mitglied

  • Members
  • PIPPIP
  • 34 Beiträge

Geschrieben 18 Januar 2011 - 14:31 Uhr

wenn ich die desktopeffekte ausschalte im kde ist es instantan, mit eingeschalteten dauert es ca 5 sek ... ueberlege gerade was ich mit dem pegaap anstelle, und wie ich evtl die virt tatstatur anpassen kann :roll:

nun aber:
http://www.whaazzup....load/rotate.mkv

sorry fuer die "orientierung" ... aber nen mkv zu rotieren oder zu flippen ist nicht ne sache von 2 minuten ... :lol:
aber man sieht ja wie schnell's geht ... das ist die hauptsache

ps: mousetweaks lief noch nie bei mir ... lasse im script jetzt einfach twofing killen und restarten
  • 0

#17 Guest_streifi89_*

Guest_streifi89_*
  • Guests

Geschrieben 21 Januar 2011 - 10:30 Uhr

As always sorry for the English on a German language board, hopefully this is some use to you.

I've looked at this and I asked for the GPL stuff to be asked about which I believe it was and a positive response was given.

Basically how this works is

/user/bin/tiitoo-g-sensor-daemon is a python script that keeps an eye on com.tiitoo.Accelerometer using dbus and when it notices a change it checks to see if the sensor indicates a rotated state and runs /usr/bin/tiitoo-rotate.sh with one of the options normal, inverted, left or right and since your rotate script is the same as that I'm guessing you already found that one.

Now the question is how does the data get into dbus
Well looking around you can find that
/usr/bin/tiitoo-g-sensor.sh uses /usr/bin/pegaap to check the g-sensor and then it writes that into the dbus
but this never seems to run from what I can see. That said if you remove either of those files it stops rotating so it must be being run by something but I don't know what or when.

The pegaap binary is quite useful in itself.

pegaap -m XLRX:1
returns the X value of the g-sensor
same for XLRY and XLRZ for the respective axis

pegaap uses the module pega-ext.ko

[root@localhost 2.6.35.3-9965.1.1-wetab]# modinfo pega_ext
filename: /lib/modules/2.6.35.3-9965.1.1-wetab/kernel/drivers/char/pega-ext.ko
license: GPL
description: Pega Laptop Extension Support
author: Pegatron Corp.
depends:
vermagic: 2.6.35.3-9965.1.1-wetab SMP preempt mod_unload PENTIUMM

Which as you can see is GPL so the first thing you need is the source code for that and for pegaap but I'm guessing with the kernel source you could probably figure out how to write a replacement pegaap but source for that would be cool too.

pegaap also lets you change the hardware a bit so it seems it's the interface to the whole EC

pegaap -m ALED:0
[RESULT] LED OFF
pegaap -m ALED:1
[RESULT] LED ON

pegaap -m ENPR:0
Switching WIFI ON

pegaap -m ENPR:1
Switching Bluetooth ON

pegaap -m ENPR:2
Switching 3G ON

DAPR does the opposite and switches them off

pegaap -m LSON:0

will turn the light sensor off and

pegaap -m LSON:1

will turn it back on again.

pegaap -m LVEL:1
returns the brightness level


Hi,

the pegaap kernel module is CLOSED SOURCE from Pegatron :)... So we can't have the Source -.-
  • 0

#18 Catscrash

Catscrash

    Mitglied

  • Members
  • PIPPIP
  • 38 Beiträge

Geschrieben 05 Februar 2011 - 00:58 Uhr

how can it be closed source if the modinfo says gpl? wrong modinfo or do they just not want to share... (GPL Violation is taken very seriously)
  • 0




Besucher die dieses Thema lesen: 1

Mitglieder: 0, Gäste: 1, unsichtbare Mitglieder: 0