[GAMES] NVIDIA Game Streaming with ODROID

Moderators: meveric, mdrjr, odroid

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby HateB » Thu Jul 27, 2017 1:59 am

Icy wrote:Thanks for the quick reply HateB

So you're suggesting I start again with Debian Stretch? Or is there a way of resolving the problem with meveric's Jessie image as a base?
Happy to work with newer version, but may need a hand with the extra steps you mention as I am quite new to all this :D
Unless meveric's WIP Stretch image is a good start? - viewtopic.php?f=138&t=27449


I suppose it was a good time for me to take a step towards Stretch since my Moonlight was totally broken somehow. :D There are no problems, people have said, and I can agree but hear that I have very little experience with it now. I had to run manually installed Setup-odroid because there was a problem with missing files probably. I have fbturbo and all the files that are required to be installed here: https://github.com/irtimmer/moonlight-embedded/wiki/Compilation. And please, don't forget aml-libs-odroid:http://fuzon.co.uk/meveric/pool/main/a/aml-libs-odroid/. Please don't hesitate to ask more help.

A little bit more testing. I tried with RJ45 connection but it wasn't smooth enough. I have modem with 100mb switches but I suppose it should be enough. 1080p 60fps 15000kbps settings and it was more or less laggy. 720p with 10k kbps and it was fine but totally not good enough to be used daily instead of sitting in front of PC. Wireless 2,4 GHz is awful, it works but frames are missed a lot to be able to play any intensive. Note that on my phone moonlight.apk works great.

Edit: I just tested again with my phone at the same location as my Odroid. 1080p@60fps, 20 Mbps, H265 and DiRT Rally was very close to playble condition. :o Should I try android(6.0.1? or which build?) or what is still making it working bad?
HateB
 
Posts: 20
Joined: Tue Nov 29, 2016 12:51 am
Location: Finland
languages_spoken: English
ODROIDs: Odroid C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby Icy » Sat Jul 29, 2017 12:55 pm

Just a quick update - I managed to persevere and compile the latest Moonlight on the Jessie image and successfully stream some games with reasonable performance results. Thanks again HateB - good luck with your Android endeavors.
I've had no luck getting my Xbox One controller working with xboxdrv (with USB). Is this even possible? I understand Xbox 360 controller is more successful.
Icy
 
Posts: 3
Joined: Thu Jul 27, 2017 12:24 am
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby HateB » Tue Aug 08, 2017 3:09 am

I did some testing on Android 6.0.1(v3.4). Clean image on a rather slow microSD card(class 4). Android ran fine and I installed Moonlight for rooted devices. I tried on 720p@60fps, 10 Mbps, H265(and H264). The game I tested on Linux was still unplayable on Android at least wirelessly. I suppose it was working just a little bit better. I could try wired connection some day. Anyways, how are games running on your system? I thought it was cool app to avoid using 10 meter HDMI/RJ45 cables but there's something wrong since RJ45 cable ain't stable enough.
HateB
 
Posts: 20
Joined: Tue Nov 29, 2016 12:51 am
Location: Finland
languages_spoken: English
ODROIDs: Odroid C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Tue Aug 08, 2017 4:09 am

Last time I actively used it on the C2 I was playing in 1080p@60Hz 25Mbit H264, and it was working beautifully.
But a lot changed since then and I'm not even sure if it's still working.
On the XU4 I could run it on Kernel 4.9 in 1080p@30 FPS with hardware decoder, 60 FPS had some speed issues every now and then.
But on Kernel 3.10 software decoding was also working in 1080p@60 FPS.
But as said earlier, that's all quite some while in the past.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby HateB » Tue Aug 08, 2017 1:09 pm

meveric wrote:Last time I actively used it on the C2 I was playing in 1080p@60Hz 25Mbit H264, and it was working beautifully.
But a lot changed since then and I'm not even sure if it's still working.
On the XU4 I could run it on Kernel 4.9 in 1080p@30 FPS with hardware decoder, 60 FPS had some speed issues every now and then.
But on Kernel 3.10 software decoding was also working in 1080p@60 FPS.
But as said earlier, that's all quite some while in the past.
Could it be possible that you found the microSD card or backup and upload it somewhere without updating any packages in the image? Of course not in case the image is full of personal stuff.


Edit. Just another thought; Could Ubuntu or some other image make any difference?
HateB
 
Posts: 20
Joined: Tue Nov 29, 2016 12:51 am
Location: Finland
languages_spoken: English
ODROIDs: Odroid C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Tue Aug 08, 2017 2:13 pm

HateB wrote:But as said earlier, that's all quite some while in the past.
Could it be possible that you found the microSD card or backup and upload it somewhere without updating any packages in the image? Of course not in case the image is full of personal stuff.[/quote]
Since I provide .deb packages for moonlight it's the easiest to just take them instead. But as I said, they are older and outdated and don't work with the latest version of GFE.

HateB wrote:Edit. Just another thought; Could Ubuntu or some other image make any difference?

depending on how these images are configured maybe, but I kinda doubt it since it's using the video layer on the C2 which is separate from the OS.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby HateB » Tue Aug 08, 2017 2:22 pm

meveric wrote:
HateB wrote:But as said earlier, that's all quite some while in the past.
Could it be possible that you found the microSD card or backup and upload it somewhere without updating any packages in the image? Of course not in case the image is full of personal stuff.
HateB wrote:Edit. Just another thought; Could Ubuntu or some other image make any difference?
depending on how these images are configured maybe, but I kinda doubt it since it's using the video layer on the C2 which is separate from the OS.


Okay, then I don't see any other solution than just wait and hope for magical "fix" for the problem. I should check the output Moonlight sends to terminal when I try next time if that could indicate something about the issue.
HateB
 
Posts: 20
Joined: Tue Nov 29, 2016 12:51 am
Location: Finland
languages_spoken: English
ODROIDs: Odroid C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Tue Aug 08, 2017 4:07 pm

Just tested moonlight on the ODROID C2 under Debian Stretch (nothing else can compile it at the moment, due to some stupid dependencies, on latest ffmpeg libraries).
Anyway... I made a very quick test just a minute or so... I couldn't run it as normal user, but could run it as root.
Sound was working fine for a few seconds, then I heard crackling, then nothing.
Game itself was running full speed, but I only left the default values, not sure if they are 720p or 1080p at the moment.

I might look into it later when I have more time.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Tue Sep 12, 2017 10:55 pm

meveric wrote:Just tested moonlight on the ODROID C2 under Debian Stretch

Hello Meveric,
would you mind telling me the steps you took to get there?
I took this stretch-image:
https://github.com/Fourdee/DietPi/issues/1032#issuecomment-312318867
and cloned this git:
https://github.com/irtimmer/moonlight-embedded
and apt-get'et make and cmake, but i get the error
Code: Select all
No CMAKE_C_COMPILER could be found

and google only has solutions conserning this error on windows that i can't implement in our environment..

Any help would be much appreciated
cheers,
Daniel
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Tue Sep 12, 2017 11:33 pm

it seems you're missing all compilers, you should try installing build-essential first to have C Compiler installed.
moonlight is not that hard to compile.

cmake should complain about anything it's missing.
You can also check their wiki on what you need to compile the code: https://github.com/irtimmer/moonlight-e ... ompilation
You can skip on the packages that have raspberrypi in it's name since they are obvious not for us.

For ODROID C2 you'll also need my package aml-libs-odroid installed to compile with hardware decoder support.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Wed Sep 13, 2017 5:30 am

Hey Meveric,
thanks for your fast answer. You were right, build-essential seems to have been a big step.
Of all the (non-rpi)dependencies on the moonlight compilation page "libudev0" is the only one that can't be located by apt-get. aml-libs are also installed.
Now when i cmake i get:
Code: Select all
root@DietPi:/home/dietpi/moonlight-embedded/build# cmake ../
-- 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)
-- Checking for module 'vdpau'
--   No package 'vdpau' found
-- Checking for module 'libcec>=4'
--
-- Checking for module 'egl'
--   No package 'egl' found
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
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/dietpi/moonlight-embedded

and for a make after that:
Code: Select all
make[2]: *** No rule to make target 'libgamestream/CMakeFiles/moonlight-common.dir/build'.  Stop.
CMakeFiles/Makefile2:183: 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

I'm probably missing something obvious. Rather new-ish to the whole thing ;-)
As far as i can find theres no easier way to get this to run on a os that could also run kodi, right?
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Wed Sep 13, 2017 5:55 am

gartensofa wrote:
Code: Select all
-- Checking for module 'egl'
--   No package 'egl' found

try installing libegl1-mesa-dev but afterwards you'll have to reinstall mali450-odroid again:
Code: Select all
apt-get install libegl1-mesa-dev
apt-get install --reinstall mali450-odroid


gartensofa wrote:
Code: Select all
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
CMake Error: CMake can not determine linker language for target: moonlight-common
CMake Error: Cannot determine link language for target "moonlight-common".

Seems you forgot to download the submodules for moonlight.
You can do this with:
Code: Select all
git submodule update --init --recursive

this should download moonlight-common.

gartensofa wrote:As far as i can find theres no easier way to get this to run on a os that could also run kodi, right?

Unless there's an OS that already has the packages, no.
Although I think it should be available on my Debian Stretch and Jessie images (and also DietPi).
I'm currently testing the new version 2.4.3 under Debian Stretch to see if it works.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Wed Sep 13, 2017 6:05 am

Yay, all new error messages. :-D Getting closer
Code: Select all
root@DietPi:/home/dietpi/moonlight-embedded/build# cmake ../
-- 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)
-- Checking for module 'vdpau'
--   No package 'vdpau' found
-- Checking for module 'libcec>=4'
--
-- Checking for module 'egl'
--   Found egl, version 13.0.6
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dietpi/moonlight-embedded


Code: Select all
root@DietPi:/home/dietpi/moonlight-embedded/build# make
make[2]: *** No rule to make target 'libgamestream/CMakeFiles/moonlight-common.dir/build'.  Stop.
CMakeFiles/Makefile2:183: 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


Yes, i bieleve i tried the jessie one, i only got a black screen using moonlight on that one..

Again, your help is very much appreciated

EDIT: disregarding all those errors, a "make install" is all green until:
Code: Select all
[ 62%] Building C object CMakeFiles/moonlight.dir/src/main.c.o
In file included from /home/dietpi/moonlight-embedded/src/main.c:25:0:
/home/dietpi/moonlight-embedded/src/sdl.h:22:17: fatal error: SDL.h: No such file or directory
 #include <SDL.h>
                 ^
compilation terminated.
CMakeFiles/moonlight.dir/build.make:134: recipe for target 'CMakeFiles/moonlight.dir/src/main.c.o' failed
make[2]: *** [CMakeFiles/moonlight.dir/src/main.c.o] Error 1
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/moonlight.dir/all' failed
make[1]: *** [CMakeFiles/moonlight.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Wed Sep 13, 2017 6:36 am

ok, I tried currently and got it to work under Debian Stretch, although it has some minor issues and it seems to require new permissions.
Not sure if it will work under Debian Jessie at the moment. I encountered some issues under Debian Stretch first as well like described in this bug report: https://github.com/irtimmer/moonlight-e ... issues/555
I got it to work eventually by using libssl-dev which is version 1.1 rather than version 1.0.2.
And Debian Jessie only has 1.0.2 so it might not work at all under Debian Jessie. I'll give i a try anyway.
I had some other issues with flickering graphics though, not sure if that's related though or another issue.
I'll upload moonlight for ODROID C2 Debian Stretch in a moment, and will try to get Debian Jessie to work, although I'm not sure it will work.

The error above missing SDL.h means you need to install libsdl2-dev make sure you do the cmake again, as it needs to find where the SDL2 is located.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Thu Sep 14, 2017 5:53 am

The error above missing SDL.h means you need to install libsdl2-dev

Yes, that made it work!
Now i can pair and stream, but ONLY with the -4k flag, which makes it a bit sluggish..
On any other resolution and fps or bitrate i only get the initial state of the host display, but it's not refreshing.

Output is:
Code: Select all
No mapping available for cec_input (100000008e1b0000ec0c000001000000) on /dev/input/event0
No mapping available for vt-input (19000000b41600000107000001000000) on /dev/input/event1
shared memfd open() failed: Function not implemented


after that everything gets "...done" and then a lot of "Alsa error from writei: -32"
Any idea on that?
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Thu Sep 14, 2017 7:07 am

I had a similar result... as root from terminal do a chmod 666 /dev/am* this should allow the normal user to run 1080p and other frame rates as well. It worked for me at least.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Fri Sep 15, 2017 3:04 am

The chmod sadly does not work for me..
Would you mind telling me what system image you used?
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Fri Sep 15, 2017 3:12 am

My Debian Stretch image for ODROID C2. -> viewtopic.php?f=138&t=27449
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby gartensofa » Fri Sep 15, 2017 5:33 am

YES! Your image as base did the trick.
Everything runs very smooth now. Even sound over s/pdif shield is stable.
(Although with the controller plugged in the PC, i read that makes it better.)
Anyway, thanks again and have a beer on me :)
Cheers!
gartensofa
 
Posts: 6
Joined: Sun Sep 03, 2017 8:06 pm
languages_spoken: english
ODROIDs: c2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Fri Sep 15, 2017 6:06 am

Glad it's working for you :)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7947
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Mon Oct 30, 2017 9:51 pm

Hi,

Does someone got moonlight working with latest Hardkernel's Ubunto v2.4 image? I've compiled moonlight 2.4.3 from irtimmer and I only get a green screen with some artefacts.
I've tried all available distros (Ubunto, Strech, Jessie, Libreelec) and I can't find one that is able to run kodi, hyperion.ng and moonlight :'(

Thank you in advance
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Tue Oct 31, 2017 2:23 am

danielfmo wrote:Hi,

Does someone got moonlight working with latest Hardkernel's Ubunto v2.4 image? I've compiled moonlight 2.4.3 from irtimmer and I only get a green screen with some artefacts.
I've tried all available distros (Ubunto, Strech, Jessie, Libreelec) and I can't find one that is able to run kodi, hyperion.ng and moonlight :'(

Thank you in advance


I've found that the source of the issue was setting the value of /sys/module/amvdec_h265/parameters/double_write_mode to other than 1 breaks moonlight.

I was using 3 as described HERE
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby crashoverride » Tue Oct 31, 2017 5:55 am

danielfmo wrote:I was using 3 as described HERE

https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/drivers/amlogic/amports/vh265.c#L118-L121
Code: Select all
/* DOUBLE_WRITE_MODE is enabled only when NV21 8 bit output is needed */
/* double_write_mode: 0, no double write; 1, 1:1 ratio; 2, (1/4):(1/4) ratio
   0x10, double write only
*/


The value 3 is not valid. The value of 1 is what I used in testing. The subject of lag is described in this thread. Setting "freerun" mode (search this thread) will produce the least amount of video lag.
crashoverride
 
Posts: 3112
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Tue Oct 31, 2017 3:39 pm

crashoverride wrote:
danielfmo wrote:I was using 3 as described HERE

https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/drivers/amlogic/amports/vh265.c#L118-L121
Code: Select all
/* DOUBLE_WRITE_MODE is enabled only when NV21 8 bit output is needed */
/* double_write_mode: 0, no double write; 1, 1:1 ratio; 2, (1/4):(1/4) ratio
   0x10, double write only
*/


The value 3 is not valid. The value of 1 is what I used in testing. The subject of lag is described in this thread. Setting "freerun" mode (search this thread) will produce the least amount of video lag.


Thank you @crashoverride, once more :)

But I'm a bit lost here, searching for keyword "freerun" don't return any result in this thread other then this same post.
When I search in the entire forum (or google) the results are to random for me to be able to understand how to set the "freerun" mode.

Can you please give some more pointers?

Thank you in advance,
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby crashoverride » Tue Oct 31, 2017 6:59 pm

The original post is here:
viewtopic.php?f=91&t=15456&start=200#p175051

The codec now displays a frame as soon as its available rather than using its internal timing. This should reduce video lag at the expense of video "judder". It should be comparable to other systems such as the RPi that did not use internal timing to smooth out video frames.


Code: Select all
cat /sys/class/video/freerun_mode

It should be "0" before and after a clean exit. During operation, it should be "1".


TL;DR =
Code: Select all
echo 1 | sudo tee /sys/class/video/freerun_mode

Don't forget to set it back to 0 afterwards or other video apps like Kodi may not work properly.
crashoverride
 
Posts: 3112
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Wed Nov 01, 2017 4:49 am

crashoverride wrote:The original post is here:
viewtopic.php?f=91&t=15456&start=200#p175051

The codec now displays a frame as soon as its available rather than using its internal timing. This should reduce video lag at the expense of video "judder". It should be comparable to other systems such as the RPi that did not use internal timing to smooth out video frames.


Code: Select all
cat /sys/class/video/freerun_mode

It should be "0" before and after a clean exit. During operation, it should be "1".


TL;DR =
Code: Select all
echo 1 | sudo tee /sys/class/video/freerun_mode

Don't forget to set it back to 0 afterwards or other video apps like Kodi may not work properly.


Thank you,

I've noticed that:
- after boot (starting kodi or not) freerun_mode is not set;
- stop kodi and during moonlight streamimng freerun_mode is automatically set to 1
- stop moonlight and start kodi freerun_mode is kept at 1
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Wed Nov 01, 2017 5:19 am

I need your help for one more thing,

I'm currently using Hardkernel's Ubuntu v2.4 and moonlight works out of the box after compiling it and addin the bellow commands to rc.local:
Code: Select all
chmod 666 /dev/amstream_hevc
chmod 666 /dev/amvideo
echo 16 | tee /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin


Though I want also to use kodi and hyperion.ng.
In order to make the latter work I need to compile the kernel with bellow parameters (as described HERE):
Code: Select all
CONFIG_AM_VIDEOCAPTURE=y
CONFIG_CMA_SIZE_MBYTES=16
MAX_ZONEORDER=14


After compiling the kernel with those configs, moonlight does not work anymore with h265, just freezes at first frame.

moonlight stream -1080 -fps 60 -codec h265 -app "Desktop" xxx.xxx.xxx.xxx
Code: Select all
Connect to xxx.xxx.xxx.xxx...
No mapping available for meson-ir (19000000000000000000000000000000) on /dev/input/event4
No mapping available for Logitech USB Keyboard (030000006d0400001dc3000010010000) on /dev/input/event3
No mapping available for cec_input (100000008e1b0000ec0c000001000000) on /dev/input/event0
No mapping available for vt-input (19000000b41600000107000001000000) on /dev/input/event1
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...OPEN es hevc
codec_init amstream version : 2.0
done
Starting audio stream...done
Starting input stream...done
Returning RTP packet queued for too long
Received OOS audio data (expected 12722, but got 12723)
codec_write error: ffffffff
[codec_close_cntl]video codec close return=0!
OPEN es hevc
[codec_reset:1211]ret=0
Requesting IDR frame on behalf of DR
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
Waiting for IDR frame
IDR frame request sent
Waiting for IDR frame
Waiting for IDR frame


dsmeg with h265 (NOT working):
Code: Select all
[Oct31 13:57] tv_vout: vout [tv_set_vframe_rate_end_hint] return mode = 67, policy = 1!
[  +0.000130] codec:free_alloced_keep_buffer           (null).          (null).          (null)
[  +0.000006] codec:keep exit is di
[  +0.000005] codec:video first pts = 0
[  +0.000013] di_uninit_buf keep cur di_buf 4 (0 1 -1)
[  +0.000013] switch_vpu_mem_pd: di_pre OFF
[  +0.000004] codec:vdec_clock_set-----0
[  +0.000005] codec:vdec1_set_clk 2, 2
[  +0.000019] codec:vdec_clock_set 2 to 200
[  +0.000009] codec:vdec1 video changed to 0 x 0 0 fps clk->200MHZ
[  +1.664129] switch_vpu_mem_pd: viu_vd1 OFF
[  +0.000015] switch_vpu_mem_pd: afbc_dec OFF
[  +0.000004] switch_vpu_mem_pd: di_post OFF
[  +3.343486] aiu i2s playback disable
[  +0.000015] audio_hw_958_enable 0
[  +1.889686] [aml-i2s-dai]i2s dma ffffff80004eb000,phy addr 1545076736,mode 0,ch 2
[  +0.000012] ----aml_hw_iec958_init,runtime->rate=48000,sample_rate=4--
[  +0.000004] aml_set_spdif_clk rate
[  +0.000012] divider=20,frac=33920000,SDMval=5654
[  +0.000012] set normal 512 fs /4 fs
[  +0.000006] iec958 mode PCM16
[  +0.000007] IEC958 16bit
[  +0.000006] hdmitx: audio: aout notify rate 48000
[  +0.000004] hdmitx: audio: aout notify size 16
[  +0.000004] 958 with i2s
[  +0.000104] [aml-i2s-dai]i2s dma ffffff80004eb000,phy addr 1545076736,mode 0,ch 2
[  +0.000005] ----aml_hw_iec958_init,runtime->rate=48000,sample_rate=4--
[  +0.000003] aml_set_spdif_clk rate
[  +0.000006] divider=20,frac=33920000,SDMval=5654
[  +0.000006] set normal 512 fs /4 fs
[  +0.000004] iec958 mode PCM16
[  +0.000006] IEC958 16bit
[  +0.000004] hdmitx: audio: aout notify rate 48000
[  +0.000003] hdmitx: audio: aout notify size 16
[  +0.000003] 958 with i2s
[  +0.000306] aiu i2s playback enable
[  +0.000014] audio_hw_958_enable 1
[  +0.157907] codec:hevc_clock_set-----2
[  +0.000019] codec:hevc_set_clk 0, 1
[  +0.000170] codec:HEVC stbuf alloced at 0000000060700000, size = 15728640
[  +0.000008] codec:vdec_dev_reg.mem[0x0 -- 0x0]
[  +0.000005] codec:vdec base memory alloced 0000000061600000
[  +0.000156] codec:h265: ver (201510011,0) decinfo: 1920x1080 rate=1600
[  +0.000068] codec:loading firmware vh265_mc to vdec ram  ok!
[  +0.000877] tv_vout: vout [tv_set_vframe_rate_hint] duration = 1600, policy = 1!
[  +0.000009] tv_vout: not in valid HDMI mode!
[  +0.000016] codec:vdec_clock_set-----630
[  +0.002268] codec:hevc_clock_set-----333
[  +0.000019] codec:gp_pll_user_cb_vdec call
[  +0.000004] codec:hevc_set_clk 1, 2
[  +0.000008] codec:hevc video changed to 1920 x 1080 60 fps clk->333MHZ
[  +0.001038] codec:vdec_clock_set 2 to 648
[  +0.000002] codec:gp_pll_user_cb_vdec call set
[  +0.000012] codec:vdec1 video changed to 4096 x 2048 30 fps clk->648MHZ
[  +0.000504] codec:video first pts = 0
[  +0.272535] codec:set pic_list_init_flag 1
[  +0.010305] codec:allocate cma buffer[0] (1552,1545338880,1545338880)
[  +0.001351] codec:allocate cma buffer[1] (1552,1551695872,1551695872)
[  +0.003510] codec:allocate cma buffer[2] (1552,1558052864,1558052864)
[  +0.002010] codec:allocate cma buffer[3] (1552,1564409856,1564409856)
[  +0.000019] codec_mm:not enough mem for codec_265 size 6356992
[  +0.000004] codec:alloc cma buffer[4] fail
[  +0.000505] codec:init_decode_head_hw: (1920, 1088) body_size 0x2fd000 header_size 0x1fe0
[  +0.000004] codec:init_buf_spec2 1920 1088
[  +0.000004] codec:set pic_list_init_flag to 2
[  +0.000008] codec:set pic_list_init_flag to 3
[  +0.008640] switch_vpu_mem_pd: di_pre ON
[  +0.009675] pre_de_buf_config: source change: 0x0/0/0/0=>0x9000/1920/1080/0
[  +0.025408] switch_vpu_mem_pd: viu_vd1 ON
[  +0.000016] switch_vpu_mem_pd: afbc_dec ON
[  +0.000005] switch_vpu_mem_pd: di_post ON
[  +0.000012] recycle_keep_buffer recycle keep cur di_buf 4 (
[  +0.000005]  0
[  +0.000004]  1
[  +0.000002] )



dsmeg with h264 (working):
Code: Select all
[Oct31 13:56] [aml-i2s-dai]i2s dma ffffff80004eb000,phy addr 1545076736,mode 0,ch 2
[  +0.000012] ----aml_hw_iec958_init,runtime->rate=48000,sample_rate=4--
[  +0.000004] aml_set_spdif_clk rate
[  +0.000012] divider=20,frac=33920000,SDMval=5654
[  +0.000013] set normal 512 fs /4 fs
[  +0.000006] iec958 mode PCM16
[  +0.000007] IEC958 16bit
[  +0.000006] hdmitx: audio: aout notify rate 48000
[  +0.000004] hdmitx: audio: aout notify size 16
[  +0.000004] 958 with i2s
[  +0.000091] [aml-i2s-dai]i2s dma ffffff80004eb000,phy addr 1545076736,mode 0,ch 2
[  +0.000004] ----aml_hw_iec958_init,runtime->rate=48000,sample_rate=4--
[  +0.000004] aml_set_spdif_clk rate
[  +0.000005] divider=20,frac=33920000,SDMval=5654
[  +0.000006] set normal 512 fs /4 fs
[  +0.000004] iec958 mode PCM16
[  +0.000005] IEC958 16bit
[  +0.000005] hdmitx: audio: aout notify rate 48000
[  +0.000003] hdmitx: audio: aout notify size 16
[  +0.000003] 958 with i2s
[  +0.000298] aiu i2s playback enable
[  +0.000015] audio_hw_958_enable 1
[  +0.162002] codec:vdec_clock_set-----2
[  +0.000014] codec:vdec1_set_clk 0, 1
[  +0.000006] codec:vdec_clock_set 2 to 500
[  +0.000167] codec:Video stbuf alloced at 0000000060700000, size = 15728640
[  +0.000016] codec:vdec_dev_reg.mem[0x0 -- 0x0]
[  +0.000005] codec:vdec base memory alloced 0000000061600000
[  +0.003245] codec:amvdec_h264 mem-addr=61600000,buff_offset=60600000,buf_start=6173e000
[  +0.000014] codec:H264 sysinfo: 1920x1080 duration=1600, pts_outside=0,
[  +0.000004] codec:sync_outside=1, use_idr_framerate=0
[  +0.000368] codec:264 ucode swap area: phyaddr 000000005c068000, cpu vaddr ffffff8009f82000
[  +0.000006] codec:start load orignal firmware ...
[  +0.000065] codec:loading firmware vh264_mc to vdec ram  ok!
[  +0.000297] tv_vout: vout [tv_set_vframe_rate_hint] duration = 1600, policy = 1!
[  +0.000006] tv_vout: not in valid HDMI mode!
[  +0.000442] codec:video first pts = 0
[  +0.003731] codec:vdec_clock_set-----600
[  +0.000217] codec:gp_pll_user_cb_vdec call
[  +0.001040] codec:vdec_clock_set 2 to 648
[  +0.000001] codec:gp_pll_user_cb_vdec call set
[  +0.000008] codec:vdec1 video changed to 1920 x 1080 60 fps clk->648MHZ
[  +0.268611] codec:frame_mbs_only_flag 1, crop_bottom 4,  frame_height 1080,
[  +0.000011] codec:mb_height 68,crop_right 0, frame_width 1920, mb_width 68
[  +0.030094] switch_vpu_mem_pd: di_pre ON
[  +0.010150] pre_de_buf_config: source change: 0x0/0/0/0=>0x9000/1920/1080/0
[  +0.015901] codec:video first pts = 5dc
[  +0.000031] switch_vpu_mem_pd: viu_vd1 ON
[  +0.000005] switch_vpu_mem_pd: afbc_dec ON
[  +0.000005] switch_vpu_mem_pd: di_post ON
[  +0.016744] recycle_keep_buffer recycle keep cur di_buf 2 (
[  +0.000010]  4
[  +0.000007]  5
[  +0.000002] )


Any hints?

Thank you in advance
Last edited by danielfmo on Thu Nov 02, 2017 1:59 am, edited 1 time in total.
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby crashoverride » Wed Nov 01, 2017 6:25 am

danielfmo wrote:[ +0.000019] codec_mm:not enough mem for codec_265 size 6356992
[ +0.000004] codec:alloc cma buffer[4] fail

The dmesg log states there is not enough CMA memory available. Try increasing your "CONFIG_CMA_SIZE_MBYTES" setting until it works again.
crashoverride
 
Posts: 3112
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby danielfmo » Fri Nov 03, 2017 1:23 am

crashoverride wrote:
danielfmo wrote:[ +0.000019] codec_mm:not enough mem for codec_265 size 6356992
[ +0.000004] codec:alloc cma buffer[4] fail

The dmesg log states there is not enough CMA memory available. Try increasing your "CONFIG_CMA_SIZE_MBYTES" setting until it works again.


Thank you

Setting it to 32 did the trick
danielfmo
 
Posts: 54
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Previous

Return to Games and Emulators

Who is online

Users browsing this forum: No registered users and 2 guests