maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Flip clock pre pre pre pre release (https://talk.maemo.org/showthread.php?t=25582)

anidel 2008-12-21 10:01

Re: Flip clock pre pre pre pre release
 
What you could do, Ciro (btw, my name's Aniello, not Daniel :) ), is to allow for personalization.

You could load an image called "logo.png" into that place and let the user choose whichever they want. By default, put whatever free image as you like, and let people personalize they way they want. I could put in the Maemo logo, someone the penguin mascot and so on...

About the power save feature, that is an important thing. When the screen dims down or the tablet goes in "sleep mode" (i.e. the tablet is in low power consumption), and same when it wakes up, it sends out events. Python for Maemo have APIs that let you handle this events accordingly.
This allow your application to stop handling refresh events when the tablet's screen is dimmed down and start again (refreshing the application) when it receives the wake up event.

Is not that much difficult to develop in.
Probably you should start from here: http://maemo.org/development/documen...o_devicestate/

Great application, btw :)

ciroip 2008-12-21 10:23

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by anidel (Post 251400)
What you could do, ciro (btw, my name's Aniello, not Daniel :) ), is to allow for personalitation.

You could load an image called "logo.png" into that place and let the user choose whichever they want. By default, put whatever free image as you like, and let people personalize they way they want. I could put in the maemo logo, someone the penguin mascotte and so on...

About the power save feature, that is an important thing. When the screen dims down or the tablet goes in "sleep mode" (i.e. the tablet is in low power consuption), and same when it wakes up, it sends out events. Python for Maemo have APIs that let you handle this events accordingly.
This allow your application to stop handling refresh events when the tablet's screen is dimmed down and start again (refreshing the application) when it receives the wake up event.

Is not that much difficult to develop in.
Probably you should start from here: http://maemo.org/development/documen...o_devicestate/

Great app, btw :)

ops, sorry aniello but sometime im just dislessic and i made up that daniel...
mh the idea to let peope add their own personalization iss not bad but i think is a bit too hard for the casual users without a dialog inside the app. btw, having the logo.png open to customizations could appel some advanced user.
Ill take a look to tha link for the power save feature.
All the advices on Itt really helped me a lot to speed up things. Great job guys :)

anidel 2008-12-21 10:29

Re: Flip clock pre pre pre pre release
 
It's because we were waiting for such an application for ages :)

There was something earlier, but yours is what many were waiting for :p

It is there now, just needs to grow and can grow a lot (I am sure).

For example:

- alarms: more than one, repetitive (choose day, week, whatever), snooze, stop (big buttons), volume, choose mp3 to play, radio station (for n800 users), internet radio station and so on, flashing display when alarm sounds
- themes
- seconds
- flipping animation
- user settings
- integrated FM/Internet radio tuner ( :-) )

and so on...

ciroip 2008-12-21 18:36

Re: Flip clock pre pre pre pre release
 
ok, I put down some ideas for the noparty version.
Since Im sharing the app evolution with some folks here seem reasonable U could suggest some interface preferences: I decided to move as much as possible the controls on the 2nd page (the alarm set) and leave the clock as empty as I can. To avoid false annoying switches I plane to do a drag up area for the entire top clock and use all the bottom 100 pixel for stopping the alarm (someone smartly suggested a big area for that)
Let me know, Ill be out all the sunday afternoon so the answer could be a bit delayed :)
I would love to have a smooth slide up/down effect for the clock part but that for now is out of my capacity. Any suggestion is appreaciate like always :)
I also think to keep the bottom part partially transparent to see the user wallpaper trough: anyone know where I can find the hildon user wallpaper file? (I was just thinking to duplicate is on the app level and do my trasnparency experiment on the 'fake' wallpaper. I know, it is a bit confused but Im in a sort of rush :)
Buona settimana a tutti
https://garage.maemo.org/frs/downloa...5085/005_1.png
https://garage.maemo.org/frs/downloa...5086/005_2.png

ciroip 2008-12-21 18:37

Re: Flip clock pre pre pre pre release
 
...and no, I will probably never give up the MOOD effect...
playing with the LED is FUN

ciroip 2008-12-23 16:11

Re: Flip clock pre pre pre pre release
 
closed the 0.005 release: the 0.006 will return to have the plastic wood.
No one, any any circumstances, should ever use this release.
We are managing pretty heavystuff here :D lights and music. So since crappy programmer + led flashing = big troubles: Im not responsable if someone is going to stress the led and burn something.
I warned you people. BE AWARE!
https://garage.maemo.org/frs/downloa...oparty.tar.bz2
https://garage.maemo.org/frs/downloa...SShot005_1.jpg
https://garage.maemo.org/frs/downloa...SShot005_2.jpg

EPILEPSY WARNING
READ THIS NOTICE BEFORE YOU OR YOUR CHILD USE ANY VIDEO GAME
A very small portion of the population have a condition which may cause them to experience epileptic seizures or have momentary loss of consciousness when viewing certain kinds of flashing lights or patterns that are commonly present in our daily environment. These persons may experience seizures while watching some kinds of television pictures or playing certain video games. Players who have not had any previous seizures may nonetheless have an undetected epileptic condition.

If you or anyone in your family has experienced symptoms linked to an epileptic condition (e.g. a seizure or loss of awareness), immediately consult your physician before using any video games. We recommend that parents observe their children while they play video games. If you or your child experience any of the following symptoms: dizziness, altered vision, eye or muscle twitching, involuntary movements, loss of awareness, disorientation, or convulsions, DISCONTINUE USE IMMEDIATELY and consult your physician.

As someone noticied some posts ago: because with trademarks and healty things is not matter of sense of humor

@ qwerty12: If u dont notice anything too bad feel free to debianize it

ciroip 2009-01-02 05:58

Re: Flip clock pre pre pre pre release
 
Ok, let skip the version 006 and jump directly to the 007:
Rock solid fast no frill finger friendly FLIP ALARM CLOCK
No led this time but great optimization job on the code (it look nearly decent now...)
https://garage.maemo.org/frs/downloa...44/fk7.tar.bz2

https://garage.maemo.org/frs/downloa...145/sshot1.jpg

(I know the screenshot look exactly like the old but the application is nearly completely new :) )
I guess this is the right balance of features for the final version...
Im sure Ill end working on the usual pinataallfeatureson version anyway...

ciroip 2009-01-02 07:07

Re: Flip clock pre pre pre pre release
 
to have an idea of the features i leaved out i made a clip:
http://www.youtube.com/watch?v=WRMxSStlGxg

I feel the led blinkings were cool but maybe a bit too 'risky' for a 'final' version... otherwise the led are very bright and i suppose they could work like a 'backup warning' in case the volume is too low for the ringin sound.

jolouis 2009-01-02 14:06

Re: Flip clock pre pre pre pre release
 
Looks awesome, I've been following the development thread here for a while as I've really wanted a nice BIG full screen clock that has alarm support for quite some time (ever since my old 1980's "digital alarm clock" kicked the bucket and I decided the tablet made a lot more sense than buying a new clock!). Did you manage to get the power-management code tied into your "Rebuilt" version of the app? For me that's the important one because I want to be able to leave the clock running on the tablet when it's not plugged into AC and not have to worry about the battery dying over night because the tablet hasn't gone into "standby/low power mode"...

Again great work!!

Thanks,
-Rob

lcuk 2009-01-02 14:13

Re: Flip clock pre pre pre pre release
 
ciroip,

how difficult is it to make all the top row buttons respond to the alarm ringing - like a real alarm clock.
In the form you have it now I can see myself poking blearily and making n810 slide off the bedside and smash on the floor.

when the alarmclock is ringing, think of your users as cavemen ;)

ciroip 2009-01-02 17:40

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by jolouis (Post 254028)
Did you manage to get the power-management code tied into your "Rebuilt" version of the app?
-Rob

Yes, I always keep in mind a minimal version that act as much clever as I can manage. Im trying to keep the think modular and configurable moving all the variables in one place (ci_init) at the point that the app could recognize it the tablet is connected or not to the power and downgrade the functionality (update the clock each 10 seconds instead of every 1, and stop completely the video update when the screen go dark). I just need to look around for the os call to check the battery/charning status. Since the application is mean to run everytime I was thinking to keep some stats so advanced users could keep track of charging (and discharging) time (and how it degrade during the device history...) mh, maybe nokia will not be too excited about that....
Anyway yes, number 1 priority is to make the thing ringin :)

ciroip 2009-01-02 17:52

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by lcuk (Post 254030)
ciroip,
how difficult is it to make all the top row buttons respond to the alarm ringing - like a real alarm clock.
In the form you have it now I can see myself poking blearily and making n810 slide off the bedside and smash on the floor.
when the alarmclock is ringing, think of your users as cavemen ;)

Yes, I was thinking to use the real buttons on top for the "another5minutesinbed" and prolong the ringing until someone really want to switch off (or close the app). I pondered to use the slide keyboard to arm and disarm the alarm but that 1. too risky (too easy to change the status) and 2. that would cut out the n800/770 whatever.I still didnt check how access the hardware buttons but the thing should be ridicolously easy to make it. Anyway Im still not sure if the application can run 8 hours straight without a glitch. Im keeping calling pygame screens without caring too much about release resources, I have no idea how clever are the python+pygame solution.

Jaffa 2009-01-03 14:58

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 254067)
Yes, I always keep in mind a minimal version that act as much clever as I can manage. Im trying to keep the think modular and configurable moving all the variables in one place (ci_init) at the point that the app could recognize it the tablet is connected or not to the power and downgrade the functionality (update the clock each 10 seconds instead of every 1[...]

Ah, so even the updated version doesn't do anything clever to avoid pegging the CPU?

0.0.4 sat constantly eating 12% CPU when not even in the foreground. It's a lovely looking app, but it needs some smarts (and not even the variety you're talking about ;-)):
  • Don't update the clock every second. The display only changes every minute. If you want to ensure that the clock flips at the instant the minute rollsover, identify the number of seconds until the next minute change, and sleep the main thread until that time. Only check the alarm when necessary.
  • As you say, stop completely any updating or counting or anything the moment your app isn't in the foreground, or when its minimised, or when the screen blanks.
  • You can test this by opening up X Terminal (under the Utilities menu) and running top. When you can see X Terminal (i.e. Flip Clock's in the background) the CPU usage of your process should be 0.0%. When it is in the foreground (and you'll have to SSH in to your tablet to see this), it should be as low as possible to make it practicable to actually use as a clock without a mains adapter.

If you've started on a rewrite, get this structure in first, and then add features. IMNSHO, this'll help you keep things sane in your head.

HTH,

Andrew

ciroip 2009-01-04 05:10

Re: Flip clock pre pre pre pre release
 
@jaffa, i love this kind of comments :). Really help me to keep' the focus on the right things. I have no idea how balance the things... ill try to rebalance the app as much as i can

TrueJournals 2009-01-04 19:49

Re: Flip clock pre pre pre pre release
 
Well, I took a bit of time to see if I could modify ciroip's code to at least implement Jaffa's first suggestion, and this improved CPU usage DRAMATICALLY. The changes are actually pretty simple...
In fk007.py, find the line:
Code:

pygame.time.set_timer(DRAW_CLOCK_EVENT, 5000)
And replace it with:
Code:

ctime = time.ctime()
pygame.time.set_timer(DRAW_CLOCK_EVENT, (60-int(str(ctime[17])+str(ctime[18])))*1000)
timesixty=False

Find the line:
Code:

elif event.type == DRAW_CLOCK_EVENT:
And add AFTER (inside the if):
Code:

    if timesixty == False:
      pygame.time.set_timer(DRAW_CLOCK_EVENT, 60000)
      timesixty = True

Tah-dah! This adds a small extra if statement for the program to check when updating the clock, but it only happens once a minute, and it's just boolean checking, so there really shouldn't be any extra strain on the CPU for updating. I checked top in xterm, and even in the foreground, this now runs at 0% CPU (except for the update once a minute). Before this change, top would never show the CPU below ~1.5%

Jaffa 2009-01-05 13:50

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by TrueJournals (Post 254418)
Well, I took a bit of time to see if I could modify ciroip's code to at least implement Jaffa's first suggestion[...]

There is a possibility of clock drift with this approach. Consider, time is 11:54:36
  1. Timer is correctly calculated to go off in 24 seconds.
  2. Device gets busy or app stumbles or some other circumstance occurs which means timer doesn't go off for 25 seconds.
  3. Clock doesn't change until 11:55:01. Timer is set to go off in 60 seconds.
  4. Repeat whatever caused step 2, timer doesn't go off for 61 seconds.
  5. Clock doesn't change until 11:56:02.
  6. ...

So, although it's an extra call I'd suggest not committing the cardinal sin of premature optimisation until the extra step is a significant part of refreshing the screen/checking the alarm/doing nothing (if screen blank and no alarm set).

nilchak 2009-01-07 22:02

Re: Flip clock pre pre pre pre release
 
Any .deb's available for install for the all new noParty version with Alarams ?

danramos 2009-01-07 22:30

Re: Flip clock pre pre pre pre release
 
Rather than sleeping as a way of freeing up CPU cycles and checking every minute (I'd also immediately considered drifting and imprecision as issues if this is implemented), is there a way to use a system interrupt based library to run the update code every time the system's clock has incremented the minute? I'm not familiar with programming in python, but I would assume this would mean using a library that deals with the HAL (Hardware Abstraction Layer) interface? This would offload the work from the app and leave it up to the operating system to run the routine as an event.

danramos 2009-01-07 22:41

Re: Flip clock pre pre pre pre release
 
Actually, this seems to make great reference to the technique I'm trying to express:
http://maemo.org/maemo_release_docum...1.x/node6.html

The relevant portion is "5.3.1.12 Maemo Alarm Framework" and in a more general way "5.3.4 Application Framework". If the OS can execute the routine to update, rather than having the app running busy the entire time, then it can just simply sit there in memory and just exist to execute on a hardware timer to update the screen and another routine, again called by hardware timer event, to run the alarm routine.

Maybe I'm just thinking this way because I did too much assembly programming as a kid. Seems like this would be a really easy thing to write in assembly but I've never looked at anything on writing assembly in ARM and I'd assume this type of functionality had probably already been written into the maemo python libraries somewhere.

Jaffa 2009-01-07 22:56

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by danramos (Post 255255)
Actually, this seems to make great reference to the technique I'm trying to express:
http://maemo.org/maemo_release_docum...1.x/node6.html

Indeed, alarmd immediately sprung to mind when you described what you wanted.

Quote:

The relevant portion is "5.3.1.12 Maemo Alarm Framework" and in a more general way "5.3.4 Application Framework". If the OS can execute the routine to update, rather than having the app running busy the entire time, then it can just simply sit there in memory and just exist to execute on a hardware timer to update the screen and another routine, again called by hardware timer event, to run the alarm routine.
IMHO, alarmd isn't designed for frequent updates within a single running app, but it is designed to handle the case where the alarm set in flip-clock should go off whether the app is running or not.

I think the overhead of context switching and DBUS signals make alarmd unsuitable for the task of updating the clock, every minute, when the app is running. It may be suitable, however, if the alarm should be integrated into the existing alarm system (including the built-in Clock). In that circumstance, it can even "do" the alarm sound and popup, not requiring flip-clock to even be (re-)started.

daperl 2009-01-08 00:00

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by danramos (Post 255252)
Rather than sleeping as a way of freeing up CPU cycles and checking every minute (I'd also immediately considered drifting and imprecision as issues if this is implemented), is there a way to use a system interrupt based library to run the update code every time the system's clock has incremented the minute? I'm not familiar with programming in python, but I would assume this would mean using a library that deals with the HAL (Hardware Abstraction Layer) interface? This would offload the work from the app and leave it up to the operating system to run the routine as an event.

Syncing in user space should be simple. The following psuedo code would cost very little and makes the reasonable assumption that sleeping will take no less than 60 seconds and no more than a 120 seconds.

Code:

def clock_update():
  while not_done:
    now = get_system_time_in_seconds()
    update_clock (now)
    sleep_time = 60 - now MOD 60
    sleep_for_seconds (sleep_time)

clock_update_thread = threading.Thread (target=clock_update)
clock_update_thread.start()


danramos 2009-01-08 00:11

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 255270)
Syncing in user space should be simple. The following psuedo code would cost very little and makes the reasonable assumption that sleeping will take no less than 60 seconds and no more than a 120 seconds.

Code:

def clock_update():
  while not_done:
    now = get_system_time_in_seconds()
    update_clock (now)
    sleep_time = 60 - now MOD 60
    sleep_for_seconds (sleep_time)

clock_update_thread = threading.Thread (target=clock_update)
clock_update_thread.start()


Oooo.. true.. true. This would still use sleep, free up CPU cycles AND consistently keep the clock very reasonably accurate. This goes around the whole need for dillying with interrupts.

Simple and effective. :) I love it.

daperl 2009-01-08 00:24

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by danramos (Post 255275)
Oooo.. true.. true. This would still use sleep, free up CPU cycles AND consistently keep the clock very reasonably accurate. This goes around the whole need for dillying with interrupts.

Simple and effective. :) I love it.

Something similar could be used for accurate alarm threads. Multi-alarm cooking timers could be things of the past.

jolouis 2009-01-08 14:23

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 255270)
Syncing in user space should be simple. The following psuedo code would cost very little and makes the reasonable assumption that sleeping will take no less than 60 seconds and no more than a 120 seconds.

Code:

def clock_update():
  while not_done:
    now = get_system_time_in_seconds()
    update_clock (now)
    sleep_time = 60 - now MOD 60
    sleep_for_seconds (sleep_time)

clock_update_thread = threading.Thread (target=clock_update)
clock_update_thread.start()


Interesting, see I started picking at the code yesterday with the aim of helping out by getting the whole "don't do anything while the tablet is inactive" thing sorted out. I'm not a big python person (in fact some parts of it drive me crazy compared to other languages, but that's just me!), but I'm really interested in this project so I wanted to try and help. See I just took Ciro's updated code and adapted the logic so that it makes sense... If you look at his last post he started with:

Code:

ctime =
time.ctime()
pygame.time.set_timer(DRAW_CLOCK_EVENT,(60-int(str(ctime[17])+str(ctime[18])))*1000)

Which is brilliant, causes the event to fire at exactly the correct time; the only thing I found odd was that he then went on to fire the event every 60 seconds after that, instead of using the same calculation to fire it at exactly the right time. So he suggested:
Code:

if timesixty == False:
      pygame.time.set_timer(DRAW_CLOCK_EVENT, 60000)
      timesixty = True

But really that doesn't make sense... why not just do the proper time adjusted calculation each time the clock updates? That way it's always accurate... and it's one call to the ctime() method, so not exactly CPU intensive or anything. So my version ended up with the if statement looking like this:
Code:

elif event.type == DRAW_CLOCK_EVENT:
    #Clear the current timer
    pygame.time.set_timer(DRAW_CLOCK_EVENT, 0)
   
    if ci.fcmode==0:                      #Redraw the clock only
      ci_gfx.drawclock()                  #  when is visible
    else:
      ci_gfx.drawalarm()                # no need to redrawm, anyway in not cheap
       
        #recalculate time until next second and reset delay as required
    ctime = time.ctime()
    pygame.time.set_timer(DRAW_CLOCK_EVENT, (60-int(str(ctime[17])+str(ctime[18])))*1000)

Everytime the update runs it clears the old timer value (just incase soemthing odd happens during the update? I'm not 100% sure about the functionality of the set_timer method as I'm thinking along the lines of JavaScript's setInterval), then once the update has completed the timer is recalculated (that way the wait is accurately calculated again AFTER all potentially time-consuming code has been run).

Basically the same sort of solution, just a different way of going about it. Second point though... I tried implementing the power notification stuff using the osso module, but seem to have run into the same problems as others found when developing maemoClock, etc: set it all up just before the while True loop like this:
Code:


def state_cb(shutdown, save_unsaved_data, memory_low, system_inactivity,
    message, loop):

    print "System Inactivity: ", system_inactivity
    if system_inactivity:
        #Clear the current timer
        pygame.time.set_timer(DRAW_CLOCK_EVENT, 0)
    else:
        #make the update and stuff happen now
        pygame.time.set_timer(DRAW_CLOCK_EVENT, 10)

    return False


osso_c = osso.Context("flip_clock", "0.7", False)
device = osso.DeviceState(osso_c)
device.set_device_state_callback(state_cb, system_inactivity=True, user_data=None)

Which in theory should work... when system is inactive it causes the event looper to abort, preventing any kind of screen refresh/update; and when it becomes active again the screen refresh/update is restarted almost immediately. However the callback never gets executed. A lot of googling later has indicated that there's something more to the problem here... I think it's something to do with the pygame.event.wait() call, but I tried swapping that out for just some sleep and pygame.event.get() setups and it still never actually gets called. Perhaps some kind of thread or something is needed?

Great app though, awesome work to everyone involved!

Thanks,
-Rob

ciroip 2009-01-08 14:29

Re: Flip clock pre pre pre pre release
 
It seem I ll have a really busy weekend catching up all the suggestions and comment of the past 10 days. Time to reach a real computer (I followed the thread using only the N810 for a while) and Ill put my hand in the flipclock muddy code. Before leave for the xmas/newyear break I tried to use the pybattery status as a modules (and showing a progress bar of the status) and it seem working just fine. Again Ill keep the thing as modular as my poor python skill will allow so there should be no problem testing all the different technics proposed on the forum. The thread obviously grown over my aspectative and I can feel the pressure :). It is amazing how a 'simple' application trigged so many great 'spinoff' arguments. I m flattered and before return to work I just want to say thank you to all people who spent time to look at the thing.
Since is 'real'work in progress (Im still not sure if the clock and the alarm works :), and this for a clock/alarm program is probably bad...) I thinked that the app didnt deserve a debianizing (and since I write using shortcuts, tricks, weirdo technics is a pain to try to packagin it everytime (I still have no clue and since now qwerty12 made up all the packagings, and make realize that is not a so simple task. I ll try to release the long promised plain naked optimized version and ask to qwerty12 to do the job and ask to the maemo folks to promote to extra and give to everyone on the thread the credits they deserve and have the satisfaction to see the thing finally in the wild.
Peace and love, peace and love

jolouis 2009-01-08 14:41

Re: Flip clock pre pre pre pre release
 
Glad to hear that you're back on the job there Ciro! Nice to know you got the pybattery stuff going as well, that will certainly make things better! I'd found some suggestions about utilizing the power management/monitoring stuff from Kagu as well; not sure how much they overlap, but the Kagu one seems pretty extensive:
http://kagumedia.com/projects/kagu/b.../kagu/maemo.py

Thanks again for this awesome app, looking forward to seeing the full final working version with integrated system alarmd functionality and full power management (lol and maybe a way to exit without having to manually issue a kill command at some point!)

qwerty12 2009-01-08 15:36

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 255419)
Since is 'real'work in progress (Im still not sure if the clock and the alarm works :), and this for a clock/alarm program is probably bad...) I thinked that the app didnt deserve a debianizing (and since I write using shortcuts, tricks, weirdo technics is a pain to try to packagin it everytime (I still have no clue and since now qwerty12 made up all the packagings, and make realize that is not a so simple task. I ll try to release the long promised plain naked optimized version and ask to qwerty12 to do the job and ask to the maemo folks to promote to extra and give to everyone on the thread the credits they deserve and have the satisfaction to see the thing finally in the wild.
Peace and love, peace and love

I have become really lazy (and I do apologize) and have kinda let this slip to the side regarding packaging. If you get out a version that you want packaged, let me know here or on IRC and I will package it.

ciroip 2009-01-08 15:59

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qwerty12 (Post 255442)
I have become really lazy (and I do apologize)

You know qwerty12 that you are giving a great service to the project and to the entire nokia tablet scene. My main concerne is not wasting your time and as you noticied all the previous releases were pretty experimental and they didnt 'deserve' the deb. The raw compressed sources release worked fine (and probably even better than the deb for checking the code since everything were at the same place) but it's a joy to see an application packaged with the icon placed int the menu :) So no need to apologize and hope everyone spent some nice holydays.

ciroip 2009-01-08 16:51

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by jolouis (Post 255423)
I'd found some suggestions about utilizing the power management/monitoring stuff from Kagu as well;
http://kagumedia.com/projects/kagu/b.../kagu/maemo.py

... with integrated system alarmd functionality and full power management ...

at a 1st look the kagu works seem empressive, Ill cross check everythin and see how much i will understand about the entire topic.
I am waiting for someone came up with a comment about the advantages to use the alarmd. My (limited) experience is that the daemon is not really reliable. It hang and there is no easy way to be sure if the thing is running or whatever. My actual approach here is: if the application is running the alarm works, otherwise 'ciccia', no alarm. Maybe Im missing something (im really far from being a linux expert) so, in case noone will showup with something convincing to try to use the alarmd ill keep comparing the alarm variable setted directly from inside the clock.
PS Ill think a decent way to kill the app...

jolouis 2009-01-08 19:02

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 255462)
I am waiting for someone came up with a comment about the advantages to use the alarmd. My (limited) experience is that the daemon is not really reliable. It hang and there is no easy way to be sure if the thing is running or whatever. My actual approach here is: if the application is running the alarm works, otherwise 'ciccia', no alarm.

Utilizing alarmd gives you a lot of very handy and awesome benefits compared to just setting the alarm within your app; from my understanding of it by using the alarmd interface:
- Your app doesn't have to be running for the alarm to occur. You can actaully setup the alarm to launch your app if you want, so that when an alarm goes off the clock app will open if it's not there already.
- Alarmd will continue to run and trigger events at all power states of the tablets. This is important as it relates to your power savings features. If you implement proper power savings when the tablet goes into idle (not used), your application should literally stop doing anything so that the tablet can save power; it's awefully difficult to keep checking the time and comparing it to the given alarm schedule though if your app isn't doing anything, so the only way to make it work would be to have your app continue to run at some level, which wastes power.
- Alarmd has the added ability to trigger alarms even when the tablet is "off" mode... that is, if you set and alarm and turn the tablet off, put the tablet on charge, the alarm will still execute normally. Good for those times when you have something like a daily alarm, and one night have your tablet off and forget to turn it on... alarm will still run.

I'm sure there are other reasons, but from my understanding of it those are the obvious ones. The biggest point, of course, is that whole alarms will still run even if your clock is not. This is a major point. Think of it this way... if you set an alarm, then do some other stuff on the tablet (surfing the web, reading an ebook etc) before going to sleep and forget to switch back to the flipClock, your alarm will never go off! If you implement alarmd functionality then in this same scenario you can make the tablet automatically change to the flipClock app (and even open it if you had closed it before), and handle the alarm as expected.

daperl 2009-01-08 19:08

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by jolouis (Post 255417)
then once the update has completed the timer is recalculated (that way the wait is accurately calculated again AFTER all potentially time-consuming code has been run).

I agree. Get the next time stamp after the update code and right before the wait/sleep/timer/etc call. In my example I would thus flip the first two statements of my while loop. Good call.

danramos 2009-01-09 09:41

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 255448)
You know qwerty12 that you are giving a great service to the project and to the entire nokia tablet scene. My main concerne is not wasting your time and as you noticied all the previous releases were pretty experimental and they didnt 'deserve' the deb. The raw compressed sources release worked fine (and probably even better than the deb for checking the code since everything were at the same place) but it's a joy to see an application packaged with the icon placed int the menu :) So no need to apologize and hope everyone spent some nice holydays.

If you could, please point me to the latest deb so that I can try it out. I'm finding it difficult to follow along and recognize which posting had the latest version (or maybe I just didn't realize there was only the first post?). You might be surprised to know that I've actually had people ask me if this type of application existed long before this thread was started and really didn't have a clear answer.

Thanks for the great app!

ciroip 2009-01-09 13:23

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by danramos (Post 255717)
If you could, please point me to the latest deb so that I can try it out. I'm finding it difficult to follow along and recognize which posting had the latest version (or maybe I just didn't realize there was only the first post?). You might be surprised to know that I've actually had people ask me if this type of application existed long before this thread was started and really didn't have a clear answer.

Thanks for the great app!

I'm sorry to create such a mess releasing schedule. It is my 1st project ever and is a bit hard to stay focus on a stable version ready to be used. + Im more a graphic guy than a programmer so maybe the application could look more complete than actually is (even if it is only a clock+alarm I usually screw up something...) Anyway the holy people at maemo host the project so is possible to keep track of all the releases at
https://garage.maemo.org/frs/?group_id=851&release_id=2290

I wish that page could show a bit more info about each release; Ill probably begin to keep a .log to update each time and see if that help. Ill try to came out with an usable version to be debianized. Again sorry for the confusion and thank you for the comment

danramos 2009-01-09 23:56

Re: Flip clock pre pre pre pre release
 
Garage. **slaps forehead** I didn't even think to look in the obvious place. :) Nono--thank you, all-around! I look forward to trying this app out and very likely suggesting it to people who've been looking around for this.

ciroip 2009-01-10 07:22

Re: Flip clock pre pre pre pre release
 
Ok, the 008 Flip alarm clock should have all the feature I decided to keep for the final version. Now I can spend some time organizing all the suggestion from the forum to optimize the use of the resources.
I introduced the slide up and down gesture to access the alarmset screen and to disarm the alarm. For the battery check I modified the code of Harry Petas and it seem works pretty flawless. I just need to draw the graphic for the charging status since the dbus return a fixed value (-1) when the tablet is connected to the power. Still need to check how access the volume but I decided to suspend the task to focus on the optimization of the resources. I modularized even more the things so now is pretty easy change the 'settings' using the variables in ci_init (to enable/disable the led, the flipping animation and the battery status) so is possible to use/test it on a desktop linux/windows and I suppose mac? (look still fine at full screen on a desktop. Ill try to convince someone to adapt it for a xscreensaver module :)).
I really need to rewrite the alarm routine: now is pretty dumbly connected to the clock refresh and this limit a lot any optimization. Beside the battery drain should be pretty harmless and stable.


https://garage.maemo.org/frs/downloa...2/ico60x60.png
https://garage.maemo.org/frs/downloa...193/sshot1.jpg
Happy weekend

daperl 2009-01-10 18:39

Re: Flip clock pre pre pre pre release
 
Dude, I don't know where or how you're getting these images, but if it's all you; you're scary good. That zombie-green leak-through glow... Scary good. I'm almost afraid of what you're gonna do next. Excellent work.

ciroip 2009-01-10 21:55

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 256194)
Dude, I don't know where or how you're getting these images, but if it's all you; you're scary good. That zombie-green leak-through glow... Scary good. I'm almost afraid of what you're gonna do next. Excellent work.

lol,thank you daper but once you know the trick everything became pretty dumb :).
I have sort of a graphic experience in my story but 90% of the tricks here came from the amazing program Xara. It have a great antialias algo and is scaryfast + it export the 256 palette optimized image i use for the most part of the graphic and the excellent managing of the trasparent png of pygame do the rest. Xara programmers (uk rulez) have a free (nonopensourrce) linux version of their program (im pretty sure ubuntu have it in some ufficial universe/repository otherwise is possible to dl from their site.
Anyway, next version is nearly complete. I completely divided the alarm part so now i can introduce the 'letmesleep5moreminutes'feature pretty easily. When Ill complete the about page (thinking to introduce a graphic of the battery cycles) and all the credits and thanks ill ask to qwerty12 to help me again with the packaging.

ciroip 2009-01-11 06:01

Re: Flip clock pre pre pre pre release
 
Alarm routine completed. Now it run in its own while loop and let me update the clock each 60 seconds (instead of each second like before). I m sure this solution will raise some exception to the alarm but im too dummy to try to figure out what and where so I decided to just drop the thing on the wild and see what happen. Ill keep studing some more serious solutions but for now this is what I am able to put up :).
This should be the 1st really usable release, it show the percentage of the battery level all the time (another reason to keep the application running all the time :D. I should not be too difficult to keep a variable to store an entire day of battery history (something like 720 ticks per day (a sample each 2 minutes) to populate the graph space I prepared on the about screen and it should fit well on the 800 pixel of the tablet.
https://garage.maemo.org/frs/downloa...98/fk9.tar.bz2
https://garage.maemo.org/frs/downloa...sshot009_1.jpg
https://garage.maemo.org/frs/downloa.../changelog.txt
I know, the leds could become really annoying but I can't force myself to remove the feature. In case just changing the
sw_led variable to 1 in ci_init.py should be enough to disable the 'spettring'.
There is a lot of free space on the about screen so if someone want his name there can drop a line here to say if the alarm have any issue on a long term (more than a couple of hours) use.
The clock still keep working even when is in background since I didnt found the OS call to interrogate and save some resource anyway I really like the idea to keep updating the battery things so even without any alarm set the application have always have something to do at least each 2 minutes.
I think that's all for the day.
Buonanotte a tutti e buona domenica.

Faz 2009-01-11 09:33

Re: Flip clock pre pre pre pre release
 
Good morning ciroip!

Thank you for all the time and energy you've put into this project!! It is most definitely appreciated!!!
It's been interesting to follow, although not being a developer I have to admit in skipping the high geek factor stuff! :rolleyes:

I've just downloaded fk9.tar.bz2 and after extraction I'm executing using the command "python fk009.py" successfully launching "Flip Alarm Clock 0.008" ...8? ;)

Nice battery meter, working as expected.
Liking the use of the LED too! First time I've ever seen my N810's LED turn purple!! :D

albright 2009-01-11 14:15

Re: Flip clock pre pre pre pre release
 
I can start flipclock with the python command in
xterm and it runs, but nothing happens when I push the
set alarm button. Is there some trick to this?


All times are GMT. The time now is 07:28.

vBulletin® Version 3.8.8