|
|
Wiki > Main > UiSimulator (compare)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Difference: UiSimulator (r55 vs. r54)Rockbox UI SimulatorIntroductionThe Rockbox UI simulator is a version of Rockbox compiled to run on a host PC. It is known to work on Linux, Mac OS X and Windows, and should be able to run on any Unix-like operating system where SDL is available. It was originally designed by the Rockbox developers as a platform to make developing and testing code easier - removing the need to repeatedly install on the target device, and even to own a particular target, and also allowing easier debugging. It is also useful to WPS/theme authors for similar reasons. A Rockbox simulator is specific to a target device - i.e. when building it, you select the combination of the target device and "Simulator", and it will build a simulator for that device, replacing the low-level drivers in Rockbox with their SDL or host operating system equivalents. It is important to note that the simulator is NOT an emulator - this means that you can't take (for example) .rock files compiled to run on a target device and use them in the simulator - simulator ".rock" files contain code compiled to run on the host PC's processor (e.g. Intel x86), and the target device .rock files contain code for that device (e.g. ARM, Coldfire or SH). DownloadBecause it is mainly aimed at developers, there are no official downloads of ready-to-run Rockbox UI simulators. The simulator source code is part of the Rockbox source download, or can be retreived via SVN. See below for instructions to compile it. However, unofficial (but trusted) pre-compiled Windows versions of the simulators can be found here: http://rasher.dk/rockbox/simulator/ Simulated APIs
File and dir operations are redirected to use the local directory named "simdisk" as a simulated root dir. LCD operations should operate in a window on your screen and buttons should be usable. How It WorksWhen building a simulated Rockbox, the simulated functions are simply redirected to use the alternative versions provided in the uisimulator/ source tree. The simulator tries to use as many Rockbox functions as possible, putting the simulated layer as "low-level" as possible. Code in firmware/ and apps/ are subject to get simulated (the goal is of course to make everything in apps/ totally ignorant about simulation or not, but we're not quite there yet). Code in uisimulator/ is for doing the simulation. This code may never include files that are present in firmware/include. Building1. Get SourcesThe the very latest sources off the SVN server. Get the 'tools' dir, 'firmware' dir, the 'apps' dir and the 'uisimulator' dir on the same dir level, to make it easier to build things (some of the files assume this hierarchy). SVN details can be found here: UsingSVN 2. Build UIsimulator(Note: you do not need any target-specific CrossCompiler to build the simulators.) (Note: under linux, you need the libsdl-dev package installed) (Note: ensure the complete path (especially your username in the home directory) has no spaces, otherwise you will get errors compiling) Create a new directory and run the 'tools/configure' script in there. Select target to simulate and select simulation. The script will then generate a Makefile for you: $ mkdir build-dir
$ cd build-dir
$ ../tools/configure
[ answer the questions ]
[ Makefile created, simdisk subdirectory created ]
$ make
$ make fullinstall
$ ./rockboxui
Run "../tools/configure --help" for more informations, including argument line options. Note that the simulator uses a local subdirectory named 'simdisk' as "root directory" for the simulated box. Copy a bunch of mp3 files into that directory, create subdirectories and do all sorts of things you want to be able to browse when you fire up the simulator. Don't forget to do the "make fullinstall". That step actually copies the rockbox code into "make fullinstall" includes all the rockbox fonts, a faster way to install is "make install" which skips the fonts but once you have made a full install there is no reason to copy all the fonts every time you build. Building on Mac OS X 10.4The simulator will build and run on Mac OS X, linked with libSDL 1.2.9. There are still problems with sound output. Building in the XWindow environment on Mac OS X 10.4
Building Windows sim in Linux It is possible to build a Windows simulator from Linux. You will need the Mingw32 compiler environment (Debian package First, download and build SDL:
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar xvzf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure --host=i586-mingw32msvc --prefix=${HOME}/mingw32-sdl
make && make install
You can change the argument to --prefix to wherever you want the mingw32 version of SDL installed, but you really should set a prefix, since the sdl-config will overwrite your native sdl-config otherwise. Then you need to put the path to the mingw32 sdl-config in your path (eg. by putting PATH=$PATH:$HOME/mingw32-sdl/bin/ into $HOME/.bashrc) Now, just compile as normal, selecting the (A)dvanced build option and selecting (S)imulator and (W)in32 crosscompile.
find -name "*rock" -exec i586-mingw32msvc-strip "{}" ";"
find -name "*codec" -exec i586-mingw32msvc-strip "{}" ";"
find -name "rockboxui.exe" -exec i586-mingw32msvc-strip "{}" ";"
If you're getting this message during configuring: '*** Your compiler (/usr/bin/gcc) does not produce Win32 executables!', try doing this:
CC=/usr/bin/i586-mingw32msvc-gcc CXX=/usr/bin/i586-mingw32msvc-gcc ./configure --host=i586-mingw32msvc --prefix=${HOME}/mingw32-sdl
(with the right paths to i586-mingw32msvc-gcc) Building Windows sim in WindowsIt is possible to build a Windows simulator in Windows using MSYS and MingW. Requirements:
Note: UIsimulator build is currently broken for MS Windows. Here is a possible workaround. 3. Run UIsimulatorFirst, populate the 'simdisk' directory with a bunch of test files/directories to create a simulated disk drive for the simulator to see. Then type ./rockboxui to run UIsimulator. To get a list and a description of available switches, type ./rockboxui --help. Note: if you build the simulator on cygwin or MingW and want to be able to start it by clicking, you need to copy the SDL DLL from /usr/local/bin/ to \windows or similar. Linux note: you may see ALSA error messages printed to the console such as "ALSA lib conf.c:xxxx:(snd_config_hooks): id of field i is not and integer". This may affect actual sound output but the rest of the sim should run normally. Running Windows sim in LinuxAn alternative for testing purposes under Linux you can use WINE for a Windows environment that will execute the various Win Emulator Binaries. Target Keypad EquivalentsThe keyboard's numerical keypad is used to simulate the native device keypads. Note: to make a screenshot in the simulator press F5 or NUM0. Screenshots are saved in the 'simdisk' directory named dump*.bmp Note: USB connection can be simulated on all targets by pressing U Note: on touchscreen targets, you can switch between simulated buttons and real touch screen by pressing F4 Note: mappings not explained here can be found by looking in the uisimulator/sdl/button.c file Mappings: Generic Archos:
Archos Recorder only:
Archos Player only:
iAudio X5:
iPod
iRiver H1xx/H3xx:
iRiver H10:
Sansa e200:
r58 - 09 Mar 2013 - 02:26:21 - RafaelCarre
Revision r55 - 26 Dec 2011 - 19:56 - FrankGevaertsRevision r54 - 09 Feb 2011 - 21:11 - MikhailTitov? Copyright © by the contributing authors.
|