Rotate

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(updated rotate.c sources)
Line 17: Line 17:
 
http://dev.laptop.org/~cjb/rotate
 
http://dev.laptop.org/~cjb/rotate
  
'''update by Kurt Van Dijck'''
+
== rotated ==
 +
* author: Kurt Van Dijck <kurt.van.dijck_at_skynet.be>
 +
* [http://www.ecirc.net/openmoko/rotated_0.9_armv4t.ipk] ipkg for 2008.12
 +
* [http://www.ecirc.net/openmoko/rotated.tgz] for sources
  
I modified the above program to use read (not fread) with struct input_event
+
I found that rotating the desktop area in landscape (using xrandr) makes the XGlamo eat the CPU on my GTA-02
datastructures. The simplifies the detection of current position. No sleeps
+
system.
are necessary, no incomplete reads, ....
+
code is:
+
http://www.ecirc.net/openmoko/rotate.c
+
  
invoke with: rotate [ DEVICE FILE [landscape]]
+
Rotating the display head (xrandr --output default ...) works without major CPU load.
  
the second paraemeter is to allow landscape rotation. On my system,
+
By using no libxrandr, but invoking xrandr commands, it only depends on the accelerometer.
the glamo graphics driver eats all cpu when rotated in landscape.
+
  
 
== omnewrotate at code.google.com ==
 
== omnewrotate at code.google.com ==

Revision as of 12:37, 11 January 2009


Here's a quick and simple C program that reads a packet from the accelerometer once per second, and rotates the screen to a new orientation if the orientation has changed.

I don't mean this to conflict with Paul's excellent work on Gestures; my reason for writing it is so that it can be used as an always-on daemon in the OM distributions. (Full gesture interpretation is more CPU heavy and requires reading data more often than once per second, so perhaps that will be done on-demand instead of always-on.)

The code is: http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true

There's an ARM binary here (chmod a+x rotate && ./rotate): http://dev.laptop.org/~cjb/rotate

Contents

rotated

  • author: Kurt Van Dijck <kurt.van.dijck_at_skynet.be>
  • [1] ipkg for 2008.12
  • [2] for sources

I found that rotating the desktop area in landscape (using xrandr) makes the XGlamo eat the CPU on my GTA-02 system.

Rotating the display head (xrandr --output default ...) works without major CPU load.

By using no libxrandr, but invoking xrandr commands, it only depends on the accelerometer.

omnewrotate at code.google.com

accel-rotate at projects.openmoko.org

No-screenshot.png Rotate

Rotates the screen according to the position of the Neo FreeRunner.


Homepage: http://projects.openmoko.org/projects/accell-rotate/
Package: accel-rotate (external download)
Tested on: FSO, ASU, QtExtended


  • Om2008.x package:
opkg install http://projects.openmoko.org/frs/download.php/455/accel-rotate_0.41_armv4t.ipk
  • Qt Extended 4.4.1 package:
opkg install http://projects.openmoko.org/frs/download.php/456/accel-rotate-qte_0.41_armv4t.ipk
  • Source codes are in subversion, developers are welcome
  • TODO:
    • better heuristics - any ideas how to do this well? please use discussion on this wiki.
    • disabling on screensaver
  • [3] how to display data from accelerometers on Desktop with gnuplot (there is a few of czech text, but there is also youtube video).

See also

Personal tools


Here's a quick and simple C program that reads a packet from the accelerometer once per second, and rotates the screen to a new orientation if the orientation has changed.

I don't mean this to conflict with Paul's excellent work on Gestures; my reason for writing it is so that it can be used as an always-on daemon in the OM distributions. (Full gesture interpretation is more CPU heavy and requires reading data more often than once per second, so perhaps that will be done on-demand instead of always-on.)

The code is: http://github.com/cjb/freerunner-rotate/tree/master/rotate.c?raw=true

There's an ARM binary here (chmod a+x rotate && ./rotate): http://dev.laptop.org/~cjb/rotate

update by Kurt Van Dijck

I modified the above program to use read (not fread) with struct input_event datastructures. The simplifies the detection of current position. No sleeps are necessary, no incomplete reads, .... code is: http://www.ecirc.net/openmoko/rotate.c

invoke with: rotate [ DEVICE FILE [landscape]]

the second paraemeter is to allow landscape rotation. On my system, the glamo graphics driver eats all cpu when rotated in landscape.

omnewrotate at code.google.com

accel-rotate at projects.openmoko.org

No-screenshot.png Rotate

Rotates the screen according to the position of the Neo FreeRunner.


Homepage: http://projects.openmoko.org/projects/accell-rotate/
Package: accel-rotate (external download)
Tested on: FSO, ASU, QtExtended


  • Om2008.x package:
opkg install http://projects.openmoko.org/frs/download.php/455/accel-rotate_0.41_armv4t.ipk
  • Qt Extended 4.4.1 package:
opkg install http://projects.openmoko.org/frs/download.php/456/accel-rotate-qte_0.41_armv4t.ipk
  • Source codes are in subversion, developers are welcome
  • TODO:
    • better heuristics - any ideas how to do this well? please use discussion on this wiki.
    • disabling on screensaver
  • [1] how to display data from accelerometers on Desktop with gnuplot (there is a few of czech text, but there is also youtube video).

See also