PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

x30 missing some key presses ?

The PocketTV Team · 24 Aug 2004, 20:01 UTC
Apparently when the x30 is busy doing something CPU intensive (e.g. like playing video), the device seems to be missing a large number of key presses.

I.e. you press a button (e.g. mapped on some command of the application) and nothing happens, because the application does not receive the key message.

We see that happening with PocketTV.

We think it could be caused by a bug in the button driver (maybe driver not running with high enough priority on the x30 ?)

Has anyone else noticed this ?
I haven't tried it with PocketTV but I have seen it with other applications and games that hog the cpu. Sometimes I press a button/key and nothing happens. Sometimes I must press it twice to get a response.
This happens most often with emulators for me (and I'm not talking about just Morphgear).

When the PPC isn't doing much or with casual use or with PocketPC-designed games, there's no problem.

JJB
The PocketTV Team · 24 Aug 2004, 20:12 UTC
JongJungBu wrote:I haven't tried it with PocketTV but I have seen it with other applications and games that hog the cpu. Sometimes I press a button/key and nothing happens. Sometimes I must press it twice to get a response.
This happens most often with emulators for me (and I'm not talking about just Morphgear).

When the PPC isn't doing much or with casual use or with PocketPC-designed games, there's no problem.

That's exactly what we observe. So apparently the problem is real.
I've noticed that on 2 games I'm working on, that if I have no throttling of the FPS, the controls seemed delayed - and sometimes didn't register.

Throttling the FPS down to a max of 50-60 using sleep()'s got rid of it.

I haven't noticed it with pocketTv .
The PocketTV Team · 25 Aug 2004, 03:21 UTC
fast_rx wrote:I've noticed that on 2 games I'm working on, that if I have no throttling of the FPS, the controls seemed delayed - and sometimes didn't register.

Throttling the FPS down to a max of 50-60 using sleep()'s got rid of it.

I haven't noticed it with pocketTv .

The problem only occurs when the CPU load is important. When using PocketTV, the problem will occur only when playing large resolution files (e.g. 352x240). If you play small resolution files, the CPU load is less than 100% and the problem does not happen.

Our analyze is that the driver that detects button pressing does not run with a high-enough priority, and it fails to detect button-press events when the CPU load in high.
Isn't raising the priority a rather trivial thing?
The PocketTV Team · 25 Aug 2004, 03:40 UTC
sponge wrote:Isn't raising the priority a rather trivial thing?

Yes, it should be, but drivers are doing tricky things, so it may not that be as simple. Only HTC engineers would know. (HTC is the Taiwanese company that designed the Axim x30 for Dell).
strange. i assumed button presses generate interrupts which are always taken and not influenced by cpu load. (maybe if the cpu is in a higher priority interrupt a lower priority could be delayed. but i don't think that's the case here)

update: i think it doesn't work that way. the actual keyboard or any other driver code is not in the interrupt itself. the interrupt only fires an event. if the thread waiting for the event is not started fast enough the keyboard hit can be lost and probably it's even more complicated and has other aspects i have no idea about.
The PocketTV Team · 25 Aug 2004, 05:29 UTC
picard wrote:strange. i assumed button presses generate interrupts which are always taken and not influenced by cpu load. (maybe if the cpu is in a higher priority interrupt a lower priority could be delayed. but i don't think that's the case here)
Yes, you would assume that, but apparently the driver misses some.

Yes, it's not that you get them late. In some cases you just don't get the button messages at all.
update: i think it doesn't work that way. the actual keyboard or any other driver code is not in the interrupt itself. the interrupt only fires an event. if the thread waiting for the event is not started fast enough the keyboard hit can be lost and probably it's even more complicated and has other aspects i have no idea about.


I am not quite sure how it works under WinCE but under the Desktop OS the driver has an ISR, which is directly called by the OS if an interrupt occurs, so there cannot be anything missed if programmed correctly.
Also the whole driver is working at higher priority then any application. The highest priority a driver routine can get is the IRQL the ISR is running on. If the ISR is not returning in time the whole system is locking up. Dispatch functions and DPCs are running at lower priority but still higher then applications.
Have you tried lowering the priority of the PocketTV process? Assuming nothing else CPU-intensive is running then it might not harm playback quality.

Dan East
I played around with the 'un-throttled' version of my game... It really seems as if a press-and-hold clicks always register - although sometimes quite delayed. The only ones I seem to miss are press-release clicks. Like the button up event cancels the button down event if they get que'd up together.

Definitely something not right...
The PocketTV Team · 26 Aug 2004, 05:18 UTC
Dan East wrote:Have you tried lowering the priority of the PocketTV process? Assuming nothing else CPU-intensive is running then it might not harm playback quality.

Yes, we could try that as an experiment...