Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: BrendanR on November 25, 2015, 04:18:48 PM

Title: iPod 4G data corruption issues since v3.13
Post by: BrendanR on November 25, 2015, 04:18:48 PM
I've been using Rockbox exclusively on my iPods since around version 3.0 and I've had never ending problems with the 4G since 3.13. Not sure if many or even anybody are still using one. I hope this isn't too long but I've tried to do the most controlled experiment that I could.

Hardware used: Multiple iPod 4Gs, 2x cheapo CF adapters, 2x Kingston 16GB CF cards (133x and 266x), 20GB MK2004GAL HDD

Rockbox versions: 3.13 release to current build (I usually use the 3.13 release because I can't live without database load to RAM missing in the current version. iPod is way too sluggish without it.)

Basically, the problem is extensive data corruption to the point where the ipod has to be restored. This was less of a problem until recently as I could go weeks without using my ipod. I started noticing the issue now due to using it all the time (job change, moved state, not really driving much now etc.)

It starts as random checksum errors at boot about 1 in every 5 times. Writing rockbox to the firmware partition instead of the Apple OS solves this it seems. I notice problems when I try to open the database and I'm told that it needs to be initialized or the theme is reset to failsafe for no reason. Then I notice the .Rockbox directory is littered with garbled files and running check disk reveals crosslinks and lost chunks. MP3 files are affected far less. After two days of solid use, the iPod is unusable. Sometimes it self destructs after about an hour of restoring.

Now for the testing. Original firmware causes no issues what-so-ever. Over the years I have had about 4 or 5 4G iPods (they all die eventually of bad dock ports or stop reading drives. Don't think they were built well!) and for the past two years or so, the ones I've had have had this issue. I originally put this down to bad hard drive cables, or CF card adapters. I wasn't using it enough to really notice how bad the issue was. About a month ago, I bought 2x 40GB iPods (bad drives) and a 20GB 3G iPod to really look into it. Using my current Kingston CF 266x card or the HDD in the 3G has no issues (maybe PP5002 difference?). Now with 2x iPod 4Gs, a 16GB Kingston 266x CF card and the 20gb HDD from the 3G, both have data corruption issues. Strangely the CF is much quicker to corrupt. Also to note, I have a 5G video that still is on it's 30GB HDD and never has issues other than the odd data abort on USB connection.

Could this be a PP5020 DMA issue still? I find it unlikely that I have bad hardware as I have done too much testing on different devices. I'd just use the 3G but I can't deal with only 4 hours of battery life on a new battery in Rockbox and it's too slow for crossfading without making popping noises!

I hope there are still some greyscale iPod users and developers (being optimistic) out there.

Brendan
Title: Re: iPod 4G data corruption issues since v3.13
Post by: BrendanR on November 25, 2015, 04:33:23 PM
I also forgot to mention that I have tried using both iPod disk mode and Rockbox disk mode for data transfer and Checkdisk. When I have time over the winter, I'll try out compiling and see if I can disable DMA and test again. Worth a shot maybe.
Title: Re: iPod 4G data corruption issues since v3.13
Post by: saratoga on November 25, 2015, 04:33:36 PM
Did these replacement drives/adapters ever work with Rockbox?  Often some hacking is needed to get non-stock ATA devices to work reliably with the drivers. 
Title: Re: iPod 4G data corruption issues since v3.13
Post by: BrendanR on November 25, 2015, 04:47:56 PM
Well I asked myself the same thing as it's been so long I can hardly remember it working correctly but then I remembered being in college with a 4G and apart from the odd error (not data corruption but just an older less stable build) it used to work fine every commute. I have had the same two adapters for years. Lost the other a while back (it was a different PCB). The 20GB HDD from the iPod 3G working in the 3G but causing errors in the 4G just changed that theory. That's why I finally decided to share the experiences. It's an original apple branded (has the apple logo) MK2004GAL and is the original drive from the same iPod. If my memory is correct, that is the exact model of HDD that shipped in my 4G iPod when new.

I actually ordered another adapter off eBay a couple of days ago before I tested the 3G drive and I didn't go for the cheapest one although it looks identical to the one I have now. Waiting for that anyway. I know it's almost impossible to find a good 50pin IDE-CF adapter unlike the 5g+ ZIF ones who have Tarkan. Is there any non-cheapo out there? Also, I am up for learning about drivers and the relative hacks too when I have more time soon.
Title: Re: iPod 4G data corruption issues since v3.13
Post by: BrendanR on November 25, 2015, 06:52:38 PM
I've put 3.12 back on as a test (DMA is disabled I believe in that release) with the 16GB CF card first. I'll try it out over the next few days.
Title: Re: iPod 4G data corruption issues since v3.13
Post by: BrendanR on November 30, 2015, 11:20:45 PM
So after running 3.12 extensively on two different 4G iPods for the past four days, there has been no data corruption at all. One was with a 20GB MK2004GAL drive and the other with a Kingston 16GB CF card. Have I ruled out everything but DMA at this point? I suppose it means I'm stuck with PIO mode 4 with these old iPods as I don't see anyone else using one. I'll take the time soon and compile the latest version and figure out how to disable DMA in the ATA driver (I'm guessing as I haven't ever compiled Rockbox yet).
Title: Re: iPod 4G data corruption issues since v3.13
Post by: chris_s on January 17, 2019, 03:36:12 PM
Thought I'd cross-reference my own thread, because I've had similar experiences. The hint to disable DMA was very helpful and does indeed seem to have stopped any data corruption. I wonder if DMA shouldn't be disabled on this model by default, unless or until someone manages to fix the issue. I see that it was re-enabled in October of 2012 (https://github.com/Rockbox/rockbox/commit/d118f47d24a1791e4d97b7c09cc1188fab0d880e) after the previous instability had supposedly been fixed. But apparently there are still issues on this specific model?



(Updated title:) DMA leads to FS corruption on iPod 4G ? (http://forums.rockbox.org/index.php/topic,52658.0.html)
Title: Re: iPod 4G data corruption issues since v3.13
Post by: chris_s on November 29, 2020, 12:22:07 PM
I posted a copy of the latest dev build (10f05b3b27) from today with DMA disabled in my other thread (https://forums.rockbox.org/index.php/topic,52658.msg247421.html#msg247421), if anyone's interested