This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12063 - Android: put resources on SD card
Attached to Project:
Rockbox
Opened by Dominik Riebeling (bluebrother) - Thursday, 14 April 2011, 19:50 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Sunday, 04 September 2011, 21:13 GMT+2
Opened by Dominik Riebeling (bluebrother) - Thursday, 14 April 2011, 19:50 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Sunday, 04 September 2011, 21:13 GMT+2
|
DetailsRockbox on Android brings various resources (themes, languages) packaged into a file libmisc.so 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 libmisc.so 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. |
This task depends upon
Closed by Dominik Riebeling (bluebrother)
Sunday, 04 September 2011, 21:13 GMT+2
Reason for closing: Accepted
Additional comments about closing: 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.
Sunday, 04 September 2011, 21:13 GMT+2
Reason for closing: Accepted
Additional comments about closing: 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.
My personal preference is still adding a rbutil activity to the binary which downloads libmisc.so 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 / )
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.
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?
- Uses credits.rock to determine if libmisc.so needs to get extracted again. This means that you can force extracting libmisc.so by simply deleting the application settings from the Android applications menu.
- Set the timestamp of the checked file to the same as libmisc.so. 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 libmisc.so stays on the internal memory
- it doesn't move the user settings to the SD card.
Basically, the two memory hogs libmisc.so 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)