This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9155 - Simplified battery bench plugin
Attached to Project:
Rockbox
Opened by Bertrik Sikken (bertrik) - Saturday, 05 July 2008, 13:13 GMT+2
Last edited by Bertrik Sikken (bertrik) - Friday, 15 August 2008, 00:46 GMT+2
Opened by Bertrik Sikken (bertrik) - Saturday, 05 July 2008, 13:13 GMT+2
Last edited by Bertrik Sikken (bertrik) - Friday, 15 August 2008, 00:46 GMT+2
|
DetailsAttached patch contains the current work-in-progress for a simplified version of the battery bench plugin. The main difference with the old one is that the battery measurements themselves are now done purely on a time basis (once a minute) and do not depend on disk activity or disk spindown times. Writing the measurements to disk is still as unobtrusive as possible (written when the disk is active anyway).
Other changes: * Now uses the ata idle callback mechanism to flush measurements to disk, instead of polling for disk activity with ata_disk_is_active(). Infact, this patch removes ata_disk_is_active from the plugin API and adds the ata idle register/unregister functions. * Skipped measurements are no longer kept track of, because they are nearly impossible. The only problem occurs when the measurement buffer gets full after > 16 hours of no disk activity, which is rather unusual. The current implementation chooses to save the data in that case (and spin up the disk). * Measurements/disk activity is no longer logged, because it makes no sense with time-based logging. Things to consider: * The measurement thread simply sleeps for 60 seconds between measurements, resulting in a measurement interval that is actually slightly more than 60 seconds. * Only tested on my sansa e200 (which is a flash target), so it has not been tested on a DAP with a hard disk yet. I tested the buffer-full scenario by modifying the source for a small measurement buffer (500 bytes) and short measurement interval (10s). |
This task depends upon
Closed by Bertrik Sikken (bertrik)
Friday, 15 August 2008, 00:46 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as svn r18281
Friday, 15 August 2008, 00:46 GMT+2
Reason for closing: Accepted
Additional comments about closing: Committed as svn r18281
one thing to remember is that on the flash targets, the ata callback is called every 3s or so (iirc)....
Buschel, thanks for testing so far. Did you notice anything strange? Can you verify that it does no unnecessary disk spinups and that logging is complete (measurement cache should be flushed on shutdown)?
E.g. http://www.rockbox.org/twiki/bin/viewfile/Main/IpodRuntime?rev=1;filename=battery_bench_080505_mpc_24_nolineout.txt.
Maybe the flush at shutdown is not performed?
I don't know what your player's shutdown voltage is exactly, or what caused the dip. BTW, there seem to be some bugs in the battery runtime calculation code. At a voltage of 3.431, the estimated runtime is 0 minutes, but at 3.430 it becomes 2:20 again.
Attached is the patch updated to current SVN. It's a bit smaller because I stripped most of the non-essential white-space changes, but it's otherwise the same.
See comments in plugin.h before and at the end of the plugin api.
But, I possibly confused the two versions. Now, that I've read the comment again, I think you've done it correctly.
Anyway, you didn't take the opportunity to sort in any new function which are "waiting" at the end of the function table :D
Meh, I'm too tired right now...
http://www.rockbox.org/tracker/task/8070
maybe some ideas (ie. more frequent flushing when battery is under 10%) would be helpful
Tomasz, I added task 8070 as a related task. I'd like to keep the amount of special cases (like more frequent flushing) to an absolute minimum. I don't want to fix something if it isn't clear that it is a problem in the first place. Besides, more frequent flushing will make the battery bench less true to the normal situation (because of the extra disk spinups).
Attached is a new version of the patch. It is updated to svn r18813 and fixes the problem that it would not compile in the simulator.
* on exit, the battery bench now logs a final line with the reason for exiting (normal plugin exit or power off). This way you can detect if a battery bench terminated abnormally.
* fixed compilation issue for ifp7xx.
* minor bugfix in buffer overflow handling.