moonlight-stream / moonlight-embedded

Gamestream client for embedded systems
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
1.51k stars 325 forks source link

Platform 'default' not found #350

Closed amylizzle closed 8 years ago

amylizzle commented 8 years ago

After compiling from source (in order to get GFE 2.11 compatibility), all moonlight commands fail with the message "Platform 'default' not found".

Please provide the following info.

NVidia Geforce Experience version: 2.11.2.46 Moonlight Embedded version: 2.1.4 (built from source from git as of 30/03/16 18:00 GMT) Moonlight Embedded running on: Raspberry Pi

Output of Moonlight Embedded: Moonlight Embedded 2.1.4 (EMBEDDED;PI) Platform 'default' not found

What is the expected result? Pairing, streaming, all commands fail except help.

What happens instead of that? Error message "Platform 'default' not found, followed by immediate termination of moonlight.

Build Log

pi@raspberrypi ~/moonlight/moonlight-embedded/build $ cmake ../ -- The C compiler identification is GNU 4.7.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.25") -- Found Opus: /usr/lib/libopus.so -- Found Broadcom: /opt/vc/include -- Could NOT find Freescale (missing: FREESCALE_INCLUDE_DIR KERNEL_INCLUDE_DIR VPU_LIBRARY) -- Could NOT find Amlogic (missing: AMLOGIC_INCLUDE_DIR AMCODEC_LIBRARY AMADEC_LIBRARY AMAVUTILS_LIBRARY) -- Found PkgConfig: /usr/bin/pkg-config (found version "0.26") -- checking for module 'libevdev' -- found libevdev, version 1.4.6 -- checking for module 'libudev' -- found libudev, version 175 -- checking for module 'sdl2>=2.0.4' -- package 'sdl2>=2.0.4' not found -- checking for module 'libavcodec' -- package 'libavcodec' not found -- checking for module 'libavutil' -- package 'libavutil' not found -- checking for module 'x11-xcb' -- package 'x11-xcb' not found -- checking for module 'vdpau' -- package 'vdpau' not found -- checking for module 'libpulse-simple' -- package 'libpulse-simple' not found -- checking for module 'libcec>=3.0.0' -- package 'libcec>=3.0.0' not found -- checking for one of the modules 'uuid' -- Looking for include file pthread.h -- Looking for include file 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.26.0") -- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libssl.so;/usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.0.1e") -- 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.13 -- Configuring done -- Generating done -- Build files have been written to: /home/pi/moonlight/moonlight-embedded/build

pi@raspberrypi ~/moonlight/moonlight-embedded/build $ make Scanning dependencies of target moonlight-common [ 2%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/PlatformSockets.c.o [ 4%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/RtspConnection.c.o [ 6%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/RtspParser.c.o [ 8%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/InputStream.c.o [ 11%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/VideoDepacketizer.c.o [ 13%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/FakeCallbacks.c.o [ 15%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/ControlStream.c.o [ 17%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/Connection.c.o [ 20%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/RtpReorderQueue.c.o [ 22%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/LinkedBlockingQueue.c.o [ 24%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/VideoStream.c.o [ 26%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/Misc.c.o [ 28%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/ByteBuffer.c.o [ 31%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/AudioStream.c.o [ 33%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/Platform.c.o [ 35%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/SdpGenerator.c.o [ 37%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/OpenAES/oaes_lib.c.o [ 40%] Building C object libgamestream/CMakeFiles/moonlight-common.dir//third_party/moonlight-common-c/limelight-common/OpenAES/oaes_base64.c.o Linking C shared library libmoonlight-common.so [ 40%] Built target moonlight-common Scanning dependencies of target gamestream [ 42%] Building C object libgamestream/CMakeFiles/gamestream.dir/xml.c.o [ 44%] Building C object libgamestream/CMakeFiles/gamestream.dir/discover.c.o [ 46%] Building C object libgamestream/CMakeFiles/gamestream.dir/client.c.o [ 48%] Building C object libgamestream/CMakeFiles/gamestream.dir/sps.c.o [ 51%] Building C object libgamestream/CMakeFiles/gamestream.dir/mkcert.c.o [ 53%] Building C object libgamestream/CMakeFiles/gamestream.dir/http.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_sei.c.o [ 60%] Building C object libgamestream/CMakeFiles/gamestream.dir/__/third_party/h264bitstream/h264_stream.c.o Linking C shared library libgamestream.so [ 60%] Built target gamestream Scanning dependencies of target moonlight [ 62%] Building C object CMakeFiles/moonlight.dir/src/main.c.o [ 64%] Building C object CMakeFiles/moonlight.dir/src/global.c.o [ 66%] Building C object CMakeFiles/moonlight.dir/src/config.c.o [ 68%] Building C object CMakeFiles/moonlight.dir/src/platform.c.o [ 71%] Building C object CMakeFiles/moonlight.dir/src/connection.c.o [ 73%] Building C object CMakeFiles/moonlight.dir/src/sdl.c.o [ 75%] Building C object CMakeFiles/moonlight.dir/src/loop.c.o [ 77%] Building C object CMakeFiles/moonlight.dir/src/input/evdev.c.o [ 80%] Building C object CMakeFiles/moonlight.dir/src/input/mapping.c.o [ 82%] Building C object CMakeFiles/moonlight.dir/src/input/cec.c.o [ 84%] Building C object CMakeFiles/moonlight.dir/src/input/sdlinput.c.o [ 86%] Building C object CMakeFiles/moonlight.dir/src/input/udev.c.o [ 88%] Building C object CMakeFiles/moonlight.dir/src/audio/alsa.c.o Linking C executable moonlight [ 88%] Built target moonlight Scanning dependencies of target moonlight-pi [ 91%] Building C object CMakeFiles/moonlight-pi.dir/src/video/pi.c.o [ 93%] Building C object CMakeFiles/moonlight-pi.dir/src/audio/omx.c.o [ 95%] Building C object CMakeFiles/moonlight-pi.dir/third_party/ilclient/ilclient.c.o [ 97%] Building C object CMakeFiles/moonlight-pi.dir/third_party/ilclient/ilcore.c.o Linking C shared library libmoonlight-pi.so [ 97%] Built target moonlight-pi Scanning dependencies of target docs [100%] Generating moonlight.1 [100%] Built target docs

pi@raspberrypi ~/moonlight/moonlight-embedded/build $ sudo make install [ 40%] Built target moonlight-common [ 60%] Built target gamestream [ 88%] Built target moonlight [ 97%] Built target moonlight-pi [100%] Built target docs Install the project... -- Install configuration: "" -- Installing: /usr/local/lib/libmoonlight-pi.so -- Removed runtime path from "/usr/local/lib/libmoonlight-pi.so" -- Installing: /usr/local/bin/moonlight -- Removed runtime path from "/usr/local/bin/moonlight" -- Up-to-date: /usr/local/share/moonlight/mappings -- Installing: /usr/local/share/moonlight/mappings/xbox360.conf -- Installing: /usr/local/share/moonlight/mappings/rumblepad2.conf -- Installing: /usr/local/share/moonlight/mappings/dualshock3.conf -- Installing: /usr/local/share/moonlight/mappings/default.conf -- Installing: /usr/local/share/moonlight/mappings/dualshock4.conf -- Installing: /usr/local/etc/moonlight.conf -- Installing: /usr/local/lib/libgamestream.so.2.1.4 -- Up-to-date: /usr/local/lib/libgamestream.so.0 -- Up-to-date: /usr/local/lib/libgamestream.so -- Removed runtime path from "/usr/local/lib/libgamestream.so.2.1.4" -- Installing: /usr/local/lib/libmoonlight-common.so.2.1.4 -- Up-to-date: /usr/local/lib/libmoonlight-common.so.0 -- Up-to-date: /usr/local/lib/libmoonlight-common.so -- Installing: /usr/local/share/man/man1/moonlight.1

pi@raspberrypi ~/moonlight/moonlight-embedded/build $ moonlight pair 192.168.200.7 Moonlight Embedded 2.1.4 (EMBEDDED;PI) Platform 'default' not found

amylizzle commented 8 years ago

So I'm pretty sure I know what's going on, I'm just not 100% sure why.

It looks like platform_check() in platform.c is being compiled to a return 0 stub, possibly because HAVE_PI and the like aren't getting defined properly (this may be the fault of the build process, don't understand it well enough to be sure).

I managed to hack around the problem by commenting out if statements such that the code that should run if HAVE_PI is defined always runs, though of course this is not a general solution. This has got me further, but greets me with:

Moonlight Embedded 2.1.4 (EMBEDDED;PI) Connect to 192.168.200.7... NVIDIA GeForce GTX 770, GFE 2.11.2.46 (protocol version 7) Errorcode starting app: -1

EDIT: A little more digging into the build process, and it seems making sure libavcodec and libavutil are installed will trigger the HAVE_PI flag, still the Errorcode -1 however.

amylizzle commented 8 years ago

Errorcode -1 seems to be caused by a protocol change in the streaming API. In libgamestream/client.c, moonlight searches the returned XML for a node cancel which is not there in the latest protocol, and so fails. Commenting out that search gets me to the next error which was reported in #349 and is also a protocol issue.

I'm not sure what the ideal fix for #350 is, but it seems to be an error in the build process that could be resolved by requiring libavcodec if Broadcom is detected.

dead commented 8 years ago

Moonlight-embedding is not working with GFE 2.11.2.46 yet. To fix the Errorcode starting app: -1 I had to revert this commit (https://github.com/irtimmer/moonlight-embedded/commit/016ac91c1c19f868cc46cac5b4d794b414b8d74e).

About the HAVE_PI maybe it's a problem with CMake (older version?), it's working fine here...

Migs3 commented 8 years ago

Edit platform.c and add the following in where you find it:

  #ifdef HAVE_PI
  if (std || strcmp(name, "pi") == 0) {
    void *handle = dlopen("libmoonlight-pi.so", RTLD_NOW | RTLD_GLOBAL);
    if (handle == NULL) fprintf(stderr, "%s\n", dlerror());  // <------ ADD THIS LINE
    if (handle != NULL && dlsym(RTLD_DEFAULT, "bcm_host_init") != NULL)
      return PI;
  }
  #endif

Then compile and run it again, it should tell you the error it's having opening the library file.

amylizzle commented 8 years ago

CMake was compiled from source, version 3.2.3. Could still be something to do with my setup, this pi isn't exactly a clean dev machine.

Errorcode -1 is entirely due to lines 575-581 in client.c. I got it to dump data->memory to console on failure, and the XML node cancel wasn't there, hence atoi(result) would always return 0.

@Unknownforce351 I was actually playing a little with that code already, and it always got a proper handle. I'm fairly sure it was just a build issue.

Migs3 commented 8 years ago

Ah! I just remember running into #350 when debugging the OMX audio code I recently PR'd and was committed. I used that to debug and found that it wouldn't get a handle because of some bad declaration/definitions in my code. I was just making sure it wasn't related to that code I pushed. Didn't want to be the cause of problems!

cgutman commented 8 years ago

Moonlight-common-c is updated upstream to support GFE 2.11.2.46.

amylizzle commented 8 years ago

Well, my build environment is still screwy apparently.

After running cmake ../ in build/, running make

pi@raspberrypi ~/moonlight/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:184: recipe for target 'libgamestream/CMakeFiles/moonlight-common.dir/all' >failed make[1]: * [libgamestream/CMakeFiles/moonlight-common.dir/all] Error 2 Makefile:116: recipe for target 'all' failed make: *\ [all] Error 2

cybern0id commented 8 years ago

Using a clean build environment and current git master as of today results in a working build (for me) on RPi Jessie. I've used irtimmer's moonlight-common-c submodule and the packaged libenet-dev from Jessie repos (rather than cgutman's one in his moonlight-common-c repo).

I have seen the "Platform 'default' not found" error when calling the compiled moonlight executable from my home folder (e.g. ./sources/moonlight-embedded/build/moonlight stream). However, this error didn't occur when running moonlight from within the build directory (cd ~/sources/moonlight-embedded/build/ & ./moonlight stream) or when running moonlight from the system install after running sudo make install. I think the error is related to the location of the libmoonlight-pi.so compiled library that is compiled along with the main app.

amylizzle commented 8 years ago

Did a clean build, everything is working now! Thanks for all your help :)

I'm happy to mark this as resolved? Seems to have just been an issue on my end, excepting the protocol stuff of course.