Release Moonlight


Followed your instructions and here's is the output of cat

ledop:~$ cat /mnt/utmp/moonlight/runscript.sh

#!/bin/bash

 

pwd=$(pwd)

 

export PS1='\w\$ '

umask 022

 

version="01"

 

export PATH=$pwd:$PATH

export LD_LIBRARY_PATH=$pwd/lib:$LD_LIBRARY_PATH

 

if [ ! -e home ]

then

 echo "--------------------------------------------------------------"

 echo "mkdir home"

 mkdir home

fi

 

if [ -e home/.version ];then

 lastrun=`cat home/.version`

else

 lastrun="00"

fi

 

#check Java

if [ ! -e /usr/bin/java ];then

zenity --error --title="Moonlight" --text="You need JAVA to run this game.

Go grab the JAVA PND, it's easy to install..."

exit

fi

 

if [ -z "$REAL_HOME" ];then

export REAL_HOME="$HOME"

fi

 

export HOME=$pwd/home

 

#all done, write the new lastrun...

if [ ! "$version" = "$lastrun" ];then

echo "$version">home/.version

fi

 

free=`free -mt | grep Total | awk '{print $4}'`

 

#check free mem, as low mem will probably lead to quiet error and sure hang...

if [ $free -lt 250 ];then

echo Low on memory, but not critical, warn user about it

zenity --warning --title="Moonlight" --text="Warning, your free memory is a bit low. You have $free, and 256Mo is recommanded. 

It will strart, but creating/loading a game will probably silently failed.

 

If the game takes forever to create the world (it's a long process anyway), create a Swapfile to add some free memory"

fi

 

if [ ! -e left_nub ];then

 cat /proc/pandora/nub0/mode >left_nub

fi

if [ ! -e right_nub ];then

 cat /proc/pandora/nub1/mode >right_nub

fi

 

left_nub=`cat left_nub`

right_nub=`cat right_nub`

 

# handle analog nubs => save current version and switch to joystick for both

cat /proc/pandora/nub0/mode > /tmp/moonlight_nub0mode_before

cat /proc/pandora/nub1/mode > /tmp/moonlight_nub1mode_before

 

if [ -e /usr/pandora/scripts/op_nubchange.sh ]; then

  /usr/pandora/scripts/op_nubchange.sh $left_nub $right_nub

else

  echo $left_nub > /proc/pandora/nub0/mode

  echo $right_nub > /proc/pandora/nub1/mode

fi

 

 

echo System check

echo ============

echo Freememory is $free

echo Cpu Speed is `cat /proc/pandora/cpu_mhz_max`

echo Sys Speed is `cat /proc/pandora/sys_mhz_max`

echo nubs has $left_nub $right_nub

 

[ -e "$HOME/pre_script.sh" ] && . $HOME/pre_script.sh

if [ -e "$HOME/post_script.sh" ];then

java -Xmx256m -jar build/moonlight-pandora.jar

. $HOME/post_script.sh

else

java -Xmx256m build/moonlight-pandora.jar

fi

 

 

cat /tmp/moonlight_nub0mode_before > /proc/pandora/nub0/mode

cat /tmp/moonlight_nub1mode_before > /proc/pandora/nub1/mode

 

sleep 1

 

rm /tmp/moonlight_nub0mode_before /tmp/moonlight_nub1mode_before

# set back the nubs to their initial state

 
 
Followed your instructions and here's is the output of cat

ledop:~$ cat /mnt/utmp/moonlight/runscript.sh


#!/bin/bash


pwd=$(pwd)


export PS1='\w\$ '


umask 022


version="01"


export PATH=$pwd:$PATH


export LD_LIBRARY_PATH=$pwd/lib:$LD_LIBRARY_PATH


if [ ! -e home ]


then


 echo "--------------------------------------------------------------"


 echo "mkdir home"


 mkdir home


fi


if [ -e home/.version ];then


 lastrun=`cat home/.version`


else


 lastrun="00"


fi


#check Java


if [ ! -e /usr/bin/java ];then


zenity --error --title="Moonlight" --text="You need JAVA to run this game.


Go grab the JAVA PND, it's easy to install..."


exit


fi


if [ -z "$REAL_HOME" ];then


export REAL_HOME="$HOME"


fi


export HOME=$pwd/home


#all done, write the new lastrun...


if [ ! "$version" = "$lastrun" ];then


echo "$version">home/.version


fi


free=`free -mt | grep Total | awk '{print $4}'`


#check free mem, as low mem will probably lead to quiet error and sure hang...


if [ $free -lt 250 ];then


echo Low on memory, but not critical, warn user about it


zenity --warning --title="Moonlight" --text="Warning, your free memory is a bit low. You have $free, and 256Mo is recommanded. 


It will strart, but creating/loading a game will probably silently failed.


If the game takes forever to create the world (it's a long process anyway), create a Swapfile to add some free memory"


fi


if [ ! -e left_nub ];then


 cat /proc/pandora/nub0/mode >left_nub


fi


if [ ! -e right_nub ];then


 cat /proc/pandora/nub1/mode >right_nub


fi


left_nub=`cat left_nub`


right_nub=`cat right_nub`


# handle analog nubs => save current version and switch to joystick for both


cat /proc/pandora/nub0/mode > /tmp/moonlight_nub0mode_before


cat /proc/pandora/nub1/mode > /tmp/moonlight_nub1mode_before


if [ -e /usr/pandora/scripts/op_nubchange.sh ]; then


  /usr/pandora/scripts/op_nubchange.sh $left_nub $right_nub


else


  echo $left_nub > /proc/pandora/nub0/mode


  echo $right_nub > /proc/pandora/nub1/mode


fi


echo System check


echo ============


echo Freememory is $free


echo Cpu Speed is `cat /proc/pandora/cpu_mhz_max`


echo Sys Speed is `cat /proc/pandora/sys_mhz_max`


echo nubs has $left_nub $right_nub


[ -e "$HOME/pre_script.sh" ] && . $HOME/pre_script.sh


if [ -e "$HOME/post_script.sh" ];then


java -Xmx256m -jar build/moonlight-pandora.jar


. $HOME/post_script.sh


else


java -Xmx256m build/moonlight-pandora.jar


fi


cat /tmp/moonlight_nub0mode_before > /proc/pandora/nub0/mode


cat /tmp/moonlight_nub1mode_before > /proc/pandora/nub1/mode


sleep 1


rm /tmp/moonlight_nub0mode_before /tmp/moonlight_nub1mode_before


# set back the nubs to their initial state
Ok thanks.


I confirm that is the first beta build, and is not the one on the Repo. (the line, near the end, "java -Xmx256m build/moonlight-pandora.jar" should if fact be "java -Xmx256m -jar moonlight-pandora.jar")


You should reboot your pandora (to be sure the pnd is unmounted), and redownload the PND, something is wrong here.
 
Thank you ptitSeb. I am able to start Moonlight now after deleting and downloading the new Moonlight PND. Now I have to figure out how to connect to my Nvidia machine. Can PC with GTX970 work?
 
Thank you ptitSeb. I am able to start Moonlight now after deleting and downloading the new Moonlight PND. Now I have to figure out how to connect to my Nvidia machine. Can PC with GTX970 work?
Yes, a GTX970 is more than enough.

You have to sign-on on the PC side, and on the Pandora you have to Pair with the PC before being able to use the streaming...
 
Last edited:
The pnd has been updated.
The new version now use Moonlight-embedded, a build from ODroid user AreaScout that use GLES2 for rendering.

So, no more Java needed, and some better performances.
Now, actio game can mostly be played.
You will (probably) need to create the Pandora screen resolution (800x480) as a custom resoluton in the NVidia control panel to be abble to use it (or simply used 640x480 or 800x600). The higher the resolution, or higher fps, and the cpu load on the Pandora may become to important for smooth gameplay.

For an idea of the lag and quality, take a look at the youtube I put on 1st post (using the game FEZ, with 800x480@15fps).

Build 02
-----------

  • Switched to Moonlight-embedded (GLES2 build from ODroid user AreaScout).
  • Using some cheap gtkdialog menu for more ease of use
 
Tried Downwell, only got a white screen, likely because of the weird resolution the game uses, so disregard that one.
Super Meat Boy worked and gave me a picture. Damn shame we can't have that game natively, sniff.
The only slow game I've got isntalled is XCOM2, but that won't run at 640x480 :)
Touchscreen doesn't seem to do anything. Buttons just do their regular PgUp etc. thing.
The input lag is impressively low. You can use pandora as wifi controller for steam stuff if the mapping is okay.

This will be great on the Pyra.
 
Now build on the repo.
This version use Streaming Texture. It should be faster because it's a streamin texture (so texture upload to SGX is faster) and Color space conversion is also handled by hardware (using an NV12 tetxure).

Build 03
-----------

  • Now using Streaming Texture

It's higly experimental. This build seems less stable (and segfault at exit, not sure why), but should enable higher fps / resolution, so I'm interested in your feedback.
 
Now, I'm still using build 2, but when I play Everybody's Gone To The Rapture, this happens:
Code:
=======================================================================================
PND             : /media/1/pandora/menu/moonlight_ptitseb.pnd
PND_FSTYPE      : Squashfs
APPDATADIR      : /media/1/pandora/appdata/moonlight
APPDD_FSTYPE    : ext4
PND_CPUSPEED    : <unset>
EXENAME         : runscript.sh
ARGUMENTS       : <unset>
=======================================================================================
[ START ]--- Mount the PND ----------
Mounting : mount -t squashfs -o ro "/dev/loop0" "/mnt/utmp/moonlight"
Mounting the Union FS : mount -t aufs -o exec,dirs="/media/1/pandora/appdata/moonlight=rw+nolwh":"/mnt/pnd/moonlight=rr" none "/mnt/utmp/moonlight"
[SUCCESS]--- Mount the PND ----------
[ START ]--- Starting the application ( runscript.sh  ) ----------
System check
============
Freememory is 354
Cpu Speed is 1000
Sys Speed is 400
nubs has mouse mbuttons
Launching with moonlight stream 192.168.1.106 -app "Steam" -width 800 -height 480 -fps 30 -bitrate 2000
INFO: Available renderers:
INFO:
INFO: opengl
INFO: opengles2
INFO: opengles
INFO: software
INFO:
INFO: Vendor     : Imagination Technologies
INFO: Renderer   : PowerVR SGX 530
INFO: Version    : OpenGL ES 2.0 build 1.10@2359475
INFO: Extensions : GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_vertex_half_float GL_OES_texture_float GL_OES_texture_half_float GL_OES_element_index_uint GL_OES_mapbuffer GL_OES_fragment_precision_high GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_required_internalformat GL_OES_depth_texture GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_standard_derivatives GL_OES_vertex_array_object GL_OES_egl_sync GL_EXT_discard_framebuffer GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture GL_EXT_shader_texture_lod GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_IMG_shader_binary GL_IMG_texture_compression_pvrtc GL_IMG_texture_stream2 GL_IMG_texture_npot GL_IMG_texture_format_BGRA8888 GL_IMG_read_format GL_IMG_program_binary GL_IMG_uniform_buffer_object GL_IMG_multisampled_render_to_texture
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...Decode failed - Invalid data found when processing input
Decode failed - Invalid data found when processing input
done
Starting input stream...done
Discarding RTP packet queued for too long
Network dropped middle of a frame
Invalidate reference frame request sent
Decode failed - Invalid data found when processing input
Decode failed - Invalid data found when processing input
Discarding RTP packet queued for too long
Network dropped end of a frame
Invalidate reference frame request sent
Decode failed - Invalid data found when processing input
Decode failed - Invalid data found when processing input
Discarding RTP packet queued for too long
Network dropped an entire frame
Discarding RTP packet queued for too long
Received OOS audio data (expected 8653, but got 8660)
Discarding RTP packet queued for too long
Received OOS audio data (expected 8673, but got 8675)
Invalidate reference frame request sent
Discarding RTP packet queued for too long
Received OOS audio data (expected 11219, but got 11221)
Discarding RTP packet queued for too long
Network dropped middle of a frame
Invalidate reference frame request sent
Network dropped an entire frame
Invalidate reference frame request sent
Decode failed - Invalid data found when processing input
Decode failed - Invalid data found when processing input
Control stream received disconnect event
Loss Stats: Transaction failed: 11
./runscript.sh: line 236:  2750 Segmentation fault      moonlight stream $Remote -app "$APP" -width $WIDTH -height $HEIGHT -fps $FPS -bitrate $BITRATE
[SUCCESS]--- Starting the application ( runscript.sh  ) ----------
[ START ]--- Restoring the frame buffer status ----------
[SUCCESS]--- Restoring the frame buffer status ----------
[ START ]--- Restoring nub mode ----------
[SUCCESS]--- Restoring nub mode ----------
[ START ]--- uMount the PND ----------
[ START ]--- Waiting the Union to be available ----------
[SUCCESS]--- Waiting the Union to be available ----------
rmdir: failed to remove `/mnt/utmp/moonlight': Device or resource busy
[ START ]--- Waiting the PND mount dir to be free ----------
[SUCCESS]--- Waiting the PND mount dir to be free ----------
cleanup done
[SUCCESS]--- uMount the PND ----------
=======================================================================================
Return code is : 10
 
Well crap, I wanted to use this to play Stardew Valley, since that's a pretty simple game graphically, but Moonlight won't even work now. It just says "Error while getting App list, something is wrong...". There's nothing useful in the .out file either. Any advice?
 
I had the same problem as Silent-Hunter but I got Moonlight to work last night, the problem was in windows defender which I had to switch off for private networks. After I had done that it works great and cost me a couple of hours sleep last night. :D

I'm flabbergasted about the performance of this. Sure, "15 FPS only", artifacts and or frame drops start to appear at higher fps or video stream bit rates on Wi-Fi but it's very playable already. Even a match of Total War Shogun 2 or Battlefield 4 on Ultra settings are possible. I'll try a higher frame rate with an Ethernet adapter later on.
Tip: Adding and starting mstsc.exe as a game will just show the desktop of the remote windows system, enabling video and audio streaming from stuff like netflix and spotify too.
No need to tone down the resolution either, I can just stream a 2560x1440 resolution to my Pandora without any sweat, It just scales on the fly. Only readability suffers but setting the windows desktop resolution lower or icon and text scaling higher will solve that.

I'll try to make a youtube of this piece of magic later this morning showing the Pandora playing Steam Big Picture X86 games.

Who needs a Win when you have a Pandora.

Ha!

Awesome and very useful port!

Edit: I tried it with a wired network on my Pandora too but unfortunately it didn't improve the frame rate possibilities much. 15 fps with 2000 bit rate stream seems to be the smoothest possible without video artifacts. Still, I'm well impressed and my guess is the Pyra can only improve on this, maybe even enabling 60fps streams.

I'm so happy with this :D

Edit2: I forgot to mention the Wi-Fi performance was with a 3 euro 802.11n adapter. Internal Wi-Fi doesn't cut it.

@ptitSeb Are there more options available than the ones in the appdata folder? Like setting the mouse to the right nub for instance?
[doublepost=1515753304,1515743477][/doublepost][doublepost=1515756307][/doublepost]Sorry for the spammage :)

I made a picture of this
running.
The delay between PC and Pandora is 2 frames at 24fps

IMAG0910.jpg
 
Nice @Eight Bit
About the options (like nub reversing), I'll check (I'm at work and don't have access to my Pandora right now).
I'll try a fresh recompile also of Moonlight, maybe that will help a bit.
From what I remember of my performances testing, the limiting factor was the Decoding of the Video Frame (using FFMPEG, with NEON enabled). The upload of the frame to GL Texture used Texture Streaming Extension and was quite fast, and so was the display of the frame.
 
Moonlight is a big reason why I bought an Nvidia card. Your porting efforts are really appreciated. ;)

I don't have a Pandora but I hope that the performance and wifi of the Pyra will be enough to allow 720p60 moonlight gaming.
 
So, I spent most of my Saturday on this.
Moonlight is now up-to-date with upstream, and the launch dialog is now improved.
Nubs are configurable in the launch dialog, and the Stream Texture is also an option.
Note that if Streaming Texture fail to initialize (it can happens with multiple launch when using 4.10 driver on Gigaherz model), moonlight will fall back to non-streaming texture mode silently (well, almost silently, you'll need to look in /tmp/pndrun_moonlight.out to see the error in the Texture creation).


Build 04
-----------

  • Switched to upstream Moonlight-embeded
  • Using latest sources
  • Revamped gtkdialog to add a more options
  • Nubs are now configuration in the dialog
  • Streaming Texture is now optional
 
Back
Top