maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Custom Brightness for N900 - no ALS (https://talk.maemo.org/showthread.php?t=63985)

dr_frost_dk 2010-10-18 14:48

Custom Brightness for N900 - no ALS
 
I have looked most of meamo and goggled a lot but can't seem to find anybody that has made an app or got a solution to making a custom brightness setting/app

My own findings/solutions so far have been:
Disabling ALS via /etc/mce/mce.ini
Making a SH that loops with:
echo 160 >/sys/class/backlight/acx565akm/brightness
sleep 1

This works, and keeps my screen brightness at 160 witch is a nice setting since is kinda in the middle of setting 4 and 5 with ALS.

Disabling ALS is possible by removing it in mce.ini but it does have a bad effect by changing the 5 normal settings to 2, 5, 7, 10, 12, now whats needed in my view is to find out how to change the 5 normal settings from the really low settings without ALS to 5 custom steps.

Progress so far.
-----------------------------------
edit /etc/mce/mce.ini
remove the 'filter-brightness-als' from 'Modules=', of course rember to backup original 'mce.ini'.

make a script file in /etc/event.d/ "your filename here"
Code:

start on started hildon-desktop
exec /etc/init.d/ "your filename here"

make a script file in /etc/init.d/ "your filename here"
Code:

#! /bin/sh
cat "brightness file" >sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_ind' | while grep -q "display_status_ind"
do
  cat "brightness file" >sys/class/backlight/acx565akm/brightness
done

files:
"brightness file" - mine is /home/user/bright_setting
"your filename here" - mine is /etc/event.d/frost_custom_settings and /etc/init.d/frost_custom_settings

remember to make the "brightness file" before rebooting else it will assume your brightness is 0 and that will turn off your backlight completely, witch will make it VERY difficult to see anything on the screen.

dr_frost_dk 2010-10-18 19:45

Re: Custom Brightness for N900 - no ALS
 
bump...
any idea's anyone....
i been looking in about every file on the n900 with mc but can't find the standard values for the 5 brightness steps....

Megaltariak 2010-10-18 19:47

Re: Custom Brightness for N900 - no ALS
 
The standard value for the 5th brightness step is the max which is 255.

dr_frost_dk 2010-10-18 19:58

Re: Custom Brightness for N900 - no ALS
 
yes and step 4 is about 80, but that is when ALS is on.
When ALS is disabled the 5 values are 2, 5, 7, 10, 12......
witch makes the screen very dark, probably good for night reading.

what i want is to change the 5 values to something like 15, 25, 80, 160, 255 and again with ALS off because i hate the self adjusting brightness....

dr_frost_dk 2010-10-18 21:17

Re: Custom Brightness for N900 - no ALS
 
so if anybody out there knows where the values are defined/stored in the OS or MCE please let me know.

dr_frost_dk 2010-10-19 08:22

Re: Custom Brightness for N900 - no ALS
 
bump again...

JonWW 2010-10-19 08:44

Re: Custom Brightness for N900 - no ALS
 
Have you tried:
http://maemo.org/downloads/product/M...htness-applet/

dr_frost_dk 2010-10-19 08:54

Re: Custom Brightness for N900 - no ALS
 
yes and it's a great app, but that is not what this thread is about.

What i have done is disabling ALS (light sensor) so that it doesn't change brightness all the time witch is very ignoring. All so the 5 normal steps aren't very good, got the choice of 4 steps thats to dark and 1 step witch normally is to bright....

But as i said before when disabling mce in /etc/mce/mce.ini the 5 steps become very dark, but now it should just be a question of finding the 5 values and changing them to 5 custom steps with suits the user.

JonWW 2010-10-19 10:51

Re: Custom Brightness for N900 - no ALS
 
Have you checked the source code to the app to see if the values are hard coded.

I found in the past when I manually changed the brightness values in xterm they would then change by themselves after the screen timed out or was locked, I don't know what was controling the brightness, the app or the OS as I didn't uninstall it.

I agree the automatic brightness setting is annoying, but I am now used to it.

As you have disabled the light sensor it would be interesting to see if the brightness gets automatically changed when the screen times out or you lock the device.

maemo5 2010-10-19 11:04

Re: Custom Brightness for N900 - no ALS
 
sooo....i can change some settings to get brighter camera flash?

AlMehdi 2010-10-19 11:11

Re: Custom Brightness for N900 - no ALS
 
Could ALS be faked? So it will tell a faked light environment... thus making the steps lighter

noobmonkey 2010-10-19 11:16

Re: Custom Brightness for N900 - no ALS
 
W00000p - i detailed a bit about the backscreen on my healthcheck page here -
http://www.greg-roberts.com/index.ph..._id=7&Itemid=1

But the basic commands to get the backscreen light and therefore find out more about it are:

x-Terminal commands -
Actual Brightness level - cat /sys/class/backlight/acx565akm/brightness
Max Brightness level - cat /sys/class/backlight/acx565akm/max_brightness

Take a look at what is actually in the /sys/class/backlight/acx565akm folder. i assume it is possible to write to these and monitor, therefore changing the brightness? :)

dr_frost_dk 2010-10-19 11:23

Re: Custom Brightness for N900 - no ALS
 
again.
since i disabled ALS, the normal values are all under 15 in value out of the 255 steps, so very dark....
As i all so posted first is that i have a script running that does:

tell brightness to be 160, wait 1 second, tell it to be 160 again and keep looping

does have some funny effects like:
when i activate key-lock from "sleep state" depending on where it is in the 1 second loop, it than starts up with brightness 12 (step 5) and within 1 second it goes to 160.

when the phone goes to black (30 sec timeout) it fades for max 1 sec, but the loop is still telling it to go to 160, and it goes to 160, then about 2 sec later (out of 3 sec "fade out") it goes to black

so for anyone wondering if it's will be lit all the time because of the script, it doesn't...

dr_frost_dk 2010-10-19 12:24

Re: Custom Brightness for N900 - no ALS
 
actual code from script ( i'm not the best programmer.... so if you have some good changes please post :) )

----------------------------------------------------------------
#!/bin/sh
i=5
while [ i$ -lt 10 ]
do
echo 160 >/sys/class/backlight/acx565akm/brightness
sleep 1
done
------------------------------------------------------------------
so if you want to try it.
as for /etc/mce/mce.ini just remove the 'filter-brightness-als' from 'Modules=', of course rember to backup original 'mce.ini'.

Just a warning: edit of 'mce.ini' and reboot, will make your screen very dark since brightness step 5 (max setting) will have a value of 12 instead of orig value of 255.

dr_frost_dk 2010-10-19 18:31

Re: Custom Brightness for N900 - no ALS
 
bump.... anybody got any ideas yet.....

dr_frost_dk 2010-10-20 09:19

Re: Custom Brightness for N900 - no ALS
 
Been trying different things, and can report that you cannot change/alter max_brightness witch would be a nice function to have.
That would make it possible to set max_brightness to 160 witch would make step 5 value 160, but would not disable ALS....
But no matter what i try it will not permit changing the value in max_brightness

The solution will still be to be able to alter the 5 brightness steps somewhere in the system.

Tigerite 2010-10-20 09:49

Re: Custom Brightness for N900 - no ALS
 
Maybe you could try writing to /sys/devices/platform/omap2_mcspi.1/spi1.2/backlight\:acx565akm/brightness as this sticks until display is dimmed or turned off?

dr_frost_dk 2010-10-20 10:18

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by Tigerite (Post 845906)
Maybe you could try writing to /sys/devices/platform/omap2_mcspi.1/spi1.2/backlight\:acx565akm/brightness as this sticks until display is dimmed or turned off?

thats what my script is doing, it's just doing it every second to keep display up at 160 brightness

note:
"/sys/devices/platform/omap2_mcspi.1/spi1.2/backlight\:acx565akm/brightness" is the same as "/sys/class/backlight/acx565akm/brightness"

JonWW 2010-10-20 10:51

Re: Custom Brightness for N900 - no ALS
 
Try a dbus-monitor command, it will save you battery as you will not be running a point less loop all the time doing something that hardly ever needs to be done.
Code:

#!/bin/sh

dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_ind' | while grep -q "display_status_ind"
do
  echo 160 >/sys/class/backlight/acx565akm/brightness
done

This code will only ever activate when the brightness changes (hopefully), I have not been playing around with /etc/mce/mce.ini so cannot say how well it will work for you.

dr_frost_dk 2010-10-20 14:58

Re: Custom Brightness for N900 - no ALS
 
That seemed to work just fine, both with "fade out" and with key-lock

thank you very much, now this is a possibly to use this for a "locked" brightness setting.

if we can't find the values for the 5 steps, this solution can be made as a widget as custom setting and maybe with some "memory" settings.

just a side question, what kind of command/file exe, to make this work on startup....

dr_frost_dk 2010-10-20 17:25

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by JonWW (Post 845953)
Try a dbus-monitor command, it will save you battery as you will not be running a point less loop all the time doing something that hardly ever needs to be done.
Code:

#!/bin/sh

dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_ind' | while grep -q "display_status_ind"
do
  echo 160 >/sys/class/backlight/acx565akm/brightness
done

This code will only ever activate when the brightness changes (hopefully), I have not been playing around with /etc/mce/mce.ini so cannot say how well it will work for you.

Can you tell me how to make your nice script run on boot.

dr_frost_dk 2010-10-20 23:14

Re: Custom Brightness for N900 - no ALS
 
as i said i'm not the most hardcore programmer, so if anybody can tell me how to get JonWW's script to start up on boot that would be nice.

dr_frost_dk 2010-10-21 10:45

Re: Custom Brightness for N900 - no ALS
 
been trying various things....
still can't figure out how to make this run on startup.....

Tigerite 2010-10-21 11:04

Re: Custom Brightness for N900 - no ALS
 
You could try with fcron, but tread carefully:

http://wiki.maemo.org/Fcron#Configuration

JonWW 2010-10-21 11:24

Re: Custom Brightness for N900 - no ALS
 
Look in
Code:

/etc/event.d
the start up scripts for many programs are in there, look at them and adapt one to suit your needs.

dr_frost_dk 2010-10-21 12:12

Re: Custom Brightness for N900 - no ALS
 
allmost got it working now just need help with one last thing:
It now starts the scrips on boot (started hildon-desktop) but it does not keep running, and brightness is back to normal after keyock or "fadeout"

my /etc/event.d/frost_custom_settings
--------------------------------------------------
start on started hildon-desktop
stop on starting shutdown

script
echo 4 >/sys/class/i2c-adapter/i2c-2/2-0063/region
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',mem ber='display_status_in' | while grep -q "display_status_ind"
do
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
done
end script
-----------------------------------------

what am i doing wrong???

JonWW 2010-10-21 12:30

Re: Custom Brightness for N900 - no ALS
 
Run an boot setup should go here
/etc/event.d/frost_custom_settings:
Code:

start on started hildon-desktop
stop on starting shutdown
exec /etc/init.d/frost_custom_settings

Appartently scripts to then be run should go in /etc/init.d so
/etc/init.d/frost_custom_settings:
Code:

echo 4 >/sys/class/i2c-adapter/i2c-2/2-0063/region
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_in' | while grep -q "display_status_ind"
do
  cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
done


dr_frost_dk 2010-10-21 12:46

Re: Custom Brightness for N900 - no ALS
 
still no cigar.....
it still only runs on startup, but doesn't keep going....


scratch that, there was a typo in the code in my script.....
member='display_status_in' should had been member='display_status_ind'

dr_frost_dk 2010-10-21 12:55

Re: Custom Brightness for N900 - no ALS
 
now i just have to make a widget or something that does

----------------
"get value" from widget (brightness)
echo (brightness) >/sys/class/backlight/acx565akm/brightness
write/echo (brightness) >/home/user/bright_setting

than it should change brightness and use the value from /home/user/bright_setting

the widget can be made with 2 - xx memory settings for the settings you like to use.

MANY thanks to JonWW for all the help in finally making this work.
No more stupid ALS and a custom brightness thats suits the user

I have made a complete guide to this at the first post now.

This so far only gives you 1 brightness setting but a homemade widget can be made to give you more settings.
This does not change the stock 5 settings, witch after the removal of ALS will be 5 very low steps.
If anybody finds out how to change the 5 stock steps to 5 custom steps please post it here or let me know :).

JonWW 2010-10-21 13:14

Re: Custom Brightness for N900 - no ALS
 
Try experimenting with 'Simple Brightness Applet' in your do loop to see what value it set the screen brightness to, then if those value appear when you 'cat /sys/class/backlight/acx565akm/brightness' substitute you own values to suit you.

Run you script in XTerm to see whats going on first.

Keep us updated.

dr_frost_dk 2010-10-21 13:29

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by JonWW (Post 847081)
Try experimenting with 'Simple Brightness Applet' in your do loop to see what value it set the screen brightness to, then if those value appear when you 'cat /sys/class/backlight/acx565akm/brightness' substitute you own values to suit you.

Run you script in XTerm to see whats going on first.

Keep us updated.

when using 'Simple Brightness Applet' it sets the brightness to the 5 steps that are now - 2,5,7,10,12 (Very dark ;)), and to get the "custom brightness" back i have to tab 2 times on keylock (screen off & on) than my custom setting of 160 is active again

again - the 5 low steps are due to disabled ALS else it would be the normal 5 steps that you all use.

JonWW 2010-10-21 13:40

Re: Custom Brightness for N900 - no ALS
 
Try something like:
Code:

echo 4 >/sys/class/i2c-adapter/i2c-2/2-0063/region
cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
dbus-monitor --system type='signal',interface='com.nokia.mce.signal',member='display_status_in' | while grep -q "display_status_ind"
do
  case `cat /sys/class/backlight/acx565akm/brightness` in
    2) echo 50 > /sys/class/backlight/acx565akm/brightness;;
    5) echo 80 > /sys/class/backlight/acx565akm/brightness;;
    7) echo 160 > /sys/class/backlight/acx565akm/brightness;;
    10) echo 205 > /sys/class/backlight/acx565akm/brightness;;
    12) echo 255 > /sys/class/backlight/acx565akm/brightness;;
    *) cat /home/user/bright_setting >/sys/class/backlight/acx565akm/brightness
done


dr_frost_dk 2010-10-21 13:52

Re: Custom Brightness for N900 - no ALS
 
that didn't work... but i see what you are trying to do and i hope we can make it work, then we will have the 5 custom steps

Tigerite 2010-10-21 14:05

Re: Custom Brightness for N900 - no ALS
 
It's a dbus call, therefore I believe you need run-standalone.sh in front of the line where you run the script?

dr_frost_dk 2010-10-21 14:06

Re: Custom Brightness for N900 - no ALS
 
Is there a dbus command that registers brightness change?, the command i use now only reacts when the phone goes from "sleep" to "turn on display".

JonWW 2010-10-21 14:09

Re: Custom Brightness for N900 - no ALS
 
1 Attachment(s)
This could be quite good if you can get it to work.

My thoughs are:
I have a realy good flash based flip clock (HH:MM no seconds) that fills the screen and runs in the browser, now if you can get the case statement to work and if you can find out how to disable the screen blanking after timeout, then in the first 'case "2" in' result could be made to keep screen switched on; set at say brightness 1 so it is just visible at night and to open the browser with the flash clock, that would be sweet.

Attachment 14900

You might have found a new way to use the 'Simple Brightness Applet'

Keep going.

JonWW 2010-10-21 14:16

Re: Custom Brightness for N900 - no ALS
 
If you have Windows try downloading PuTTY, it will make life alot easier, it's a terminal window into you phone from your PC. In that type
Code:

dbus-monitor --profile --system
to monitor system events.
You will need OpenSSH installed on your phone to connect from your PC.

JonWW 2010-10-21 14:19

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by Tigerite (Post 847121)
It's a dbus call, therefore I believe you need run-standalone.sh in front of the line where you run the script?

Tigerite
Thanks for that, I was having problems of my own with a boot script and a dbus-send command that wasn't working as I wanted, I got around it by opening another terminal window to call the dbus command, realy messy. Now it works as required, thanks.

dr_frost_dk 2010-10-21 14:43

Re: Custom Brightness for N900 - no ALS
 
regarding your clock at night with brightness at 1 or 2, i have my phone hocked up thou a Amp meter right now and if you do this your phone will drain from full charge (1320mAh) in about 12 hours, right now it's using 100ma on average at brightness 2. at 160 it's using 190ma on average.
so if you do this you might want it connected to charger thug the night.

dr_frost_dk 2010-10-21 14:44

Re: Custom Brightness for N900 - no ALS
 
Quote:

Originally Posted by JonWW (Post 847133)
If you have Windows try downloading PuTTY, it will make life alot easier, it's a terminal window into you phone from your PC. In that type
Code:

dbus-monitor --profile --system
to monitor system events.
You will need OpenSSH installed on your phone to connect from your PC.

i'm only in ubuntu.....


All times are GMT. The time now is 21:57.

vBulletin® Version 3.8.8