Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: omendelovitz on August 23, 2006, 10:01:25 AM

Title: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 23, 2006, 10:01:25 AM
I have a technical background and some basic to intermediate computing skills  and want to help develop Rockbox's ipod power consumption optimization.  My problem is that already I find I am having problems understanding even the iPod hardwareinfo wiki.  I'd really like to help in whatever way I can contribute, and am wondering if there is something I can do from a systems development and optimization standpoint that would be of use.  If not, can anyone suggest other sites/info where I could do some more learning to help speed up development of battery optimization on the rockbox ipod?

Thanks in advance.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: saratoga on August 23, 2006, 10:30:30 AM
The one helpful thing is just optimizing the various codecs.  MAD (the mp3 decoder) in particular could use some attention. 
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 23, 2006, 10:37:07 AM
Where do I find this decoder?  Then, how do I open/decode the algorithm [blushing with embarrassment] ??? - I appreicate the help; If someone is willing to just point me in the right direction and throw me a couple of bones, I'll be glad to learn the rest myself.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: ryran on August 23, 2006, 10:40:03 AM
The one helpful thing is just..? !!
Uhhh...maybe it's not how you meant it, but that makes it sound as if there isn't anything else one could do, which certainly isn't accurate. I'm not a developer, but from this (http://www.rockbox.org/twiki/bin/view/Main/IpodStatus#General_tasks) you can glean there's quite a bit to be done.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: Bagder on August 23, 2006, 10:43:53 AM
Quote
point me in the right direction and throw me a couple of bones

1. Get the code
2. Make sure you can build your own Rockbox
3. Start writing a simple plugin to get a feel for this
4. Move on to poking in core Rockbox.
5. Submit patches in flyspray
6. Goto 4
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: saratoga on August 23, 2006, 10:48:01 AM
The one helpful thing is just..? !!
Uhhh...maybe it's not how you meant it, but that makes it sound as if there isn't anything else one could do, which certainly isn't accurate. I'm not a developer, but from this (http://www.rockbox.org/twiki/bin/view/Main/IpodStatus#General_tasks) you can glean there's quite a bit to be done.

Sorry!  Should read "One helpful thing".  Theres lots of other things that could use help too, but codecs are the only thing I've been looking at recently, so I meant to say they're the only thing I know of.

Where do I find this decoder?  Then, how do I open/decode the algorithm [blushing with embarrassment] ??? -

Decoders are stored here in CVS:
http://www.rockbox.org/viewcvs.cgi/apps/codecs/

They're all written in c with a tiny bit of assembly, so hopefully thats not a problem. 

You might also want to look at the "For Developers" section here for general stuff (like setting up the compiler and getting source code):
http://www.rockbox.org/twiki/bin/view/Main/DocsIndex

Finally, if you have specific questions, the IRC link is a great place to go.  People there are really helpful.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: linuxstb on August 24, 2006, 08:59:52 AM
As I wrote on the IpodStatus wiki page, there are two ways to attack the reduced battery life Rockbox achieves in Rockbox:

1) Optimise, optimise, optimise - mostly the audio codecs, but other areas like screen drawing, LCD updates and disk reading/writing speed could all be improved.  

2) Make sure that Rockbox is correctly initialising and (whenever possible) powering down all the hardware components - this is a difficult job without PortalPlayer documentation, and will need serious reverse-engineering of the Apple firmware.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: Bagder on August 24, 2006, 11:24:53 AM
Also, experience from the other ports (iriver h300 and iaudio x5) says that (2) is the most likely reason for the drain we see now. So, fire up your disassembler and dig in...
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 24, 2006, 11:30:44 AM
Go figure, it seems I'm a mouse with the appetite of a Horse - (2) is also what interests me the most.  I'll see if I can get any help from PP on this one!
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: Llorean on August 24, 2006, 11:31:57 AM
I've already tried contacting PortalPlayer and they haven't responded at all, not even a rejection.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 24, 2006, 12:16:24 PM
I've managed to find some of their technical data sheets (the public ones - no 5021 however :P), and a picture or a few of some of the older iPods dissected. Would any of these help?
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: Llorean on August 24, 2006, 12:18:48 PM
Dissected iPods, maybe not so much. Depending on the contents of the data sheets, possibly. I don't know what information has already been collected, honestly.

I was just trying to open up diplomatic relations.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 24, 2006, 12:23:59 PM
I know, and considering how many DAPs use thier SOC's and our lack of competition in  any way (seemingly), it would make sense for them give us access to their schematics - in the end, it would only help their sales as DAPs overall increased in sales due to rockbox (which is a 'fact' - many people buy units based on their rockboxability).  I understand Sandisk (or sansa)? has recently approached Rockbox to develop it for their players.  Maybe we could use that connection to get us some PP info?
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: saratoga on August 24, 2006, 07:45:55 PM
I know, and considering how many DAPs use thier SOC's and our lack of competition in  any way (seemingly), it would make sense for them give us access to their schematics - in the end, it would only help their sales as DAPs overall increased in sales due to rockbox (which is a 'fact' - many people buy units based on their rockboxability).  I understand Sandisk (or sansa)? has recently approached Rockbox to develop it for their players.  Maybe we could use that connection to get us some PP info?

They probably charge a lot of money for dev kits, so thats one reason why they provide no free information at all.  Plus it makes it harder for other companies they compete with (Samsung and TI) to supply an equivilent product and attempt to lure aware their customers (mainly Apple).
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 24, 2006, 08:54:10 PM
In that case, can anyone suggest how one would start disassembling and reading apple's firmware?  I know that w/ipodlinux, the firmware can be extracted and saved.  I'm wondering what program could disassemble it into something readable.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: Bagder on August 25, 2006, 02:41:57 AM
Quote
'm wondering what program could disassemble it into something readable.

Readable as in assembler source code I take it?

Then plain ordinary objdump can do it, and for a fancier option: IDA Pro.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: omendelovitz on August 25, 2006, 08:12:27 PM
I've managed to find a program that dissects .exe and resource files by the name of reshack - quick and easy to use, a real treat.  So, opening up the 2006-06-28 apple FW, I find the following folders, each with its own "1033" file. I'll list them below as well as my guess as to which iPod they represent:

1.1.5 - 1/2g 1.5
128.1.1.4 - Shuffle 1.1.4
129.1.1.4 -     "         "
13.6.1.2 - nano 1.2
14.5.2 -         "     "
2.2.3 - 3g 2.3
3.2.6.1 - 5g 30
4.3.1.1 - 4g monochrome 3.1.1
5.4.2.1 - 4g photo/colour 1.2.1
7.2.6.1 - 5g 60

Can anyone confirm my guesses?

What then follows is ~282000 lines of code that look similar to the following:

018B1BC0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ••••••••••••••••
018B1BD0  21 41 54 41 73 6F 73 6F 00 00 00 00 00 44 00 00   !ATAsoso•••••D••

anyone know if I'm seeing the right stuff?  If I am, can anyone help me decipher the code?

I've also found some harware pics with legends to point out what the main chips in 5g are, as well as a breakdown (including costs) of what is in the 5g 30GB:

1) MK3008GAL Toshiba 30GB 1.8" HDD $65.00

2) PP5021 PortalPlayer Decoder/SoC 8.00

3) BCM2722 Broadcom Video decoder/processor 10.00

4) K4S56163PF Samsung SDRAM - 256Mbit 1.75

5) WM8758 Wolfson Microelectronics Audio codec 3.75

6) LTC4066 Linear USB Power Manager/ Li-Ion Battery charger 1.60

7) LM34910SD National Step Down Switching Regulator 0.75

8) TEA1211 Philips DC/DC converter with I 2 C Interface 1.00

9) SST39WF800A Silicon Storage Technology Parallel Flash - 8Mbit 1.30

10) PCF50607 Philips Power Management Unit 2.50

11) CY8C21 Cypress PSoC Mixed Signal Controller - Touch Pad 0.85

12) Touch pad 2.50

13) Li-Ion Battery 4.50 - BTW, this battery is only 760 mAh, not 1300 - I confirmed it at two places

14) 2.5" color LCD 15.00

15) PCB, passives, mechanical 10.00

16) Other 15.00

Total BOM $143.50
Apple Retail Price $299.00
Implied Apple Gross Margin 52%

Hope this is worth something.  Let me know where to post the pics (assuming they're useful).

mods, if any of this is worth anything, please contact me and I'll send you the original documents to post for developers.
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: saratoga on August 25, 2006, 09:37:34 PM
I've managed to find a program that dissects .exe and resource files by the name of reshack - quick and easy to use, a real treat.  So, opening up the 2006-06-28 apple FW, I find the following folders, each with its own "1033" file. I'll list them below as well as my guess as to which iPod they represent:

1.1.5 - 1/2g 1.5
128.1.1.4 - Shuffle 1.1.4
129.1.1.4 -     "         "
13.6.1.2 - nano 1.2
14.5.2 -         "     "
2.2.3 - 3g 2.3
3.2.6.1 - 5g 30
4.3.1.1 - 4g monochrome 3.1.1
5.4.2.1 - 4g photo/colour 1.2.1
7.2.6.1 - 5g 60

Can anyone confirm my guesses?

What then follows is ~282000 lines of code that look similar to the following:

018B1BC0  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ••••••••••••••••
018B1BD0  21 41 54 41 73 6F 73 6F 00 00 00 00 00 44 00 00   !ATAsoso•••••D••

anyone know if I'm seeing the right stuff?  If I am, can anyone help me decipher the code?

I'm not familar with that program, but it looks like it didn't actually disassemble the binary, so you're seeing machine langague.  Probably that program isn't meant to work with ARM (since exe files do not generally contain arm assembly).  Try a disassembler that supports ARM (objdump is included with the rockbox dev tools) and see if you get asm.

Alternatively, you can try IDA Pro, but you have to pay for ARM support (free version is x86 only).


Hope this is worth something.  Let me know where to post the pics (assuming they're useful).

mods, if any of this is worth anything, please contact me and I'll send you the original documents to post for developers.


If you find anything thats not already documented here:

http://www.rockbox.org/twiki/bin/view/Main/IpodPort
http://ipodlinux.org/Documentation

then it might be interesting to post.  Though I think most of the stuff on google was picked apart years ago by the ipodlinux people (and then passed down to rockbox).
Title: Re: ipod energy efficiency/power handling - wannabe developer
Post by: the_winch on August 26, 2006, 03:25:53 PM
Can anyone confirm my guesses?

It's documented on this ipod linux wiki page.
http://ipodlinux.org/Firmware