Recalbox 7.0

18.03.16 - Moonlight

  • Well, i'm having this issue, maybe you have more ideas and could help me debuging this one.

    I've installed 18.03.16 this morning, and wanted to test Moonlight. Since it was a long time i didn't used it, i removed all game data, and paired again the devices:

    # /etc/init.d/S31emulationstation stop
    # pwd
    # rm -fr *
    # ls
    # cd /recalbox/scripts/moonlight/
    # ./ pair
    () /recalbox/share/system/configs/moonlight/moonlight.conf | /recalbox/share/system/configs/moonlight/keydir
    Searching for server...
    Connect to
    Generating certificate...done
    Please enter the following PIN on the target PC: 1481
    Succesfully paired
    YOLO MODE !!!
    # ./ init
    YOLO Mode
    Adding and scraping LEGO Lord of the Rings ...
    Invalid predicate: root/App[AppTitle = 'PlayerUnknown's Battle Grounds']/ID
    compilation error: element with-param
    XSLT-with-param: Failed to compile select expression 'root/App[AppTitle = 'PlayerUnknown's Battle Grounds']/ID'
    Invalid predicate: root/App[AppTitle = 'PlayerUnknown's Battle Grounds']/ShortName
    compilation error: element with-param
    XSLT-with-param: Failed to compile select expression 'root/App[AppTitle = 'PlayerUnknown's BattleGrounds']/ShortName'
    Adding and scraping StarCraft II ...
    Adding and scraping TERA ...
    Adding and scraping Cuphead ...
    Adding and scraping The Witness ...
    Adding and scraping Minecraft ...
    Adding and scraping Kingdom ...
    Adding and scraping PlayerUnknown's Battle Grounds ...
    Adding and scraping The Elder Scrolls V: Skyrim Special Edition ...
    Adding and scraping Terraria ...
    Adding and scraping LEGO MARVEL Super Heroes ...
    Adding and scraping Broforce ...
    Adding and scraping The Witcher 3: Wild Hunt ...
    Adding and scraping Minecraft: Windows 10 Edition ...
    Adding and scraping Steam ...
    # /etc/init.d/S31emulationstation start

    Games are scrapped as expected and explained at the blog, but if i try to launch any game, it gets stuck at the black screen with the following logs:


    # lvl0:         Error - File type unknown!
    lvl0:   Could not initialize texture from memory, invalid data!  (file path: /recalbox/share/roms/moonlight/downloaded_images/.jpg, data ptr: 32490704, reported size: 0)
    lvl0:   Error - File type unknown!
    lvl0:   Could not initialize texture from memory, invalid data!  (file path: /recalbox/share/roms/moonlight/downloaded_images/.jpg, data ptr: 31366424, reported size: 0)
    lvl0:   Error - File type unknown!
    lvl0:   Could not initialize texture from memory, invalid data!  (file path: /recalbox/share/roms/moonlight/downloaded_images/.jpg, data ptr: 31370144, reported size: 0)
    lvl0:   Error - File type unknown!
    lvl0:   Could not initialize texture from memory, invalid data!  (file path: /recalbox/share/roms/moonlight/downloaded_images/.jpg, data ptr: 30844088, reported size: 0)
    lvl0:   Error - File type unknown!

    It will stay on this screen for about, 5 minutes, until it times out. What i have done so far:

    • Downgraded GFE to was 3.13)
    • Turned of Windows firewalls to all network profiles(don't think it could be firewall, since it is pairing/syncing)

    Any tips?

  • OK. Found the first error. It seems that pairing again, the script will find the new GFE Windows host, but will not update /recalbox/share/system/configs/moonlight/moonlight.conf file address= parameter(also, i don't know if this script during the pair action is supposed to do this.)

    I've changed the address and now, Moonlight connects. However, i'll have to find how to make the controller works, since from inside Steam it cant see that there is a controller connected.

    This is the gamecontrollerdb.txt auto generated each time i start Moonlight:

    # cat gamecontrollerdb.txt

    And this is my controller, a PS3 clone:

    # evtest
    No device specified, trying to scan all of /dev/input/event*
    Available devices:
    /dev/input/event0:      PLAYSTATION(R)3 Controller
    Select the device event number [0-0]: 0
    Input driver version is 1.0.1
    Input device ID: bus 0x5 vendor 0x54c product 0x268 version 0x0
    Input device name: "PLAYSTATION(R)3 Controller"
    Supported events:
      Event type 0 (EV_SYN)
      Event type 1 (EV_KEY)

    Also, tried input=/dev/input/event0 on moonlight.conf without luck

  • @nwildner hey pal,

    2 things :

    • looks like PUBG has quotes problems, that's a script side bug i have to solve
    • for the IP, the script said "YOLO mode" which means you rely on luck to find you host. I will update the wiki very soon, but you can use the find parameter to scan for GFE hosts. And when pairing, you can use either an IP, either a netbios name

    Regarding the controller, this depends on games. Big picture used to be troublesome, haven't tried it again, even since steam updates and GFE 3.12

  • @substring I had no problems with Big Picture and older GFE(2.x series), cause you needed to map manually the controllers. Once you did that, worked all the time.

    I've tested with the following Steam and Non-steam games

    • Tera Online(non-Steam)
    • Minecraft Windows 10 Edition(non-Steam, Windows UWP software)
    • Steam App
    • Lego The Lord of The Rings(steam, launched directly through ES).

    None of them had the controller mapped. I'll try to update GFE to 3.13 later today.

    If there is any log i can post here, just let me know ๐Ÿ™‚

  • @nwildner a support archive is always welcome. Haven't tried wth PS3 pads, i'll try to give it a go asap

  • @substring There you go. recalbox-support file created ๐Ÿ™‚


    File: recalbox-support-20180318150341.tar

  • @nwildner can you try to reconfigure your pad in ES ? Moonlight doesn't find you pad because of its SDL2 GUUID which doesn't fit. It should be 050000004c0500006802000000000000 whereas it got 05000000504c415953544154494f4e00

  • Hi @substring . Reconfigured controller inside ES, but it generates the gamecontrollerdb.txt inside /recalbox/share/system/configs/moonlight with the same string. Deleted the file before running Moonlight, but it creates the file with the same wrong GUUID.

     # cat gamecontrollerdb.txt
    05000000504c415953544154494f4e00,PLAYSTATION(R)3 Controller,platform:Linux,b:b13,righty:a3,rightx:a2,a:b14,x:b15,righttrigger:b9,rightstick:b2,leftshoulder:b10,dpup:b4,start:b3,dpdown:b6,rightshoulder:b11,dpright:b5,lefttrigger:b8,leftstick:b1,guide:b16,y:b12,lefty:a1,leftx:a0,back:b0,dpleft:b7,# 

    Further testing, if i try to put 050000004c0500006802000000000000 GUUID string manually, but it will get replaced. If i change the file to immutable to prevent writes with chattr +i gamecontrollerdb.txt, Moonlight will fail to bring the game to the screen.

    Don't know if it is relevant, but my controller is a Shanwan type of those PS3 clone pads.

  • @nwildner this is how I could make it work ... 1st of all, moonlight is wrong with the device GUID, i'll try to look why if i ever have some time


    • duplicate the gamecontrollerdb.txt to the same folder with a different name, say fixedgcdb.txt
    • edit ~/configs/moonlight/moonlight.conf (if you're un yolo mode when pairing) and add/uncomment mapping = fixedgcdb.txt
    • no need to reboot, just launch a game

  • @substring Worked like a charm ๐Ÿ™‚ Yay. Duplicated the controller mapping file to customcontrollerdb.txt, fixed the GUUID and added the following line to moonlight.conf

    mapping = /recalbox/share/system/configs/moonlight/customcontrollerdb.txt

    And it also worked with a second controller that i bought on the same batch from China. Guess i can play Lego LOTR with my wife now ๐Ÿ™‚

    Thanks again Subs, on helping me with my Moonlight issues.

    Also, i think Moonlight isn't the one to blame here. sdl2-test reports me the incorrect GUUID

    # sdl2-jstest -l
    Found 1 joystick(s)
    Joystick Name:     'PLAYSTATION(R)3 Controller'
    Joystick Path:     '/dev/input/event0'
    Joystick GUID:     05000000504c415953544154494f4e00
    Joystick Number:    0
    Number of Axes:     4

  • @nwildner the guid is reported by SDL2 itself ! Recalbox and sdl2-jstest report the same so ... I also trued sdl2-jstest to make sure the guid was right ๐Ÿ˜‰

  • @substring Should i open a bugfix at moonlight-embedded github and reference this thread?

  • @nwildner i'd rather review their code first

  • @nwildner So i've dived in the code ... moonlight computes itself the GUID instead of calling SDL2 dedicated methods ๐Ÿ˜•

  • @substring Yeah. I'm browsing through Recalbox-EmulationStation source and it's pretty clean C++ SDL call, while moonlight gets it by computing with the following code:

    evdev.c(tag 2.4.6)

    struct libevdev *evdev = libevdev_new();
    libevdev_set_fd(evdev, fd);
    const char* name = libevdev_get_name(evdev);
    int16_t guid[8] = {0};
    guid[0] = int16_to_le(libevdev_get_id_bustype(evdev));
    guid[2] = int16_to_le(libevdev_get_id_vendor(evdev));
    guid[4] = int16_to_le(libevdev_get_id_product(evdev));
    guid[6] = int16_to_le(libevdev_get_id_version(evdev));
    char str_guid[33];
    char* buf = str_guid;
    for (int i = 0; i < 16; i++)
        buf += sprintf(buf, "%02x", ((unsigned char*) guid)[i]);

    Maybe i should open an issue on moonlight-embedded Github after all? (and link this thread)...

  • @nwildner Why not ... But I think he computed it himself simply because he may not have found how to link an input and its guid. Anyway, I know SDL changed their way of computing the GUID over time, SDL 2.0.8 uses the mthod he chose, i don't know since when. This also means that when we bump to SDL 2.0.7 we should hopefully fit. Stupid me, i do have a SDL 2.0.7 pi3 build, i will try to find some time to test with my shanwan.

    Final word : he should rely on SDL2 to get the GUID, period.

  • @substring It's done.

    Let's see if this could make Moonlight better integrated with Recalbox ๐Ÿ™‚

  • @substring Hey Subs! Is it possible to cherry-pick commit dcda1a5, and try the irtimmer fix on your SDL build?

    It seems that devices with no vendor or product id are handled different, by copying the first 11 Characters(PLAYSTATION) to GUID.

  • @nwildner yep easy
    Just need to add a .patch to the commit url, add it to the package and it should be good to go. Can you open an issue and assign it to me please ?

  • Will do it, nevermind ๐Ÿ˜‰

Log in to reply

Want to support us ?