Wednesday, 25 July 2007

In the dark with backlights...

Nice easy one here, which is always useful...

On PPC/Smartphone if your app needs to keep the backlight on you can requst that the backlight driver is kept in a high power state (i.e. ON!)

// force backlight on
SetPowerRequirement(TEXT("BKL1:"), D0, POWER_NAME POWER_FORCE, NULL, 0);

On PPC you may need to keep the system alive as well else it'll go into suspend, but this'll work indefinately on smartphone.

Use ReleasePowerRequirement to return the backlight to system timeout control. Note unlike some SatNav software this is nicer than editing the control panel system settings...! ;)

Friday, 13 July 2007

Enabling DShow Debug

Having problems debugging your new DShow filter?

When using a debug CE build (or a retail build with a debug quartz.dll) if you can enable DShow logging by turing on the following debug zones of quartz (tested in CE6.0):

Good luck debugging!

In previous OS versions (certainly CE4.2) you could edit the registry to enable these zones:


The levels go from 0 (none) to 5 (full). Try first changing TRACE and ERROR to 5 to start with.

Thursday, 12 July 2007

Video Driver Speedup

I've been working recently on improving the video performance on a Samsung 2413 processor.

The platform I'm working on does not have hardware video acceleration or a hardware cursor.

Did you know that if you disable the software cursor in the driver and remove the overlap detection for emulated line and blit you can get a two fold speed increase at least with drawing polygons.

The hardware supports DMA and I've started to look at using this to accelerate line fills and various blits. Unfortunately the hardware does not support block DMA which cuts down how it could help with majority of blit operations. Another snag with this approach is the overhead it takes to setup the DMA controller and cope with odd end of line conditions.