Closed Bug 915666 Opened 6 years ago Closed 6 years ago
Estimate mean time to first sample (MTFS) for the digital ammeter
As a B2G developer, I want to know the sampling delay of the digital ammeter so that I can time correlate the power draw samples with the marionette/gecko events in the log file from the device. This requires the use of a USB digital I/O board, digital ammeter, and a test script that will measure the time between telling the digital I/O board to assert its output pin and when we get the first sample back from the ammeter that shows current draw on that pin. By repeating this test thousands of times we can estimate the MTFS for the digital ammeter and use that as the time delta to shift the ammeter samples when correlating measurements with events in the device log.
I'm picking this up and adding it to the 9.20 sprint. I want to get this done upon arrival back in Seattle.
Assignee: nobody → dhuseby
Status: NEW → ASSIGNED
Whiteboard: [c=profiling s= p=] → [c=profiling s=2013.09.20 p=2]
Cool stuff! One thing to keep in mind is power = voltage x current. So unless you're using a constant-voltage source to simulate a battery, a real battery will have changing output voltage depending on its charge and output current, and that will affect the accuracy of the power consumption measurement. You should also talk to the A-team because they had some ideas (bug 828668).
Whiteboard: [c=profiling s=2013.09.20 p=2] → [c=power p=2 s=2013.09.20 u=]
Note that my next revision of the battery harness will include a custom chip that measures both current and battery voltage, so we will be able to take that into account.
So most, if not all, cell phones have built-in battery voltage meters that the kernel talks to. We already have support for it. That's how we estimate remaining charge in the batter and draw the battery icon in the status bar. We could pull the voltage data from there and correlate it with the current to get power draw.
I finished estimating the delay to first sample from the ammeter. My results are written up here: https://wiki.mozilla.org/B2G/Performance/Sample_Delay_Calibration_of_COTS_Ammeter
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.