yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] velis74:
This is very strange indeed. I check for camera existence using standard Android API and it should always report the same thing (it does on my phone). This is just it with Android cameras: the support is extremely shaky and there's no way (that I have found) that would guarantee a consistent operation of cameras. That said, I am looking for a solution constantly because I want to properly support cameras. Just haven't found it yet.

The text file columns are:

Last sensor reading, camera pic average brightness, camera pic median brightness, average percentile, iso, apperture, shutter

Picture brightness is then calculated using these two formulas:

double exposure = Math.sqrt((4 / iso) * (40000 / shutter));

double light = Math.pow(avg, 1.5) * Math.sqrt((average percentile) / 0.5) * exposure;

This has been found to produce the best correlation with light sensor on my phone.

All that said, on my phone camera works in some 1/3 of reboots. In all other cases something goes wrong and the app can't get a pic to calculate brightness from. Sometimes things go so wrong even that the app crashes even though the code is entirely wrapped in try / except statements.
[Android Apps and Games] lklaus:
Then I see one problem on my phone: shutter is always 0 (as is aperture and last sensor reading)

Will try some reboots and check which/wether cameras is/are detected...

I probably should also say I'm on enox AMD3 ROM

Thanks

Klaus
[Android Apps and Games] velis74:
Last sensor reading is expected to be 0 since you probably don't even have it (it's the ligt sensor as such). That reading is only available on phones with actual light sensor so that I can do correlation calculations.

As for shutter speed parameter, that one is very bad to be missing - it is the single most important reading giving more than 90% of total lightness calculation.

That said, the app stores two images on its data folder if you check the appropriate check in the dev settings dialog. Is it possible for you to send me the larger one? It should contain EXIF information, perhaps there's another field that stores shutter speed in there.
[Android Apps and Games] lklaus:
Yes, this explains it, then...

I put them at my webserver, lichtenwalder.name, with their names pic_front.jpg and pic_back.jpg, due to their size (can't yet post links)

Klaus
[Android Apps and Games] sunsero:
So how you are checking for the cameras is the same as described at http://stackoverflow.com/questions/...able-in-android-device-and-also-if-the-device ? Can you make a debug button to actually let the user check for the results of hasSystemFeature()? Also when is the check for the camera done - if it's during boot time then maybe it's a timing issue that some time during the boot up time the camera is not available for detection?

Hmm... never ever saw the option to use the camera as sensor on my i8190 - and I really did a lot of reboots. What other sensors do you have activated when the option was active after the reboot? Maybe there's the dependency - I've also got an app called Auto Screen On running that checks for the proximity sensor.

Just saw the front picture loads much faster...

[MENTION=2424510]velis74[/MENTION] - would it make sense to reduce the camera resolution for the pictures taken to make processing them faster?
[Android Apps and Games] lklaus:
Yeah, that's a bit tricky, and took me some time to get it working... Velis describes it in his manual. Just the region where it's possible to activate it is very small. Always takes me some tries...
[Android Apps and Games] sunsero:
That has been tricky but not related to my issue on i8190 I think: I'm seeing both the options for front and back camera in settings however it tells at both of them "Es wurde kein Sensor in deinem Handy gefunden" which means "There was no sensor found in your device". Therefore I can activate none of them - those options are visible but greyed out.
[Android Apps and Games] lklaus:
I see. At the moment, with stock kernel (enox) and lupohirp goldenkernel I also get the main (back) camera. The other camera gives the same output (in German :)) Right now it's fairly constant, but first I had only the front camera, then I had both cameras, now for some time already I only have the back (main) camera...

Klaus
[Android Apps and Games] sunsero:
So far I'm using only the stock kernel Android 4.1.2 I8190XXAMD3 - the device is not rooted but there are 282 apps installed on it ;)

Let's hope velis74 has some idea to our informations provided.
[Android Apps and Games] velis74:
Thanks, now downloaded. What's with the pic size though?!?! Those jpegs are bigger than BMPs would be for that image size?!?!?!

I took a quick peek and it seems shutter speed is included. Perhaps it's the reverse speed or something, will take a look and adapt the algorithm accordingly.

I just call Camera.getNumberOfCameras / Camera.getCameraInfo to get the info. I will see if I can include some more obvious info in the dialog itself. About time I got this working too.

I suppose you ddn't enable it as per instructions: You have to activate dev support dialog (long-press the proximity sensor reading value on main screen) and select camera support in the dialog. Only then will detection take place.

After seeing image sizes Klaus provided, I will most definitely do that. The cameras on my phone take some pretty low res images by default, so I didn't mess with the code to reduce possible issues, but images THAT big require some attention, it seems.
[Android Apps and Games] lklaus:
You're right, I saw that size, but it did not come to my mind that this is totally wrong. I just checked, and it looks like it appends pictures, instead of writing the file anew everytime

Klaus
[Android Apps and Games] sunsero:
There are devices that do not have a front camera like HTC Wildfire S and some tablets that do not have a back camera. Any reason you do not use pm.hasSystemFeature(PackageManager.FEATURE_CAMERA) and pm.hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT) to explicitely check for back and front camera?

Actually in the dev support dialog I already had the first option on, now I additionaly turned on the other two camera related options and suddenly your app detected the front camera so I could activate it in settings. The option to for the back camera however was still disabled so I could not activate it. Not sure if it has any effect though except the mobile now tells the memory is almost full - therefore I think I'll better wait for a version not appending the pictures.
[Android Apps and Games] sunsero:
[MENTION=2424510]velis74[/MENTION]:

I'm having the front camera sensor active again and just disabled the option to store the last picture. However I don't think the app does change the brightness of the display (only sensor activated in settings is the front camera). I've also looked for the data folder for the app to have a look at the log but I could not find a data folder for the app in /sdcard/Android/data/. How should the folder there be named exactly?
[Android Apps and Games] lklaus:
Hi,

the location is /data/data/com.velis.auto.brightness. You need root to enter there...
[Android Apps and Games] sunsero:
Thanks, as my i8190 is not rooted and I currently don't want to root it, unfortunately I can't see the contents of this folder.

[MENTION=2424510]velis74[/MENTION]: Is it possible to store the log at a location that does not require root access? Maybe the last status could be directly shown in the app?
[Android Apps and Games] velis74:
I am not using said function because Camera.getNumberOfCameras and Camera.getCameraInfo functions seem to be sufficient. I do not see what I could gain by calling another function that would yield the same result.

I have however been programming today and made the detection code more robust. I am hoping that this should lessen your problems with camera detection.

Will release an update ASAP.

I am using Context.openFileOutput with no path so the folder should be /app/package/data/data or something like that (apps private data storage folder).
[Android Apps and Games] velis74:
I am planning on adding a "troubleshooting" activity where one could see such info as well as get tips on solving common problems. I have already started writing a FAQ (it's at the end of the manual), but it doesn't seem to help much so perhaps a better solution will be to simply add appropriate helpers into the code itself. I've just been avoiding it so far because that requires a lot of text and would be pretty stressful on the translators.

Edit: it's not already being done because that requires additional permissions and I'm taking lots of flak for camera permissions already.

I may also be able to get my hands on an SGS3 mini in the near future so I will be able to check your issues directly. Don't know when though so don't hold your hopes up too high :D

I have also arranged to get the SGS2 again so that I may try to implement the "precise" sensor readings, instead of 1,10,100,1000 as it works by default. Also no ETA, it's hard to get people I hardly know to lend me their phones for a day :)
[Android Apps and Games] sunsero:
Thanks, actually I realized now that my gone memory must be there so I could delete the app's complete data (259 MB) using Android's application manager. Looking forward to your update and hope it might already solve the issue or helps to get the necessary hints for a solution :)
[Android Apps and Games] velis74:
Yes, the update will solve the issue. Those 259 MB should be reduced to a few KB after the patch. You could also disable camera image and log generation which will also stop consuming your storage.
[Android Apps and Games] sunsero:
Might it even solve the issue that the brightness is not adjusted by the readings from the front camera?
[Android Apps and Games] velis74:
Thanks for reminding me: this kinda slipped by me. ;)

The camera readings should be reflected on main app activity as current light sensor value. The brightness SHOULD already be adjusted according to that. Can you check that current light sensor reading is actually being adjusted right now?
[Android Apps and Games] lklaus:
Not on my S3mini... It always stays at 0, but right now I can only activate the main camera. It does not detect a front camera...
[Android Apps and Games] velis74:
This is probably the issue with shutter speed not being detected properly. I haven't been able to figure this one out yet. After I fix this, I will publish a patch. There's no point in issuing a patch that fixes minor details, but not major issues :)
[Android Apps and Games] sunsero:
Same on my S3 Mini - the sensor value stays here at 0 as well - but for the front camera, the back camera is here currently not detected.
[Android Apps and Games] lklaus:
I can understand :) and will wait (semi) patiently :)

Klaus
[Android Apps and Games] velis74:
Hopefuly, my wife and kids will be very tired tonight (devil)
[Android Apps and Games] velis74:
I just updated the OP (not Google Play) with a fix:

3.05.125 (23.5.2013)

FIX: Camera detection should be more robust now

FIX: Excluded apps empty by default, only add APK installer when superdim is enabled

FIX: Excluded apps list would not be sorted

FIX: Camera picture analysis more robust working with more camera models

Updated translation: german

This should hopefully fix the issues discussed above, except the one where cameras are not recognized at all. I'm not even sure how I should go about fixing that one :p Id does seem to be much more stable on my phone though: it worked 100% of the time for me while I was testing the fixes.
[Android Apps and Games] sunsero:
Unfortunately since yesterday evening no more cameras are recognized on my S3 Mini. Just updated to the new version of your app and they are no more recognized either. When are the cameras detected, when starting the app or when going to settings or only when rebooting the mobile? I think it can''t be only while rebooting because the front camera became yesterday undetected without a reboot.

One thing that I noticed however is, that the app recognizes a light sensor in my mobile while actually the device has none.
[Android Apps and Games] velis74:
The cameras are detected every time when you enable camera support in the dev dialog. So just disabling / enabling again should re-detect the cameras. Can't say about the sensor though: again I use standard android API (except for xperia) and just report what it says...

Edit: Oh, and cameras not getting detected any more could be a result of those exceptions that make my life so difficult. if the camera app also isn't working, you'll have to restart the phone. Otherwise just restart the app (close it from app manager, start it again).
[Android Apps and Games] sunsero:
:good:

The cameras were now detected and iauto brightness seems to somehow work :good:

I'll check things more out...
[Android Apps and Games] kantjer:
Hi Velis,

I'm back, I stopped using Velis AB on my S2 because of the crappy light sensor. I just installed it again on my new S4 and I'm impressed again.

I will have a lot reading to do to catch up.

First thing to sort out is how to get my Tasker plugin back to work. I purchased the preium version in the past but it doesn't show up yet.
[Android Apps and Games] lklaus:
HI Velis,

great, it seems to detect light changes (after having a look for a few seconds). Will test further, but it looks good

Thanks,

Klaus
[Android Apps and Games] velis74:
And just when I'm about to attempt to fix the SGS2 sensor :D
[Android Apps and Games] kantjer:
There still a lot of S2 users left ;)

Any tips on how to get my premium functionality back? I installed the version on the OP, should I start with the play store version :confused:

ATM there is nothing in the Purchased items list

Premium status solved after installing from play store and than updating with the version on the OP.
[Android Apps and Games] kubics:
+1 S2 user :D
[Android Apps and Games] kantjer:
I wont forget my old friends ;)

And your on RootBox, the light sensor on that is working much better than on Samsung stock.
[Android Apps and Games] velis74:
Actually SGS2 made it to the top of device charts for my app.

Edit: SGS3 was the definite leader, followed by Nexus 4, but both of them went down because people were bothered by steppy brightness transitions. That is now fixed, but the customers don't forgive that easily :p Actually, most of them don't even know how to set the app for this to work nicely on their phones. Hence the idea to include a troubleshooting page. :angel:

Latest graph:

Samsung Galaxy S2 (GT-I9100) 8.35%

mako 5.73%

Samsung Galaxy S3 (m0) 4.50%

Samsung Galaxy Nexus (maguro) 3.57%

Asus Nexus 7 (grouper) 3.52%

V6 3.43%

SEMC Xperia S (LT26i) 2.69%

Samsung Galaxy Nexus (toro) 1.61%

HTC Desire HD (ace) 1.59%

Others 65.00%
[Android Apps and Games] kantjer:
Samsung did a much better job with the S4 light sensor implementation.

I'm getting fluent readings between 0 and 60000 with a stock based ROM.
[Android Apps and Games] lklaus:
My first tests are very promising.I activated the front camera, and it gives different readings for different lighting conditions and chamnges brigthness according to surrounding light. Really great. Probably some fine tuning required, but really great!

Klaus
[Android Apps and Games] jdec529:
Not Sure if I have Something set wrong or not. I installed earlier on my note 2 at work and everything Seemed perfect. when I got home I was in my basement and noticed it flickering really bad. So I decided to edit the graph Cause I thought maybe the amount of light was maybe to close to 2 different Settings. but when I opened the graph I noticed it was reading between 22-36 Lux , but Kept jump

down to 0. So I decided to go to the other room where it was brighter and now it was around the 250 range and kept jumping to O. And for the record I am running Beantowns Jellybeans build 17. thanx in advance
[Android Apps and Games] mentasm:
VAB causing wakes with screen ons

Hi,

I have been using the app on my Galaxy S2 for a while now.

I run latest Rootbox and latest DorimanX kernel.

I had noticed that every 5 or so mins my phone would wake up and the screen would come on. It would then turn off after a few seconds.

After trying all sorts and full wiping etc, I finally started looking at the logs using CatLog. From what I can see Velis AB is the culprit. I have tried uninstalling the app and have noted so far that the wake ups have gone away.

Any ideas on what might be going on. I'd like to reinstall it as I like the functionality.

I can post the log I captured last night if someone wants to look at it.

Cheers!
[Android Apps and Games] velis74:
This is a common problem also on SGS3, though it's not always 0 the reading that is involved. The problem can be solved by setting downward smoothing time to a huge value, like 10 seconds or so. Also make sure to set smoothing override to some large value, like 30% or it will still cause immediate lightness changes.

I sincerely doubt this. VAB only reacts to screen-on / off events. VAB does not use wake locks. At all.
[Android Apps and Games] sunsero:
Again thank you very much for front camera support for light sensor emulation!!

I've currently even set on my S3 mini the camera read interval even to 1 s and it doesn't seem to use much CPU time.

Anyway I'm having several questions:

Is there the possibility to see the power usage of the camera taking pictures?

I'm using another app called DisplayFilter which puts an on-screen-control into an overlay with which you can manually superdim the display down to 20%. Now, when VAB is active Display Filter still works but VAB does not change the brightness anymore (still shows the detected brightness level in the Android system settings - without actually changing the brightness). I wonder why this is so because I have superdimming in VAB disabled so there should be now conflict with the overlays. Alternatively it would be great to have Display Filter's functionality integrated in VAB.

I could not get VAB's own superdimming to work the way I'd prefer - it refuses to protect me from very low brightness which I want indoors at night. My current graph is:

Pt: 0 1

Pt: 30 1

Pt: 62 24

Pt: 555 255

Pt: 15000 255

Any chance to get superdimming work with this?

Or ideally to use negative values to specify additional superdimming when the system brightness is already at 1? I'm thinking of something like "Pt: 0 -80" to specify a superdimming matching Display Filter's 20% brightness.

Regarding refusing to apply the default filter I would prefer VAB to just give a warning and then only actually dim down to a brightness level threshold still readable in a low-light environment at night.

There's one more thing I've noticed: I'm using e.g. Swiss Army Knife or Flashlight Mini to use the LED flashlight of my S3 mini. Those and even the normal camera app I had to put into the list of excluded apps of VAB otherwise they crash on start when the front camera is used as a sensor in VAB. As the other apps only use the back camera / back LED I wonder why they need to be on the list of excluded app when VAB only uses the front camera or if it would be possible to only reserve the front camera. Well, I guess VAB already does this?

Can you please help me with these questions?
[Android Apps and Games] Jockson:
I'm not sure if I'm doing something wrong but does this app always use a full screen overlay, regardless of whether Superdimming is enabled or not? I ask this because every similar app that uses a screen filter has a significant performance hit on my S2. Just tried VAB and also experiencing the same thing - using a live wallpaper the whole launcher lags noticeably. Jerky animations and the scrolling notification toggles in touchwiz stutter badly. When I turn off VAB everything is butter smooth. I was under the impression that screen filtering would only be used if I want to use lower than the minimum brightness than the phone allows?
[Android Apps and Games] velis74:
No, I haven't researched power usage in this respect so I don't know how I would display this info.

Android uses the last overlay to set screen backlight brightness. It seems DisplayFilter is setting backlight or VAB would still work.

VAB covers this functionality through super dim. In fact, the functionality offered is more advanced than that of DisplayFilter.

This is my biggest issue with super dimming: I just can't explain its function well enough. To be brief, this is all covered.

The long explanation:

Super dimming will dim the display beyond what backlight setting can. It can do this linearly because it actually paints a "picture" over the entire display that is completely black, but has some transparency. The level of transparency depends on the strength we want for the filter.

This is all combined with the requested backlight level.

VAB has a safeguard built in which will prevent setting super dimming in low light conditions. However, the app cannot know how bright your display actually is: this is up to the user to test while setting it up.

Taking for example the above numbers: VAB will use backlight to set brightness to the values specified. Low light conditions will result in lowest backlight setting (lux <= 30 ==> 1). In addition to that you want to activate super dimming, say at 10%. This means that any time backlight would be set below 10% (26) -incidentally, that just about around the 3rd point in the example points), super dimming will kick in, linearly down to 0. So at set brightness of 1, the backlight will be set to lowest and additionally, super dimming will be set to 4% (1 / 25). This is pretty much total black leading to unreadable display.

Actually when setting super dimming, one should never set the graph to its lowest values. If your backlight of 1 is still too bright and you want to reduce that brightness further by 50%, you should choose a graph that begins setting brightness to 12 and activate super dimming at 10%. That way the filter will be at half strength when sensor will be reading 0 lux. For your first two points, that would mean 0 12 and 30 12.

Darn, another craptastic explanation. If I just managed to confuse you, let me know, I will try to respin :D

I don't know how flash apps work, but I'm assuming they have to reserve a camera in order to light up the flash. I have noticed that on my phone only one camera can be active at any one time. Thus it would be normal that these apps fail to work if VAB is grabbing a pic. And yes: you should add any camera using app to exceptions or something will FC. As I said before: Android really has crappy cam implemantation.

Actually, the filter is always present. There is no other way to set backlight brightness. It is just more agressive when super dimming is enabled (takes whole screen, has color to dim the display).