tags:

views:

169

answers:

2

Hi.

I am currently developing a WPF application for a Single Board AMD Geode Computer (touch screen).

Windows Embedded Standard installs fine on the device and it has .Net 3.5 loaded. The application runs fine for the most part but I am getting some anomalous behavior and I am suspecting it coming from the framework, as the problems cannot be reproduced on my development machine.

A short description of the problem:

I have this on screen keyboard. As you touch the buttons it displays what you are typing inside this text box at the top of the on screen keyboard. The user key presses are handled by a mouse down event handler on the buttons. Pretty simple. Inside this handler I:

  1. Play a sound for the key press.
  2. Do some shift and caps logic
  3. Determine what key was pressed (via sender)
  4. Update the keyboard text

Now, this works pretty obviously on my development machine. No problems. On Windows Embedded standard I get this weird lag on my keyboard. Basically I press a key, the sound plays but the key that you pressed is not updated in the text box at the top of the keyboard. It only updates much much later, randomly. ( Either seconds later or 30 seconds later, its pretty random and keeps track of all the keys I pressed )

Now, I have placed a log entry at the bottom of my "mouse down handler", and have established that my handler does complete. The text is simply not updated. Also, I can keep on hitting buttons and the sounds play as I hit them, but the text is not update for long times, then suddenly all at once.

The other weird thing is this behavior is not always present. It seems that the longer the OS is up, the more likely it becomes that the keyboard will lag. No other programs are running on the device. Usually after a fresh restart the lag is not there for about 5-20 mins. I have checked the CPU, its pretty much idle through the lag spikes. Application restarts does not solve the initial lag hypothesis. The OS must be restarted to get rid of the problem

Now, I have tried almost everything I can think of but I think this place is my last hope.

Please help me.

Regards,

A: 

My blind guess is that disk isn't fast enough to load the sound while in a message handler - try playing the sounds on another thread.

Paul Betts
Unfortunately not.I have event completely reduced the handler to basically to a:{ tbDisplay.text+="a";}No sounds, not calculations just when you press a button the text should be appended with an "a". Still lags. While its lagging the rest of the OS is responsive, just my app that does not display those appended characters for randomly long times.
pompomJuice
Have you checked memory usage after the 20 mins?
Paul Betts
+1  A: 

I found the problem.

It was obvious in a sense. The SBC has a on board video controller that shares memory with the system. The amount of memory shared can be set in the bios. I set it up from 32Mb to 64Mb and it completely solved my lag issues.

Unusual circumstances, hope it helps someone else out.

pompomJuice