Mips port

Subforum for discussion and help with ScummVM's Android port

Moderator: ScummVM Team

Post Reply
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Mips port

Post by jsmtux »

Hi all, i've recently bought an android tablet named ainol Paladin.
It's quite good but it has a mips architecture instead of arm and scummvm doesn't work.
Could someone recompile it with mips libs?.
I've tried myself downloading the ndk and following instructions on wiki . scummvm . org/index.php/Compiling_ScummVM/Android changing the arm toolchain with the mips one and the architecture name so that it could find the c compiler.
However it keeps giving errors when compiling sdl although i know it could compile flawlessly.
Could you help me?
Thank you
User avatar
Lubomyr
Posts: 90
Joined: Fri Mar 07, 2008 6:56 pm
Location: L'viv, Ukraine
Contact:

Post by Lubomyr »

I recommend to try magiccode utility
http://forum.xda-developers.com/showthr ... ?t=1411879
This utils transform arm-code to mips, and many games sucessfully run on mips-devices, but not tested with scummvm
You can try it with official or sdl-based port.
If this don't help, must wait for new version Android NDK with MIPS support
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Yes, i've tried with magic code but it closes after giving an error.
There is already a version of android sdk with mips support but I don't know what things do I have to change in the configure script.
I've already compiled apps just changing some values in the application.mk file, but I don't know where to start here.
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Hi, I'm trying to compile scummvm for mips; Ive compiled the sdl library and libiconv without problems.
However, when I'm compiling scummvm it is ok until it reaches the plugins part; linking scum plugin(the first one) it says it doesn't find libscummvm.so.
I didn't find it either, when it compiles scummvm it just creates a file named scummvm, and I think it is then when it should have created the libscummvm.so.
Any suggestions?
Thanks!
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Well, I've managed to succesfully compile it with minor tweaks to the config file and android.mk.
Once it gets compiled and packed into Apk's I can install it in my tablet but when I open scummvm it force closes itself.
I'll try with some debugging program but I don't know what to do.
If any of you has any suggestions please tell me
Thanks
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Ok, it was a silly bug; it was looking for the .so libraries in the armeabi folder instead of the mips one.
Now it loads ok and I can go through the menues. The only problem is it doesn't find games. I have the day of the tentacle, which scummvm 1.3.1 finds in my computer, but when I load it on the tablet and tell scummvm to go there it says there is no game in there altough I installed the scumm engine.
Any idea?
fuzzie
ScummVM Developer
Posts: 178
Joined: Mon May 24, 2010 3:02 pm

Post by fuzzie »

jsmtux wrote:Ok, it was a silly bug; it was looking for the .so libraries in the armeabi folder instead of the mips one.
Now it loads ok and I can go through the menues. The only problem is it doesn't find games.
Look in the 'About' dialog to see if it manages to load the plugins. The default plugin manifest also specifies the 'armeabi' folder. I have a patch which de-hardcodes the ABI, I'll try and find time to apply it.

Perhaps you could supply details about what you've done so that we can look at doing MIPS builds on our buildbot?
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Thanks for your time.
I've compiled sdl and libicon libraries with the mips ndk. In the configure file i've added:

Code: Select all

android-mips)
	_host_os=android
	_host_cpu=mips
	_host_alias=mips-linux-android
	;;
in line 1119, changed lines 1823 to 1863 to:

Code: Select all

android)
		case $_host in
			android)
				CXXFLAGS="$CXXFLAGS -march=armv5te"
				CXXFLAGS="$CXXFLAGS -mtune=xscale"
				CXXFLAGS="$CXXFLAGS -msoft-float"
				;;
			android-v7a)
				CXXFLAGS="$CXXFLAGS -march=armv7-a"
				CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
				CXXFLAGS="$CXXFLAGS -mfpu=vfp"
				LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8"
				;;
			android-mips)
				;;
		esac
		case $_host in
			android|android-v7a)
				CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
				# FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this.
				CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__"
				CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__"
				CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__"
				CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__"
				LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm"
				CXXFLAGS="$CXXFLAGS -mthumb-interwork"
				;;
			android-mips)			
				CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-14/arch-mips"
				LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-14/arch-mips"
				;;
		esac
		CXXFLAGS="$CXXFLAGS -fpic"
		CXXFLAGS="$CXXFLAGS -ffunction-sections"
		CXXFLAGS="$CXXFLAGS -funwind-tables"
		if test "$_debug_build" = yes; then
			CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
			CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
		else
			CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
			CXXFLAGS="$CXXFLAGS -fstrict-aliasing"
		fi
		CXXFLAGS="$CXXFLAGS -finline-limit=300"
		_optimization_level=-Os
		# supress 'mangling of 'va_list' has changed in GCC 4.4'
		CXXFLAGS="$CXXFLAGS -Wno-psabi"
		add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
		_seq_midi=no
		;;
and line 2108 to

Code: Select all

android | android-v7a | android-mips)
in backends/platform/android/android.mk changed armeabi folders to mips and set /platforms/android-14, but I don't thing this last change was necessary.
In unpacker.java i changed line 274 to

Code: Select all

 .path("mylib/mips/libscummvm.so"). 
Also, I commented line 40 in /usr/include/wchar.h in the platform folder of the ndk as it gave me an error and it wasn't used. I don't think it is the best way to do it but it worked :D
My environment was set through:

Code: Select all

export ANDROID_NDK=~/Paladin/dev/android-ndk-r7m/
export ANDROID_SDK=~/Paladin/dev/android-sdk-linux/
export PATH=$PATH:~/Paladin/dev/android-ndk-r7m/toolchains/mips-linux-android-4.4.3/prebuilt/linux-x86/bin/
export MACHDEP="--sysroot=$ANDROID_NDK/platforms/android-14/arch-mips/"
I think that's all.
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

well, I've done it, it runs
But it is going quite slow and I don't know why, even on the menues it takes a lot of time to move the arrow and make it click on things.
And it is weird as the cpu shows little use and there is a lot of available ram.
Do you have any idea why is this happening?
Thanks
fuzzie
ScummVM Developer
Posts: 178
Joined: Mon May 24, 2010 3:02 pm

Post by fuzzie »

jsmtux wrote:well, I've done it, it runs
But it is going quite slow and I don't know why, even on the menues it takes a lot of time to move the arrow and make it click on things.
And it is weird as the cpu shows little use and there is a lot of available ram.
Do you have any idea why is this happening?
Thanks
Broken/slow OpenGL, perhaps? How is performance with other OpenGL applications? If the Paladin is the Novo 7, benchmark performance doesn't look too bad but perhaps it doesn't provide acceleration for the texture formats we need.. do you have the log of the startup with details of the OpenGL driver/modes?
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

Yes, it is novo 7
OpenGL performance is not excellent but quite good.
About the log : http://pastebin.com/a6f6Q178
Could it be that I'm using SDL 1.2 and it is not optimized for android?
I tried 1.3 but I'm having an issue as there is two lines of ARM assembler code I don't know how to port.
Anyway shouldn't it work without even opengl?, devices like dingoo which have a processor similar but weaker than mine and no HW acceleration run scummvm with no problems.
fuzzie
ScummVM Developer
Posts: 178
Joined: Mon May 24, 2010 3:02 pm

Post by fuzzie »

jsmtux wrote:Yes, it is novo 7
OpenGL performance is not excellent but quite good.
About the log : http://pastebin.com/a6f6Q178
Could it be that I'm using SDL 1.2 and it is not optimized for android?
I tried 1.3 but I'm having an issue as there is two lines of ARM assembler code I don't know how to port.
Well, we don't support SDL builds (although lubomyr does unsupported SDL builds from master, so presumably it is possible if you wish) and it doesn't look like you're doing an SDL build.. if you're doing a native ScummVM Android build then ScummVM should provide OpenGL information itself in the log.

Edit: (And please try and provide that information from the log if you can!)

Is it slow everywhere or just in the menus?
jsmtux wrote:Anyway shouldn't it work without even opengl?, devices like dingoo which have a processor similar but weaker than mine and no HW acceleration run scummvm with no problems.
Android needs OpenGL. If you install a non-Android OS then it should be fine.
jsmtux
Posts: 9
Joined: Sat Jan 28, 2012 2:24 pm

Post by jsmtux »

well, it was a problem with my device
Various testers reported it worked correctly
Thank you very much for your support
digitall
ScummVM Developer
Posts: 1172
Joined: Thu Aug 02, 2012 1:40 pm

Post by digitall »

We now have experimental daily builds for Android MIPS here:
http://buildbot.scummvm.org/builds.html

Feel free to test, though you may have issues as these are very experimental.
Post Reply