Author Topic: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4  (Read 39022 times)

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
[HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« on: January 11, 2016, 10:58:22 PM »
Tutorial - How to compile Attract-Mode on your Odroid XU3/XU4.

This tutorial works for Attract-Mode V2.2.0

Log into your Odroid as Root user (otherwise you need to add "sudo")
Also these steps have been used on a Debian Jessie based image (OGST)

Install git-core
Code: [Select]
apt-get install git-core

Create a build environment:
Code: [Select]
cd /home/odroid
mkdir develop

apt-get install cmake libx11-dev libx11-xcb-dev libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg62-turbo-dev libfreetype6-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-ewmh-dev libxcb-keysyms1-dev libxcb-icccm4-dev libudev-dev libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavresample-dev libfontconfig1-dev
(Attract-Mode was originally using libjpeg8-dev, but on debian Jessie it's been replaced by libjpeg62-turbo-dev, so if you don't have a Debian Jessie based image, maybe you'll need to install libjpeg8-dev instead)

Download and build SFML:
If you have installed OGST image on your Odroid, you should be able to install SFML just with this:
Code: [Select]
apt-get install libsfml-odroid
If it works, then you can skip the next steps and go directly to "Build Attract-Mode"

Otherwise you need a few more steps:
Code: [Select]
cd develop
git clone https://github.com/SFML/SFML sfml

Before building SFML library, 4 files need some modifications:
   /home/odroid/develop/sfml/src/SFML/Window/EglContext.cpp
   /home/odroid/develop/sfml/src/SFML/Window/EglContext.hpp
   /home/odroid/develop/sfml/src/SFML/Window/GlContext.cpp
   /home/odroid/develop/sfml/src/SFML/Window/CMakeLists.txt

You can directly replace them with the ones included in the attached file called "sfml.zip"

Then, on the terminal:
Code: [Select]
mkdir sfml/build;cd sfml/build
cmake -DSFML_OPENGL_ES=1 ..
make install
ldconfig

Build Attract-Mode:
Code: [Select]
cd /home/odroid/develop
git clone --depth 1 https://github.com/mickelson/attract attract
cd attract

2 files need to be modified in order to compile properly:
   /home/odroid/develop/attract/Makefile
   /home/odroid/develop/attract/extlibs/gameswf/gameswf/gameswf_freetype.h

You can find the modified files in the attached file called "attract.zip"

After overwriting these 2 files, do:
Code: [Select]
make
make install

You're done!
Now, to run attract-mode, type attract in the console.
« Last Edit: November 14, 2016, 09:14:38 PM by tipoto »

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 393
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #1 on: February 11, 2016, 05:47:30 PM »
Hey there, thanks for the write up.  This would be a great thing to add to the wiki as well.

Also I've updated the Makefile so building for ODROID and other GLES-based systems should be easier in the future.  NO need to apply the patch on the last step ("Build Attract-Mode").  Instead you would run make with the USE_GLES=1 option:

Build Attract-Mode:
Code: [Select]
cd /home/odroid/develop
git clone --depth 1 https://github.com/mickelson/attract attract
cd attract
make USE_GLES=1
make install

should do the trick...

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #2 on: February 27, 2016, 12:40:01 AM »
I just compiled the new v2.0 on the XU4 and it works great, however I still had to use the patch, otherwise I got the same error message as before (it doesn't manage to create the texture or something like that)

When I have a moment I will update the wiki. ;)

danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #3 on: November 14, 2016, 10:58:20 AM »
this doesnt work for me throws this error at me:

Code: [Select]
root@gamestation-turbo:/home/odroid/develop/sfml/build# cmake -DSFML_OPENGL_ES=1 ..
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
CMake Error at src/SFML/Window/CMakeLists.txt:214 (find_package):
  By not providing "FindXCB.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "XCB", but
  CMake did not find one.

  Could not find a package configuration file provided by "XCB" with any of
  the following names:

    XCBConfig.cmake
    xcb-config.cmake

  Add the installation prefix of "XCB" to CMAKE_PREFIX_PATH or set "XCB_DIR"
  to a directory containing one of the above files.  If "XCB" provides a
  separate development package or SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!
See also "/home/odroid/develop/sfml/build/CMakeFiles/CMakeOutput.log".
root@gamestation-turbo:/home/odroid/develop/sfml/build# make install
make: *** No rule to make target 'install'.  Stop.

this is the edited section in the CMakeList.txt

Code: [Select]
# find external libraries
if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
    find_package(X11 REQUIRED)
    if(NOT X11_FOUND)
        message(FATAL_ERROR "X11 library not found")
    endif()
    if(NOT X11_Xrandr_FOUND)
        message(FATAL_ERROR "Xrandr library not found")
    endif()
    include_directories(${X11_INCLUDE_DIR})
endif()
if(NOT SFML_OPENGL_ES)
    find_package(OpenGL REQUIRED)
    include_directories(${OPENGL_INCLUDE_DIR})
endif()
if(SFML_OPENGL_ES AND SFML_OS_LINUX)
    find_package(EGL REQUIRED)
    find_package(GLES REQUIRED)
    include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
    find_package(XCB COMPONENTS xlib_xcb icccm image randr util REQUIRED)
    if(NOT LIBXCB_FOUND)
    message(FATAL_ERROR "Xcb library not found")
    endif()
    include_directories(${LIBXCB_INCLUDE_DIRS})
    endif()
    include_directories(${UDEV_INCLUDE_DIR})
endif()

any help??
« Last Edit: November 14, 2016, 11:05:23 AM by danfozzy85 »

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #4 on: November 14, 2016, 11:16:11 AM »
Yes the line numbers are not the same now (after a few updates), so the patch doesn't work anymore, but I can provide to you all the modified files you need during the installation. I'll post them here once I get home.

EDIT: Oh, I just noticed that it was you asking for the same thing on the Odroid forums ;)
« Last Edit: November 14, 2016, 11:18:00 AM by tipoto »

danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #5 on: November 14, 2016, 11:46:51 AM »
Your a gentleman, I posted over there too as neither post had been posted on for a long while!

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #6 on: November 14, 2016, 07:50:26 PM »
I updated the first post, it should now work with the version 2.2.0.
Let me know if there is any issue.

danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #7 on: November 15, 2016, 04:05:23 AM »
Just followed your instructions worked a treat but on launching its saying it's version 2.1.0?

there any guides with setting this up on xu4 with the cores and emulators made on the OGST image as im lost!, an chance you could share your config files for linking the emulators and cores?
« Last Edit: November 15, 2016, 04:30:32 AM by danfozzy85 »

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #8 on: November 15, 2016, 10:01:25 AM »
Just followed your instructions worked a treat but on launching its saying it's version 2.1.0?
Yes it says 2.1.0 but it's actually 2.2.0. You can double check that by going to the menu and see if you can select a specific layout for the display menu. If you can, it means you are on 2.2.0 since this feature wasn't available before.

there any guides with setting this up on xu4 with the cores and emulators made on the OGST image as im lost!, an chance you could share your config files for linking the emulators and cores?
I use OGST but everything is completely customized on my image, all my emulator.cfg files point at one bash script actually. When this script is launched, depending on the type of system (arcade, port, OpenBOR, Nintendo consoles, Sega consoles etc... ), it launches another specific script, this one reads my own settings files (one txt file by system), then it launches the right emulator with the right rom.
So my cfg files are useless for you.

But when I have a moment, I'll give you the core paths and emulator list for each system, with that you should be able to create your config files.

danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #9 on: November 15, 2016, 10:45:45 AM »
That would be brilliant, hopefully I can build up to something like your setup

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #10 on: November 16, 2016, 01:10:39 AM »
So first of all, I think you should install what meveric calls the "bad" cores on your OGST, it's an extra set of cores available on his repository, they are supposed to be less efficient or to have problems, but I use some of them, especially for the arcade games.

To install them, if I remember correctly, you have to type:
apt-get install retroarch-cores-bad

Here are the paths to all the cores (good and bad):
\usr\local\share\retroarch\cores\good
\usr\local\share\retroarch\cores\bad

Now, here is the core list and the systems they emulate:
3dengine (?)   
4do   (3DO)
81   (Sinclair - ZX 81)
2048   (Probably a puzzle game)
bluemsx   (Microsoft - MSX|Microsoft - MSX2)
bnes      (NES / Famicom)
bsnes_cplusplus98_accuracy      (NES, SNES, GB, GBC and GBA)
cap32   (Amstrad CPC 8bit)
catsfc   (SNES)
desmume   (Nintendo DS)
dinothawr   (Game)
dosbox   (Microsoft DOS)
easyrpg   (Game)
fb_alpha_cps1   (CP System I)
fb_alpha_cps2   (CP System II)
fb_alpha_neo   (Neo Geo)
fba   (FBA-Next v0.2.97.30 -> 0.154)
fbalpha2012_cps1   (CP System I)   
fbalpha2012_cps2   (CP System II)
fbalpha2012   (v0.2.97.30 -> 0.154)
fbalpha2012_neogeo   (Neo Geo)
fbalpha   (FBA-Next v0.2.97.38 -> 0.167?)
fceumm   (NES / Famicom)
ffmpeg   (Record gameplay)
fmsx   (Microsoft - MSX|Microsoft - MSX2)
fuse   (Spectrum)
gambatte   (GB and GBC)   
genesis_plus_gx   (Sega MS/GG/MD/CD)
glupen64   (Nintendo 64)   
gme   (Game Music Emu)
gpsp   (Gambe Boy Advance)
gw   (Game & Watch)
handy   (Atari Lynx)
hatari   (Atari ST/STE/TT/Falcon)
lutro   (open source games / Create your own game)
mame_0151   (0.151)
mame_0152   (0.152)
mame2000   (0.37b5)
mame2003   (0.78)
mame2010   (0.139)
mame2014   (0.159)
mame   (0.166)
mednafen_gba   (Game Boy Advance)
mednafen_lynx   (Atari Lynx)
mednafen_ngp   (Neo Geo Pocket/Color)   
mednafen_pce_fast   (PC Engine/PCE-CD)
mednafen_pcfx   (NEC - PC-FX)
mednafen_psx   (PSX)
mednafen_snes   (SNES / Super Famicom)
mednafen_supergrafx   (PC Engine SuperGrafx)
mednafen_vb   (Nintendo - Virtual Boy)
mednafen_wswan   (Bandai - WonderSwan|Bandai - WonderSwan Color)
meteor   (Game Boy Advance)
mgba   (Game Boy Advance)
mupen64plus   (N64)
nestopia   (NES / Famicom)
nxengine   (Cave Story game engine)
o2em   (Magnavox - Odyssey2)
pcsx1   (PSX)
pcsx_rearmed   (PSX)
picodrive   (Sega MS/MD/CD/32X)
pocketsnes   (SNES / Super Famicom !!! None Listed !!!)
ppsspp   (PSP)
prboom   (DOOM game engine)
prosystem   (Atari 7800)
psp1   (PSP)
puae   (amiga core)
quicknes   (NES / Famicom)
scummvm   (Game engine)
snes9x2002   (SNES / Super Famicom)
snes9x2005   (SNES / Super Famicom)
snes9x2010   (SNES / Super Famicom)
snes9x   (SNES / Super Famicom - Most recent)
snes9x_next   (SNES / Super Famicom - Different emulator I guess)   
stella   (Atari 2600)
tgbdual   (GB and GBC)
tyrquake   (Quake game engine)
vba_next   (Game Boy Advance)
vbam   (Game Boy Advance)
vecx   (GCE - Vectrex)
virtualjaguar   (Atari Virtual Jaguar)
yabause   (Sega - Saturn)

You won't find some of these cores in your image since they have been installed separately. Meveric gave them to me for testing purpose, I don't find them anymore on his repository, so I guess he removed them and wants to prepare a clean package with them... I guess they will be available soon. However, while these new cores were supposed to significantly increase the performances, I actually didn't notice any improvement at all! Which is very weird, but maybe it's because of my settings, I need to investigate a little more.

You can also check out these pages, it helps sometimes:
https://github.com/retropie/retropie-setup/wiki
http://wiki.libretro.com/index.php?title=Main_Page
« Last Edit: November 16, 2016, 01:13:45 AM by tipoto »

danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #11 on: November 16, 2016, 05:28:18 AM »
Man thank you!

Thanks for your patience with me, got some learning/tinkering/playing to do

I did see a post by him saying that he's got a new update inbound that looks very promising.

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #12 on: November 16, 2016, 09:33:37 AM »
No problem ;)

Don't forget to also check the first post of the OGST thread on the Odroid forums, and the thread itself, you'll find complementary information, but I'm sure you've been doing it already ;).

I forgot to mention that I only listed the Libretro cores, but you will also need:
reicast   (standalone -> For Dreamcast)
ppsspp   (standalone -> For PSP)
mupend64   (Standalone -> For N64)

For ppsspp and mupend64, always go for the standalone version first and if there is a compatibility issue, then try the libretro core instead, but the performances won't be the same. For reicast, you don't really have the choice since there is no libretro version installed of the emulator, so the standalone one is the only way to go.



danfozzy85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #13 on: November 16, 2016, 11:04:09 AM »
how do you put the path to the executable?  For example, im playing around with getting snes9x to work.. What im putting for the path is.

executable           /usr/local/share/retroarch/cores/good/snes9x_next_libretro.so

but im not having luck. As for the layout, marquee, etc ive got that sorted and looking nice just need to find the path for the emulators and launch them!


Edit: just had a look at the rom browser add on for xbmc, copied it's execute command (snes-xbmc) and that works. Getting tearing thought, seems there's no way round it either
« Last Edit: November 16, 2016, 01:02:15 PM by danfozzy85 »

tipoto

  • Full Member
  • ***
  • Posts: 43
    • View Profile
Re: [HOW TO] Compile Attract-Mode on your Odroid XU3/XU4
« Reply #14 on: November 16, 2016, 05:01:12 PM »
I think it should look something like this:
Code: [Select]
executable          /path/to/retroarch
args                -L /usr/local/share/retoarch/cores/bad_or_good/<CORE> -c /path/to/config.cfg "[romfilename]"
rompath              /home/odroid/<SYSTEM>/<ROM>
romext               .ext
system               System_Name
info_source          thegamesdb.net
artwork    flyer           
artwork    marquee         <MARQUEE PATH>
artwork    snap            <SNAP PATH>
artwork    wheel           <WHEEL PATH>

I don't have my XU4 with me and I don't remember the path to retroarch, but you can probably figure it out by typing this in a terminal:
Code: [Select]
which retroarch

The tearing is an annoying issue on the XU4 because of the kernel/GPU drivers, it's also why I use different cores in order to have different options and pick the best core for each game (so I can get the best performances and less or no tearing)