From dbabd0d9c34a33bc0c51243ec37f230d117db955 Mon Sep 17 00:00:00 2001 From: Udo Schläpfer Date: Mon, 2 Feb 2015 21:44:29 +0100 Subject: iBasso DX50/DX90: Major code cleanup and reorganization. Reorganization - Separated iBasso devices from PLATFORM_ANDROID. These are now standlone hosted targets. Most device specific code is in the firmware/target/hosted/ibasso directory. - No dependency on Android SDK, only the Android NDK is needed. 32 bit Android NDK and Android API Level 16. - Separate implementation for each device where feasible. Code cleanup - Rewrite of existing code, from simple reformat to complete reimplementation. - New backlight interface, seperating backlight from touchscreen. - Rewrite of device button handler, removing unneeded code and fixing memory leaks. - New Debug messages interface logging to Android adb logcat (DEBUGF, panicf, logf). - Rewrite of lcd device handler, removing unneeded code and fixing memory leaks. - Rewrite of audiohw device handler/pcm interface, removing unneeded code and fixing memory leaks, enabling 44.1/48kHz pthreaded playback. - Rewrite of power and powermng, proper shutdown, using batterylog results (see http://gerrit.rockbox.org/r/#/c/1047/). - Rewrite of configure (Android NDK) and device specific config. - Rewrite of the Android NDK specific Makefile. Misc - All plugins/games/demos activated. - Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa. Includes - http://gerrit.rockbox.org/r/#/c/993/ - http://gerrit.rockbox.org/r/#/c/1010/ - http://gerrit.rockbox.org/r/#/c/1035/ Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight interface and new option for hold switch, touchscreen, physical button interaction. Rockbox needs the iBasso DX50/DX90 loader for startup, see http://gerrit.rockbox.org/r/#/c/1099/ The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If /mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit gracefully and the loader will restart Rockbox on USB disconnect. Tested on iBasso DX50. Compiled (not tested) for iBasso DX90. Compiled (not tested) for PLATFORM_ANDROID. Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7 --- tools/configure | 83 +++++++++++++++++++++++++++++++++++++++++++++------------ tools/root.make | 8 ++++-- 2 files changed, 72 insertions(+), 19 deletions(-) (limited to 'tools') diff --git a/tools/configure b/tools/configure index 20b9095f73..2dd1bf3e12 100755 --- a/tools/configure +++ b/tools/configure @@ -726,6 +726,58 @@ androidcc () { prefixtools $gcctarget } +androidndkcc() +{ + if ! [ -d "$ANDROID_NDK_PATH" ]; then + echo "ERROR: You need the Android NDK installed (r16 or higher) and have the ANDROID_NDK_PATH" + echo "environment variable point to the root directory of the Android NDK." + exit + fi + + make_toolchain="${ANDROID_NDK_PATH}/build/tools/make-standalone-toolchain.sh" + + if ! [ -e "${make_toolchain}" ]; then + echo "ERROR: ${make_toolchain} could not be found." + exit + fi + + buildhost=$(uname -s | tr "[:upper:]" "[:lower:]") + buildhost="${buildhost}-$(uname -m)" + + GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef//` + LDOPTS="$LDOPTS -ldl -llog" + SHARED_LDFLAG="-shared" + SHARED_CFLAGS='' + GLOBAL_LDOPTS="-Wl,-z,defs -Wl,-z,noexecstack" + + # arch dependant stuff + case $1 in + armeabi) + endian="little" + gccchoice="4.6" + gcctarget="arm-linux-androideabi-" + echo "${make_toolchain} --system=${buildhost} --toolchain=arm-linux-androideabi-4.6 --platform=android-16 --install-dir=${pwd}/android-toolchain" + ${make_toolchain} --system=${buildhost} --toolchain=arm-linux-androideabi-4.6 --platform=android-16 --install-dir=${pwd}/android-toolchain + if [ ${?} != 0 ]; then + exit + fi + GCCOPTS="$GCCOPTS -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer --sysroot=${pwd}/android-toolchain/sysroot" + LDOPTS="$LDOPTS --sysroot=${pwd}/android-toolchain/sysroot" + ;; + *) + echo "ERROR: androidndkcc(): Unknown target architecture" + exit + ;; + esac + + echo "Using endian ${endian}" + echo "Using gccchoice ${gccchoice}" + echo "Using gcctarget ${gcctarget}" + + PATH=$PATH:${pwd}/android-toolchain/bin + prefixtools $gcctarget +} + whichadvanced () { atype=`echo "$1" | cut -c 2-` ################################################################## @@ -3751,26 +3803,24 @@ fi target_id=94 modelname="ibassodx50" target="DX50" - app_type="android_standalone" + app_type="android_ndk" lcd_orientation="landscape" - sharedir="/system/rockbox/app_rockbox/rockbox" - bindir="/system/rockbox/lib" - libdir="/system/rockbox/app_rockbox" - memory=32 + # Actually 408260kB + memory=256 uname=`uname` - androidcc armeabi + androidndkcc armeabi tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" output="rockbox" bootoutput="rockbox" - appextra="recorder:gui:radio:hosted/android" + appextra="recorder:gui:hosted" plugins="yes" swcodec="yes" # architecture, manufacturer and model for the target-tree build t_cpu="hosted" - t_manufacturer="android" + t_manufacturer="ibasso" t_model="dx50" ;; @@ -3779,27 +3829,24 @@ fi target_id=95 modelname="ibassodx90" target="DX90" - app_type="android_standalone" + app_type="android_ndk" lcd_orientation="landscape" - sharedir="/system/rockbox/app_rockbox/rockbox" - bindir="/system/rockbox/lib" - libdir="/system/rockbox/app_rockbox" - memory=32 + memory=256 uname=`uname` - androidcc armeabi + androidndkcc armeabi tool="cp " boottool="cp " bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 4" output="rockbox" bootoutput="rockbox" - appextra="recorder:gui:radio:hosted/android" + appextra="recorder:gui:hosted" plugins="yes" swcodec="yes" # architecture, manufacturer and model for the target-tree build t_cpu="hosted" - t_manufacturer="android" - t_model="dx50" + t_manufacturer="ibasso" + t_model="dx90" ;; *) @@ -4333,6 +4380,8 @@ if test -n "$t_cpu"; then elif [ "$simulator" = "yes" ]; then # a few more includes for the sim target tree TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/sdl" TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted" + elif [ "$t_manufacturer" = "ibasso" ]; then + TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/hosted/ibasso/tinyalsa/include" fi TARGET_INC="$TARGET_INC -I\$(FIRMDIR)/target/$t_cpu/$t_manufacturer" diff --git a/tools/root.make b/tools/root.make index 4e0ca7c4f0..2deae8cc82 100644 --- a/tools/root.make +++ b/tools/root.make @@ -132,8 +132,12 @@ else # core include $(ROOTDIR)/firmware/target/hosted/samsungypr/ypr1/ypr1.make endif - ifneq (,$(findstring android, $(APP_TYPE))) - include $(ROOTDIR)/android/android.make + ifneq (,$(findstring android_ndk, $(APP_TYPE))) + include $(ROOTDIR)/firmware/target/hosted/ibasso/android_ndk.make + else + ifneq (,$(findstring android, $(APP_TYPE))) + include $(ROOTDIR)/android/android.make + endif endif ifneq (,$(findstring pandora, $(MODELNAME))) -- cgit v1.2.3