Bug 12886 - Brightness curve needs updating
: Brightness curve needs updating
Status: CLOSED FIXED
Product: SB Radio
Classification: Unclassified
Component: Buttons/Knob
: Include FW version in comment
: PC Other
: -- normal (vote)
: CAT
Assigned To: Felix Mueller
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-16 07:29 UTC by Caleb Crome
Modified: 2009-10-06 09:22 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
calculate brightness curve based on equi-percent steps. (323 bytes, text/x-perl-script)
2009-07-16 07:46 UTC, Caleb Crome
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Caleb Crome 2009-07-16 07:29:05 UTC
The brightness curve on baby needs to be updated.  Currently, the UI setting corresponds to the PWM brightness (i.e. kernel setting).  I don't think this is correct.

I think the UI brightness steps should be in terms of % brightness increase. Currently step 2 is 100% brighter than step 1, but step 255 is only 0.4% brighter than 254 -- almost imperceptible.

Currently, the baby PWM is driven by a 256 step PWM (8-bits).  It has the capability to be driven from a different PWM timer, which will give us much better performance.  The driver for that hasn't been written yet though.

So, for now, the brightness settings are:

brightness = n/256.  

This means that for equal-brightness-increase steps in the UI, we need nonlinearly spaced steps.

So, for 10% increase per step (and maintaining maximum resolution at low brightness), the steps would be as in the following table.

Can somebody give this a try?  I suspect it will be much better brightness curve, but I haven't tried it out.

1
2
3
4
5
6
7
8
9
10
11
12
14
16
18
20
22
24
27
30
33
37
41
45
50
55
61
67
74
81
89
98
108
119
131
144
158
174
191
210
231
255
Comment 1 Caleb Crome 2009-07-16 07:46:20 UTC
Created attachment 5476 [details]
calculate brightness curve based on equi-percent steps.
Comment 2 Caleb Crome 2009-07-16 07:46:49 UTC
Check attached the perl script for auto-calculation of these values.
Comment 3 Felix Mueller 2009-07-18 07:36:31 UTC
Adding Raphael who did the ambient light sensor on Fab4
Comment 4 Felix Mueller 2009-07-23 15:26:25 UTC
Implemented in r6765

This is the Lua generated brightness table:

 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 13, 15, 17, 19, 21, 24, 27, 30, 33,
37,41,46,51,57,63,70,77,85,94,104,115,127,140,154,170,187,206,227,250

Lua code:

function _initBrightnessTable( self)
  local pwm_steps = 256
  local brightness_step_percent = 10
  local k = 1

  brightnessTable[k] = 1
  for step = 1, pwm_steps, 1 do
    if 100 * ( step - brightnessTable[k]) / brightnessTable[k] >= brightness_step_percent then
      k = k + 1
      brightnessTable[k] = step
    end
  end
end
Comment 5 Caleb Crome 2009-07-23 16:24:56 UTC
Nice.  I like it.

Matt?
Comment 6 James Richardson 2009-10-06 09:22:36 UTC
This bug has been fixed in the latest release of MySqueezebox.com (formally
known as SqueezeNetwork)!

If you are still experiencing this problem, feel free to reopen the bug with
your new comments and we'll have another look.