Long time no see

It has been a while indeed, calise development more or less stopped in the last year (even more) and I didn’t write a word about it…

It’s few weeks now that I’ve had a bit more spare time and so I decided give calise a look after all that time.
It was not as bad as I thought but I was ashamed of myself because I left the stable version at that point (0.4.2) with version 0.5.0 almost ready on git. I’ve been using the “future” version for over a year now and I feel really bad knowing that I didn’t release version 0.5.0, that was just few hours away from being ready, back then.

So, after all the bla bla bla, yes, version 0.5.0 is just few work-hours to be published. I just need to fix some text-lines (and associated translations) and test the program on a few different machines.
For those who don’t care about correct text-lines (calibration passages can be easily misunderstood, beware) just get git-master branch (calise-git for archlinux friends).

At the start of the topic I said that development had “more or less stopped”, what you may be interested in is the “more or less” part because I still managed to start a complete rewrite of the code to improve performance and code readability/cleanness.
You can check current progress on the git-develop branch.
I would say the rewrite is more or less at 40% of completion and I don’t know how much will it take.

NOTE: I’m almost sure that version 0.5.0 will cut support for non-userspace and non-x11 environments, the first for security reasons, the latter just because it doesn’t make sense in my opinion.
Anyway, on the release post I will be more precise about that.

Posted in Information, Update | Comments Off

calise beta 0.4.2

New release is out, includes a fix for bug 3607544 (time not reporting and acting correctly) and other fixes of minor issues.

Version 0.5.0 is almost ready to be released too, actually it’s in testing stage and within a month will be ready and throughly tested.

Bug 3607544 was a serious issue occurring for every part of the world in timezones where localtime sunrise (and sunset) times occurred in a different GMT date.
For example the bug kicked out if localtime sunrise time was 6.00 am 28/06/2011 and GMT date was 29/06/2013.
It was a major bug because there was no way to manually tweak dates to fix it.
Now everything should be fine and, if not please comment here: http://sourceforge.net/p/calise/bugs/20/

Sorry for the long absence, I will post about 0.5.0 release soon (or at least as soon as that’s ready).

Posted in Release | Comments Off

calise beta 0.4.1

Just released calise 0.4.1, this release is mostly a bugfix one but comes with few great improvements that will enhance precision (in certain cases a lot).
I also wrote down some known issues that can be found at the bottom of this post.
 
Changelog:

  • CORE: fixed issue 3543010 (missing inclusion in camera.c) -> iss3543010.fix.diff
  • CALIBRATION: fixed issue 3543055 (calibration fail on step 6) -> iss3543055.fix.diff
  • SERVICE: enhanced feature 3540266 (geoip lookup) -> iss3540266.fix.diff
  • SERVICE: enhanced weather lookup
  • SERVICE: updated weather conversion definitions
  • CORE: changed screen compensation algorythm
  • SERVICE: fixed issue 3539286 (wrong/broken suspend/hibernate – resume behaviour)
  • SERVICE: added signal handling also for service version
  • CORE: fixed issue 3541919 (camera hung-up: look at issue bugtracker page for further infos)
  • SERVICE: fixed issue 3540981 (screen brightness not working outside session)
  • CALIBRATION: fixed a critical bug happened whan not connected to internet on calibration step 4 (geolocation)
  • CORE: fixed camera python c-module memory allocation bug
  • SERVICE: changed behaviour on some camera.Error exceptions
  • SERVICE: added a value check method to correct sistematic and progressive errors on capture values [1]
  • SERVICE: added process ‘niceness’ selective setting

[1] Because of this, most users will need to recalibrate since wrong values previously (< 0.4.0) included are removed and so average value will change (in certain cases even up to ~40/255).
 
Known issues (not easily fixable or not fixable at all):

  • Bad brightness percentage (up to 20%) if background behind user is unaffected by ambient brightness
    For example, this exact situation can be achieved when user’s background is the sky (eg. big window just behind the user) or big monitors (eg. your favourite 70” television just behind you)
  • Bad percentage (up to 20%) if the user (and not the background) is being hit by a single sunray
    Well, it’s not actually a program’s error, since the image captured is way darker than user (hit by sunray) perception.
    In these cases avoid sunrays hit you or pause calise and set backlight level to 20-25% more than calculated (current).
  • Issues when using lucid screens
    If any light source reflects (badly) on the lucid panel, higher backlight levels help contrasting reflection effects. This program won’t return higher backlight levels for these cases and so the user feels the backlight level being wrong.
    In these cases avoid reflections or pause calise and set backlight level to 20-25% more than calculated (current).
Posted in Release | Comments Off

Post 0.4.0 release patches

In the same folder of the 0.4.0 tar.gz package I uploaded 3 patches, here’s some explanation:

iss3543010.fix.diff: pointer from integer without cast (64bit) bugfix (useless, it was a request to being able uploading to Launchpad)
iss3543055.fix.diff: a bugfix for a bug that affected cameras with slow initialization time (on calibration step-6 only)
iss3540266.fix.diff: geoip city display on calibration (not a bugfix but since it was done I included it)

As you can see, if you had problems on calibration step 6 you should patch and reinstall the program.
Just for completion I’ll list some useful installation steps:

wget http://sourceforge.net/projects/calise/files/calise-beta/0.4.0/calise-0.4.0.tar.gz
wget http://sourceforge.net/projects/calise/files/calise-beta/0.4.0/iss3543010.fix.diff
wget http://sourceforge.net/projects/calise/files/calise-beta/0.4.0/iss3543055.fix.diff
wget http://sourceforge.net/projects/calise/files/calise-beta/0.4.0/iss3540266.fix.diff
tar -xzvf calise-0.4.0.tar.gz
cp iss3543010.fix.diff calise/
cp iss3543055.fix.diff calise/
cp iss3540266.fix.diff calise/
cd calise
patch -p1 < iss3543010.fix.diff
patch -p1 < iss3543055.fix.diff
patch -p1 < iss3540266.fix.diff

then you can proceed with build and installation steps as usual.

Posted in Information, Update | Comments Off

calise beta 0.4.0

  • CORE: Replaced PyGame camera module with a custom C python-module [1]
  • CORE: PyGame, NumPy and PIL (Python Image Library) dependencies removed
  • SERVICE: Fixed and enhanced usage as root
  • CALIBRATION: Global fixes and enhancements
  • GUI: Fixed “flickering” error caused by high number (>20) of backlight steps
  • TRANSLATION: Updated (non-service) Italian translation
  • OTHER: Added initd and systemd scripts (not tested outside archlinux)

[1] this itself carries a lot of enhancements (eg: less power, CPU and RAM usage; faster captures; …)

 
NOTE: Since I received a lot of questions on how does this or that works I decided to write a wiki. It’s really exhaustive, of course if you have questions feel free to ask but before check the wiki.
Also, anyone can edit wiki entries (after registration), just not be distribution-specific.
The link to the wiki it’s just left of the home link on the menubar.

Posted in Release | Comments Off

Graph and pre-release thoughts

Within a week version 0.4.0 should be released, you would be surprised since version 0.3.0 was released less than two weeks ago but I have one (at least) strict release versioning rule: if there are major changes then mid version number has to be raised. Btw don’t expect 0.5.0 soon, I already know that version 0.4.0 will need quite much minor version upgrades.

Speaking of major changes, 0.4.0 major change is a custom python-module written in C for the camera that leads to lower CPU-time and RAM usage (a lot less RAM), more precise capture values, faster captures and few dependencies removal.

To test camera module precision, same days ago, I’ve plotted a graph of 5h program’s execution from just before sunset to night and I would like to share it with you (automated plot using “calised –dump-all” and gnuplot, I will release a generic python script so that you can try yourself).
Image is quite big (1280×800) so you’ll need to either download it or watch “fullscreen” be able to see it well.
 

In the plot above you can see clearly how and how much screen-brightness compensation works to correct ambient brightness, trying to remove brightness that comes from the screen (more or less “the more the brightness of the screen, the more the correction”).
Also, about sleeptime between captures: during the day varies according to weather informations (as you can see there have been at least 2 different weather conditions), during sunset (but also dawn) sleeptime increases substantially, as night (civil night) comes, the program enters a idle state.

Posted in Information | Tagged | Comments Off

Own camera module

As I said I’ve just merged ~1800 code lines with a v4l2 camera python-C module.

It still needs a lot of tests since it’s the core of the core of the program. If you want to contribute adding your feedback just clone git repository
git clone git://calise.git.sourceforge.net/gitroot/calise/calise
and compile/install as usual (pygame is not more needed but you need kernel-headers to compile the new camera module)

so far:

  • RAM usage is ~8MiB instead of ~16MiB;
  • the camera lock pygame module had did not show (at least not yet);
  • since my camera module is able to query/set camera controls, white_balance, autogain and backlight_compensation are disabled (and after the capture re-enabled) to get more precise captures;
  • Qt interface does no more run a subprocess, I made (awfully but works) it run inside as a normal loop function
  • more…
Posted in Update | Comments Off

calise beta 0.3.0

  • SERVICE: DBus service implementation [1]
  • CALIBRATION: auto minimum backlight level check
  • PROFILES: “Daemon” section replaced with “Service” (anyway with backward compatibility)
  • EPHEM: horizon set from 0 (natural) to -6 (civil)
  • OTHER: added pm-utils suspend script (NOTE: not installed through setup.py)
  • OTHER: man pages and help errors mostly fixed
  • OTHER: INSTALL and README instructions mostly corrected

 
[1] this need further explanations. The http server has been removed in favor of DBus; DBus is way safer and has better implementation capabilities (both for the program and from it).
The connection to DBus bus is set as follows:

  • any non-root user will initiate a SessionBus object that can only be controlled by him/her (calised client, executed as root can control it too)
  • root user will initiate a SystemBus object; that object’s methods are not all available to everyone: root can do everything, video group members can do everything except stopping the service, non-video group members can only dump(-all/-settings), check execution and do manual captures

 
NOTE: After update/install, if you updated/installed inside a running dbus-daemon session you’ll need to reboot or somehow reload DBus to run correctly the service as root since DBus config policies are loaded only on daemon startup (it can be done sending SIGHUP to the running dbus-daemon but I won’t suggest that). For simple user execution that is not needed.
Also, to run as root, you’ll need to copy one of the profiles created in ~/.config/calise to /etc/calise.conf
I think it’s better to run calised as simple user but if you’re on a machine frequently used by 2 or more persons during the day I suggest running as root -out of any user session- so that any user can control it as he/she wish.

Posted in Release | Tagged , , | Comments Off

DBus implementation & roadmap

With commit 228 232 (way better than first implementation published) on svn, calise *can* be called a service. I successfully replaced the http server with a full featured DBus based service (from now onward DBus is a dependency of course). In the end the whole thing came out pretty well and it’s stable as hell, even cpu and RAM usage are slightly less.

Now, I think it’s a good think to post a simple roadmap of what I will do with future releases:

  1. DBus implementation (already done :) )
  2. Own camera module that will be as simple as possible with autogain/auto-white-balance controls*
  3. Service GUI, the same of the interactive version one with service related controls

*right now, due to the poor options offered by pygame camera module (which is also experimental) only three v4l2 camera controls are available and autogain and auto-white-balance are not. Right now calise’s “core” is heavily limited by those two controls since they are able to change white-balance and exposure and, in certain machines, make any measurement useless.
The writing of this C module will be very difficult since my machine’s webcam hasn’t got the two controls specified before editable (btw it has auto-white-balance and autogain process captured images) so I will need to ask a friend to use his machine for some coding and *especially* for every test on the code (the bad thing is I’m not able to see him more than once/twice a week).

Posted in Information, Update | Tagged , , | Comments Off

calise beta 0.2.1

It took me little less than expected, anyway this is a brief changelog between 0.2.0 and 0.2.1:

  • CORE: multiple kernel backlight interfaces not recognized bugfix
  • CORE (daemon): high number of backlight steps dawn/sunset cause wrong sleeptime value bugfix
  • CORE (daemon): default http service port changed to something funnier*
  • CORE (daemon): added debug logging for module calise.sun
  • CODE: continued pep-8 standardization and code cleaning
  • CODE: improved and added comments
  • OTHER: 0.1.x to 0.2.x profile updater moved to tools (inside package main dir)

*I said funny because I set it to 30780 which is actually equal to 3*1*12*9*19*5 which is equal to C*A*L*I*S*E (letter order in the 26 char latin alphabet)

As you can see, this release is mainly a bugfix one. Most of the changes targeted bad written code and non-pep-8 compliant code, anyway you can still enjoy few new features that are always welcome (or at least hope so).

Finally, about the poll I “promised” you a while ago, I’m actually working on it (reeeally little, but working).

Posted in Release | Comments Off