• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category User Interface → Themes
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by linuxstb - 2007-01-24
Last edited by linuxstb - 2008-03-24

FS#6571 - Load WPS .bmp files from a tar file

This is a first, proof-of-concept patch to load wps .bmp files from a .tar file.

This doesn’t include patches to the build system, so to create an appropriate .tar file, you need to do something like:

cd wps/iCatcher
awk -vFS=”|” ‘(/^%x[l]?\\|/) {print $3}’ ../iCatcher.220x176x16.wps | tar cvf ../iCatcher.tar -T -

and then copy the resulting iCatcher.tar file to the .rockbox/wps/ directory on your player.

As you can see from the above command, this only places the %x[l] bitmaps into the .tar file. The background .bmp file, and the progress bar .bmp files (if they exist) should still go in the normal directory.

The patch has very little error checking at the moment, and has one major limitation which we may or may not wish to retain - the .bmp files in the .tar file must be in the same order as they are referenced in the .wps file.

But if you test, you will see it vastly reduces the loading time for a bitmap-heavy wps.

Closed by  linuxstb
2008-03-24 09:38
Reason for closing:  Rejected
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

Bitmap strips have achieved the required speed-up and are easier for WPS authors to use than tar files.

I worked on tarred themes some months ago (and lost the time for working on it, but not the interest). Looks like I missed posting my results to the tracker, but the main problem was a noticeably speed penalty (which was also discussed on IRC). I guess this was caused because I didn’t rely on a specific order of the files inside of the tar file, and as there is no index in tar files itself that slowed down seeking. You can still find my (outdated) patch here:

I think the loading needs to be enhanced to load the image files directly instead of opening every file separately to overcome that speed problem.

I also created an installer for my proposed theme file format, it simply unpacks the theme file to the standard location. See  FS#6156  – my idea was to use this as intermediate solution to establish our own theme format until it gets implemented in the core.

I’m really interested in single-file themes, but unfortunately won’t find the time working on it myself until may. Too much work at uni …

Attached is a patch to wps/ to package the .bmp files in a tar file instead of copying them individually.

Oops, I’ve just realised that my wpsbuild.diff would attempt to create a .tar file even if there are no .bmp files. Here’s a corrected version.

I’ve updated this patch to work with the new WPS code. Because the bitmap loading in the new code is done at the end of the WPS source parsing, it is now possible to get rid of the original order limitation. This patch reads the tarball in order but there is no requirement on this order anymore.

Here’s a synced version of my patch to to build a .tar file. I’ve noticed one remaining bug though - it creates a directory for bitmaps even if there aren’t any.

This script has a problem on targets that have an LCD remote : the tar created with the bitmaps for the RWPS replaces the one with the bitmaps for the WPS, making the WPS lack all its pictures.

Here is an updated version of the patch.
One thing that I think still needs fixing is the backdrop, as it is still loaded from a bmp file. Maybe it would be worth adding code to allow loading a backdrop from an fd.
Also I’d like to remove the duplication between load_wps_bitmaps and load_wps_bitmaps_tar, but I’m not sure it will be possible.

I’d like to know whether this patches improves WPS loading time over regular WPS loading with separate bitmaps.

Here is a version with support for loading the backdrop from the tar file.

I think the patch is ready for committing, but still needs some work for remote targets.

This version makes the WPS and RWPS use different tar files.

e.g. for iCatcher the tar files will be iCatcher-wps.tar and iCatcher-rwps.tar.


Available keyboard shortcuts


Task Details

Task Editing