[HowTo] Moonlight-Embedded (former Limelight) using Luna Launcher

Try it – that looks reasonable, but you also need to add the previously specified -DAMLOGIC directives.

cmake works!

next step, next obstacle :stuck_out_tongue_winking_eye:

root@osmc:/home/osmc/moonlight-embedded/build# cmake ../ -DAMLOGIC_INCLUDE_DIR=/opt/vero2/usr/include -DAMCODEC_LIBRARY="/opt/vero2/lib" -DAMADEC_LIBRARY="/opt/vero2/lib" -DAMAVUTILS_LIBRARY="/opt/vero2/lib"
-- The C compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ALSA: /usr/lib/arm-linux-gnueabihf/libasound.so (found version "1.0.28") 
-- Found Opus: /usr/lib/arm-linux-gnueabihf/libopus.so  
-- Could NOT find Broadcom (missing:  BROADCOM_INCLUDE_DIR VCOS_LIBRARY VCHIQ_LIBRARY OPENMAXIL_LIBRARY BCM_HOST_LIBRARY) 
-- Could NOT find Freescale (missing:  FREESCALE_INCLUDE_DIR KERNEL_INCLUDE_DIR VPU_LIBRARY) 
-- Found Amlogic: /opt/vero2/usr/include  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Checking for module 'libevdev'
--   Found libevdev, version 1.3
-- Checking for module 'libudev'
--   Found libudev, version 215
-- Checking for module 'sdl2>=2.0.4'
--   
-- Checking for module 'libavcodec'
--   No package 'libavcodec' found
-- Checking for module 'libavutil'
--   No package 'libavutil' found
-- Checking for module 'x11-xcb'
--   No package 'x11-xcb' found
-- Checking for module 'vdpau'
--   No package 'vdpau' found
-- Checking for module 'libpulse-simple'
--   Found libpulse-simple, version 5.0
-- Checking for module 'libcec>=3.0.0'
--   
-- Checking for one of the modules 'uuid'
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CURL: /usr/lib/arm-linux-gnueabihf/libcurl.so (found version "7.38.0") 
-- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libssl.so;/usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.0.1t") 
-- Found EXPAT: /usr/lib/arm-linux-gnueabihf/libexpat.so (found version "2.1.0") 
-- Checking for module 'avahi-client'
--   Found avahi-client, version 0.6.31
-- Checking for module 'libenet'
--   Found libenet, version 1.3.12
You have called ADD_LIBRARY for library moonlight-common without any source files. This typically indicates a problem with your CMakeLists.txt file
-- Configuring done
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
CMake Error: CMake can not determine linker language for target: moonlight-common
CMake Error: Cannot determine link language for target "moonlight-common".
-- Generating done
-- Build files have been written to: /home/osmc/moonlight-embedded/build
root@osmc:/home/osmc/moonlight-embedded/build# ls
CMakeCache.txt	CMakeFiles  cmake_install.cmake  configuration.h  docs	libgamestream  Makefile
root@osmc:/home/osmc/moonlight-embedded/build# make
Scanning dependencies of target moonlight-common
make[2]: *** No rule to make target 'libgamestream/CMakeFiles/moonlight-common.dir/build'.  Stop.
CMakeFiles/Makefile2:163: recipe for target 'libgamestream/CMakeFiles/moonlight-common.dir/all' failed
make[1]: *** [libgamestream/CMakeFiles/moonlight-common.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

No idea – but probably best to clone fresh. Make sure you build in the right directory. Vero 2 specifics should be covered now, so you can build it like you would for other platforms.

ok another milestone reached :slight_smile:

git reset --hard
git submodule update --init

fixes some make errors, now im stuck at 62% in the make process:

root@osmc:/home/osmc/moonlight-embedded/build# make
Scanning dependencies of target moonlight-common
[  2%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtspConnection.c.o
[  4%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtspParser.c.o
[  6%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Platform.c.o
[  8%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/InputStream.c.o
[ 11%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/ControlStream.c.o
[ 13%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Misc.c.o
[ 15%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/VideoDepacketizer.c.o
[ 17%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/ByteBuffer.c.o
[ 20%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Connection.c.o
[ 22%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtpReorderQueue.c.o
[ 24%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/VideoStream.c.o
[ 26%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/PlatformSockets.c.o
[ 28%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/FakeCallbacks.c.o
[ 31%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/LinkedBlockingQueue.c.o
[ 33%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/SdpGenerator.c.o
[ 35%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/AudioStream.c.o
[ 37%] Linking C shared library libmoonlight-common.so
[ 37%] Built target moonlight-common
Scanning dependencies of target gamestream
[ 40%] Building C object libgamestream/CMakeFiles/gamestream.dir/xml.c.o
[ 42%] Building C object libgamestream/CMakeFiles/gamestream.dir/client.c.o
[ 44%] Building C object libgamestream/CMakeFiles/gamestream.dir/discover.c.o
[ 46%] Building C object libgamestream/CMakeFiles/gamestream.dir/sps.c.o
[ 48%] Building C object libgamestream/CMakeFiles/gamestream.dir/http.c.o
[ 51%] Building C object libgamestream/CMakeFiles/gamestream.dir/mkcert.c.o
[ 53%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_sei.c.o
[ 55%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_nal.c.o
[ 57%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_stream.c.o
[ 60%] Linking C shared library libgamestream.so
[ 60%] Built target gamestream
Scanning dependencies of target moonlight-aml
[ 62%] Building C object CMakeFiles/moonlight-aml.dir/src/video/aml.c.o
/home/osmc/moonlight-embedded/src/video/aml.c:30:27: fatal error: amcodec/codec.h: No such file or directory
 #include <amcodec/codec.h>
                           ^
compilation terminated.
CMakeFiles/moonlight-aml.dir/build.make:62: recipe for target 'CMakeFiles/moonlight-aml.dir/src/video/aml.c.o' failed
make[2]: *** [CMakeFiles/moonlight-aml.dir/src/video/aml.c.o] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/moonlight-aml.dir/all' failed
make[1]: *** [CMakeFiles/moonlight-aml.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Thanks for taking the time. Gives the same result. Also, if i just to sudo su, or sudo -s without the echo just diconnects the ssh connection.

Im feeling i forgot some really simple yet crucial step. Need to change anything before i can add the repo?

EDIT:

Seems my ssh client was out of date or not working with the pi and osmc, switched to putty and all seems to have gone well. Although it ended with this:
‘E: There are problems and -y was used without --force-yes’

Make sure you have the vero2-libamcodec-dev-osmc package installed.

Try

export CFLAGS="-I/opt/vero2/usr/include"
export CXXFLAGS="${CFLAGS}"

how do I use these export lines?

Just paste them in the terminal and press enter before using cmake.

ok cleared the build folder and before cmake I used the export lines, same error:

root@osmc:/home/osmc/moonlight-embedded/build# cd ..
root@osmc:/home/osmc/moonlight-embedded# rm -r build/
root@osmc:/home/osmc/moonlight-embedded# mkdir build
root@osmc:/home/osmc/moonlight-embedded# cd bui
bash: cd: bui: No such file or directory
root@osmc:/home/osmc/moonlight-embedded# cd build/
root@osmc:/home/osmc/moonlight-embedded/build# export CFLAGS="-I/opt/vero2/usr/include"
root@osmc:/home/osmc/moonlight-embedded/build# ls
root@osmc:/home/osmc/moonlight-embedded/build# export CXXFLAGS="${CFLAGS}"
root@osmc:/home/osmc/moonlight-embedded/build# cmake ../ -DAMLOGIC_INCLUDE_DIR=/opt/vero2/usr/include -DAMCODEC_LIBRARY="/opt/vero2/lib" -DAMADEC_LIBRARY="/opt/vero2/lib" -DAMAVUTILS_LIBRARY="/opt/vero2/lib"
-- The C compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found ALSA: /usr/lib/arm-linux-gnueabihf/libasound.so (found version "1.0.28") 
-- Found Opus: /usr/lib/arm-linux-gnueabihf/libopus.so  
-- Could NOT find Broadcom (missing:  BROADCOM_INCLUDE_DIR VCOS_LIBRARY VCHIQ_LIBRARY OPENMAXIL_LIBRARY BCM_HOST_LIBRARY) 
-- Could NOT find Freescale (missing:  FREESCALE_INCLUDE_DIR KERNEL_INCLUDE_DIR VPU_LIBRARY) 
-- Found Amlogic: /opt/vero2/usr/include  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Checking for module 'libevdev'
--   Found libevdev, version 1.3
-- Checking for module 'libudev'
--   Found libudev, version 215
-- Checking for module 'sdl2>=2.0.4'
--   
-- Checking for module 'libavcodec'
--   No package 'libavcodec' found
-- Checking for module 'libavutil'
--   No package 'libavutil' found
-- Checking for module 'x11-xcb'
--   No package 'x11-xcb' found
-- Checking for module 'vdpau'
--   No package 'vdpau' found
-- Checking for module 'libpulse-simple'
--   Found libpulse-simple, version 5.0
-- Checking for module 'libcec>=3.0.0'
--   
-- Checking for one of the modules 'uuid'
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CURL: /usr/lib/arm-linux-gnueabihf/libcurl.so (found version "7.38.0") 
-- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libssl.so;/usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.0.1t") 
-- Found EXPAT: /usr/lib/arm-linux-gnueabihf/libexpat.so (found version "2.1.0") 
-- Checking for module 'avahi-client'
--   Found avahi-client, version 0.6.31
-- Checking for module 'libenet'
--   Found libenet, version 1.3.12
-- Configuring done
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "moonlight-aml" requests linking to directory "/opt/vero2/lib".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/osmc/moonlight-embedded/build
root@osmc:/home/osmc/moonlight-embedded/build# make
Scanning dependencies of target moonlight-common
[  2%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtspConnection.c.o
[  4%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtspParser.c.o
[  6%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Platform.c.o
[  8%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/InputStream.c.o
[ 11%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/ControlStream.c.o
[ 13%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Misc.c.o
[ 15%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/VideoDepacketizer.c.o
[ 17%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/ByteBuffer.c.o
[ 20%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/Connection.c.o
[ 22%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/RtpReorderQueue.c.o
[ 24%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/VideoStream.c.o
[ 26%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/PlatformSockets.c.o
[ 28%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/FakeCallbacks.c.o
[ 31%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/LinkedBlockingQueue.c.o
[ 33%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/SdpGenerator.c.o
[ 35%] Building C object libgamestream/CMakeFiles/moonlight-common.dir/__/third_party/moonlight-common-c/src/AudioStream.c.o
[ 37%] Linking C shared library libmoonlight-common.so
[ 37%] Built target moonlight-common
Scanning dependencies of target gamestream
[ 40%] Building C object libgamestream/CMakeFiles/gamestream.dir/xml.c.o
[ 42%] Building C object libgamestream/CMakeFiles/gamestream.dir/client.c.o
[ 44%] Building C object libgamestream/CMakeFiles/gamestream.dir/discover.c.o
[ 46%] Building C object libgamestream/CMakeFiles/gamestream.dir/sps.c.o
[ 48%] Building C object libgamestream/CMakeFiles/gamestream.dir/http.c.o
[ 51%] Building C object libgamestream/CMakeFiles/gamestream.dir/mkcert.c.o
[ 53%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_sei.c.o
[ 55%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_nal.c.o
[ 57%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_stream.c.o
[ 60%] Linking C shared library libgamestream.so
[ 60%] Built target gamestream
Scanning dependencies of target moonlight-aml
[ 62%] Building C object CMakeFiles/moonlight-aml.dir/src/video/aml.c.o
/home/osmc/moonlight-embedded/src/video/aml.c:30:27: fatal error: amcodec/codec.h: No such file or directory
 #include <amcodec/codec.h>
                           ^
compilation terminated.
CMakeFiles/moonlight-aml.dir/build.make:62: recipe for target 'CMakeFiles/moonlight-aml.dir/src/video/aml.c.o' failed
make[2]: *** [CMakeFiles/moonlight-aml.dir/src/video/aml.c.o] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/moonlight-aml.dir/all' failed
make[1]: *** [CMakeFiles/moonlight-aml.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Seems this is missing, but when i try to add it seems i dont have permission. How do i add this?

And will this fix this problem:

‘WARNING: The following packages cannot be authenticated!
moonlight-embedded
E: There are problems and -y was used without --force-yes’

Thanks for your help.

EDIT:

Think i got it working now, removing the -y command let me enter yess myself preventing that error. Not sure why that happens though.

so close at getting this done, anybody got an idea how to include the amcodec?

Check if this headers actually exist, we just copy the lib (as nothing else needs them). If this is the case, you can pinch the headers from the repository I mentioned before. No need to build; just copy them to /opt/vero2/usr/include so they it is under amcodec/codec.h

no usr folder in vero2. guess i have to create it. the libs from the package, where do i copy them from?

/usr is a typo, but you do have /opt/vero2/include. You can chuck the amcodec header in there and that should be enough.

ok found them, they were under /usr/osmc/include/amcodec.
i copied them to the PATH needed, seems it worked.
now make worked :slight_smile:

but guess it would be too easy if make install wouldn’t want to tell me something annoying:

[ 62%] Building C object CMakeFiles/moonlight-aml.dir/src/video/aml.c.o
In file included from /opt/vero2/usr/include/amcodec/codec_type.h:17:0,
                 from /opt/vero2/usr/include/amcodec/codec.h:15,
                 from /home/osmc/moonlight-embedded/src/video/aml.c:30:
/opt/vero2/usr/include/amcodec/amports/aformat.h:80:35: warning: backslash and newline separated by space
          ||(afmt == AFORMAT_EAC3) \         
 ^
/home/osmc/moonlight-embedded/src/video/aml.c: In function ‘osd_blank’:
/home/osmc/moonlight-embedded/src/video/aml.c:45:29: warning: incompatible implicit declaration of built-in function ‘strlen’
     int ret = write(fd,bcmd,strlen(bcmd));
                             ^
[ 64%] Linking C shared library libmoonlight-aml.so
[ 64%] Built target moonlight-aml
Scanning dependencies of target moonlight
[ 66%] Building C object CMakeFiles/moonlight.dir/src/loop.c.o
[ 68%] Building C object CMakeFiles/moonlight.dir/src/platform.c.o
[ 71%] Building C object CMakeFiles/moonlight.dir/src/global.c.o
[ 73%] Building C object CMakeFiles/moonlight.dir/src/sdl.c.o
[ 75%] Building C object CMakeFiles/moonlight.dir/src/config.c.o
[ 77%] Building C object CMakeFiles/moonlight.dir/src/connection.c.o
[ 80%] Building C object CMakeFiles/moonlight.dir/src/main.c.o
[ 82%] Building C object CMakeFiles/moonlight.dir/src/input/mapping.c.o
[ 84%] Building C object CMakeFiles/moonlight.dir/src/input/udev.c.o
[ 86%] Building C object CMakeFiles/moonlight.dir/src/input/cec.c.o
[ 88%] Building C object CMakeFiles/moonlight.dir/src/input/sdlinput.c.o
[ 91%] Building C object CMakeFiles/moonlight.dir/src/input/evdev.c.o
[ 93%] Building C object CMakeFiles/moonlight.dir/src/audio/pulse.c.o
[ 95%] Building C object CMakeFiles/moonlight.dir/src/audio/alsa.c.o
[ 97%] Linking C executable moonlight
[ 97%] Built target moonlight
Scanning dependencies of target docs
[100%] Generating moonlight.1
[100%] Built target docs
root@osmc:/home/osmc/moonlight-embedded/build# make install
[ 37%] Built target moonlight-common
[ 60%] Built target gamestream
[ 64%] Built target moonlight-aml
[ 97%] Built target moonlight
[100%] Built target docs
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libmoonlight-aml.so
-- Set runtime path of "/usr/local/lib/libmoonlight-aml.so" to ""
-- Installing: /usr/local/bin/moonlight
-- Set runtime path of "/usr/local/bin/moonlight" to ""
-- Installing: /usr/local/share/moonlight/mappings
-- Installing: /usr/local/share/moonlight/mappings/rumblepad2.conf
-- Installing: /usr/local/share/moonlight/mappings/cordlessrumblepad2
-- Installing: /usr/local/share/moonlight/mappings/dualshock4.conf
-- Installing: /usr/local/share/moonlight/mappings/default.conf
-- Installing: /usr/local/share/moonlight/mappings/dualshock3.conf
-- Installing: /usr/local/share/moonlight/mappings/xbox360.conf
-- Installing: /usr/local/etc/moonlight.conf
-- Installing: /usr/local/lib/libgamestream.so.2.2.0
-- Installing: /usr/local/lib/libgamestream.so.0
-- Installing: /usr/local/lib/libgamestream.so
-- Set runtime path of "/usr/local/lib/libgamestream.so.2.2.0" to ""
-- Installing: /usr/local/lib/libmoonlight-common.so.2.2.0
-- Installing: /usr/local/lib/libmoonlight-common.so.0
-- Installing: /usr/local/lib/libmoonlight-common.so
-- Installing: /usr/local/share/man/man1/moonlight.1
root@osmc:/home/osmc/moonlight-embedded/build# moonlight
moonlight: error while loading shared libraries: libgamestream.so.0: cannot open shared object file: No such file or directory
root@osmc:/home/osmc/moonlight-embedded/build#

im gonna search now for libgamestream.so.0

1 Like

ok found out that
ldconfig
fixed the missing library.

i cant believe it, but i made it!

thanks @sam_nazarko for your patience with noobs like me :wink:

You’re welcome. Make sure you test it first before celebrating success

EDIT: all fixed, just had to sudo apt-get upgrade via shh

Always use dist-upgrade or you could wreck your system!

Totally new at this, so please explain.
This was the first thing i could think of.