Related
The question was: Is the screen rotation possible on Tornado devices (for example for better Internet browsing).
Many efforts were done to gain this possibility. We have not fully received what we need, but we're on good way. We know now that the standard Tornado DDI.DLL driver is uncapable of screen rotation, so we (partially) replaced it with one taken from HTC Vox ROM. There is one serious disadvantage we're still working about: the joystick doesn't follow orientation for now, so using the phone in landscape mode is seriously difficult. We will be trying to adopt the Vox's keybddr.dll into Tornados.
I have collected all these things in an application, that you can install to skip manual registry editing.
Here is the application:
http://www.mediadrain.com/TDM_1.0.0.cab
You MUST install the following certificates! If not, a hard reset will be required!
http://www.mediadrain.com/WMtequan.cab
To rotate the screen select Change Driver option from the Display Driver option, and change to a VOX one.
i don't think it will be supported on this alpha version...!!!
qtek_metanol said:
i don't think it will be supported on this alpha version...!!!
Click to expand...
Click to collapse
this isn't connected
OS either supports screen rotation or not
WM6 supports screen rotation, like on the vox, so surely we could do the same for tornado but add some start menu shortcuts or a home screen plugin to make it rotate?
Phil
i tried writing an app in .net compact framework. While it worked and rotated a PPC WM5, it didn't work in my SP WM6.
maybe .net is hard-coded and disallows screen rotation on smartphone, what doesn't mean it's impossible
WM6 supports screen rotation, like on the vox, so surely we could do the same for tornado but add some start menu shortcuts or a home screen plugin to make it rotate
Click to expand...
Click to collapse
may you need the dll file from VOX which enable the screen rotation by opening the keyboard
i think we should write a list with Q&A, and other with Bugs, Do have somebody a list with a resume of troubles...??
i build a .NET project that allow to rotate the screen, but for me it works ONLY on emulator SDK only in both WM5 and WM6 why? i post the exe and the source.. give me some answer..
Code:
#include <windows.h>
#include <stdafx.h>
int
WINAPI
WinMain(
HINSTANCE,
HINSTANCE,
#ifdef UNDER_CE
LPWSTR,
#else
LPSTR,
#endif
int
)
{
DEVMODE DevMode;
int RotationAngles;
int CurrentAngle;
int NewAngle;
//
// Check for rotation support by getting the rotation angles supported.
//
memset (&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYQUERYORIENTATION;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_TEST, NULL))
{
RotationAngles = DevMode.dmDisplayOrientation;
RETAILMSG(1, (L"ChangeDisplaySettingsEx supports these rotation angles %d", RotationAngles));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to get the supported rotation angles."));
RotationAngles = -1;
}
//
// Get the current rotation angle.
//
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_TEST, NULL))
{
CurrentAngle = DevMode.dmDisplayOrientation;
RETAILMSG(1, (L"ChangeDisplaySettingsEx reports the current rotation as %d", CurrentAngle));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to get the current rotation angle."));
CurrentAngle = -1;
}
//
// Rotate to the "next" angle.
//
if (CurrentAngle >= 0 && RotationAngles >= 0)
{
NewAngle = CurrentAngle;
do
{
NewAngle <<= 1;
if (NewAngle == DMDO_0)
{
NewAngle = DMDO_90;
}
if (NewAngle > DMDO_270)
{
NewAngle = DMDO_0;
}
} while (!(NewAngle & RotationAngles) && (NewAngle != DMDO_0));
memset(&DevMode, 0, sizeof (DevMode));
DevMode.dmSize = sizeof (DevMode);
DevMode.dmFields = DM_DISPLAYORIENTATION;
DevMode.dmDisplayOrientation = NewAngle;
if (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx(NULL, &DevMode, NULL, CDS_RESET, NULL))
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx changed rotation angle to %d", NewAngle));
}
else
{
RETAILMSG(1, (L"ChangeDisplaySettingsEx failed to change the rotation angle to %d", NewAngle));
}
}
return 0;
}
giuseppebitonti said:
i build a .NET project that allow to rotate the screen, but for me it works ONLY on emulator SDK only in both WM5 and WM6 why? i post the exe and the source.. give me some answer..
Click to expand...
Click to collapse
Hey, I have a Vox (s710) for a few days so I could search which application is used by this phone to rotate the screen.
kartam said:
Hey, I have a Vox (s710) for a few days so I could search which application is used by this phone to rotate the screen.
Click to expand...
Click to collapse
that would be great mate. we'll be waiting for it.
bad news...
i found this somewhere in eMbedded VC++ documentation:
Screen rotation requires support from the display driver, which maintains information regarding rotation. Screen rotation is currently supported only on devices that use a single screen and is not supported on multiple screen devices.
An application calls the ChangeDisplaySettingsEx function to determine the screen orientation modes that the system supports, to set the angle by which the screen is rotated, and to query the current angle of rotation
Click to expand...
Click to collapse
I've written small utility (C++, native code just to be sure that no funny hardcode in compact framework is messing) and i've tested it on SPV C600 and TYTNII. On TYTN all was OK (screen rotated), on C600 (WM6) error was 'DISP_CHANGE_BADMODE' - exactly like described in docs...
so (IMHO): display driver (heh.. I suspected that there is sth like display driver ) just does not support screen rotation, so no matter that WM6 supports it...
we got two choices:
- find better one (heh... i do not even know the name of the file... but this i can find - i think i saw it once where i was plaing with regedit )
- live with 0 degrees rotation
It is necessary patch driver from vox. It approaches, but incorrectly turnoff screen. Illumination does not die away, and after that the image is displaced on 15 pixels to the right. With the all perfectly rotates. Except for joystick...
kmz said:
It is necessary patch driver from vox. It approaches, but incorrectly turnoff screen. Illumination does not die away, and after that the image is displaced on 15 pixels to the right. With the all perfectly rotates. Except for joystick...
Click to expand...
Click to collapse
could you uploader the driver plz
How can I find the driver in the ROM?
http://kmz.ho.com.ua/dispdriver.vox.zip
Here the driver and the certificate by which is signed the driver.
so we got POC done, now time for hard reset
driver supports screen rotation, but it got problems with display time out - when backlight should be off it is on, but screen becomes white and it's premament (until reboot).
Just for info - U can use MyMobiler to operate - no matter that screen is dead, phone itself is still doing his job
Hey, that is great
Good job guys, i'm sure you guys can improve it.
Just some suggestion, perhaps you can make some application which will toggle landscape/potrait and map it to one of the shortcut keys such as long_volup
driver supports screen rotation, but it got problems with display time out - when backlight should be off it is on, but screen becomes white and it's premament (until reboot).
Just for info - U can use MyMobiler to operate - no matter that screen is dead, phone itself is still doing his job
Click to expand...
Click to collapse
Excelent work Qlphn, what about the joystick control? It changes the way to control the Joystick when you switch to Panorama Modus?
THX
Has anyone got the Tornado display driver? I could probably check differences with windiff and hexedit it .
Hey!
I managed to do this with DDI driver you've attached.
Well, the joy doesn't follow orientation, screen rotation works. After some time my display takes weird colours. I hope this can be fixed anyway, well I will try to work it
Maybe only registry edit is required? I will compare vox registry with tornado one and say what I noticed.
Greetings
Something went wrong with my Vox. It doesn't longer completely dim the display after a given timeout. What could be the problem?
Search this forum maybe?
http://forum.xda-developers.com/showthread.php?t=303778
agentdr8 said:
Search this forum maybe?
http://forum.xda-developers.com/showthread.php?t=303778
Click to expand...
Click to collapse
Thanks for the hint but I couldn't figure out which keys to edit or create. Could you please show me an overview of your keys in "HKEY_Current_User > ControlPanel > Power"?
Thank you in advance.
I found the full version of the tutorial and it worked: http://titourhea.free.fr/site/faq.php?lng=fr&pg=312
Thanks to all
What do they mean with:
"HKEY_Current_User, ControlPanel, Power, faire : Values, Display (cliquer dessus), Value Data par défaut = 60"
Do they mean setting value "Default" in HKCU/ControlPanel/Power ?
(in my case it is unset)
Or do they mean setting value "Display" in HKCU/ControlPanel/Power ?
(in my case "Display" does not exist)
Depending on which registry editor you use, it'll have different means of editing the values for that key's default value.
So if it were arranged as a tree, it would look like this:
Code:
HKCU
\\
ControlPanel
\\
Power <== *** under here, you'd edit its (Default) (or hit Values softkey in PHM) ***
\\
LockLevel <== this is a sub-key of the Power key, which has it's own values
\\
Display <== if this existed, it would be here, as another sub-key of Power
I have still not under stood. I am using resco registry editor but : what to change in what I have somethin " Locklevel" under Power.. nothin else. what to change in this. I am using HTC VOX
jsbutran said:
I have still not under stood. I am using resco registry editor but : what to change in what I have somethin " Locklevel" under Power.. nothin else. what to change in this. I am using HTC VOX
Click to expand...
Click to collapse
I do not understand either:
so you do have to create a value under "Power" that is called "Display" (if - as with my Vox - it is not there) and under that you can enter 60,30 or whatever?
TIA
Here's how I did it using Resco's Registry Editor.
Navigate to HKCU>ControlPanel>Power
There you will find:
Code:
..
LockLevel
(Default)
Display
Click on "Display". Now you will see "DWORD Data". Enter "30" there (stands for seconds).
PS. You DO NOT need to create any new keys, string values or whatever.
In my case after some readings from various forums i've found out my problem was caused by installing the tcpmp player. It created the "display" value in the first place. So the best way is to simply delete the "display" value.
After that on the tcpmp player options > settings > advanced - select the options for " no backlight keepalive for video" and home screen timeout for music".
This solution has worked for me. I just have to manually change the display timeout settings to "never" before playing anything on the player.
Hello, i want to custom the HTC'Button
I don't know how to do that, but i know it's in Base register
For ComManager i know it's
Code:
HKLM\Microsoft\Shell\Keys\40C6
default = \Window\CommManagerLink.exe (pour l'exemple) (String Value)
Flags = 0 (DWORD Value)
Icon = \windows\SendKeyIcon.exe, 0 (String Value)
Name = Send key(Hold) (String Value)
And it work
and now i want to start TaskManager with the windows button...
Please help me! Sorry about my English
Just use AE Button Plus.
The easiest and the best.
Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
eg: Lockscreen shows 8:00. I want 08:00.
Thanks in advance.
PS - I can get the zero with lockscreen widgets in CHT2. BUT I want it without any widget add ons.
Try Start-Settings-System-Regional Settings-Time [Page]-Time style HH:mm:ss
hgalanos said:
Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
eg: Lockscreen shows 8:00. I want 08:00.
Thanks in advance.
PS - I can get the zero with lockscreen widgets in CHT2. BUT I want it without any widget add ons.
Click to expand...
Click to collapse
Thanks for your reply. I have changed the regional settings to:
hh:mm:ss and also
HH:mm:ss
Nothing happens. The flip clock stays without a zero.
If you are looking for lockscreen with leading zero try manals Windows LockScreen V4 http://forum.xda-developers.com/showthread.php?t=854047
with settings below it have leading zero for sure. (This is standard windows lockscreen modification, not CHT)
hgalanos said:
Thanks for your reply. I have changed the regional settings to:
hh:mm:ss and also
HH:mm:ss
Nothing happens. The flip clock stays without a zero.
Click to expand...
Click to collapse
The Touch x 24 hours clock fixes the alarm and lockscreen so they now appear as 08:00.
However nothing I have tried works for the home screen flip clock.
Anyone?
Try reg:
[HKEY_LOCAL_MACHINE\nls\overrides]
"STFmt"="HH:mm:ss tt" // (Ex: 08:00 AM or 20:00 PM)
"SSDte"="dd-MM-yyyy" // (Ex: 08-01-2011)
Yep, already tried/checked that. It is as you wrote it.
ALL clocks are showing leading zero, just not Manila home flip clock. Very strange.
Surely there is a way to change it.
hgalanos said:
Yep, already tried/checked that. It is as you wrote it.
ALL clocks are showing leading zero, just not Manila home flip clock. Very strange.
Surely there is a way to change it.
Click to expand...
Click to collapse
It will be controlled by the LUA script for the CHT main clock (assuming it is the main one with various flip/analog/weather options. I'll have a look over the weekend if you like?
Would I be safe in assuming you've already gone to the manila settings tab, date & time and then ticked 24-hour format?
Swarvey said:
Would I be safe in assuming you've already gone to the manila settings tab, date & time and then ticked 24-hour format?
Click to expand...
Click to collapse
Yes you would be safe in assuming this.
As per the ealier threads, time format, local settings have all been checked and changed. Even the registry. Nothing changes the flip clock have a leading zero.
Depending on what version of cht or sense you have it will be in the lua. There should be a statement near the top that says "shouldhideleadingzeros = true" you just need to change it to false and recompile.
EDIT:
Looked into it a little more for you and the file is 5fa4d4b7_manila from your stock sense.
Code:
-- Decompiled using luadec 3.2.2beta -- Tue Jan 11 10:19:35 2011
-- File name: 5fa4d4b7_manila
trace("Loaded digital clock\n")
TabHalf = {Tab = nil, HighDigit = nil, LowDigit = nil}
UV = {UP = 0.26171875, DOWN = 0.5234375}
TabHalf.new = function(l_1_0, l_1_1)
if not l_1_1 then
l_1_1 = {}
end
setmetatable(l_1_1, l_1_0)
l_1_0.__index = l_1_0
return l_1_1
end
TabFlip = {Time = 0, TimeDifference = 0, ShowingTime = 0, WrapAroundNumber = 0, StartValue = 0, [B][COLOR="Red"][B]ShouldHideLeadingZeros = true[/B][/COLOR][/B], TopTab = nil, TopTabFlip = nil, BottomTab = nil, BottomTabFlip = nil, LastDuration = -1, UseAltTiming = false, rotatecount = 1, getDuration = function(l_2_0)
if l_2_0.UseAltTiming then
Wow, I have stock version of 1.72 WWE ROM.
It sound like you are on a winner.
I will check this out tonight when I get home and see what I can do.
Thank you for the information, I will be sure to let you know what happens.
mrhayami said:
Depending on what version of cht or sense you have it will be in the lua. There should be a statement near the top that says "shouldhideleadingzeros = true" you just need to change it to false and recompile.
EDIT:
Looked into it a little more for you and the file is 5fa4d4b7_manila from your stock sense.
Code:
-- Decompiled using luadec 3.2.2beta -- Tue Jan 11 10:19:35 2011
-- File name: 5fa4d4b7_manila
trace("Loaded digital clock\n")
TabHalf = {Tab = nil, HighDigit = nil, LowDigit = nil}
UV = {UP = 0.26171875, DOWN = 0.5234375}
TabHalf.new = function(l_1_0, l_1_1)
if not l_1_1 then
l_1_1 = {}
end
setmetatable(l_1_1, l_1_0)
l_1_0.__index = l_1_0
return l_1_1
end
TabFlip = {Time = 0, TimeDifference = 0, ShowingTime = 0, WrapAroundNumber = 0, StartValue = 0, [B][COLOR="Red"][B]ShouldHideLeadingZeros = true[/B][/COLOR][/B], TopTab = nil, TopTabFlip = nil, BottomTab = nil, BottomTabFlip = nil, LastDuration = -1, UseAltTiming = false, rotatecount = 1, getDuration = function(l_2_0)
if l_2_0.UseAltTiming then
Click to expand...
Click to collapse
ok so I couldn't wait and though I would give it a go now. I have found the same Manila file you have listed, I also downloaded lua utility. How doesn this work, I ran it on my pc and nothing happens.
How can I edit the file?
hgalanos said:
ok so I couldn't wait and though I would give it a go now. I have found the same Manila file you have listed, I also downloaded lua utility. How doesn this work, I ran it on my pc and nothing happens.
How can I edit the file?
Click to expand...
Click to collapse
Well I suggest downloading the manila kitchen by 12 and kilaireg found here:
Thread
It will tell you how to run everything you need but the down and dirty is this.
Copy the manila file into this directory "kitchen>_source>file>xxxx_manila
then use the command prompt link and drag the file manilatool.cmd into the cmd window.
your main commands are going to be as followed in order:
-oem:2.5
-mnf:2.5
-dec
(now that it is decompiled you will be edit the lua in notepad save and then move to the next step.)
Notice: not all files will decompile correctly and you may have to tweak it to get it to decompile correctly.
-cmp (only if it does not fully decompile aka. you have the file in your incomplete folder.)
-rec (will recompile the file which you can then put on your device and enjoy)
I know it isn't much but as I said they have detailed info in the pack.
In case anyone is still trying to figure this out.
I installed the latest 314 WWE ROM and it supports a leading zero on the original manila clock.
Awesome.
hgalanos said:
Hi guys - Happy New Year.
Can anyone tell me how to add a leading '0' (zero) to the lockscreen clock?
I have used a large number of lockscreens, NONE of them have a leading zero. I am using 24hour time. I have the leading zero on the home tab, and on the top taskbar menu. I cannot seem to get it on the lockscreen.
...
Click to expand...
Click to collapse
If you set PocketShield clock display to 24h it will display the leading 0
NO fix as yet.
Guys,
I have to apologise, I don't know what planet I was on, but the new 314 ROM, does NOT fix this issue. There is still no leading zero for manila flip clock.
Anyway have a fix that works?
I have no idea how to edit manila files, and have not been successful is doing so.
I will have to rely on someone generous enough to do it for me.
Thank you in advance to anyone willing to help.
This MOD/FIX is only for Sense Kernels and ROMs/Frameworks
This is only for Kernel and ROM developers. (And maybe some framework tweakers.)
If you wan't to make use out of it, ask your favorite ROM and7or kernel developer.
The mod I describe here, should work with GB as well as Froyo (Desire/Bravo of course).
At first, big thanks to snq- for implementing the kernel mod and making it available for testing and further development.
Thanks to Leedroid for his great ROM in which I am using this MOD/FIX.
Further, thanks to anderl78 for pointing me to adjust the autobrighness in the framework and to sloppy for providing the howto on how to actually change the brightness in the framework.
Big thanks to ivicask who actually patched services.jar to make autobrightness together with the fixed/improved sensor driver work like a charm (see here and here)
If I forgot someone, just let me now.
So as many of you who like to use the autobrightness setting to automatically get the best brighness setting in every light condition I was not quite happy with the way HTC implemented it. Reason for that is, that the autobrightness in the stock framework was at far too high levels leading in to bright screens and unnecessary battery drain.
I will describe both changes in the Kernel and one (optional but recommended) mod in android itself - namely services.jar.
Let's start with the Kernel:
Kernel Mod:
While adjusting the values in the framework and during some testing I realized that not all sensor levels stated in the framework are reported by the lightsensor driver. Most importantly, Level 0 (which refers to absolutely darkness) was never reported by the driver. This made me look into the kernel sources and I finally found a solution.
I will not go into detail and explain the code for you. Every kernel developer should be able to understand and to follow the changes I provide.
First of all, the lightsensor driver uses a loop to report lightlevels for a range of sensor raw data. The lightsensor driver can be found in drivers/input/misc/cm3602_lightsensor_microp.c. In order to make the mod work, there would actually no need in changing the driver itself. But snq- provided a change that makes it even more simple.
Original Code: (drivers/input/misc/cm3602_lightsensor_microp.c)
Code:
static int get_ls_adc_level(uint8_t *data)
{
[B]...[/B]
for (i = 0; i < 10; i++) {
if (adc_value <=
li->ls_config->levels[i]) {
adc_level = i;
[I][B]if (li->ls_config->levels[i])
break;[/B][/I]
}
}
ILS("ALS value: 0x%X, level: %d #\n",
adc_value, adc_level);
data[2] = adc_level;
}
[B]...[/B]
}
Changed Code: (drivers/input/misc/cm3602_lightsensor_microp.c)
Code:
static int get_ls_adc_level(uint8_t *data)
{
[B]...[/B]
for (i = 0; i < 10; i++) {
if (adc_value <=
li->ls_config->levels[i]) {
adc_level = i;
[I][B]break;[/B][/I]
}
}
ILS("ALS value: 0x%X, level: %d #\n",
adc_value, adc_level);
data[2] = adc_level;
}
[B]...[/B]
}
Now for the "real" kernel tweak:
The lightsensor values are stored in the bravo board file: arch/arm/mach-msm/board-bravo.c
Original Code: (arch/arm/mach-msm/board-bravo.c)
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0, 0x21, 0x4D, 0xDC, 0x134, 0x18D, 0x1E5, 0x3FF, 0x3FF, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
Changed Code: (arch/arm/mach-msm/board-bravo.c)
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0x04, 0x21, 0x4D, 0xDC, 0x134, 0x18D, 0x1E5, 0x280, 0x340, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
I changed the values again (just took the ones from bravoc which has all levels defined) to the following - which is working great:
Code:
static struct microp_function_config microp_lightsensor_function = {
.name = "light_sensor",
.category = MICROP_FUNCTION_LSENSOR,
[B][I].levels = { 0, 10, 15, 21, 60, 209, 362, 488, 560, 0x3FF },[/I][/B]
.channel = 6,
.int_pin = 1 << 9,
.golden_adc = 0xC0,
.ls_power = capella_cm3602_power,
};
the final code - especially the lightsensor driver - looks a little bit different (few more tweaks).
They are implemented in snq-'s current kernel and from what I've seen even in bananacakes and tristans...
Those changes enable level 0 (since it is no longer skipped from the driver) and enables levels 7 to 9 (since 0x3FF is the last one and the previous ones are adjusted to lower values).
So, if you have a kernel with the changes implemented you can easily verify with
Code:
cat /sys/devices/i2c-0/0-0066/ls_adc
(and proper light conditions) all sensor levels from 0 to 9 are reported. You can even use a sensor app to verify that all light levels are reported (in lux within those apps).
Here comes the first and (in my opinion) only downside:
I have no idea if HTC implemented the driver the way they did by purpose. And I have no idea if the new reported sensor values in any way report the "right" lux values for the environment brightness. But I actually do not care about that, because I can adjust the framework and do not rely on exactly reported lux values (which is anyway only possible in a quite large range between the levels).
Framework:
Now for the framework / android:
I was quite happy to have all sensor levels enabled. And with proper adjusted autobrightness levels in the framework (framework-res.apk) it works quite well.
I adjusted my framework to tweak the values a little bit further (especially to have the screen quite dimmed in low light conditions). I tried to verify my changes with simply logging sensor data and screen brightness. I do this with a simple script:
Code:
#!/bin/bash
#
while :
do
sleep 1
echo.
adb shell cat /sys/class/leds/lcd-backlight/brightness
adb shell cat /sys/devices/i2c-0/0-0066/ls_adc
done
The script showed me, that even with all levels being reported, the value I set for the lowest level was not applied if you wake up the screen. On screen wakeup, what I saw was either the value for level one, or the maximum brightness (this only happens if you turn off and on again very quickly using the power button). Further, without changines in the environmental light conditions, no new values were applied. This is still annoying if you get max brightness in the middle of the night. Fortunately I was not the only one with that experience. The solution seems to be the (maybe poorly implemented) services.jar in the desire rom. So ivicask patched services.jar with the PowerManager related stuff from the Sensation to make autobrightness together with the fixed/improved sensor driver work like a charm (see here and here).
I flashed this on on my LeeDrOiD 3.3.3 (HD Mod) and it works perfectly.
With those changes in the services.jar (and the "config_autoBrightnessLcdBacklightValues" etc) adjusted accordingly, I now get all levels and the corresponding brightness which feels good and will hopefully add some highly appreciated hours to my battery life.
So, that's all in short. If you have any specific (development related) questions, just let me know.
Please do not ask how to implement it or where to get it - since despite the references below - I have no information on who has implemented or ever will implement this. Use the search function or ask your ROM/Kernel developer.
Update: Information for Brightness / Gamma settings for Amoled (not SLCD)
- max brightness value is 250
- min value is 10 but anything <31 will be set to 20
- gamma steps are 30 and there are actually 9 levels. But that doesn't matter. any value between 30 an 250 should be (more or less).
So if you take those "restrictions" into account while changing your framework, it could add a bit of smoothness (yet not sure about it).
References:
I do not know of any ROM with the mod applied. I personally use
LeeDrOiD HD V3.3.3-Port-R5
snq-'s kernel thread where we tried and made sure it works. I currently use 110918-lsmod1
HowTo change Autobrightness in framework:
Desire HD (Ace) (where I learned to tweak it) Lower Auto-Brightness Settings for DEODEXED FROYO / GINGERBREAD Sense ROMs
Classic Desire specific (Bravo) [How to] Adjust auto-brightness on GB Sense ROM
Question:
Has anyone been successfull to do the same for the hardware button backlights? (meaning to turn them off at higher levels). Seems the changes I applied so far do not work like I expect it.
So, I hope that this mod is of any use for Sense Rom's and kernels. I am more than happy with it and just wanted to share it with you.
Best regards,
Toby
Finally, if any mod thinks this is the wrong section or has no reason to be here, just let me know.
tobi01001 said:
The script showed me, that even with all levels being reported, the value I set for the lowest level was never applied. (Maybe someone can confirm).
Click to expand...
Click to collapse
I can confirm to have seen this behaviour. I could see in the log that the lower level in "config_autoBrightnessLcdBacklightValues" was being applied when no ambient light, but I couldn't see any change in my screen light...
Thanks a lot for your effort. I'm sure anderl78 will take note and adapt his modified frameworks with this 10er value.
If I'm right, currently snq- kernel is up to date with this info (from 110918-lsmod1). I don't really know about bananacakes and others.
bye!
Since this thread deals with brightness level, I'm hoping someone can look at this and shed some light...
Re-posting my post from the orher thread...
Delete it if it's not cool to post this here...
Nice guide...
Did you find a way to adjust Camera's backlight..?
Every time the Camera app launches, the screen's backlight always turn up the brightness substantially...
If this can be adjusted, then it will be a perfect complimentary...
Click to expand...
Click to collapse
Some follow-up...
I didn't find anything in the framework...
But decompiling HTCCamera.apk, and looking at smali's did show something...
It seems that it call's setMaxBrightness (), in almost all activity...
I always felt it increases the backlight, but quite surprised that it's set at MAX...
So...
Anyone experienced in smali's..?
Which line is save to delete/edit to prevent this backlight maxing out..?
Thanx in advance...
Click to expand...
Click to collapse
i just see 1 problem with your framework-res.apk values.
light sensor value can only reach to 10240 so adding 10241 value is useless.
adc reads these values :
- 10
- 40
- 90
- 160
- 225
- 320
- 640
- 1280
- 2600
- 10280
and in framework we have :
- 11
- 41
- 91
- 161
- 226
- 321
- 641
- 1281
- 2601
so all 10 levels (0 to 9) are already presents as you can see :
(level 0 : lower than 11 so 10 indeed)
- 11
(level 1 : from 11 to 40)
- 41
(level 2 : from 41 to 90)
- 91
(level 3 : from 91 to 160 )
- 161
(level 4 : from 161 to 225)
- 226
(level 5 : from 226 to 320 )
- 321
(level 6 : from 321 to 640)
- 641
(level 7 : from 641 to 1280)
- 1281
(level 8 : from 1281 to 2600 )
- 2601
(level 9 : from 2601 to 10280)
so IMOH it's useless to add the last level.
if i didn't understand something please can you explain to us
That's exactly what I thought it should work. Unfortunately the lowest value was never set. So I just added the (rather useless) last value. Now all works like it should and like you described.
So even if it seems useless (and I would agree to that), this is the way it worked out for me...
Sent from my HTC Desire using xda premium
strange, it worked good for me without any other changes than "backlightvalues" in arrays.xml.
probably it depends on rom you use.
NeoEpsilon said:
Since this thread deals with brightness level, I'm hoping someone can look at this and shed some light...
Re-posting my post from the orher thread...
Delete it if it's not cool to post this here...
Click to expand...
Click to collapse
Here's autobrightness fix for HTCCamera
Change
HTCCamera.smali, HTCSnapbooth.smali
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="Red"]MAX[/COLOR]"
Into
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="red"]NORMAL[/COLOR]"
Now when you start camera app screen wont go to MAX but standard android autobrightness will work for camera app.
Here's Camera apk for michaelm_007 Sense2.1+3ROM
View attachment HTCCamera.apk
Or give me you apk so ill mod it for you so you can test.
tobi01001 said:
So, if you have a kernel with the changes implemented you can easily verify with
Code:
cat /sys/devices/i2c-0/0-0066/ls_adc
(and proper light conditions) all sensor levels from 0 to 9 are reported. You can even use a sensor app to verify that all light levels are reported (in lux within those apps).
Click to expand...
Click to collapse
cat /sys/devices/i2c-0/0-0066/ls_adc
ADC[0x0EC] => level 4
Presumably this means it's not working in tristans kernel?
Bit confused by => level 4
ivicask said:
Here's autobrightness fix for HTCCamera
Change
HTCCamera.smali, HTCSnapbooth.smali
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="Red"]MAX[/COLOR]"
Into
Code:
const-string v2, "com.android.settings.request.BRIGHTNESS_[COLOR="red"]NORMAL[/COLOR]"
Now when you start camera app screen wont go to MAX but standard android autobrightness will work for camera app.
Here's Camera apk for michaelm_007 Sense2.1+3ROM
View attachment 731562
Or give me you apk so ill mod it for you so you can test.
Click to expand...
Click to collapse
Thanx...
I've already edited mine exactly like that...
Haven't tried it yet though...
Glad to see the same solution...
Currently looking for a way to enable auto-brightness when launching HTCCamera...
Just in case the phone is set to manual brightness...
t-minik said:
strange, it worked good for me without any other changes than "backlightvalues" in arrays.xml.
probably it depends on rom you use.
Click to expand...
Click to collapse
Are you sure that you've seen all levels and the according screen brightness values? Level 0 and level 1 were always the same for me...
Sent from my HTC Desire using xda premium
NeoEpsilon said:
Thanx...
I've already edited mine exactly like that...
Haven't tried it yet though...
Glad to see the same solution...
Currently looking for a way to enable auto-brightness when launching HTCCamera...
Just in case the phone is set to manual brightness...
Click to expand...
Click to collapse
With the above fix camera is on auto-brightness all the time, theres no manual setting...
ziggy1001 said:
cat /sys/devices/i2c-0/0-0066/ls_adc
ADC[0x0EC] => level 4
Presumably this means it's not working in tristans kernel?
Bit confused by => level 4
Click to expand...
Click to collapse
How can you come to such conclusion? The level you see will depend on the light that is on the sensor... That's the whole meaning about it..
And make sure the screen is one. Otherwise what you get from the sensor is everything but the light level.
Sent from my HTC Desire using xda premium
ivicask said:
With the above fix camera is on auto-brightness all the time, theres no manual setting...
Click to expand...
Click to collapse
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
---------- Post added at 09:04 PM ---------- Previous post was at 09:00 PM ----------
tobi01001 said:
How can you come to such conclusion? The level you see will depend on the light that is on the sensor... That's the whole meaning about it..
And make sure the screen is one. Otherwise what you get from the sensor is everything but the light level.
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
@tobi01001
tobi...
In a normally lighted bedroom, what level is your Desire set to..?
My Desire never set the level above 2...
To push it to level 4, I need to blast it with a flashlight...
Just curious about the sensitivity...
NeoEpsilon said:
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
Click to expand...
Click to collapse
If you turn off automatic brightness in your phone and put it manualy to the max Camera will be also at max.
If you put it on middle..camera will be middle
If you put it to Auto, camera will be auto
thats it
tobi01001 said:
Are you sure that you've seen all levels and the according screen brightness values? Level 0 and level 1 were always the same for me...
Sent from my HTC Desire using xda premium
Click to expand...
Click to collapse
i'm sure
as i set level 0 is 41 and level 1 is 55 all others are working.
i just saw a thing that can help.
for me when screen is off, adc level is set to 5.
so when you lit up screen adc can read a value between 0 and 9 and screen brightness change to desired value.
but when adc level go up brightness setting used seems to be those :
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
when adc level go down it's the same with :
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
if values for a same level are higher than in <integer-array name="config_autoBrightnessLcdBacklightValues">, when adc level returns to 0 backlight will never go down to the normal value but go to the "config_autoBrightnessLcdBacklightValuesDown" for exemple.
so extreme personally I set the same extreme values for the 3 lists.
EDIT // do you think adc level 0 can be set to 20 instead of 10 for a slightly less sensibility ?
Here are my values, and so far working perfectly, minimum and maximum values and everything... (gingercakes-0.7c) .
Code:
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>33</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>208</item>
<item>230</item>
<item>254</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>31</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>209</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>32</item>
<item>52</item>
<item>82</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>207</item>
<item>229</item>
<item>253</item>
What's your opinion?
t-minik said:
i'm sure
as i set level 0 is 41 and level 1 is 55 all others are working.
i just saw a thing that can help.
for me when screen is off, adc level is set to 5.
so when you lit up screen adc can read a value between 0 and 9 and screen brightness change to desired value.
but when adc level go up brightness setting used seems to be those :
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
when adc level go down it's the same with :
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
if values for a same level are higher than in <integer-array name="config_autoBrightnessLcdBacklightValues">, when adc level returns to 0 backlight will never go down to the normal value but go to the "config_autoBrightnessLcdBacklightValuesDown" for exemple.
so extreme personally I set the same extreme values for the 3 lists.
Click to expand...
Click to collapse
Well, I've never seen the values in up and down. I set them different by purpose. But at least for me, it turns out they are never set.
EDIT // do you think adc level 0 can be set to 20 instead of 10 for a slightly less sensibility ?
Click to expand...
Click to collapse
Short answer: maybe, but with little use.
Well, at the moment it is possible to adjust the table in the bravo board file. Those represent somehow the raw values and are then set as light levels.
I do not know how to change the 10 to a 20. But that would make not that much sense since the driver will set the same levels. Android (the sensor manager) would only see a 20 instead of a 10 - but the environmental light conditions didn't change.
However, it would be possible to increase the value, which represents level 0 - so the span for level 0 would be a bit wider. Actually, I already proposed this with using 4 instead of 1...
Further:
I just found, that if you turn on the screen in absolutely brightness then the screen brighness is still set to the value of level 1 (40 in my framework). In this case it does somehow not go down to the value of level 0. There is a change to a brighter value needed first.
I will investigate a bit more and play with different settings as soon as I have time to do so.
NeoEpsilon said:
Seriously..?
I'm under impression that if my phone uses manual brightness, then the above fix will also use the same manual setting...
So whatever setting my brightness is, it HTCCamera will always use auto..?
Will try this later...
---------- Post added at 09:04 PM ---------- Previous post was at 09:00 PM ----------
@tobi01001
tobi...
In a normally lighted bedroom, what level is your Desire set to..?
My Desire never set the level above 2...
To push it to level 4, I need to blast it with a flashlight...
Just curious about the sensitivity...
Click to expand...
Click to collapse
In my bedrom is totally darkness... at least when I intend to sleep. So level 0. With common indoor light it is usually level 1 to 3. Level 4 to 5 in some cloudy sky and or in the shadow. The upper levels need more or less sunlight.
Do you have a case or something covering the lightsensor maybe?
ivicask said:
Here are my values, and so far working perfectly, minimum and maximum values and everything... (gingercakes-0.7c) .
Code:
<integer-array name="config_autoBrightnessLevels">
<item>11</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>33</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>208</item>
<item>230</item>
<item>254</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>31</item>
<item>51</item>
<item>81</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>209</item>
<item>231</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>32</item>
<item>52</item>
<item>82</item>
<item>115</item>
<item>133</item>
<item>153</item>
<item>186</item>
<item>207</item>
<item>229</item>
<item>253</item>
What's your opinion?
Click to expand...
Click to collapse
So you are using 9 values (stock ones of course) in
Code:
<integer-array name="config_autoBrightnessLevels">
as well.
Could you maybe confirm that you see Level 0 and the corresponding screen brightness (33 in your case)... If so, I may have been totally wrong in my assumptions about the framework.
I do not understand the slight differences in the up/down lists and my personal feeling is that those have no impact on what you actually see.
I have them set totally different and as already mentioned, I never saw the screen brightness set to any of them.
this is how I set my values in the framework, but thats personal feeling anyway:
Code:
<integer-array name="config_autoBrightnessLevels">
<item>21</item>
<item>41</item>
<item>91</item>
<item>161</item>
<item>226</item>
<item>321</item>
<item>641</item>
<item>1281</item>
<item>2601</item>
<item>10241</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>21</item>
<item>40</item>
<item>50</item>
<item>70</item>
<item>80</item>
<item>90</item>
<item>120</item>
<item>160</item>
<item>200</item>
<item>255</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesUp">
<item>21</item>
<item>28</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>85</item>
<item>105</item>
<item>140</item>
<item>180</item>
<item>228</item>
</integer-array>
<integer-array name="config_autoBrightnessLcdBacklightValuesDown">
<item>28</item>
<item>45</item>
<item>60</item>
<item>75</item>
<item>85</item>
<item>105</item>
<item>140</item>
<item>180</item>
<item>228</item>
<item>255</item>
</integer-array>
I'm pretty sure it works perfectly on 10 levels without adding any level in framework.
values, valuesip and valuesdown are very close and it should work perfectly.
for me, values, valuesip and valuesdown are the same and it's perfect on BravoS V7