dux icon indicating copy to clipboard operation
dux copied to clipboard

Ambient light based adaptive brightness mode?

Open Celti opened this issue 8 years ago • 12 comments

It'd be nice to have a mode to adjust the brightness based on a light sensor (which some devices have) or webcam (which many devices have), a la yawls or calise.

Celti avatar Aug 09 '16 10:08 Celti

I was thinking about it, the problem is I don't have a webcam nor a light sensors :panda_face:

meh avatar Aug 09 '16 15:08 meh

Actually I think I do have a light sensor, looking into it.

meh avatar Aug 09 '16 17:08 meh

Well, I do have a webcam in my laptop (and technically also a light sensor on my phone, though I don't have a setup to cross-compile Rust for Android) — I just have too many projects on a very small plate right now. If you start a framework for the feature, though, I will happily bug-test and contribute to getting it working!

Celti avatar Aug 10 '16 21:08 Celti

Brightness adjustment based on webcam input would be a great addition.

nxnfufunezn avatar Aug 12 '16 17:08 nxnfufunezn

Yeah, I'm definitely going to add the webcam one.

I did some research and interacting with the light sensors seems to be hell on earth with inconsistent sysfs interfaces between different drivers, so I'll scrap that for now.

But webcam is coming!

meh avatar Aug 13 '16 00:08 meh

I have an ALS accessible via /sys/bus/iio and already wrote software to read the sensor value and adjust the backlight via /sys but will now go and try to add that implementation to dux.

Excellent work btw. Brandon

On Aug 12, 2016 5:18 PM, "meh." [email protected] wrote:

Yeah, I'm definitely going to add the webcam one.

I did some research and interacting with the light sensors seems to be hell on earth with inconsistent sysfs interfaces between different drivers, so I'll scrap that for now.

But webcam is coming!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/meh/dux/issues/1#issuecomment-239588693, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYMoVLrKVvezTLeW4BozzPSA6RsPpKJks5qfQ1kgaJpZM4Jf6h0 .

brandonedens avatar Aug 13 '16 17:08 brandonedens

@brandonedens nice, if you have any questions about the code don't hesitate to ask.

meh avatar Aug 13 '16 17:08 meh

So I had a bit of free time and sanity to revisit this, and found the rscam crate. It looks like it should be pretty easy to just grab a single camera frame and run the same code that dux already has to extract luminance and adapt the brightness — which means I'm probably missing some horrible blocker on this one.

Celti avatar Nov 10 '16 04:11 Celti

@Celti I think the algorithm used would be different to have decent enough results.

meh avatar Nov 10 '16 05:11 meh

I wrote this whole big response to that and then I realised I'm an idiot when an actual thought came into my brain: Why not let the camera do the work? Each camera knows best what exactly its capturing in terms of light, after all — and I don't think I've seen a webcam made in the past fifteen years that didn't support capturing in YUV format. The Y channel being luminance data, can we just extract and average that?

Celti avatar Nov 10 '16 05:11 Celti

@Celti my doubt is mostly whether or not averaging the luminance of what the camera is seeing would map correctly or well to the luminance the person perceives around them.

meh avatar Nov 10 '16 05:11 meh

Any progress?

marsjaninzmarsa avatar Apr 07 '17 03:04 marsjaninzmarsa