• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Settings
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by bluebrother - 2011-04-14
Last edited by bluebrother - 2011-09-04

FS#12063 - Android: put resources on SD card

Rockbox on Android brings various resources (themes, languages) packaged into a file that is extracted on first start. These resources have quite some size and occupy internal memory. This patch is a (trivial) proof of concept to store parts (everything but codecs and rocks) on the SD card instead of using the internal memory.

There is a lot missing and there is no error handling. If Rockbox is about to store parts of its resource files on SD card it should check for the SD card before extracting or starting. Also, I have no idea if this breaks things as it is right now – loading themes, languages and fonts works.

For me this change frees around 5MiB data memory. Manually removing after extraction gains around 3 MiB which in total brings Rockbox memory consumption down to 7.5MiB from 15MiB (480x800px device). Since you need to store your music somewhere I think it’s feasible to require an SD card to be present for running Rockbox.

Closed by  bluebrother
2011-09-04 19:13
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

An extended / reworked version has been committed as r30430. Create a file /rockbox/rockbox-info.txt on the SD card to make Rockbox extract its resources to the card. Since that file is part of Rockbox this will keep the extraction location even between reinstalls.

Fix Rockbox extracting every time it starts.

Some phones have non-trivial amounts of internal storage, so I wouldn't like to see having an SD card inserted as a requirement. However, on my spartan budget smartphone internal storage is nearly exhausted so I would love to have this as an option.

How does this work on phones that dont have an sdcard? is /sdcard symlinked to some other directory?

My personal preference is still adding a rbutil activity to the binary which downloads on request/first run so the apk is half the size (the apk is stpred twice IIRC so a 7MB apk turns out to 15MB used space in / )

Personally I'd really like to avoid extracting at all and instead being able to use it directly but I guess this is simply not possible. Another idea I've tried it to remove after extracting but haven't succeeded (haven't investigated that too much, maybe a permission problem?)

As for /sdcard: I've ased on IRC about this and from my understanding I can expect any Android device to have a /sdcard path. We shouldn't take this for granted though, and as I said I consider the patch more of a proof of concept. It might also be a good idea to change theme graphics from bmp to a different format (png?) for Android since the bmp files require a lot of space.

Personally I don't feel this is a problem we should be trying to solve.

Android offers the ability to move applications to the sdcard natively, and there are non-native solutions which allow you to re-map the internal storage to the sdcard anyway.

Any other opinions?

Updated patch.

- Uses credits.rock to determine if needs to get extracted again. This means that you can force extracting by simply deleting the application settings from the Android applications menu.
- Set the timestamp of the checked file to the same as This avoids problems caused by different time zones configured on build PC and Android device.

Bryan: A2SD doesn't solve this issue because:
- the lib data won't get moved so stays on the internal memory
- it doesn't move the user settings to the SD card.
Basically, the two memory hogs and the data extracted from it will still be on the internal memory. The file that gets moved to the SD card is the apk file (/data/app/org.rockbox-1.apk)


Available keyboard shortcuts


Task Details

Task Editing