Moonlight Addon Amlogic

  • Progress: I was able to start moonlight in the S905

    Unfortunately it seems its only software aceleration so it looks very bad, -platform aml still doesnt work even tho it is listed as available.

    Will keep working on this.

    edit: I found out we probably need libmoonlight-aml.so somewhere, but I am not sure where to put it so that moonlight can find it, I tried in the libs folder and it didn't work.

    Edited once, last by niabi (June 14, 2017 at 8:45 PM).

  • That's great news !!

    Did you try putting it in the same dir as the binary ?

    On my S805 it is sitting under: ./storage/.kodi/addons/script.moonlight/lib/libmoonlight-aml.so

    I already saw you asked irtimmer over at github.

    Let's hope for the best.

  • That's great news !!

    Did you try putting it in the same dir as the binary ?

    On my S805 it is sitting under: ./storage/.kodi/addons/script.moonlight/lib/libmoonlight-aml.so

    I already saw you asked irtimmer over at github.

    Let's hope for the best.

    Yes and it didn't work.

    note that I didn't build it as an add-on so I might need to set up some configuration file that I missed, I will try again after work and see what I can find.

  • I tried to add some basic debugging to moonlight-embedded src/platform.c

    #ifdef HAVE_AML

    if (std|| strcmp(name, "aml") == 0) {

    void *handle = dlopen("libmoonlight-aml.so", RTLD_NOW | RTLD_GLOBAL);

    printf(handle);

    if (handle != NULL && access("/dev/amvideo", F_OK) != -1) {

    printf("Returning AML\n");

    return AML;

    }

    }

    the moment i added "printf(handle);" everyting started working !!!

    ./moonlight --verbose stream 192.168.1.100 -mapping /storage/.kodi/addons/script.moonlight/share/moonlight/mappings/xbox360.conf

    Moonlight Embedded 2.4.0 (SDL;EMBEDDED;ALSA;PULSE;CEC;AML)

    Connect to 192.168.1.100...

    NVIDIA GeForce GTX 970, GFE 3.6.0.74 (gs_03_70_22061309, 7.1.370.0)

    Returning AML

    Platform AMLogic VPU

    No mapping available for /dev/input/event1

    No mapping available for /dev/input/event0

    No mapping available for /dev/input/event2

    Stream 1280 x 720, 60 fps, 10000 kbps

    Initializing platform...done

    Resolving host name...done

    Starting RTSP handshake...done

    Initializing control stream...done

    Initializing video stream...done

    Initializing audio stream...done

    Initializing input stream...done

    Starting control stream...done

    Starting video stream...done

    Starting audio stream...done

    Starting input stream...done

    Problem now is I am getting a black screen instead of a stream....

    Will continue to investigate.

    Edited once, last by bubuman (June 15, 2017 at 11:38 PM).

  • I saw your post on github, and the same thing happens when I add that line.

    not sure why it is not loading the library. I've tried several other things but no luck :(

  • Something is not building right...

    I went back to the original 2.2.2 package that comes from libreelec repository (moonlight-embedded-9301898) and added the following debug to platform.c:

    #ifdef HAVE_AML

    if (std|| strcmp(name, "aml") == 0) {

    void *handle = dlopen("libmoonlight-aml.so", RTLD_NOW | RTLD_GLOBAL);

    printf("Handle error: %s\n", dlerror());

    printf("Access /dev/amvideo: %i\n", access("/dev/amvideo", F_OK));

    if (handle != NULL && access("/dev/amvideo", F_OK) != -1)

    return AML;

    }

    Got this:

    LibreELEC:~/downloads # ./moonlight stream -p aml

    Moonlight Embedded 2.2.2 (SDL;VDPAU;EMBEDDED;PULSE;CEC;AML)

    Handle error: /usr/lib/libamcodec.so: undefined symbol: codec_sw_decoder_set_ratio

    Access /dev/amvideo: 0

    Platform 'aml' not found

    This happens even if I build the whole libreelec image from the same sources I compiled moonlight...

    If I copy libamcodec.so from S805, moonlight starts with amlogic platform but nothing gets displayed to the screen..

    Guess i can't just copy a library like that..

    kszaq if you have a minute your insight would be greatly appreciated

    Edited 2 times, last by bubuman (June 16, 2017 at 8:05 AM).

  • The libamcodec from the s805 is definitely not the same as the one on the s905, the s905 one being larger, so there is something in the build code somewhere that is changing how it works depending on what project you build, maybe not in the libamcodec package itself but on some dependency.

  • Well I switched the package hash on the libamcodec and I used your debug code, this is what I got

    Code
    moonlight stream -verbose
    Moonlight Embedded 2.4.0 (SDL;EMBEDDED;ALSA;PULSE;CEC;AML)
    Searching for server...
    Connect to 192.168.1.77...
    NVIDIA GeForce GPU, GFE 3.6.0.74 (gs_03_70_22061309, 7.1.370.0)
    Handle error: (null)
    Access /dev/amvideo: 0
    Platform AMLogic VPU

    so, it detects the correct platform, still black screen. and the /proc/$moonlight_pid/maps does show libamcodec as loaded.

    :(

    Edited once, last by niabi (June 16, 2017 at 8:58 PM).

  • I upgraded manually coping /bin/ and /lib/

    Now I have : Moonlight Embedded 2.4.1

    Doesn't initialize due :

    Code
    moonlight stream -verbose -platform aml
    Moonlight Embedded 2.4.1 (SDL;EMBEDDED;ALSA;PULSE;CEC;AML)
    Searching for server...
    Connect to 192.168.0.106...
    NVIDIA GeForce GTX 1070, GFE 3.7.0.81 (gs_03_80_22266601, 7.1.380.0)
    Platform Unknown
    Platform 'aml' not found