Welcome, Guest. Please login or register.
July 30, 2010, 04:24:35 AM

Login with username, password and session length
Forum has been upgraded to SMF 1.1.4. Report any problems via PM to Troy.
38469 Posts in 4595 Topics by 2510 Members
Latest Member: zdarkazn
Search:     Advanced search
+  OQO Talk
|-+  General
| |-+  Software (Moderators: sandydlc, stuartguthrie, Pappasan)
| | |-+  Automatic Screen Rotation demo (look out iPhone!)
« previous next »
Pages: 1 ... 5 6 [7] 8 9 10 Print
Author Topic: Automatic Screen Rotation demo (look out iPhone!)  (Read 67013 times)
terran
Full Member
***
Posts: 130


View Profile
« Reply #90 on: August 22, 2007, 05:21:00 AM »

Ok I got it to work. What a great program.

Glad you're enjoying it! Sorry I didn't stop in to make another suggestion to fix it. What was the problem?
Logged

02 Best / XP Tablet / WWAN-less
Tekara
Sr. Member
****
Posts: 479

~Desu


View Profile
« Reply #91 on: August 23, 2007, 12:42:19 AM »

Okay, finally got my OQO back and was able to test it out. My one concern was the cpu usage and it's still up there. Running the auto-rotate program starts up a new wmiprvse.exe service which sucks up a steady 5-6% cpu.

Any chances on reducing the cpu drain on the program?
Logged

UX390N | OQO02 1.5ghz
"The danger from computers is not that they will eventually be as smart as man but that we will agree to meet them half-way"
"Computers are a lot like air conditioners - they both work great until you open windows."

http://oqoasis.com
terran
Full Member
***
Posts: 130


View Profile
« Reply #92 on: August 23, 2007, 08:51:12 AM »

I'm noticing that too. The wmiprvse.exe service is started by Windows. Unfortunately, I've not researched it enough to figure out what my program does that requires it.

Essentially, my program runs on a timer and does the following:

0) Program determines the OQO’s current orientation. This is done with absolute values and 2 number comparisons.

1) Program grabs the accelerometer data (it does this every X milliseconds, as determined by the user)

2) Based on the data it just grabbed, the Program determines the OQO’s new orientation and compares that with the previous orientation (doing nothing if the orientation comparison is the same)

3) If the new orientation is different, the program sets a flag saying that the orientation has changed.

4) The next time the data is grabbed, if that new orientation is the same as the prior one, the Program knows that the OQO has been held in that new orientation for the user-defined X milliseconds and then triggers the screen to change accordingly.

5) Reset the Flag, Rinse, and Repeat.

I’m not sure what would be causing that wmiprvse.exe process to be running constantly, especially since code is only executing every X ms…and not even very much code, at that. I’m open to any ideas on how to streamline the code, so fire away if you have any suggestions!
Logged

02 Best / XP Tablet / WWAN-less
Tekara
Sr. Member
****
Posts: 479

~Desu


View Profile
« Reply #93 on: August 23, 2007, 12:09:42 PM »

Hehe, makes me wish I knew more about this kinda stuff!  Huh Huh

Well, hell, best I can think of is to start looking into why the auto-rotate program is dependant on wmiprvse. I'd wager it's the dependence more than the code itself that causes the steady cpu usage. Google suggest any correlation between the software you use to code the program and wmiprvse or perhaps any of the libraries you call up?
Logged

UX390N | OQO02 1.5ghz
"The danger from computers is not that they will eventually be as smart as man but that we will agree to meet them half-way"
"Computers are a lot like air conditioners - they both work great until you open windows."

http://oqoasis.com
terran
Full Member
***
Posts: 130


View Profile
« Reply #94 on: August 23, 2007, 12:41:41 PM »

I did find something about the wmiprvse.exe file...here's an excerpt:
Quote
Windows® Management Instrumentation (WMI) is a component of the Microsoft® Windows® operating system that provides management information and control in an enterprise environment. By using industry standards, managers can use WMI to query and set information on desktop systems, applications, networks, and other enterprise components. Developers can use WMI to create event monitoring applications that alert users when important incidents occur.

In addition to the .NET Framework, which is what this application is coded to use, the only files outside of the AutoRotate program itself are:
1) OQO's accelerometer interface file.
2) Microsoft's user32.dll, which monitors and changes the screen orientation if/when I tell it to.

My guess, based on the info above, is that the user32.dll file has ties to wmiprvse...since it's monitoring and changing the screen orientation. How do I minimize its usage? No idea. I'll continue looking.
Logged

02 Best / XP Tablet / WWAN-less
Kenrick
Sr. Member
****
Posts: 442


View Profile WWW
« Reply #95 on: August 23, 2007, 02:06:06 PM »

I commented out the calls to the read the X and Y values from the accelerometer, and the WMI process seems to go away.  So I'm pretty sure it is from the accelerometer interface, not the screen orientation code.

In this case, I don't think there is much we can do to optimize (setting the sampling rate higher should help, but you'll have to hold the machine longer before the rotate kicks in) unless we can find a more efficient way to read the accelerometer.
Logged

OQO 02 still running since 4/2007, Sony Vaio P
http://www.math.uaa.alaska.edu/~afkjm/techteach/?q=taxonomy/term/9
nivenh
Full Member
***
Posts: 131

OQO, Windows Lead


View Profile WWW
« Reply #96 on: August 23, 2007, 02:40:52 PM »

that process is definitely related to the accelerometer dll i gave you.  we talk to it via WMI.  in OQO Manager, i try not to ping our embedded controller in a loop like you do, but your situation is completely different from the ones i run into, in that the accel data is your event trigger.

i'm going to think on this a little to see if i can come up with a way to get it down.
Logged
terran
Full Member
***
Posts: 130


View Profile
« Reply #97 on: August 23, 2007, 05:13:44 PM »

Agreed Kenrick: Raising the timer delay should help, in that regard. I had played around with minimizing the use of the 'dm' object (no longer keeping it as a global variable and only declaring/initializing/using it when the program was 'committed' to doing the rotation), but that didn't help at all. With Brandon's comments, we now have confirmation on what the cause is. Hopefully he/we can get something figured out.

Thanks for chiming in, guys!
« Last Edit: August 23, 2007, 05:15:22 PM by terran » Logged

02 Best / XP Tablet / WWAN-less
Intrakota
Jr. Member
**
Posts: 65


View Profile
« Reply #98 on: August 25, 2007, 07:49:00 PM »

Thanks for that Terran, some people are just too clever, i wouldn't know where to start.
Logged

Intrakota. What you want, when you want it.


Worldwide satellite tv server. Dreambox DM800PVR / DM8000 (why pay more than you need to)
Vet3shaws
Jr. Member
**
Posts: 98


View Profile WWW
« Reply #99 on: January 28, 2008, 10:03:50 AM »

I'm trying to get the auto rotating to work, but got some hiccups after installing it.  I find that the the screen doesn't rotate when doing the manual fn + rotate command.  Whether or not, although I can tell the track stick is doing something funny.  Going one way, but pointing the other...  I press up, and it moves up correctly, that is if only the screen was rotated likewise.  So gotta get the screen manual rotation working.

I think I'll try to change my video RAM and see what happens.  Maybe reinstall the 23 drivers first, OQO manager, and see what next.
Logged
devGOD
Full Member
***
Posts: 109


View Profile
« Reply #100 on: January 28, 2008, 05:17:22 PM »

I tried it out but ended up uninstalling after about a day of usage. I wanted my cpu usage back and figured the 1-2 sec it takes for the screen rotate I can do it manually with the keyboard.

but still a nice app though
Logged

OQO Model 02 1.5ghz 60hd 1gb ram Vista Bus Verizon wwan
Vet3shaws
Jr. Member
**
Posts: 98


View Profile WWW
« Reply #101 on: January 28, 2008, 06:37:35 PM »

I'm so glad I got normal rotating to work!  Just reinstalled the S3 drivers from OQO, and chose to install OQO manager after a reset.  (While resetting I reduced Video RAM from 64 to 16 to maximize regular RAM.)  Without reinstalling OQO manager, rotating was fixed by the S3 reinstall.

I tried it out but ended up uninstalling after about a day of usage. I wanted my cpu usage back and figured the 1-2 sec it takes for the screen rotate I can do it manually with the keyboard.

but still a nice app though

Y'know, normal rotating only allows me to rotate between primary landscape and primary portrait mode.  That's really not enough.  I should be able to rotate to full 180, so I can use secondary landscape.  It's really useful!  Not with auto-rotate I can do that, and quite easily and snappy.  With Vista's lame 3-D stuff gone, it's fast as I'd like it to be.

The situation is like this.  You sit down and use your OQO in your KB stand, say at a class room.  When the charge is gone, how do you charge it, while use it in the KB Stand, all without straining the plug and maybe use a USB key??  (I use my mini-stand that comes with the Stowaway KB, which only gives a minor strain, not really any!)  Well easy fix, flip it upside down.  No need to click through the short cut that doesn't do 180.  Just flip it over and it does it fast!  Say I need to walk out during a break.  I just grab and go, and it'll auto flip for built-in thumb board for me.  That's convenient.
Logged
Opus
Sr. Member
****
Posts: 285


View Profile
« Reply #102 on: January 28, 2008, 10:08:50 PM »

I like keeping the auto rotate in my system tray but disabled. Then while inking with the screen closed I can enable & rotate, then disable it with my pen until I need to rotate again.

Would be nice to just set up a system tray control to manually rotate via right click menu or toggle click like it does now to disable/enable auto rotate. Makes my 02 more penabled without having to FN Rotate.
Logged

OQO 02 1.5ghz 60gb Sprint, Vista Business upgrade from XP Tablet 2005
DVD-R Docking Station, Field Accessory Pack, Clip & Exec cases
MS Office H&S 2007 w/OneNote, MS VS Developer Express Editions, iTunes
Kenrick
Sr. Member
****
Posts: 442


View Profile WWW
« Reply #103 on: January 29, 2008, 01:00:42 AM »

I like keeping the auto rotate in my system tray but disabled. Then while inking with the screen closed I can enable & rotate, then disable it with my pen until I need to rotate again.

Would be nice to just set up a system tray control to manually rotate via right click menu or toggle click like it does now to disable/enable auto rotate. Makes my 02 more penabled without having to FN Rotate.

That would be really easy to add.  If you install the S3 drivers there is a systray icon that lets you do that, although it doesn't rotate the touch scrollers or mouse for you.  I haven't seen terran on here in a while, so if he's not around I could add that when I have some down time.

vet3shaws: I did write a 180 rotate toggle program that you could find if search the forums...
Logged

OQO 02 still running since 4/2007, Sony Vaio P
http://www.math.uaa.alaska.edu/~afkjm/techteach/?q=taxonomy/term/9
deadserious
Full Member
***
Posts: 112


View Profile
« Reply #104 on: January 29, 2008, 11:08:09 AM »

For the record, I have found that PokerStars locks up when the rotation app is running.  Don't know if it effects other applications.
Logged
Pages: 1 ... 5 6 [7] 8 9 10 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Design by 7dana.com

OQO is a registered trademark of OQO, Inc. of San Francisco, CA