cannot get backlight control working with Primo 2.4   

cannot get backlight control working with Primo 2.4

Postby Edouard » Mon May 06, 2013 9:12 am

Hello,

I just installed Primo 2.4 on a GPS running winCE 6.0 (most likely a chinese one, branded Klipad GPS4328). It runs OK but I noticed the brightness slider from inside the app doesn't do anything (no dimming of the backlight).

I googled a bit and found a couple of topics about the backlight not working, tried pretty much all the solutions proposed in the threads I found but still no luck... The best I could get is Primo changing at startup the timeout settings for the backlight to dim to a lower brightness after 10s or so of inactivity. Looking at the PNA registry, I found the backlight entries are the following (in the folder HKEY_LOCAL_MACHINE / DRIVERS / BuiltIn / BackLight):



Brightness - 50
CurrentDx - 1
DefaultDx- 19
Dll - columbus_backlight.dll
Duty - 9
FriendyName - Backlight Driver
IClass - {A32942B7-920C-486b-B0E6-92A702A99B35}
Index - 1
Order - 4
Period - 19
Prefix - BKL

The settings I put in system.ini of primo to get the behavior described above are the following (I tried some other values as well for "backlight_events" or "backlight_methods" which were not giving any result; I'm not quiet sure what those parameters do... :

[power]
backlight_day="0"
backlight_events="1"
backlight_key_bright_ac1="ACBrightness"
backlight_key_bright_ba1="Brightness"
backlight_key_on_ac="ExtOnOff"
backlight_key_on_ba="OnOff"
backlight_key_ontap_ac="ACBacklightOnTap"
backlight_key_ontap_ba="BacklightOnTap"
backlight_key_timeout_ac="ACTimeout"
backlight_key_timeout_ba="BatteryTimeout"
backlight_manage_keys="1"
backlight_manage_values="1"
backlight_max="10"
backlight_methods="1, 5, 6, 7, 8, 10, 12, 18, 21, 23, 24, 25, 26, 27, 28, 33, 36, 37, 39, 40, 42, 46, 49, 50, 52, 53, 54"
backlight_min="0"
backlight_night="0"
backlight_reverse="0"
backlight_slow_api="1"
backlight_sync_with_os="0"
battery_warning_limit="5"
power_off_mode="-1"
power_off_timeout="30"
powermgm_state="0"
skip_resume_process="1"
skip_resume_process_all="1"
skip_suspend_process="1"
skip_suspend_process_all="1"
treat_charging_as_ac_line="1"

Any help would be greatly appreciated.

Thanks,

Ed
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Postby Fatboyfun » Mon May 06, 2013 11:29 am

These entries work on Navman/Mio devices...

Code: Select all
[power]
backlight_manage_values = 1
backlight_manage_keys = 1
[B]backlight_max = 10[/B]
backlight_min = 0
backlight_reverse = 0
backlight_methods = 39
backlight_events = 1


The bold entry is related to how many levels of brightness the backlight has.

I have seen devices where the backlight is not controlled directly by the OS, but by 3rd party software, or hardware seperate to the OS, so in these cases it's unlikely iGO will control it.
Currently sleeping...
Fatboyfun offline


User avatar Ex Moderator



 
Joined: Mon May 17, 2010 5:34 pm
Posts: 5782
Has thanked: 2 times
Been thanked: 408 times

Postby Edouard » Mon May 06, 2013 5:30 pm

I just tried it but no luck :(

I've seen there is an application in the windows folder named BacklightCTL.exe which is made by "Mstar semiconductor". If I run it it has a window with a slider I can use to adjust the brightness.
I can also change the brightness from the regular PNA skin (and by the way with this one I cannot set it as bright as with the other app); so there must be some kind of mean for any application to dim the backlight; it's just about doing it the right way.

I read on the web that there is no standard API for backlight brightness control on winCE. I believe the "backlight_method" parameter of primo might be made to switch between different ways. I wonder what it does when setting it to something like this (multiple numbers):
backlight_method="1,2,3,4"
as I have seen in some forums...

of course it might be a combination of backlight_method and backlight_events; no clue what the second one does...
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Postby pippolippi » Mon May 06, 2013 5:50 pm

I attached a dll that I wrote for my unit. If you're lucky it will work with yours, if it doesn't you haven't lost anything for trying.
There's a readme file inside, basically you have to put the Lucca_API.dll in the same directory where the primo executable is, then you have to add this in sys.txt

Code: Select all
[power]
backlight_methods=50
backlight_manage_values=1
backlight_max=64
backlight_min=6


I'm not currently using primo 2.4 (too buggy) but I verified and it works with it.
pippolippi offline


Junior Member



 
Joined: Sun Mar 18, 2012 8:26 pm
Posts: 21
Has thanked: 0 time
Been thanked: 0 time

Postby bazzle » Wed May 08, 2013 11:55 am

In data.zip project_config ui_igo9.ini

[power]
; Shutdown iGO (suspend device) automatically at given level (default: -1 - no automatic shutdown)
battery_shutdown_at=1
; Delay of automatic shutdown before suspending device
battery_shutdown_delay=5
; Default backlight levels
backlight_day_default=100
backlight_day_battery_default=80
backlight_night_default=50
backlight_night_battery_default=30
backlight_tunnel_default=50
tunnel_backlight_enabled=1
; Default: Smart Powersave (1)
powermgm_state=1
bazzle offline


User avatar Senior Member



 
Joined: Thu May 20, 2010 2:08 am
Posts: 269
Has thanked: 2 times
Been thanked: 5 times

Postby Edouard » Wed May 08, 2013 8:31 pm

I tried it but it has no effect, I wonder how I can be sure that the DLL is even loaded and the functions it contains called by iGo...

But anyway this gave may some ideas... By disassembling the application that does work & control the backlight properly on my PNA, I could spot similar function calls (i.e. CreateFile & DeviceIoControl) but the parameters provided to those functions seem different. I will try to recompile the dll & modify it to use similar parameters. By doing so I believe I can also add some code to double check that the functions do get called by iGo...

The only problem I have is I'm not very familiar with WinCE development, I tried to install the winCE 5.0 SDK as mentioned in your readme but it fails with the following error:
"Software development tools required to use this SDK for developing applications with native code are not installed on this development workstation...". I have visual C++ 2008 express edition installed but I believe I need some cross-compiler for ARM; also my device runs winCE 6.0 not 5.0; I don't know if that matters much...

Can you point me to some explanations about how to setup the development environment so I can recompile the dll ?

Thanks,
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Postby kamoteka » Wed May 08, 2013 8:40 pm

I think that there is a different backlight_methods= value for each gps device, and it depends if that device is supported or not by NNG. If you are patient enough, you might want to try numbers from 1 thru 100 one-by-one on the backlight_methods parameter until you find one that actually works and enable you to adjust the backlight. That is how I found out that backlight_methods=70 works on my generic gps device with MTK3351 cpu.
kamoteka offline


Member



 
Joined: Sat May 22, 2010 12:41 am
Posts: 100
Has thanked: 2 times
Been thanked: 3 times

Postby pippolippi » Thu May 09, 2013 6:50 am

Edouard wrote:
The only problem I have is I'm not very familiar with WinCE development

Me neither, I remember I had to do a lot of googling at the time, and all I remember is what I put in the readme

Edouard wrote: I tried to install the winCE 5.0 SDK as mentioned in your readme but it fails with the following error:
"Software development tools required to use this SDK for developing applications with native code are not installed on this development workstation...". I have visual C++ 2008 express edition installed but I believe I need some cross-compiler for ARM; also my device runs winCE 6.0 not 5.0; I don't know if that matters much...

Are you sure you made a full install of Visual C++? I think the default install doesn't include the cross compiler. My device too is 6.0 and I used the 5.0 SDK, so that shouldn't be a problem.
pippolippi offline


Junior Member



 
Joined: Sun Mar 18, 2012 8:26 pm
Posts: 21
Has thanked: 0 time
Been thanked: 0 time

Postby pippolippi » Thu May 09, 2013 6:54 am

Now I notice that you have the express edition of Visual C++, that won't work, you need the full version. Unfortunately the link in my readme no longer works, you'll have to look for it elsewhere.
pippolippi offline


Junior Member



 
Joined: Sun Mar 18, 2012 8:26 pm
Posts: 21
Has thanked: 0 time
Been thanked: 0 time

Postby Edouard » Tue May 14, 2013 12:13 pm

I made some good progress. I managed to setup my development environement and rebuild the dll.

I could modify it so it now works with my backlight. I made a simple test application linking to the dll and dimming on/off the backlight and it works OK.

However, when I then put the same dll in the iGo folder, next to the .exe and I tune my system.ini file to add the following settings (min & max should match with what my backlight expects):

Code: Select all
[power]
backlight_methods=50
backlight_manage_values=1
backlight_max=10
backlight_min=3


it still doesn't work. I have seen that none of the 3 dll functions ever get called... Any idea why the functions are not called by iGo (Primo 2.4) ?

Thanks
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Postby pippolippi » Tue May 14, 2013 4:35 pm

I don't know, using backlight_methods=50 in sys.txt (I suppose that system.ini is just a typo) should be enough to use the functions in Lucca_API.dll.
As I said, I don't use 2.4 anymore, but I tested it (the one downloaded from the torrent on this site) and it worked with my dll.
pippolippi offline


Junior Member



 
Joined: Sun Mar 18, 2012 8:26 pm
Posts: 21
Has thanked: 0 time
Been thanked: 0 time

Postby Skezza » Fri May 17, 2013 5:52 am

Just a note, most China Sat nav don't support the backlight api. Some do but many have hw controlled backlight support.
Skezza offline


Senior Member



 
Joined: Mon Jul 18, 2011 11:55 am
Posts: 331
Has thanked: 1 time
Been thanked: 21 times

Postby Edouard » Fri May 17, 2013 11:47 am

I finally got it to work ! :)

The problem was my DLL was not exporting the functions the way the application was expecting it.

In case anybody would have a similar issue, I put below the modified .dll and the modified source code to get it to work for my GPS device.

5425

I had to put following settings in sys.txt:

[power]
backlight_methods=50
backlight_manage_values=1
backlight_max=19
backlight_min=1

Thanks for your help !
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Postby pippolippi » Fri May 17, 2013 1:11 pm

Glad you got it working, but I don't think the wrong exports came from my project.
pippolippi offline


Junior Member



 
Joined: Sun Mar 18, 2012 8:26 pm
Posts: 21
Has thanked: 0 time
Been thanked: 0 time

Postby Edouard » Fri May 17, 2013 1:45 pm

pippolippi wrote:I don't think the wrong exports came from my project


You are correct, I didn't mean to say so. I built the DLL with Microsoft embedded VC++ so I had to recreate the project file and I was missing the .def in there...
Edouard offline


Junior Member



 
Joined: Mon Apr 29, 2013 2:57 pm
Posts: 12
Has thanked: 0 time
Been thanked: 9 times

Next

Return to General Discussions about iGO core

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: pegaz2 and 9 guests