Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: eltonart on April 03, 2010, 08:31:53 PM

Title: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 03, 2010, 08:31:53 PM
Hi. I'm building a iPod 5.5 with 80Gb drive for rockbox. I installed a new logic board and new 80Gb slim hard drive and then succesfully restored the ipod in itunes. I then installed rockbox but after reboot I recieve error message "*PANIC* Unsupported physical sector size: 4096".

I know how to fix the error using a custom complile of rockbox (I've done this before successfully).

The problem is that now I can't get the ipod back into "disk mode" in order to fix it. I can reboot the iPod OK but when I hold play and middle button I still get the error message.

Thanks in advance for your help! Elton.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Chronon on April 03, 2010, 08:54:07 PM
If you are seeing that message when doing the button combination then you are doing it too late.  Try holding it as soon as the screen blanks from holding Menu+Select.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 03, 2010, 11:53:57 PM
I'm doing it immediately after the screen goes dark for the restart. I used to do it on my old Ipod and it worked every time. Thanks but I dont think that's the problem.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: saratoga on April 03, 2010, 11:56:10 PM
AFAIK the disk mode will always work unless you've physically broken the player.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 04, 2010, 01:33:35 AM
Thats what I thought too, but now I'm not so sure. Its only a theory but I wonder if the drive tries to start with the incorrect sector size that the head somehow gets out of allignment. If the Ipod is unable to start in disk mode then I wonder if it will try and start in normal mode???

Diagnostic mode doesnt work either. What worries me is that the Ipod was working after I used Itunes to restore it before I installed the bootloader and Rockbox. The logic board and hard drive are brand new!

Anyone able to confirm how the boot-mode and diagnostic mode works in more detail and what happens if anything is wrong? I assmue it uses the built-in firmware to load and should bypass the bootloader???
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: saratoga on April 04, 2010, 01:46:26 AM
The bootloader USB mode is on a ROM chip on the logic board.  I don't see how doing anything to the hard disk short of smashing it could impact the ROM.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Arj on April 06, 2010, 10:19:40 AM
I thought the standard build supported 60/80GB drives?  Do different 80GB drives have different physical sector sizes?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 06, 2010, 10:32:27 AM
The standard build supports the drives Apple shipped in the 5.5G iPod Video which have 1024 byte sectors. Other drives obtained from alternative sources may have any sector size.

However, most or all drives other than the one that came with the 5.5G 80GB iPod should work fine *without* the workaround to handle the larger sector size (in fact they should work *better*). That specific drive does not follow the ATA spec correctly. We just don't currently have a better way of handling this case. I am planning on taking a look at it when I have time.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: TexasRockbox on April 06, 2010, 10:33:21 AM
What is the manufacturer and model of the slim 80GB drive?  Is it listed on this page: http://www.rockbox.org/wiki/HardDriveReplacement  ?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Arj on April 06, 2010, 02:56:14 PM
Is there an easy way to determine what drive you have in an iPod w/o having to open up the case?  I ask because I have a 120GB Video I bought off eBay and had the same issue as the OP with the 4096 sector size.  So I installed the unsupported build that had the changes needed and it is working fine.  The one thing I am not sure about is if the LBA needed to be set to 48 (if I recall correctly) or not and maybe the drive info would help me determine that.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 06, 2010, 03:08:50 PM
Lba48 is needed if your drive is over 128GiB (137GB), but enabling it when it's not needed is fine. Most drives other than the original disk in the 80gb 5.5g work fine if you just *remove* the max sector size definition and will work faster that way.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Arj on April 06, 2010, 04:02:17 PM
torne, thanks for your replies.  They have been very helpful.  Your last comment prompted one more question:  you put remove in quotes, so that suggests you don't really mean to remove the definition.  Maybe you just were implying that we can comment out that definition?  I'm just surprised by this suggestion and am willing to try it, but want to be sure I understand it.  I think you are saying we could use the standard build and just comment out the size definition and it should be good for most drives (80 - 128GB).  Correct?

@eltonart:  did you ever get back into disk mode?  If not, did you try leaving the hold switch on and plugging it into a USB port?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Llorean on April 06, 2010, 04:44:14 PM
Those are not quotes. They're asterisks, which are often used to denote emphasis in text-based communication when options such as "bold" aren't available (and a habit some people get used to, so that they do it even places like these where bold is available).
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 06, 2010, 05:13:17 PM
Yeah, sorry, I was on my phone and I couldn't be bothered to find the square brackets to type the bbcode for bold. You can either comment it out, or change it to just #undef instead of #define (with no value). With no value specified it basically disables the workaround to specially handle different sector sizes, and assumes the hard drive will take care of it, which almost all hard drives *do*, and they do it more efficiently than our code does.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: Arj on April 06, 2010, 05:56:21 PM
 :-[ Ugh, need to get my eyes checked!  Sorry about that, they are indeed asterisks and, yeah, I would have seen that was for emphasis.  Again, I appreciate the helpful responses folks.  Very much appreciated!
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: TexasRockbox on April 06, 2010, 11:59:36 PM
Just inquiring: could it be a Toshiba MK8022GAA 1.8" CE ATA-4 (the iPod Classic uses a similar (same?) drive) that would make it like the Toshiba 240GB drive which is ATA-4 as well and it needs the LBA, 4096, etc.

I inquire because I see the word "building".  Have any paperwork for the drive or where it was bought from?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 07, 2010, 04:57:22 AM
Does that drive really require 4096 byte accesses, or does it work if you just remove the emulation support?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 08, 2010, 10:12:13 AM
I have released a test build which should hopefully work for people with upgraded/replaced drives regardless of disk size or sector size: http://forums.rockbox.org/index.php?topic=24439.0

Please test it, as if it works, this code can be committed to svn and you won't need a custom build any more.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 12, 2010, 01:09:55 AM
Hi guys, thanks for all your answers and info. I still cant get into disk mode after a lot of stuffing around. I ordered a USB to ZIF adapter on ebay for $5 so I can try deleting everything off the disk to see if it lets me restore in i-tunes. Fingers crossed.

Does anyone know how to confirm the amount of RAM on a logic-board? I originally had a 30Gb board (32Mb RAM) and I ordered an 80Gb board (64Mb RAM) as a replacement but I want to confirm in case I was given the wrong one - maybe that could be related to my problem. The actual chip looks like its 256Mb but perhaps only 64Mb can be used???

TexasRockbox:
I'm using Samsung model HS081HA (80Gb, 5mm) which seems to be on the list. I have used this exact same hard-drive before with Rockbox working (using custom build with modified sector size).

Arj:
I think I tried plugging in with hold switch on but I'll test again to be sure.

Torne:
Thanks for the suggestions and test-build for large drives. In my previous Ipod with the Samsung HS081HA drive and custom build with modified sector size, I noticed that the file transfer was very slow so maybe removing the emulation support will fix that. I'll give it a try once I can get into disk mode!
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: soap on April 12, 2010, 04:31:45 AM
Does anyone know how to confirm the amount of RAM on a logic-board? I originally had a 30Gb board (32Mb RAM) and I ordered an 80Gb board (64Mb RAM) as a replacement but I want to confirm in case I was given the wrong one - maybe that could be related to my problem. The actual chip looks like its 256Mb but perhaps only 64Mb can be used???
A - If there is a question whether this is related to your problem,why don't you just test the 32 MB build vs the 64 MB build?

B - iPod Video boards have 32 or 64 MB of memory on them.
It is possible if not likely you have correctly identified a 256 Mb part, as that would be 32 MB.
You would not be the first one to complain of having purchased a 60/80 GB iPod's mainboard from one of the part dealers only to receive the 30 GB model.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 12, 2010, 08:16:25 AM
Does anyone know how to confirm the amount of RAM on a logic-board?
If you use the 64MB build and Rockbox crashes when you try and start playing audio, every time, you have only 32MB of ram :)
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: TexasRockbox on April 12, 2010, 11:44:58 AM
OK, that's fine.  Just confirming the drive so everyone knows what drive that's being discussed.  Here's Samsung's specs on the drive: http://www.samsung.com/global/business/hdd/products/downloads/HS12UJQ.pdf

Would it be correct to say 32MB code should work on 64MB hardware but 64MB code would not work on 32MB hardware?
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 12, 2010, 11:55:07 AM
The drive shouldn't be relevant to the OP's problem; the code in flash can obviously access the disk just fine because it manages to load the Rockbox bootloader from it. It should be able to go into USB mode fine as well, if you hit select+play at the right time, but presumably something is wrong.

eltonart: have you tried letting the battery run all the way down until it won't power on, and then holding select+play while inserting the USB cable to power the player back up? Just a thought...

The 32MB build will work on either logic board, yes; the 64MB build will crash whenever any audio starts buffering (because the memory containing the audio codec is at the end of RAM, as soon as the buffering reaches the ~31MB mark or so it will overwrite the codec and things will go horribly wrong). There was some work to have Rockbox detect the memory size at boot and die with an error if you were using the wrong build, but it's not been committed yet; I'm chasing it up ;)
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 12, 2010, 11:10:13 PM
Hi guys. Firstly, thanks again for your input - I was feeling a bit down about the whole thing but you've given me new motivation to sort this out. Keep up the good work!

Soap:
It might not be related but was concerned that the bootloader could be an issue between the 32Mb and 64Mb boards. If disk mode is accessed via the bootloader in flash ROM then I wondered if this could be related to my problem. I'm not sure I understand your comment about the 256Mb RAM chip because I thought that the 32Mb boards would be physically limited to a 32Mb RAM chip. I will check my old 32Mb board again to try and identify the RAM chip. When I looked through the forums there seemed to be a lot of confusion about that topic. If ONLY apple had made it a different part number. GRRR.

Torne:
I didn't try running it flat but I did try disconnecting the battery. I need to have another play with it and hopefully I'll get my ZIF reader soon. I dont really understand the bootloader but my guess is that the rockbox bootloader is the same as the apple bootloader with a small change pointing to the rockbox build. Is that right or is it something different? That makes sense about the codec, thanks for the info.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: soap on April 13, 2010, 04:00:23 AM
It might not be related but was concerned that the bootloader could be an issue between the 32Mb and 64Mb boards.

Bootloader doesn't care.

<snip idle speculation>I'm not sure I understand your comment about the 256Mb RAM chip because I thought that the 32Mb boards would be physically limited to a 32Mb RAM chip.

256 megabit is 32 megaByte

b = bit
B = byte


When I looked through the forums there seemed to be a lot of confusion about that topic. If ONLY apple had made it a different part number.

I don't think there is much confusion on this issue, and Torne explained it well above. 
If in doubt run the 32 build, and he explained what you'd see if you ran a 64 on a 32.
No need to make it more complex than it needs to be.


Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 13, 2010, 05:39:32 AM
I didn't try running it flat but I did try disconnecting the battery.
That should've worked, yes. This is rather disconcerting :)

Quote
I dont really understand the bootloader but my guess is that the rockbox bootloader is the same as the apple bootloader with a small change pointing to the rockbox build. Is that right or is it something different?
It's something different. The iPod boots in several stages. It starts off executing from flash ROM, which contains the Apple flash bootloader. This flash is *never* modified by Rockbox in any way, so the Apple flash bootloader always runs, completely unmodified. The flash bootloader looks in the hidden firmware partition on the hard drive to find an image called "OSOS", which normally contains the Apple firmware image. It loads this image into ram and then executes it.

The Rockbox bootloader is a completely separate program, unrelated to the Apple flash bootloader. When you install the bootloader, the OSOS image on the firmware partition is modified so that instead of just containing the Apple firmware, it has the Rockbox bootloader appended to the end of the image as well. We also modify the header of the OSOS image to instruct the bootloader to execute our bootloader first. The Apple flash bootloader loads this modified OSOS image into ram, and then runs our bootloader, which goes and looks for the .rockbox folder on your player's normal data partition and loads rockbox.ipod from there.

So, the point here is that the Apple flash bootloader is never modified in any way, and it's responsible for detecting the button-presses at boot and booting the emergency disk mode (which is also in flash) - at the point this is supposed to happen, not one byte of code by Rockbox has been loaded...
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 14, 2010, 08:06:36 AM
Soap:
I missed that one was bits and one was bytes (doh!), thanks for clarifying. The confusion I was talking about was in relation to which board you have or were ordering since they have the same part number. For future reference these are the RAM chips I have seen on 5.5G logic boards but there may be more:

K4M56163PG - Samsung 32MB (30GB logic board)
HYE18L256 - Qimonda 32MB (30GB logic board)
HYE18L512 - Qimonda 64MB (60/80GB logic board)

Torne:
Thanks for your patience and the detailed explanation, that clears it up perfectly. Now I understand why I should be able to still access disk-mode. That prompted me to do some more troubleshooting and I finally worked out the problem! I assumed that the logic board was OK and so I tried connecting an old clickwheel. I was then able to access disk mode. I restored the Ipod and then tried the faulty clickwheel again to confirm. This time it worked even less and I could not even restart the ipod. The connector and ribbon cable is fine so I can only assume it's the controller chip. Strange that the clickwheel itself affected the surface mount buttons on the logic board.

I ordered a new clickwheel and will also try to order a logic board with 64MB RAM. With my old ipod (30GB with 32MB RAM) I had intermittant problems so I think the 64MB RAM is important for a pure FLAC player. Torne, I look forward to testing your build for large drives and will post my results on your thread. Good on you for addressing this issue.

Thanks again for your patience in helping out this noob. Elton. ;D
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: soap on April 14, 2010, 08:18:55 AM
No other Rockbox target has 64MB of RAM, 32 should be plenty for FLAC playback - not that 64 hurts, it just isn't a huge benefit.
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: torne on April 14, 2010, 08:46:22 AM
You shouldn't have any problems with a 32MB logic board, other than a very slightly shorter battery life. FLAC playback works fine on targets with only a couple of meg of ram. The only difference between the 32 and 64MB logic boards under Rockbox is the battery life, and the difference there is not even very big. Something else must've been causing whatever problems you were having (you don't say what they are...)
Title: Re: iPod video - Disk mode fails, sector size problem. PLEASE help!
Post by: eltonart on April 15, 2010, 02:03:08 AM
OK thanks for the advice, I'll keep that in mind before shelling out unnecessary cash on my "dream" flac player (see below). I didnt want to raise too many problems on the same forum post - the problem I had was that the ipod intermittently restarted during FLAC playback. It didnt happen very often but it was annoying.

My dream FLAC player MKII (work in progress):
- 5.5G ipod logic board with 64MB RAM
- Thin form factor, 5mm 80GB hard-drive
- Classic ipod shell (mod to fit)
- 650mAH thin lithium polymer battery
- Rockbox (of course)
- Grado SR80 headphones

Future upgrade to 128GB CF card (maybe 2011?)
Why? Because I can...

Since I'm buying a new click-wheel, should I buy a classic clickwheel? Is it same connector and does it work on 5.5 logic board? Anyone tried it?