RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Retropie 4.x on Odroid C2

    Scheduled Pinned Locked Moved Ideas and Development
    odroidbuild
    92 Posts 15 Posters 50.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • roleoR
      roleo @BuZz
      last edited by

      @BuZz
      Is there a donation link?
      I think there are a lot of users interested.

      BuZzB 1 Reply Last reply Reply Quote 0
      • BuZzB
        BuZz administrators @roleo
        last edited by

        @roleo https://retropie.org.uk/donate/

        I have sent an email to Hardkernel to see if they would be interested in providing any development boards (as it would benefit them too). If not I will buy an ODroid-C2 to start with.

        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

        1 Reply Last reply Reply Quote 0
        • roleoR
          roleo
          last edited by roleo

          Update.
          I compiled also lr-fbalpha adding the following section to makefile.libretro:

          else ifeq ($(platform), armv8)
              TARGET := $(TARGET_NAME)_libretro.so
              fpic := -fPIC
              SHARED := -shared -Wl,-no-undefined -Wl,--version-script=$(LIBRETRO_DIR)
              PLATFORM_DEFINES += -march=armv8-a+crc -mcpu=cortex-a53 -ffast-math
              HAVE_NEON = 1
              ENDIANNESS_DEFINES := -DLSB_FIRST
              CFLAGS += -DARM
          

          However I can not compile lr-imame4all.

          1 Reply Last reply Reply Quote 0
          • roleoR
            roleo
            last edited by

            Update.
            lr-fceumm ok without problems.
            lr-nestopia ok without problems.
            lr-snes9x2010 ok adding the following section to Makefile.libretro:

            # ARMv8
            else ifneq (,$(findstring armv8,$(platform)))
            	EXT    ?= so
            	TARGET := $(TARGET_NAME)_libretro.$(EXT)
            	SHARED := -shared -Wl,--no-undefined
            	fpic := -fPIC
            	CC   ?= gcc
            	CFLAGS += -march=armv8-a+crc -mcpu=cortex-a53 -DARM
            	ASFLAGS += -mcpu=cortex-a53
            

            lr-imame4all compiles but doesn't work.
            No chances with reicast: too asm parts...

            BuZzB 1 Reply Last reply Reply Quote 0
            • BuZzB
              BuZz administrators @roleo
              last edited by BuZz

              @roleo I have been generously offered an ODroid-C2 for free from Hardkernel so I will look into adding official support once it arrives. Thanks for your code feedback etc.

              To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

              roleoR D 2 Replies Last reply Reply Quote 1
              • roleoR
                roleo @BuZz
                last edited by

                @BuZz
                Good news!
                I hope I can help you.

                1 Reply Last reply Reply Quote 0
                • roleoR
                  roleo
                  last edited by

                  Update.
                  Finally I compiled the lr-imame4all. I encountered two problems:
                  1 - The libco (src/libretro/libretro-common/libco) gives an error at runtime: "longjmp causes uninitialized stack frame", so I had to use the ucontext.c part instead of sjlj.c modifying libco.c (could be a performance issue).
                  2 - The file src/libretro/osinline.h contains some asm code that I tried to patch (sorry but I'm not an asm programmer :) ).

                  This is the code I used for the lr-imame4all.sh script:

                  function sources_lr-imame4all() {
                      gitPullOrClone "$md_build" https://github.com/libretro/mame2000-libretro.git
                      sed -i 's/#include "sjlj.c"/#include "ucontext.c"/g' src/libretro/libretro-common/libco/libco.c
                      sed -i 's/#include <retro_inline.h>/#include <retro_inline.h>\n#include <stdint.h>/g' src/libretro/osinline.h
                      sed -i 's/    int res_hi, res_lo;/    int64_t res;/g' src/libretro/osinline.h
                      sed -i 's/("smull\\t%1,%0,%2,%3"/("smull\\t%x0,%w1,%w2"/g' src/libretro/osinline.h
                      sed -i 's/: "=r"(res_hi), "=r"(res_lo)/: "=r"(res)/g' src/libretro/osinline.h
                      sed -i 's/return res_hi;/return res>>32;/g' src/libretro/osinline.h
                      sed -i 's/( " mov %2, %2, asr #1 \\n"/( " asr %2, %2, #1 \\n"/g' src/libretro/osinline.h
                  }
                  
                  1 Reply Last reply Reply Quote 0
                  • M
                    mphil906
                    last edited by mphil906

                    Hello,

                    I was able to compile emulationstation on my C2 successfully, but I get the following error when trying to run it:

                    lvl0:   Error initializing SDL!
                            Failed to connect to the Mir Server
                    lvl0:   Renderer failed to initialize!
                    lvl0:   Window failed to intialize!
                    

                    This error occurs if lightdm is stopped or running. Any ideas? I'm new so go easy on me.

                    roleoR 1 Reply Last reply Reply Quote 0
                    • roleoR
                      roleo @mphil906
                      last edited by

                      @mphil906
                      During the build, the script has also built and installed libsdl mali-2.04?
                      Which libsdl2 packages are installed? You should have:

                      odroid@odroid64:~$ dpkg --list | grep sdl2
                      ii  libsdl2-2.0-0:arm64                   2.0.4+4mali                                   arm64        Simple DirectMedia Layer
                      hi  libsdl2-dev:arm64                     2.0.4+4mali                                   arm64        Simple DirectMedia Layer development files
                      

                      from this source:
                      https://github.com/RetroPie/SDL-mirror/tree/mali-2.0.4
                      and not the original ones of ubuntu.

                      M B 2 Replies Last reply Reply Quote 0
                      • M
                        mphil906 @roleo
                        last edited by

                        @roleo
                        Thank you for the reply, I was able to compile emulationstation succesfully. Indeed, the default Ubuntu sdl was installed. I cloned the original posters repository. I'm not entirely sure if this was the issue, but in the function platform_odroid-c2() {...} __platform_flags did not contain mali. This is what I used:

                        function platform_odroid-c2() {
                            __default_cflags="-O3 -march=armv8-a+crc -mtune=cortex-a53 -funsafe-math-optimizations"
                            __default_asflags=""
                            __default_makeflags="-j2"
                            __platform_flags="armv8 neon mali" #added mali flag
                            __qemu_cpu=cortex-a9
                            __has_binaries=0
                        }
                        

                        Not sure if this was the issue, but it compiles and runs. Thanks! Now attempting to compile retroarch.

                        roleoR ShakzS 2 Replies Last reply Reply Quote 0
                        • BuZzB
                          BuZz administrators
                          last edited by

                          Just to note - I have a board now and will be looking at adding basic support as free time permits (ES + retroarch etc first).

                          To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                          1 Reply Last reply Reply Quote 1
                          • roleoR
                            roleo @mphil906
                            last edited by

                            @mphil906
                            I think this was the issue.

                            @BuZz
                            Great!
                            Thank you.

                            1 Reply Last reply Reply Quote 0
                            • ShakzS
                              Shakz @mphil906
                              last edited by

                              @mphil906
                              See now I was just about to give up on this...dang...lemmie drag the darn thing out and give it another shot!
                              Thanks for posting!

                              RetroPie tips, tricks, and tweaks: https://www.youtube.com/eazyhax

                              1 Reply Last reply Reply Quote 0
                              • roleoR
                                roleo
                                last edited by roleo

                                With the last changes of the EmulationStation github I have a new problem during the configure phase:

                                cmake . -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/
                                

                                The cmake didn't find the vlc library.

                                CMake Error at CMake/Packages/FindVLC.cmake:33 (macro_ensure_version):
                                  MACRO_ENSURE_VERSION Macro invoked with incorrect arguments for macro
                                  named: MACRO_ENSURE_VERSION
                                Call Stack (most recent call first):
                                  CMakeLists.txt:51 (find_package)
                                

                                --- EDIT ---

                                Sorry, my mistake.
                                The libvlc-dev was missing.

                                1 Reply Last reply Reply Quote 0
                                • BuZzB
                                  BuZz administrators
                                  last edited by

                                  I am currently working on odroid-c2 support - not trying to put you off working on it, but in case you don't want to duplicate efforts etc.

                                  To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                  1 Reply Last reply Reply Quote 0
                                  • roleoR
                                    roleo
                                    last edited by

                                    Apart reicast, I compiled everything I needed but I will continue to work on it for personal pleasure.
                                    If I can help ...

                                    Thanks for your support.

                                    BuZzB 1 Reply Last reply Reply Quote 0
                                    • BuZzB
                                      BuZz administrators @roleo
                                      last edited by BuZz

                                      @roleo Thanks.

                                      Are you using the 16.04 aarch64 Ubuntu ? I was wondering as you are targetting aarch32 right ? Are you using an aarch32 targetted gcc ?

                                      I was planning on targetting aarch64.

                                      [edit] actually maybe I just misread - you will likely want to remove the "neon" platform flag though though if you have it as that's all aarch32 neon stuff which I don't think will work on aarch64 (without changes).

                                      To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                      roleoR 1 Reply Last reply Reply Quote 0
                                      • roleoR
                                        roleo @BuZz
                                        last edited by roleo

                                        @BuZz
                                        aarch64

                                        odroid@odroid64:~$ uname -a
                                        Linux odroid64 3.14.79-89 #1 SMP PREEMPT Thu Oct 13 08:42:27 BRT 2016 aarch64 aarch64 aarch64 GNU/Linux
                                        odroid@odroid64:~$ gcc -v
                                        Using built-in specs.
                                        COLLECT_GCC=gcc
                                        COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/5/lto-wrapper
                                        Target: aarch64-linux-gnu
                                        Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-arm64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-arm64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-arm64 --with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
                                        Thread model: posix
                                        gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4)
                                        

                                        --- EDIT ---

                                        I had forgotten. At a later time, I removed neon flag because the gcc doesn't support it.

                                        function platform_odroid-c2() {
                                            __default_cflags="-O3 -march=armv8-a+crc -mtune=cortex-a53 -funsafe-math-opt
                                            __default_asflags=""
                                            __default_makeflags="-j2"
                                        #    __platform_flags="arm armv8 neon mali"
                                            __platform_flags="arm armv8 mali"
                                            __qemu_cpu=cortex-a9
                                            __has_binaries=0
                                        }
                                        

                                        As far as I know neon is mandatory for arm64, so no command line flag is needed.

                                        1 Reply Last reply Reply Quote 0
                                        • F
                                          flag
                                          last edited by

                                          I've an odroidc2 board too, if there's an image to test.

                                          1 Reply Last reply Reply Quote 0
                                          • roleoR
                                            roleo
                                            last edited by

                                            Hi BuzZ.
                                            When I scroll up/down the game list (for example in MAME menu) I can see a strange screen flickerig due to the chars printed on the back (on the terminal I think).
                                            Is this a known problem? Is there a solution?
                                            This doesn't happen in raspberry image.

                                            BuZzB 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.