Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: penartur on May 07, 2009, 03:57:20 AM

Title: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 07, 2009, 03:57:20 AM
It seems for me that the problem is somewhere in rockbox's power management.
So, i'm using Ipod Video 60GB (model no. MA003LL), upgraded to 240GB Toshiba MK2431GAH. Because of the upgrade, i'm using unsupported rmaniac build ( http://forums.rockbox.org/index.php?topic=20960.0 ), based on rockbox v3.2, but i doubt if the problem could be because of rmaniac's changes. Battery is brand new, extended capacity (850mAh) from rapidrepair; it was charged/discharged for about only 10 times (so i assume it's calibrated properly, but is not dead yet).
But even after this several charges/discharges battery life under real world's usage when playing flacs is about 8-10 hours, even after i've tried to configure rockbox to be as efficient as it is possible.
I've ran battery benchmark on playlist of 12 mp3 files, 120MB total, 320kbps, and result is unbelievable 14:10. According to http://www.rockbox.org/twiki/bin/view/Main/IpodRuntime , it should be about 20+ hours with a standart battery; and nobody has such poor result since 2007. Of course, i haven't touched it for all this 14 hours; headphones is 16ohm and volume is -30.
Under original firmware on the same playlist after 12 hours of playback it shows that the battery is still has about half of its charge.
Also, under original firmware charge time is about 2 hours; but on the rockbox it charges only to about 50% for a 8 hours; however, maybe that's because of playback while charging.
What could be the problem's root? Maybe, something is wrong with my settings?

Here is my rockbox-info.txt:
Code: [Select]
Target: ipodvideo
Target id: 15
Target define: -DIPOD_VIDEO
Memory: 64
CPU: arm
Manufacturer: ipod
Version: 3.2-090324
Binary: rockbox.ipod
Binary size: 631596
Actual size: 631588
RAM usage: 1718992
Features: alarm:albumart:backlight_brightness:backlight_fade_int:dircache:disk_storage:headphone_detection:hold_button:lcd_bitmap:lcd_non-mono:lcd_color:lcd_sleep:pitchscreen:quickscreen:recording:recording_swcodec:rtc:scrollwheel:wheel_acceleration:swcodec:tagcache:tc_ramcache:charging:usb_charging:usbstack:accessory_supply:serial_port
gcc: arm-elf-gcc (GCC) 4.0.3
ld: GNU ar 2.16.1
Host gcc: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
Host system: Darwin
config.cfg:
Code: [Select]
# .cfg file created by rockbox 3.2-090324 - http://www.rockbox.org

volume: -30
repeat: all
backlight timeout: 1
scrollbar: off
show icons: off
idle poweroff: 2
battery capacity: 850
accessory power supply: off
brightness: 8
foreground color: FFFFFF
line selector start color: 0000FF
line selector end color: 00008C
line selector text color: FFDF00
volume fade: off
antiskip: 10min
disk spindown: 3
show files: music
follow playlist: on
replaygain type: album
replaygain noclip: on
dircache: on
lcd sleep after backlight off: 5
show path in browser: full path
font: /.rockbox/fonts/calibri_16.fnt
wps: /.rockbox/wps/boofers.wps
lang: /.rockbox/langs/russian.lng
backdrop: /.rockbox/backdrops/Boofers.bmp
cuesheet support: on
start in screen: wps
iconset: /.rockbox/icons/oxygen.bmp
viewers iconset: /.rockbox/icons/null.bmp
filetype colours: /.rockbox/themes/tmi.colours
Attached is battery_bench.txt
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 07, 2009, 05:01:03 AM
Have you tried putting the original disk back in, using an official SVN build, and seeing how battery bench results compare?
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 07, 2009, 05:06:14 AM
Unfortunately, i haven;'t tried it on the original hdd. Also, it took a four days from me to make ipod boot from new hdd (itunes "restore" and ipod's "disk mode" are damn unreliable things), so living with 10 hours battery life is more preferrable by me than going through this two times more.
But is there something i should change in the settings? Anti-skip buffer, disk spindown time etc?
Thanks.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 07, 2009, 05:07:30 AM
A 10 minute anti-skip buffer will kill anyone's battery life. It's rather ridiculously large. You want the value as low as possible without skipping occurring. I'll admit I hadn't even looked at your settings, because I assumed you'd run the battery bench the way we ask you to, rather than doing it with your own settings.

In fact it even says in the manual you should have this setting set to as low a value as possible.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 07, 2009, 05:25:59 AM
Oh, i haven't read the manual, that's my fault :) i've thought that larger anti-skip buffer => less frequent access to hdd => less power consumption.
Will try to set it to 30 seconds :) please, forgive me my foolishness...
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 07, 2009, 05:29:25 AM
Compressed audio is always buffered with all the memory available. The anti-skip buffer is "how low do we let the compressed buffer get  before we begin refilling it." If you're not shaking the MP3 player for long durations, there's no reason not to have it the lowest possible setting. The higher you set it, the more often it refills the memory, because there's a large portion of the memory that is never allowed to empty.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 08, 2009, 07:32:18 AM
Thanks for your explanation!

However, after i've reduced anti-skip from 10 minutes to 30 seconds, battery life increased only to 2%, it is 14:30 now on the same playlist; nobody have touched the ipod for all this 13 hours, screen was off, backlight off and hold switch was set to on to prevent accidental buttons hitting.

Attached is new battery_bench.txt.
Will try it with default settings tomorrow.

I can do any diagnostics or tests you want, except for the ones that require disassembling the device again :)
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected
Post by: Chronon on May 08, 2009, 12:44:55 PM
Apple's battery estimates can fluctuate quite a lot and aren't necessarily very reliable at any given point in time.  So a better comparison would be to run it completely down while using Apple's firmware and then compare this to what you get in Rockbox. 
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 11, 2009, 08:20:28 AM
With the default settings i've got the same 14:20 while playing mp3s.
Then, i've tried to build rockbox on a vmware build lab ( http://www.rockbox.org/twiki/bin/view/Main/VMwareDevelopmentPlatform ), i've used revision 20878 + patch from rmaniac for MK2431GAH support + FS#9746 + FS#9708 (v0.6, UDMA4) + FS#8668.
With ReplayGain on, cuesheet support on, Boofers theme, album art and 16Ohm earphones on -30dB i've got 22:23 of playback while playing FLAC (Metallica S&M, 496MB+480MB). That's more than two times more than i've got on flacs on v3.2. Hold was ON, and i've switched it to OFF for about 10 times.
So, either some changes since 3.2 or one of this three patches doubled my battery life.
I think that both my second benchmark (MP3 320kbps, anti-skip on 30 seconds and rockbox v3.2, http://forums.rockbox.org/index.php?action=dlattach;topic=21593.0;attach=3669 ) and current one should be posted on http://www.rockbox.org/twiki/bin/view/Main/IpodRuntime, so that users will be able to see the difference and understand why their battery time on 3.2 is so lower than on the wiki page and what they could do to improve it. However, i'm unable to edit wiki pages; so maybe someone here will do this for me? :)
I couldn't even hope on such battery runtime on lossless, and it is just amazing :)

PS: If you wish, i can do the same benchmark on MP3s within a couple of days :)
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 11, 2009, 08:26:39 AM
Why not track down which patch is the one that affects battery life?
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 11, 2009, 08:47:28 AM
Here we have 4 possible causes of such great improvement: changes since 3.2, FS#9746, FS#9708 (v0.6, UDMA4), FS#8668; so, it will require at least two another benchmarks just to suspect what could be the exact cause of improvement; and one more to prove it. Unfortunately, i do not have opportunity to measure current from the firewire, so the only way to compare two different builds is to run benchmark again; and that would be very inconvinient for me now, as this ipod is my only player.
After reading this three FS, i would guess that the cause is primarily in changes since v3.2; but such a guess doesn't explain such low running time on v3.2 compared to a numbers from http://www.rockbox.org/twiki/bin/view/Main/IpodRuntime . However, maybe, the problem was in the way v3.2 handled my 240GB harddrive, and this problem got fixed recently; that would describe both 2x increase with current build and 1.5-2x less running time compared to benchmarks from http://www.rockbox.org/twiki/bin/view/Main/IpodRuntime .
Just to mention, i haven't changed any settings when upgraded to a current build, everything is configured as it was on 3.2 with 14:30 running time on mp3.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 11, 2009, 09:01:29 AM
So what's the point in posting battery benchmarks to the benchmark page that are not with official code, and we don't know why they don't work?

You're the only person who can answer these questions, as you're the only person in this situation, so it would be really helpful if you could actually determine where the issue is.

You're welcome to say "I don't want to" but the battery benchmarks aren't particularly useful since they don't reflect the usual user experience, or a "normal" situation for users. And as you've pointed out, without further testing we have no way of knowing whether this low battery life even can exist for normal users using up to date source.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 11, 2009, 09:17:40 AM
Quote
So what's the point in posting battery benchmarks to the benchmark page that are not with official code, and we don't know why they don't work?
We know that:
1) On a 240GB with v3.2 running time is very low;
2) On a 240GB with the latest build + patches running time is fine.
I do not see the difference between my results and others posted on that page (e.g. 80GB with CF mod, or other builds with patches etc).
Quote
since they don't reflect the usual user experience, or a "normal" situation for users[/quote
Of course, 240GB now is not a normal situation for users, but, i think, it will be sometime. And it could be helpful for someone even now.
Quote
And as you've pointed out, without further testing we have no way of knowing whether this low battery life even can exist for normal users using up to date source.
As i understand, "normal users" are usually using latest release, not the current build?

Maybe i just don't completely understand the purpose of wiki page. What do you say is more for bug report like "without this patch (although seemingly unrelated) i'm getting terribly low battery life". I've thought that wiki page is for the statistics, so that normal users can see how long their ipod will work under certain conditions with the certain rockbox version; and from this point of view, imho, this results could be useful.
Of course, you're welcome to say "wiki page is for something else, and we will not post your benchmarks there", i don't force you to use my results in any way. I've just thought that what i hav already did could be useful for someone.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 11, 2009, 09:20:46 AM
Ones on those page (even with patches) were added when they were believed to be accurate representations of a realistic case.

We've already established that the problem goes away under some unknown conditions, and one of those unknown conditions might simply be "not using old code." So an obvious first step is to find out which patch or condition caused the low battery life.

Especially since the official 3.2 won't work on a 240GB drive, so the lowered battery life only happens if you use an unsupported build.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 11, 2009, 09:33:49 AM
Quote
Especially since the official 3.2 won't work on a 240GB drive, so the lowered battery life only happens if you use an unsupported build.
As i understand, current build won't work unchanged either.
However, after your words i'm unsure if the only changes in rmaniac's 3.2 build i've used is:
Quote
Also to allow this drive to work I added/changed these things in the config-ipodvideo.h:

/* Add LBA48 for my 240GB */
#define HAVE_LBA48

/* define this if the device has larger sectors when accessed via USB */
/* (only relevant in disk.c, fat.c now always supports large virtual sectors) */
#define MAX_LOG_SECTOR_SIZE 16384

/* define this if the hard drive uses large physical sectors (ATA-7 feature) */
/* and doesn't handle them in the drive firmware */
#define MAX_PHYS_SECTOR_SIZE 4096
so posting my benchmark on v3.2 may be really pointless.
However, i can tell that this is the only change except for patches i've did in my current v3.2 build, so that is realistic case with 240GB. If my latest benchmark will be on the wiki page, people with 240gb ipods and low battery life will just try revision 20878 + patch from rmaniac for MK2431GAH support + FS#9746 + FS#9708 (v0.6, UDMA4) + FS#8668 prior to asking this question here like i did.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: Llorean on May 11, 2009, 09:40:50 AM
Or you could try and figure out which patch fixes the problem, because maybe it's one that could be committed to SVN, so that if LBA48 support is considered for SVN we know what other patches are necessary to make it work well.

Seriously, Rockbox is entirely a volunteer effort by people who've put in hundreds of hours of work.

You could help the knowledge available significantly by just spending a few more days running battery benchmarks.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: penartur on May 11, 2009, 09:48:31 AM
If i will connect ipod to a pc with a firewire cable (if i will be able to find one), can i measure the current under windows?
I understand that rockbox is a volunteer effort, but another 4-5 days without a player is just too bad.
Of course, if i had another player, i would run usual benchmarks, but this ipod is my only one.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: soap on May 11, 2009, 01:03:08 PM
Ideally battery benches should be done by isolating changes.  I think you will notice at least all of mine and buschel's do just that.  One bench at stock, and a matching one with one change.
Even though others have done differently at times, there is little value in it.

Second point - the LCD controller sleep work is post 3.2, no?  This alone would easily explain all the battery life differences you have seen.

EDIT:  Yes it was (post 3.2).  This (FS #9890) and FS #8523 (Disable WPS updates when backlight is off) plus the DMA drive patch you applied add up to a quite significant power savings.
And FS #8668 - buschel's GUI boost lowers the base clock to 15Mhz, IIRC - leading to significant power savings on non-boosting codecs like FLAC.

Add them up and I am nowhere near shocked you get near twice the runtime of 3.2
 
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected
Post by: saratoga on May 11, 2009, 09:30:45 PM
If i will connect ipod to a pc with a firewire cable (if i will be able to find one), can i measure the current under windows?

No, you need to use a multimeter to do that.
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: dreamlayers on May 13, 2009, 02:15:15 AM
If i will connect ipod to a pc with a firewire cable (if i will be able to find one), can i measure the current under windows?

If you want to measure steady state current, I recommend http://www.rockbox.org/tracker/9728 (Note: I wrote that patch.)

If you need to measure rapidly changing current, such as during hard drive activity, then a battery bench is best.  Even a multimeter can't measure the current then; it's a very noisy waveform (http://picasaweb.google.com/boris.gjenero/RockboxRelated#5297270005596450130).

I understand that rockbox is a volunteer effort, but another 4-5 days without a player is just too bad.
Of course, if i had another player, i would run usual benchmarks, but this ipod is my only one.

You don't need to perform a whole battery bench.  A few hours should be enough when the battery life difference is that large.  Overnight would definitely be enough.  Start with a full battery, and later on align the graphs at the beginning, by moving one horizontally relative to the other.  Differences in power consumption lead to differences in slope.

Second point - the LCD controller sleep work is post 3.2, no?  This alone would easily explain all the battery life differences you have seen.

EDIT:  Yes it was (post 3.2).  This (FS #9890) and FS #8523 (Disable WPS updates when backlight is off) plus the DMA drive patch you applied add up to a quite significant power savings.
And FS #8668 - buschel's GUI boost lowers the base clock to 15Mhz, IIRC - leading to significant power savings on non-boosting codecs like FLAC.

Add them up and I am nowhere near shocked you get near twice the runtime of 3.2
 

BCM/LCD sleep is in 3.2.  For example, see:
http://www.rockbox.org/twiki/bin/view/Main/MajorChanges
Afterwards I made some tweaks and closed the task, but that should not have affected battery life.

In tests with original iPod hard drives, UDMA saved very little power when playing MP3 files.  I imagine that more power is saved when playing FLAC files.  (I don't think anyone did a battery bench with FLAC.)  Also, with an original hard drive, the transfer rate is limited by the drive (http://www.rockbox.org/tracker/task/9708#comment29372).  When boosted, a PP502X chip can transfer data much faster.  Maybe the 240 GB drive can transfer data much faster, and so the UDMA is more beneficial.

FS#8668 should save a significant amount of power when playing FLAC or MP3.  With the patch, normal CPU frequency is 24 Mhz.  Buschel found shorter runtime at frequencies below 24 Mhz:  http://www.rockbox.org/tracker/task/9800#comment27703
Title: Re: Ipod Video 60GB: Poor battery life under rockbox (2 times less than expected)
Post by: soap on May 13, 2009, 12:34:57 PM
Second point - the LCD controller sleep work is post 3.2, no?  This alone would easily explain all the battery life differences you have seen.

EDIT:  Yes it was (post 3.2).  This (FS #9890) and FS #8523 (Disable WPS updates when backlight is off) plus the DMA drive patch you applied add up to a quite significant power savings.
And FS #8668 - buschel's GUI boost lowers the base clock to 15Mhz, IIRC - leading to significant power savings on non-boosting codecs like FLAC.

Add them up and I am nowhere near shocked you get near twice the runtime of 3.2
 

BCM/LCD sleep is in 3.2.  For example, see:
http://www.rockbox.org/twiki/bin/view/Main/MajorChanges
My bad, I simply looked at the FS closure date vs 3.2.