Rockbox Technical Forums

Rockbox Development => Starting Development and Compiling => Topic started by: WS64 on August 01, 2019, 10:07:58 AM

Title: Rockbox on Raspberry
Post by: WS64 on August 01, 2019, 10:07:58 AM
Hi, I want to run Rockbox on my Raspberry and don't know how.
First, I want Rockbox there nd not Kodi or anything else since I use the Raspi with a 400*320 pixel screen, and Kodi and co are simply not readable.
I thought a linux sumlation of Rockbox would help me, but I cannot get through Gerrit: sudo ssh -p 29418 WS64@gerrit.rockbox.org => Permission denied (publickey)
No idea what this means and how to fix this.
Is there any other way to run Rockbox on a Raspberry (in retropie)?
Title: Re: Rockbox on Raspberry
Post by: Chronon on August 01, 2019, 11:24:40 PM
https://www.rockbox.org/wiki/UiSimulator

I'm not sure why you're trying to access Gerrit.
Title: Re: Rockbox on Raspberry
Post by: saratoga on August 01, 2019, 11:25:40 PM
Hi, I want to run Rockbox on my Raspberry and don't know how.

I would try the SDL build which can run on linux host. 

I cannot get through Gerrit: sudo ssh -p 29418 WS64@gerrit.rockbox.org => Permission denied (publickey)
No idea what this means and how to fix this.

That means you haven't setup the ssh keys for your gerrit account.  However, you don't actually need to use gerrit unless you're going to be contributing your own source code back to rockbox.  For now you can clone directly from our git:

https://www.rockbox.org/wiki/UsingGit#Downloading_40cloning_44_checking_out_41_the_source
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 02, 2019, 12:55:18 AM
Thanks for your answers!
I finally figured I don't need Gerrit, but following the next step in the UsingGit guide after downloading was "Updating the source" (did not work, can't remember the exact message, something was not found). So I went on to Gerrit hoping that "updating the source" was not necessary. I did not see that Gerrit was not needed for simply running the simulator.
When the Gerrit part did not work I went on and found the UISimulator doc. I could do everything until "make fullinstall" which again led to an error, it could not find "convbdf" in the tools directory.
I checked the directory, and convbdf.c was there (but only the c source code, not sure if it looked for the c file or something compiled).
After the error I was not surprised to not find "./rockboxui" on my Raspberry.
This is where I am stuck now.

@saratoga, SDL, I guess you mean this (https://www.rockbox.org/wiki/SdlPort) one here?
But ain't that "just" for plugins, not for Rockbox itself?

And SSH, I don't think this is really important now, but I have setup my SSH keys. At least I think so, the last I did there was to post my public key into Gerrit (#4 (https://www.rockbox.org/wiki/UsingGit#Setting_up_Gerrit)). Gerrit accepted it and gave me back some other stirings (for which I had no use after that), but the next step (#5) was the one that failed.
Title: Re: Rockbox on Raspberry
Post by: saratoga on August 02, 2019, 10:43:29 AM
Git is a relatively complex and not very user friendly version control software. If you aren't familiar with it and don't need to use it, you could put it aside for now and come back to it later.

Rockbox can be built as an application running on another system. In this case SDL is used. When you configure your rockbox build, do not build the simulator. Instead build a normal build and select the SDL build target (#200).
Title: Re: Rockbox on Raspberry
Post by: __builtin on August 02, 2019, 11:37:32 AM
I should point out that https://www.rockbox.org/wiki/SdlPort (https://www.rockbox.org/wiki/SdlPort) refers only to the port of the SDL runtime to run on Rockbox, not Rockbox built to run on SDL.
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 02, 2019, 01:17:05 PM
When you configure your rockbox build, do not build the simulator. Instead build a normal build and select the SDL build target (#200).

But how?
Can I download the SDL version somewhere? Where?
What does the #200 mean?

Or do I need to go through the complete build process? Which does not work (convbdf not found)...

Title: Re: Rockbox on Raspberry
Post by: __builtin on August 02, 2019, 01:32:42 PM
You should be able to build convbdf yourself by changing to the tools/ directory and typing:

Code: [Select]
make
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 02, 2019, 02:21:18 PM
Thanks builtin and saratoga.

I missed the single make and found the 200...

The make fullinstall worked now.

But how do I start it now?
Sorry for all the questions, but I am for sure a Windows guy, not Linux!
Title: Re: Rockbox on Raspberry
Post by: __builtin on August 02, 2019, 02:53:44 PM
Fullinstall should install the executable to "./rockboxui" in the build directory. To run it just type "./rockboxui".
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 02, 2019, 03:41:48 PM
Unfortunately not...
Code: [Select]
~/rockbox/uisimulator$ make fullinstall
Installing a full setup in your '/usr/local' dir
install: cannot remove '/usr/local/lib/rockbox/rocks/games/snake2.levels': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/games/sokoban.levels': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/apps/disktidy.config': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/viewers/rockbox-fonts.config': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/dbgettags.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/fade2sleep.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/filebrowse.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/fileview.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/fileviewers.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/print_lua_func.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/printmenu.lua': Permission denied
install: cannot remove '/usr/local/lib/rockbox/rocks/demos/lua_scripts/tagnav.lua': Permission denied
~/rockbox/uisimulator$ ./rockboxui
-bash: ./rockboxui: No such file or directory
~/rockbox/uisimulator$ ls
autoconf.h  battery.c  bitmaps  buttonmap  common  make.dep  Makefile  simext1  uisimulator.make
no rockboxui...
Title: Re: Rockbox on Raspberry
Post by: __builtin on August 02, 2019, 03:48:55 PM
Two things: first, you are building in the uisimulator/ directory. This is a source directory and is not meant to be a compilation directory. To do things properly, you should create an empty build directory (called build-whatever/) using the "mkdir" command.

Second, the SDL application installs to the system directories, which requires root permissions. To do this, you will need to prefix the "make" command with "sudo", like so (this may prompt for a password):

Code: [Select]
sudo make install
Then you should be able to run the application by typing just "rockbox" if things go well.
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 02, 2019, 04:03:05 PM
Yes, I was in the wrong directory.
I have a different directory and just accidently used this one today.
But in my own directory the same happens.

Where the files are created seems to depend on the target platform.
If I choose e.g. an Archos recorder it installes in the simdisk directory, if I choose 200 (SDL) it goes to /usr/local/share/
But in both cases no rockboxui anywhere.

Maybe the configuration step is still faulty, what do I choose at the end at "Build (N)ormal, (A)dvanced, (S)imulator, (B)ootloader, (C)heckWPS, (D)atabase tool, (W)arble codec tool: (Defaults to N)"?
I tried N and S and B so far, but none of those produced the rockboxui

Title: Re: Rockbox on Raspberry
Post by: __builtin on August 02, 2019, 09:09:53 PM
Where the files are created seems to depend on the target platform.
If I choose e.g. an Archos recorder it installes in the simdisk directory, if I choose 200 (SDL) it goes to /usr/local/share/
But in both cases no rockboxui anywhere.

The SDL application build ought to install it as "rockbox" (*not* "rockboxui"), and into the system directory as you've correctly pointed out. You should be able to run it by typing just "rockbox".
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 03, 2019, 02:05:31 AM
No rockbox either. The SDL rockbox directory (/usr/local/share/rockbox) has this content:
Code: [Select]
backdrops  codepages  database.ignore  docs  eqs  fonts  icons  langs  tagnavi.config  themes  viewers.config  wps
Title: Re: Rockbox on Raspberry
Post by: __builtin on August 03, 2019, 12:13:07 PM
There should be a "rockbox" executable in your build directory and under /usr/local/bin. Can you run the following commands from your build directory and post their output?

Code: [Select]
ls | grep rockbox
ls /usr/local/bin | grep rockbox
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 03, 2019, 12:31:17 PM
The output for both is empty. That's what I'm trying to say, there is no executable!
Title: Re: Rockbox on Raspberry
Post by: __builtin on August 03, 2019, 01:28:25 PM
You did run "make" to actually build the binary, right? If you did then I'm stumped.
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 03, 2019, 03:02:41 PM
I guess I reall missed one step
I always did first
../tools/configure
and then
make fullinstall

Now I tried a sinple "make", this results in this:

Code: [Select]
...
CC firmware/common/vuprintf.c
/home/pi/rockbox/apps/recorder/jpeg_idct_arm.S:25:31: fatal error: apps/core_asmdefs.h: No such file or directory
 #include "apps/core_asmdefs.h"
                               ^
compilation terminated.
/home/pi/rockbox/tools/root.make:440: recipe for target '/home/pi/rockbox/wsbin/apps/recorder/jpeg_idct_arm.o' failed
make: *** [/home/pi/rockbox/wsbin/apps/recorder/jpeg_idct_arm.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /home/pi/rockbox/apps/plugin.h:64:0,
                 from /home/pi/rockbox/apps/recorder/jpeg_load.c:30:
/home/pi/rockbox/firmware/export/font.h:36:21: fatal error: sysfont.h: No such file or directory
 #include "sysfont.h"
                     ^

More errors follow, I think they all complain about sysfont.h

The above was for SDL.

When I choose an Archos Recorder and Simulation I'll get this error:
Code: [Select]
/home/pi/rockbox/wsbin/apps/bitmaps/native/rockboxlogo.112x30x1.c:880:15: note: (near initialization for ‘bm_rockboxlogo.data’)
/home/pi/rockbox/tools/root.make:451: recipe for target '/home/pi/rockbox/wsbin/apps/bitmaps/native/rockboxlogo.112x30x1.o' failed
make: *** [/home/pi/rockbox/wsbin/apps/bitmaps/native/rockboxlogo.112x30x1.o] Error 1
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 12:03:11 AM
Ok so lets make this step by step

Starting in the root of the directory you have the rockbox source in (looks to be /home/pi/rockbox)
Code: [Select]
mkdir rbsdl
cd rbsdl
../tools/configure --target=200 --lcdwidth=320 --lcdheight=480 --type=n
make
sudo make install
rockbox
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 05, 2019, 12:58:59 AM
@Bilgus, thanks, will try this evening!

Should I delete the
/usr/local/share/rockbox
directory before?
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 01:04:22 AM
shouldn't have to but can't hurt
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 05, 2019, 09:27:40 AM
Something new happened:
Code: [Select]
ZIP apps/lang/voicestrings.zip
make: zip: Command not found
/home/pi/rockbox/apps/lang/lang.make:55: recipe for target '/home/pi/rockbox/rbsdl/apps/lang/voicestrings.zip' failed
make: *** [/home/pi/rockbox/rbsdl/apps/lang/voicestrings.zip] Error 127

So I did
Code: [Select]
sudo apt-get install zip
and repeated the make.

This time it worked way longer, but still resulted in an error:
Code: [Select]
LD rockbox
/usr/bin/ld: cannot find -ldirectfb
collect2: error: ld returned 1 exit status
/home/pi/rockbox/uisimulator/uisimulator.make:34: recipe for target '/home/pi/rockbox/rbsdl/rockbox' failed
make: *** [/home/pi/rockbox/rbsdl/rockbox] Error 1

How do I solve this?
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 09:35:34 AM
/usr/bin/ld: cannot find -ldirectfb


a quick google for raspi and the library name directfb got this..
https://computerstruggles.blogspot.com/2013/02/how-to-program-directfb-in-c-on.html
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 09:37:38 AM
now (after you get that library) you should type
Code: [Select]
make cleanand start from the beginning again
it's not always necessary but it cuts down on issues
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 05, 2019, 10:51:45 AM
Nearly there (I hope)...
make now worked (after "sudo apt-get install libdirectfb-dev")
But still:

Code: [Select]
~/rockbox/rbsdl$ sudo make install
Installing your build in your '/usr/local' dir
~/rockbox/rbsdl$ rockbox
Segmentation fault

Update: My mistake. I run that via SSH.
When I start it directly on my Raspberry it starts! It still is unreadable (too small), do I have to do all steps aginain with a smaller resolution?
(http://i65.tinypic.com/27y98hf.jpg)

Next is to find out how to use the buttons on the Gmae Hat instead of the keyboard...
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 11:03:41 AM
yeah no clue there, something is either mis-configured or just plain wrong for it to be accessing memory that throws a segfault but hey we got the binary!

I'd probably start from the very beginning like clean slate brand new pi and start over but it might just be a bad package somewhere or your compiler is funky
IDK, maybe someone else will chime in that has a raspi


Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 11:10:46 AM
Code: [Select]
rm -rf rbsdl
mkdir rbsdl
cd rbsdl
../tools/configure --target=200 --lcdwidth=320 --lcdheight=480 --type=n
make
sudo make install
rockbox

lcdwidth=320 --lcdheight=480

just be sure you keep the proper aspect ratio
I'm not sure what is supported TBH
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 05, 2019, 11:13:32 AM
smaller should make the text bigger like 240 x 360 or something like that
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 05, 2019, 11:25:56 AM
Yes, that's what I did, much better:
(http://i66.tinypic.com/jkhrpf.jpg)

Is there a config file for the mapping of the keys somewhere?
I need an exit button, not sure if that exists since you usually don't need that.

But thanks all of you, that was a big help for me!
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 07, 2019, 12:51:16 PM
So, I have my Rockbox more or less running.
A few questions, though.
First, I configure Rockbox with
Code: [Select]
../tools/configure --target=200 --rbdir="~/wdpublic/mp3" --ram=32 --lcdwidth=320 --lcdheight=240 --type=nFirst of all, is ram=32 okay?
Not sure what a usefull value is in SDL.
Second, rbdir. My expectation is that I start with this directory when I choose files. Well, it does not. It always goes to root. Is this the wrong value?
And last, can it be that the SDL version is a bit unstable? I very often have it being completely stuck after I pressed some keys on the keyboard (for testing I have a keyboard attached). Same happens with my mapped Game Hat buttons.
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 07, 2019, 01:14:50 PM
32 mb ram is probably on the small side depending on the screen size, 64 -128 mb would be better but I'm sure more is still better yet :)

Pretty sure rbdir just specifies the rockbox directory to run from (.rockbox is default) 
there is a way to start the file browser from a defined directory using the config file
There is a special config file called fixed.cfg see: https://www.rockbox.org/wiki/CustomConfigFile
I don't remember if it is listed there but the setting is something like this ->start directory: /~/wdpublic/mp3

I get crashes in the sims in a similar manner and I think it has to do with the button queue overflowing but I ignored it since it doesn't happen on actual device.
Someone else might have more insight, also mapping keys might do as well, which per your previous question, yes is possible but, No, I don't have directions for you how to do so
Title: Re: Rockbox on Raspberry
Post by: WS64 on August 07, 2019, 01:24:26 PM
I thought the ram was for the buffering of the mp3s (i remember for my Archos 2 is the correct value).
Actually the key mapping was not a question, that i have managed.
I was just not sure if my wrapper (a process running in the background translating the Game Hat‘s GPIO  buttons into real key strokes) was the culprit or if the SDL version itself is unstable. Which would be a shame, it’s on the small screen way mire usable then the unreadable kodi player!
Title: Re: Rockbox on Raspberry
Post by: Bilgus on August 07, 2019, 01:41:17 PM
There is another user on IRC doing the same <ParkerR> not sure how often he is around but I haven't heard that it was buggy