Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: AidanSonoda on February 20, 2015, 02:22:07 AM

Title: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on February 20, 2015, 02:22:07 AM
Thanks to [Saint] and ZincAlloy's assistance in the Unsupported Builds section I've got Rockbox working fairly well (just a few outstanding issues) on my Galaxy S5. I can't seem to get my barebones wps to display cover art though. (screencap and wps attached).

I do not believe that the art itself is the issue. It is embedded art, but it displays just fine in the notification tray (screen cap attached) so on some level rockbox can certainly access it. I also tried tossing in a simple cover.bmp and that too displayed in the notification tray, but not my WPS.

I tried the suggestions outlined -here- (http://"www.rockbox.org/wiki/AlbumArt#Troubleshooting") … namely a super simple %Cl(0,0,500,500) and placing the %Cl & %Cd at the bottom of the file - without any luck.

I surely hope someone can set me straight! I've had a lot of fun learning about customizing rockbox trying to get it working on this device.
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: [Saint] on February 20, 2015, 02:07:36 PM
Thanks to [Saint] and ZincAlloy's assistance in the Unsupported Builds section I've got Rockbox working fairly well...

Speak of the devil, or the saint, as it were...jere I am!

I can't remember what I did, but if it helped you - well, that's just swell. I'm happy for you.

Now regarding album art in your WPS, were I to put my speculation hat on (its my favourite hat), I would say that the issue is almost certainly overflowing the fixed buffer space. Now, I could get into a deep and meaning{ful|less} conversation about why having a static buffer allocation for all application targets, regardless of screen resolution is a hilariously bad idea, but I won't.

I will, however, point you to this gerrit task (Increase memorysize for Android build.) (http://gerrit.rockbox.org/r/#/c/956/) which attempts to alleviate this issue by way of allocating (still static - but its an improvement) buffers based on target resolution. 8MB for 540p or less, 16MB for greater than 540p and less than 720p, and 32MB for greater than 720p.

Which this still isn't ideal, this is a vast improvement over the current situation, which seems short sighted but one must keep in mind the fact that at the time this application target port was created current flagship devices were 480p, and the most common resolution for Android devices at that point in time was 240x320, which made the buffer allocations a little on the small side but still largely adequate.

If you require some assistance compiling RaaA, either with this patch installed, or in general, I would be more than happy to oblige you.

Push come to shove, I could even supply you with a patched build directly, though I would rather teach a man/woman/gender-agnostic-meat-sack to fish - as the analogy goes...

Let me know either way, I will be more than happy to assist you.

PS: the other scenario is that you may or may not be trying to display progressive jpeg images, which Rockbox does not support.


[Saint]
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on February 21, 2015, 03:45:57 AM
I'm very willing to learn to fish (or try anyway). I run Debian so I think I can manage the compilation assuming this guide (http://www.rockbox.org/wiki/LinuxSimpleGuideToCompiling) is accurate. I've got no idea how to go about integrating that patch though.

If you're willing to give me the idiots guide treatment for the whole thing that would be absolutely great, but if you don't really have the time I think I can limp through everything but the patching on my own.

Thanks in advance,

Aidan

P.S. I'm thinking that the failure to load the bmp I tried means it isn't a progressive jpg issue?
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: [Saint] on February 22, 2015, 06:57:05 PM
The guide you linked is accurate.

We also have an fairly well established development section (http://www.rockbox.org/wiki/DocsIndex#For_Developers) in the wiki (the aforementioned guide is a part of it), a portion of which details working with patches (http://www.rockbox.org/wiki/WorkingWithPatches).

You will notice in the gerrit task I linked, that there are four buttons checkout, pull, cherry-pick, and patch. Each prints a different command to be entered into the command line, and each depends vastly on what it is precisely you're wanting to do. The easiest option would be to use 'patch', and to pipe that directly to a text file.

For your convenience, I shall add the command required to do so here:
Code: [Select]
git fetch git://git.rockbox.org/rockbox refs/changes/56/956/2 && git format-patch -1 --stdout FETCH_HEAD > ~/increase_memory_size_for_android_build.patch
Which (when run from the top level of your Rockbox git checkout) will drop the file 'increase_memory_size_for_android_build.patch' in your user's $HOME directory.

To apply the patch, you would then use this command (again, to be run from the top level of your Rockbox git checkout):
Code: [Select]
patch -p 1 < ~/increase_memoery_size_for_android_build.patch
If you run into a snag, or have any more questions, I would be happy to answer them for you.


[Saint]
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on March 01, 2015, 09:30:15 PM
Ok, had a crack at this, but got hung up trying to run the setup script "rockboxdev.sh"

Quote
aidan@SonodaPC:~/rockbox/tools$ sudo ./rockboxdev.sh
ROCKBOXDEV: "libtool" is required for this script to work.
ROCKBOXDEV: Please install "libtool" and re-run the script.

clear enough, unfortunately libtool is already installed:

Quote
aidan@SonodaPC:~/rockbox/tools$ sudo apt-get install libtool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libtool is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 81 not upgraded.

not sure what my next troubleshooting step should be. Sorry for my, most likely infuriating, ignorance.
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on March 01, 2015, 09:41:47 PM
NM, should have searched harder before posting …

http://www.rockbox.org/irc/log-20141114

cleared that up: I needed "libtool-bin" package installed as well - perhaps this is a Debian thing (guide was written with Ubuntu in mind). In any case, rockboxdev script runs without errors now.
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on March 01, 2015, 10:50:09 PM
Quote
ERROR: You need the Android SDK installed and have the ANDROID_SDK_PATH environment variable point to the root directory of the Android SDK

So, it seems I will need to wrestle AndroidSDK into place … perhaps tomorrow. Going to call it for tonight though.

It seems from reading through --this-- (http://developer.android.com/sdk/installing/index.html?pkg=tools) that I'll also need to install JavaJDK and maybe some 32-bit libraries (I am running 64-bit Debian Testing). Let me know if I'm barking up the wrong tree here.
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: [Saint] on March 02, 2015, 03:43:33 AM
Uuuuuugh,

I really should have covered this in depth for you to save you wasting your time. You would never have figured this out on your own, even with the cookie crumbs I've left scattered throughout the forums over the years...well, maybe, you seem like a capable fellow. Perhaps never is a bit harsh.

On the upside, you can now build for a bunch of additional Rockbox targets you may or may not own, but, not Android.

 :-\

We don't actually use our own toolchains for this, so rockboxdev.sh is entirely irrelevant.

Compiling for Android is somewhat of a black art, I should do either one or both of two things - detail this in the wiki, and/or fix up rockboxdev.sh to actually set up an environment capable of building Rockbox for Android.

OK - so, you have our build essential tools installed, that's a great start.

Now, you're going to need to install a Java runtime and Software Development Kit. You mention Debian, so:
Code: [Select]
sudo apt-get install openjdk-7-jdk openjdk-7-jre
You are also going to need the Android SDK (http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz) and Android NDK (http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin). We can do this with a relatively simple set of commands.
Lets assume we're doing all this in a directory called "development" in our home directory, so:
Code: [Select]
mkdir -p ~/development/android
cd ~/development/android
wget http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz
wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
tar zxvf android-sdk_r24.0.2-linux.tgz
chmod a+x android-ndk-r10d-linux-x86_64.bin
./android-ndk-r10c-darwin-x86_64.bin

Now we have downloaded, and extracted, both the Android SDK and Android NDK. Lets add them to our $PATH and export some environment variables we'll need later to compile Rockbox for Android:
Code: [Select]
sudo echo "export ANDROID_NDK_PATH=~/development/android/android-ndk-r10d" >> ~/.bashrc
sudo echo "export ANDROID_SDK_PATH=~/development/android/android-sdk-linux" >> ~/.bashrc

And some paths that will make things easier for us down the line by way of exposing some Android tools to the $PATH (we're mainly interested in the Android SDK manager and adb binaries):
Code: [Select]
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/tools" >> ~/.bashrc
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/platform-tools" >> ~/.bashrc

Now we'll run the Android SDK Manager and download the required tools:
Code: [Select]
./development/android/android-sdk-linux/tools/android
This will open a GUI session to uninstall/install components of the Android SDK, manually select if not already installed or selected the following packages:
Quote
-Tools
--Android SDk Tools
--Android SDK Platform-tools
--Android SDk Build-tools 19.1
-Android 4.4.2 (API 19)
--SDK Platform 19
-Extras
--Android Support Library

Any other packages that are pre-installed may be un-installed if desired.

One last thing, as of this writing our build system looks for zipalign in the wrong place, but we can address this trivially with a simple symbolic link:
Code: [Select]
ln -s ~/development/android/android-sdk-linux/build-tools/19.1.0/zipalign ~/development/android/android-sdk-linux/tools/zipalign
And...we're done. We can now reboot our system to apply the changes to the $PATH, and make the environment variables live. We could do this manually, but rebooting is easier to type from my point of view.
Code: [Select]
sudo reboot now
We should now have a system that is entirely capable of compiling Rockbox for Android. Lets check this out (after our reboot), by navigating to where we want to be building Rockbox for Android. To keep things clean in our git checkout, lets build "out-of-tree":
Code: [Select]
mkdir -p ~/development/rockbox/build-dir
cd ~/development/rockbox/build-dir

I'm going to make an assumption here about the path to your Rockbox git repository, edit this command to reflect your own system path:
Code: [Select]
~/development/rockbox/tools/configure
Select build type ID 201 for Android
Select your desired horizontal and vertical resolution

Now lets compile Rockbox and build our .apk:
Code: [Select]
make
make apk
Hint: instead of using 'make' use 'make -J N' where N == 'number of cores on the host system * 2'

Assuming your Android device is plugged in to the host and the Android Debug Bridge (adb) is configured to run on the device and give access to the host, you can install the apk directly with:
Code: [Select]
adb install ~/development/rockbox/build-dir/*.apk
For subsequent installations use:
Code: [Select]
adb install -r ~/development/rockbox/build-dir/*.apk
And we're done here. Let me know if you have any issues with any of the points in this guide.


[Saint]
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: ploco on April 02, 2015, 06:48:10 PM
Quote
tar zxvf http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz

typo? should be
Code: [Select]
tar zxvf android-sdk_r24.0.2-linux.tgzalso
Quote
sudo echo "export PATH=${PATH}:~/Development/android/android-sdk-linux/tools" >> ~/.bashrc
sudo echo "export PATH=${PATH}:~/Development/android/android-sdk-linux/platform-tools" >> ~/.bashrc
to
Code: [Select]
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/tools" >> ~/.bashrc
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/platform-tools" >> ~/.bashrc
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: ZincAlloy on April 02, 2015, 07:22:06 PM
Quote from: [Saint

Now regarding album art in your WPS, were I to put my speculation hat on (its my favourite hat), I would say that the issue is almost certainly overflowing the fixed buffer space. Now, I could get into a deep and meaning{ful|less} conversation about why having a static buffer allocation for all application targets, regardless of screen resolution is a hilariously bad idea, but I won't.


There's hardly any graphics in that WPS. I've got 570x570px album art running fairly well on a 720x1280 screen (doesn't load when the track changes, just when I select a track manually). I guess it might be something else..
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: [Saint] on April 09, 2015, 05:10:34 PM
Quote
tar zxvf http://dl.google.com/android/android-sdk_r24.0.2-linux.tgz

typo? should be
Code: [Select]
tar zxvf android-sdk_r24.0.2-linux.tgzalso
Quote
sudo echo "export PATH=${PATH}:~/Development/android/android-sdk-linux/tools" >> ~/.bashrc
sudo echo "export PATH=${PATH}:~/Development/android/android-sdk-linux/platform-tools" >> ~/.bashrc
to
Code: [Select]
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/tools" >> ~/.bashrc
sudo echo "export PATH=${PATH}:~/development/android/android-sdk-linux/platform-tools" >> ~/.bashrc

Quite right, I was pretty tired when I wrote that. I also added in the little bit of hackery one needs to do with zipalign while re-reading it. Thanks.

Quote from: [Saint

Now regarding album art in your WPS, were I to put my speculation hat on (its my favourite hat), I would say that the issue is almost certainly overflowing the fixed buffer space. Now, I could get into a deep and meaning{ful|less} conversation about why having a static buffer allocation for all application targets, regardless of screen resolution is a hilariously bad idea, but I won't.


There's hardly any graphics in that WPS. I've got 570x570px album art running fairly well on a 720x1280 screen (doesn't load when the track changes, just when I select a track manually). I guess it might be something else..

While that may be true, the buffer isn't exactly huge either.

And you've got to try and get two fullscreen bitmaps, whatever other bitmap assets are loaded by the theme, 250 glyphs from one or more fairly large bitmap fonts, icons, ...etc.


[Saint]
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on June 08, 2015, 10:00:42 PM
Finally had some freetime this evening and  thought  to have another crack at this. Thanks to [Saint] for the detailed instructions (and ZincAlloy for the corrections) they were quite easy to follow and I was able to compile and install 4c4c645-150609 on my S5. Unfortunately no change in regards to cover art. Still shows in the notification but not on my wps.

I did apply the linked patch for increased memory size - is there any way to verify that the patch worked (there were no error messages fwiw).

Otherwise, perhaps ZincAlloy was correct that the buffer size was not the cause. Any other ideas?

Thanks again for all the help!
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: ploco on June 09, 2015, 04:58:23 AM
you can check the patch result thou the Buffer size of system menu, Rockbox Info.
It's a simple hack that alter one line in make file from "export MEMORYSIZE=8" to "export MEMORYSIZE=32"
you can even change that line manually, but remember make clean before compile the apk again.

If you wish, upload your theme somewhere, I will debug for you.


btw, this is my 1080p theme. with extra G839 patch, (MEMORYSIZE 64)
(http://i.imgur.com/w6TxP0q.jpg)


[edit]
I've tested your JJR.wps
The reason why the CoverArt not showing is because,
your forgot put them in a view!

%V(390,250,500,500,-)
%Cl(0,0,500,500,c,c)
%Cd

this should fix your problem.

Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: ZincAlloy on June 09, 2015, 08:41:37 AM
Neat. That patch will come in handy!
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: AidanSonoda on June 09, 2015, 08:26:29 PM
Thanks ploco, that sorted it straight out.

Nice to see more 1080p themes cropping up.

Thanks again to everyone for setting me straight!
Title: Re: Cover Art on barebones 1080x1920 WPS
Post by: erolk7 on August 17, 2015, 07:42:34 AM
Could somebody please post one of those 1080x1920 WPS themes?  I would really appreciate it.  Can't wait to get my rockbox working again on my S5.  Thank you very much.