Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: michaelc5047 on August 16, 2008, 02:51:15 PM

Title: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 16, 2008, 02:51:15 PM
I've got a 5.5G iPod (30GB model) that has been modded with a 32GB aData CF card. The battery in it is a 650mAh aftermarket generic battery off of eBay.  I Rockboxed it with Tarkan's build (from SVN of July 3rd.) I ran a battery bench last night and got a mere 9 hours and 45 minutes out of it.

Obviously, I suspect the battery is bad (even though I bought it in March) and have ordered a new one from a different vendor. Are there any hardware issues that could cause this, other than the battery? The battery life was also not great with the original firmware and the CF card.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: soap on August 16, 2008, 03:10:01 PM
No support for anything but the official build.

Who knows what CPU (and thus battery) hogging mods Tarkan has on his build.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: Llorean on August 16, 2008, 03:12:03 PM
Though if the OF has short life too, you really should try without the CF card.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 16, 2008, 05:26:58 PM
No support for anything but the official build.

Fair enough. 

Quote
Who knows what CPU (and thus battery) hogging mods Tarkan has on his build.

His patch is only to get aData CF cards working (not that you had any way of knowing that from my original message.) The original discussion of it is found here: http://forums.rockbox.org/index.php?topic=14524.msg129043#msg129043


Quote from: Llorean
Though if the OF has short life too, you really should try without the CF card.

Don't own a hard drive that'll fit it (other than a 6GB microdrive from an iPod mini that will fit the ZIF-to-CF adapter...)
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 16, 2008, 05:42:20 PM
That patch changes how hardware devices are initialized on the Ipod.  If its leaving some of them enabled that should not be, then battery life will probably be decreased. 
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 16, 2008, 05:45:53 PM
That patch changes how hardware devices are initialized on the Ipod.  If its leaving some of them enabled that should not be, then battery life will probably be decreased. 

Aha. That is good to know -- thanks. I think I will put that 6GB microdrive in and see if the battery benchmark looks any different with a standard build.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 16, 2008, 06:17:38 PM
You could also change one of the print statements in the apps/debug_menu.c to print the value of that register (assuming one doesn't already).  Then you could see exactly what (if anything) is different between the builds.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 16, 2008, 09:04:11 PM
For the 4G the DEV_RS statement is removed (system-pp502x.c) to allow it to get past the ATA -1 error.  Are you saying that we can find the proper value for DEV_RS by modifying debug.c?  If so, what exactly should I add to debug.c?
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 16, 2008, 09:10:42 PM
Are you saying that we can find the proper value for DEV_RS by modifying debug.c? 

I'm saying one of the easiest ways to see the value of DEV_RS is by printing it in debug_menu.c.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 16, 2008, 10:19:47 PM
Let me see if I understand what to do here:

So, under the section in debug_menu.c beginning with "#elif defined(CPU_PP502x)," I should add a new section near the end (or replace one of the pre-existing ones) with:

snprintf(buf, sizeof(buf), "DEV_RS: %08lx", DEV_RS);
        lcd_puts(0, line++, buf);

I'm just cutting and pasting and replacing DEV_INIT2 from the original code with DEV_RS. Please don't confuse me for an actual programmer, though ;-)

Then compile one build with the modified debug_menu.c file, and another one with the modified file AND Tarkan's patch, then see what the debug menu says, yes?

Does this make sense?
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 16, 2008, 11:15:54 PM
Forgive me for hijacking your thread to discuss the 4G, but maybe together we can get the ipod CF corrected.

These are the values set in firmware/target/arm/system-pp502x.c for the ipod 4G

#elif defined(IPOD_4G)
        /* set minimum startup configuration */
        DEV_EN         = 0xc2020124;
        DEV_EN2        = 0x00000000;
        CACHE_PRIORITY = 0x0000003f;
        GPO32_VAL      = 0x02000000;
        DEV_INIT1      = 0x00000000;
        DEV_INIT2      = 0x40000000;

        /* reset all allowed devices */
        DEV_RS         = 0x3ffdfef8;
        DEV_RS2        = 0xffffffff;
        DEV_RS         = 0x00000000;
        DEV_RS2        = 0x00000000;

The debug menu shows the following differences, with patch applied to remark out DEV_RS=0x3ffdfef8;

DEV_EN    = C0031926
DEV_INIT1  = 00040000
DEV_RS = 00000000
DEV_RS2 = 00000000

With a patch applied to remark out the entire code above:

DEV_EN = C0831977
DEV_EN3 = 0007003F
DEV_INIT1=00040000
DEV_RS = 0000000
DEV_RS2 = 00000000
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 17, 2008, 08:12:33 AM
I put a 6gb microdrive in (as I don't have an original hard drive for this iPod) via the ZIF-to-CF connectior and ran a battery benchmark overnight using a fresh daily build and the same album on repeat that I used to test the iPod with the CF card. 9 hours 30 minutes with the microdrive, as compared to 9 hours 45 minutes with the CF card.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: soap on August 17, 2008, 01:59:49 PM
And with the original firmware you get...?

The best test of battery condition is still measuring life with the original firmware.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 17, 2008, 02:43:00 PM
And with the original firmware you get...?

The best test of battery condition is still measuring life with the original firmware.

Huh. I guess "not as much battery life as I think it should" is too subjective a statement, eh? Thanks. Will check it.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: soap on August 17, 2008, 02:52:33 PM
I agree 100% that the numbers you posted are lower than expected with a stock battery, much less a (supposedly) higher-capacity aftermarket one.
That being said:
1 - There are lots of **** quality aftermarket batteries floating around.  Ones which aren't worth the postage they were shipped in.
2 - There are lots of fraudulently labeled, and plain ol' counterfit aftermarket batteries floating around.
3 - The only way to nail down the question (which I think is the underlying question here) "Is my battery dying already or has Rockbox regressed in terms of battery runtime?" is to test against a known benchmark - the Apple Original Firmware (R) (TM)
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 17, 2008, 03:23:09 PM
Quote from: soap
I agree 100% that the numbers you posted are lower than expected with a stock battery, much less a (supposedly) higher-capacity aftermarket one.
That being said:
1 - There are lots of **** quality aftermarket batteries floating around.  Ones which aren't worth the postage they were shipped in.
2 - There are lots of fraudulently labeled, and plain ol' counterfit aftermarket batteries floating around.
3 - The only way to nail down the question (which I think is the underlying question here) "Is my battery dying already or has Rockbox regressed in terms of battery runtime?" is to test against a known benchmark - the Apple Original Firmware (R) (TM)

Yes, that was in fact my underlying question, and my thanks were sincere.  :) I also really hadn't thought of doing a benchmark on the Apple OS and comparing it against Rockbox.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 17, 2008, 03:33:59 PM
Forgive me for hijacking your thread to discuss the 4G, but maybe together we can get the ipod CF corrected.

These are the values set in firmware/target/arm/system-pp502x.c for the ipod 4G

#elif defined(IPOD_4G)
        /* set minimum startup configuration */
        DEV_EN         = 0xc2020124;
        DEV_EN2        = 0x00000000;
        CACHE_PRIORITY = 0x0000003f;
        GPO32_VAL      = 0x02000000;
        DEV_INIT1      = 0x00000000;
        DEV_INIT2      = 0x40000000;

        /* reset all allowed devices */
        DEV_RS         = 0x3ffdfef8;
        DEV_RS2        = 0xffffffff;
        DEV_RS         = 0x00000000;
        DEV_RS2        = 0x00000000;

The debug menu shows the following differences, with patch applied to remark out DEV_RS=0x3ffdfef8;

DEV_EN    = C0031926
DEV_INIT1  = 00040000
DEV_RS = 00000000
DEV_RS2 = 00000000

With a patch applied to remark out the entire code above:

DEV_EN = C0831977
DEV_EN3 = 0007003F
DEV_INIT1=00040000
DEV_RS = 0000000
DEV_RS2 = 00000000

If you comment out that block, you just disable the PP power saving patch we commited last winter.  If you want good battery life, you should try to figure out which of those bits actually matters for CF support, instead of just removing all of them.

This page may be interesting to you:

http://www.rockbox.org/twiki/bin/view/Main/DeviceEnableRegistersPP502x
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 17, 2008, 03:50:18 PM
Thanks Saratoga for the reference, but I haven't a clue what to look for.  The only thing I do know is that it will boot with the DEV_RS = 0x3ffdfef8 removed.  I listed the changed values to hopefully help identify what the value should be.

Can you tell me exactly what I should change and test?  I'd really like to be able to use the the firmware unpatched.

What is the meaning of listing DEV_RS and DEV_RS2 twice in the reset section?  Does only the second set take effect?
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 17, 2008, 04:08:47 PM
The only thing I do know is that it will boot with the DEV_RS = 0x3ffdfef8 removed. 

Try it with and without that line removed and see what changes.

What is the meaning of listing DEV_RS and DEV_RS2 twice in the reset section?  Does only the second set take effect?

The comment says its resetting the devices, so I guess its desirable to turn them on and then back off during power up, perhaps to clear any settings or somehow initialize them.  If I knew exactly what that did, I could probably just fix the CF problem myself.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 17, 2008, 04:23:21 PM
I did post the changes with the line removed.  I can't get a value with it active, as it won't boot.

So, since the DEV_RS value is 00000000, then removing that first DEV_RS line really doesn't make a difference to the battery saving code?  Can that line be permanently removed?

I'm willing to test anything to help.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: saratoga on August 17, 2008, 04:40:29 PM

So, since the DEV_RS value is 00000000, then removing that first DEV_RS line really doesn't make a difference to the battery saving code?  Can that line be permanently removed?

Looking at the SVN logs, that line seems to have begun with the Sansa port, then moved to other devices, and then finally was kept by Buschel when he and I put in the power saving code for all the PP targets.  I don't know if its actually necessary though.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 18, 2008, 03:35:50 AM
Ok, 13 hours and 2 minutes later, the iPod (w/CF card) is still playing (although the battery indicator is far into the "red zone" and almost out) in the original Apple firmware. Now, with a CF card, I'd hope for better battery life than that, but it's still quite a bit better than the 9hr 45m I got out of Rockbox.

It occurs to me that with the CF build w/the patch to allow the iPod to boot from the aData card, I'm using a non-SVN bootloader (installed from ipodpatcher v2.0 "with v2.0 bootloaders"). Could compiling a fresh bootloader from SVN make any difference in battery life in Rockbox?

EDIT: YES, a current SVN bootloader did make a difference. I got 10h40m out of it with the same settings after compiling a new bootloader and a new Rockbox install from current SVN (and modifying system-pp502x.c to get it to boot.)
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 20, 2008, 10:27:08 PM
Did your ipod boot with the new bootloader, but without modifying the DEV_RS line?

My 4G gets 13 hours with the apple firmware and 9.2 hours with the modified DEV_RS line.  I haven't done anything about the bootloader.

I wanted to post a bug in the tracker, but can't because of the freeze.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: Llorean on August 20, 2008, 10:44:27 PM
What does the freeze have to do with posting bugs?
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 20, 2008, 11:04:42 PM
Did your ipod boot with the new bootloader, but without modifying the DEV_RS line?

With the new bootloader and with modifying the DEV_RS line.

So -- to summarize:

w/old bootloader and modified DEV_RS line: 9hrs 45m
w/new bootloader and modified DEV_RS line: 10hrs 40m.
Original firmware: 13+ hours.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: LurkAzusa on August 21, 2008, 01:08:19 AM
I registered, logged in and only get a blank page on the tracker.

Update:  I was able to reach the page, entered the information and submit.  The page goes blank, and I don't see it listed.

Can someone please enter a report about the ipod4G and ipodVideo using ADATA 16 and 32 Gb Compact Flash returns a ATA-1 error and won't boot.  Commenting out the DEV_RS=0x3ffdfef8 on the ipod4G allows rockbox to load.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: michaelc5047 on August 22, 2008, 12:15:13 PM
Update: definitely a bad battery. Got a replacement 580mAh battery, did another battery bench, got 13 hours (12h 59m) out of it. Updated the iPod runtime wiki with results.
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: tarkan on September 30, 2008, 07:23:45 PM
Hi Guys,

I thought I would chime in. I have patched a version to see DEV_RS / RS2 in the debug menu. The result is that DEV_RS / RS2 in the patched version or non-patched version is 0x00000000.

I do not think the removal of the DEV_RS line causes any increase in power consumption nor does it effect the power saving modules.

To check this I will do a battery benchmark test using patched and non-patched version of Rockbox using my Sandisk Extreme card (this card works without needing the patch).

I will post my findings later this week.

regards, Tarkan
Title: Re: iPod 5.5G w/CF card - bad battery or hardware issue?
Post by: dementio on October 07, 2008, 08:42:05 AM
Michael,
I have an IPod v5.5 with Tarkan's mod using an A-Data Speedy 32Gb.
If you can compile your own from svn, make the following change to firmware/target/arm/system-pp502x.c

[Look for your IPod type just above the lines, ex. #elif defined (IPOD_VIDEO)]
(it's the first appearance of the word VIDEO)
Remove line:
DEV_RS         = 0x3ffffef8;

once you make this change, all you have to do is compile your own, with whatever patches you want.