[GAMES] NVIDIA Game Streaming with ODROID

Moderators: mdrjr, odroid, meveric

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: 8890
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: 8890
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: 8890
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: 8890
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: 8890
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: 8890
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: 8890
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: 8890
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: 8890
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: 59
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: 59
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: 3709
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: 59
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: 3709
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: 59
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: 59
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: 3709
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: 59
Joined: Tue Mar 28, 2017 6:35 pm
languages_spoken: english
ODROIDs: ODROID-C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Fri Dec 29, 2017 3:29 am

Hi all

I pushed some changes to the SDL2 version of Moonlight for XU3/4/4Q, U2, U3, X2 boards, it was completely outdated and didn't work anymore, now it's doing fine again and i also did an update on the first post

RG
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Fri Dec 29, 2017 7:11 am

New packages for Debian will be available soon, I'm just gonna have to update the starter again to adjust the changes in the command line arguments with the new moonlight version.
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: 8890
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 substring » Sat Dec 30, 2017 7:19 am

AreaScout wrote:Hi all

I pushed some changes to the SDL2 version of Moonlight for XU3/4/4Q, U2, U3, X2 boards, it was completely outdated and didn't work anymore, now it's doing fine again and i also did an update on the first post

RG

Did you just say XU4 ?
substring
 
Posts: 51
Joined: Fri Jun 23, 2017 5:28 am
languages_spoken: english, french
ODROIDs: C2, XU4

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Sat Dec 30, 2017 8:00 am

Yep works on XU4 quite well up to 1080p@60 I played, using software decoding from ffmpeg combined with SDL2 and GLESv2.
Works slightly better on Kernel 4.14 than 3.10.
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: 8890
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 memeka » Sat Dec 30, 2017 8:24 am

meveric wrote:Yep works on XU4 quite well up to 1080p@60 I played, using software decoding from ffmpeg combined with SDL2 and GLESv2.
Works slightly better on Kernel 4.14 than 3.10.


why not hardware decoding?
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Sat Dec 30, 2017 6:02 pm

memeka wrote:
meveric wrote:Yep works on XU4 quite well up to 1080p@60 I played, using software decoding from ffmpeg combined with SDL2 and GLESv2.
Works slightly better on Kernel 4.14 than 3.10.


why not hardware decoding?


Look memeka, we have already moonlight using HW decoding, crashoverride has done it back in May i think and we did a looot of testing, at this time MFC had a problem, the texture stream did slow down extremely and due to that it was
unplayable at 1080p60, this was on kernel 4.9, know we are on 4.14 and this has to be tested again, i did some short tests already, but that was way to less to make a clear statement and we also have v4l2_m2m now, that has also to be tested.

so, a lot of new stuff to test and hopefully we get it upstream

https://github.com/OtherCrashOverride/m ... erride.git

and

viewtopic.php?f=146&t=27084

RG and happy new year
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby memeka » Sat Dec 30, 2017 9:52 pm

There is a big change in MFC in 4.14 where the buffers are cacheable and 1080p content should be 2xfaster now (vs the 4.9 that you tested).
And with v4l2m2m now in ffmpeg, you don’t need separate decoder code now for odroids.
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Sun Dec 31, 2017 1:50 am

memeka wrote:There is a big change in MFC in 4.14 where the buffers are cacheable and 1080p content should be 2xfaster now (vs the 4.9 that you tested).
And with v4l2m2m now in ffmpeg, you don’t need separate decoder code now for odroids.


i am sceptical about this, but i we will see in the new year 8-)

RG
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby memeka » Sun Dec 31, 2017 5:56 am

AreaScout wrote:
memeka wrote:There is a big change in MFC in 4.14 where the buffers are cacheable and 1080p content should be 2xfaster now (vs the 4.9 that you tested).
And with v4l2m2m now in ffmpeg, you don’t need separate decoder code now for odroids.


i am sceptical about this, but i we will see in the new year 8-)

RG

which part are you skeptical about? :)
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Mon Jan 01, 2018 7:24 pm

Ha ! My fist post in the new year :)

i am skeptical about the '2xfaster now', back in may it was already 'fast' maybe you mean compared with kernel 3.10 ?

Oh ! and what does that buffer patch, from 20 to 16 ?

RG
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby memeka » Mon Jan 01, 2018 7:45 pm

AreaScout wrote:Ha ! My fist post in the new year :)

i am skeptical about the '2xfaster now', back in may it was already 'fast' maybe you mean compared with kernel 3.10 ?

Oh ! and what does that buffer patch, from 20 to 16 ?

RG


on kernel 4.9, you could not watch 1080p video because in the absence of dmabuf, memcpy makes video very slow. with 2MB/frame (frame size on 1080p video), allocating 2MB x 60 times/s, you could reach at most 20fps.
kernel 4.14 was patched to allow CPU-cacheable DMA memory buffers, which means you don't reallocate memory as much. so now you can get up to 60fps with 1080p video. I could even play 24fps 4K video (although XU4 does not "oficially" support 4K).
this is why i say it's "2 x faster" - on 1080p. with smaller resolution, because buffers were smaller, memcpy was much faster.

that buffer patch in ffmpeg allows you to set the min DECODING buffers to 16. previously, the min # of buffers was 20. i did that to allow to use more buffers for ENCODING so that transcoding is possible.
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Mon Jan 01, 2018 8:10 pm

memeka wrote:on kernel 4.9, you could not watch 1080p video because in the absence of dmabuf, memcpy makes video very slow. with 2MB/frame (frame size on 1080p video), allocating 2MB x 60 times/s, you could reach at most 20fps.
kernel 4.14 was patched to allow CPU-cacheable DMA memory buffers, which means you don't reallocate memory as much. so now you can get up to 60fps with 1080p video. I could even play 24fps 4K video (although XU4 does not "oficially" support 4K).
this is why i say it's "2 x faster" - on 1080p. with smaller resolution, because buffers were smaller, memcpy was much faster.

that buffer patch in ffmpeg allows you to set the min DECODING buffers to 16. previously, the min # of buffers was 20. i did that to allow to use more buffers for ENCODING so that transcoding is possible.


ah ok, that makes the use of your buffer patch clear, but 1080p60 was also possible back in May with 4.9 but had some sporadic slow downs.

btw. what is the pixel output format from the v4l2m2m decoder ? still NV12 ? I only get Black and White picture :roll:
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby memeka » Mon Jan 01, 2018 8:33 pm

NV21
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby AreaScout » Mon Jan 01, 2018 9:27 pm

i am getting only green picture with nv21 and sdl2 :(
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Mon Jan 01, 2018 9:51 pm

ffmpeg hardware encoder with x11grab also produces unusable results with nv12 and nv21 one is red the other is green.. also the speed seems to be terrible slow.. 10 FPS.
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: 8890
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 AreaScout » Mon Jan 01, 2018 10:12 pm

ok and ffplay does a conversation from nv21 to yuv420p befor it sends to sdl2, this can't be done in moonlight other then losing CPU time to the cost of latency, why i can't pass nv21 directly to sdl2, sdl2 supports nv21 ... ??

Code: Select all
[auto_scaler_0 @ 0xa5704540] picking yuv420p out of 5 ref:nv21 alpha:0
[auto_scaler_0 @ 0xa5704540] w:1280 h:720 fmt:nv21 sar:1/1 -> w:1280 h:720 fmt:yuv420p sar:1/1 flags:0x4
[auto_scaler_0 @ 0xa5704540] w:1280 h:720 fmt:nv21 sar:0/1 -> w:1280 h:720 fmt:yuv420p sar:0/1 flags:0x4
Created 1280x720 texture with SDL_PIXELFORMAT_IYUV.
User avatar
AreaScout
 
Posts: 564
Joined: Sun Jul 07, 2013 3:05 am
languages_spoken: english, german
ODROIDs: X2, U3, XU3, C2, XU4Q

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby memeka » Mon Jan 01, 2018 10:18 pm

Gscaler can do zero copy conversion and scaling.
But there is no support for it in ffmpeg, only gstreamer
User avatar
memeka
 
Posts: 3962
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby Unstoppable » Thu Jan 25, 2018 8:11 am

Hello,

I'm quite new to Odroid, but I'm enjoying experimenting with it so far and I'm learning a lot in the process. Currently, I'm trying to get Moonlight working on the C2, but I'm running into a few issues that I can't seem to figure out. I was hoping you guys could help me.

Installing Moonlight is not a problem, but streaming with it is giving me difficulties. The stream usually, but not necessarily, starts out smooth. After some time (not more than a minute or two), the stream becomes.. not smooth. It seems like micro-stuttering or FPS drops. This effect will remain for some time as well, and then it becomes smooth again. And it keeps going on like this. This happens for every game I have tried (DMC4, Ori and the Blind Forest, Oddworld New 'n Tasty), so it isn't game specific.

Usually Moonlight is starting using the following command:
Code: Select all
moonlight stream -1080 -fps 60 -bitrate 20000 -platform aml -codec h265 MY_IP


I have tried many options however, such lowering the resolution, trying h264, increasing and decreasing packet size, different bitrates, etc. None of them work. When lowing to 30 FPS, it kind of feels the same as when the stream is not smooth at 60 FPS - but that makes sense I guess. I also tried different repositories for Moonlight, namely the upstream one (irtimmer) and the one by AreaScout. I also wanted to try the one made by crashoverride, but it is too outdated - causing it not to connect. Logging also indicates that it is actually using the VPU like it should. CPU usage is quite low during streaming, which should be evident of that as well.

Initially I tried to run Moonlight on Armbian, and after that I tried the latest C2 Debian Stretch image by meveric. Both have the problem described above. I'm going to try the official one soon as well, but I doubt it will have much effect. And I don't really like the official one, since it is constantly spamming me with USB disconnects while the other distro's do not. Not quite sure what that is about.

It should also be noted that I did execute the following commands before launching Moonlight:
Code: Select all
chmod 666 /dev/amstream_hevc
chmod 666 /dev/amvideo
echo 16 | tee /sys/module/amvdec_h265/parameters/dynamic_buf_num_margin


Additionally I made sure that freerun mode was enabled using:
Code: Select all
cat /sys/class/video/freerun_mode


Which returned 1 after launching, so that should be fine. Furthermore I ruled out my host PC or the network being the cause. I installed Moonlight Chrome on my laptop using the same ethernet cable as my C2 uses (Gigabit network, iperf gives almost full speed between host and C2 btw) and it worked like a charm. No slowdowns at all. So I doubt it is related to either the host PC or my network setup. I also tried re-installing GFE and the latest display driver, modifying my graphics settings according to this thread on the Nvidia forum: https://forums.geforce.com/default/topi ... oonlight-/ and switch between NVFBC and NVIFR using the script from here: https://steamcommunity.com/groups/homes ... 626704042/, but none of these things helped at all.

Here are the specs for my host PC: i7 6700k@4.5GHz, GTX1070, 16GB ram and running the latest Windows 10, GFE and graphic drivers.
The C2 only has a keyboard, bluetooth dongle (removing it doesn't affect the problem) and HDMI connected. It is powered by a 5V/2A adapter. And I removed the jumper, which apparently should decrease power consumption - should that be a problem.

That wraps up all the things I've tried. I have looked everywhere and tried all the things I could come up with, but nothing helped. If anyone has an idea or a suggestion of what more I could try, I would be very grateful :) I'll try to add some Moonlight logs too, if that helps.
Unstoppable
 
Posts: 8
Joined: Thu Jan 25, 2018 7:06 am
languages_spoken: english,dutch
ODROIDs: XU4, C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Thu Jan 25, 2018 3:59 pm

have you tried without the "-bitrate 20000" ? In the latest version I had issues if I defined the bitrate.
Also try to start moonlight remotely over ssh:
Code: Select all
DISPLAY=:0 moonlight stream -1080 -fps 60 -platform aml -codec h265 MY_IP

If you run it remotely from another PC you can check the console output especially at the time when it starts to studder and see if there's anything it complains about at that time.

You might even want to try H264 and see if it works differently.
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: 8890
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 Unstoppable » Sat Jan 27, 2018 10:48 pm

meveric wrote:have you tried without the "-bitrate 20000" ? In the latest version I had issues if I defined the bitrate.
Also try to start moonlight remotely over ssh:
Code: Select all
DISPLAY=:0 moonlight stream -1080 -fps 60 -platform aml -codec h265 MY_IP

If you run it remotely from another PC you can check the console output especially at the time when it starts to studder and see if there's anything it complains about at that time.

You might even want to try H264 and see if it works differently.


Thank you for your reply. I have already tried it without the bitrate parameter & with the h264 codec, but I did it again just now to be sure. Sadly, it doesn't seem to make any difference.
I also tried running over SSH and that helped a little. Almost instantly after launching, the console fills up with messages related to audio and rtp packets. I'm currently using your Debian Stretch image BTW, using the root account. I'll try it in a bit with a normal user & see what results that will provide.

I tried running Moonlight with the following command:
Code: Select all
DISPLAY=:0 moonlight stream -1080 -fps 60 -platform aml -codec h264 MY_IP


The following errors always show up at the beginning:
Code: Select all
xcb_connection_has_errors() returned true
shared memfd open() failed: function not implemented


This always results in the following messages being shown (spammed at high rate):
Code: Select all
received oos audio data (expected 38242, but got 38253)
alsa error from writei: -32
returning rtp packet queued for too long


Then I added the -localaudio option to the commandline, and noticed something interesting. After a refresh reboot, it will give the following output:
Code: Select all
returning rtp packet after queue overgrowth
alsa shortm write, write 16 frames
alsa error from writei: -11
alsa shortm write, write 224 frames
alsa shortm write, write 208 frames


After closing the game and starting the stream again, the output changes to:
Code: Select all
received oos audio data (expected 38242, but got 38253)
alsa error from writei: -32
returning rtp packet queued for too long

Same as when running without the localaudio option.

After restarting the C2 again, it gives these errors again:
Code: Select all
returning rtp packet after queue overgrowth
alsa shortm write, write 16 frames
alsa error from writei: -11
alsa shortm write, write 224 frames
alsa shortm write, write 208 frames


So apparently something is wrong with audio. When the errors are showing, audio sounds very.. crackling. I tried installing pulseaudio, but that didn't make any difference. I suppose that the package compiled on your repository is without pulseaudio support? When I built my own version with pulseaudio support on Armbian, the alsa errors/messages didn't show up anymore. And somehow it doesn't make sense to me that audio issues could cause video stuttering?

So maybe it is related to the "returning rtp packet queued for too long" and "returning rtp packet after queue overgrowth" messages? Could it be related to one of the errors that always show up at the beginning?

I also noticed the following error showing up when I executed "pulseaudio":
shared memfd open() failed: function not implemented
This was fixed by adding the --system option to it. So maybe that problem can be resolved by running as a normal user. I'll test that in a moment. And that still leaves the "xcb_connection_has_errors() returned true" error.
Unstoppable
 
Posts: 8
Joined: Thu Jan 25, 2018 7:06 am
languages_spoken: english,dutch
ODROIDs: XU4, C2

Re: [GAMES] NVIDIA Game Streaming with ODROID

Unread postby meveric » Sat Jan 27, 2018 11:07 pm

my packages are build WITH pulseaudio support, but it's more likely that puseaudio is causeing the issue and disabling pulseaudio and running moonlight on alsa instead could help here.
also running as root can has some sideeffects, for example pulseaudio does not work per default for root.
xcb_connection error makes me wonder if you run the program from terminal or from desktop, that could mean you run it without an X server, not sure if X is needed though, as for C1 and C2 video runs on a different layer anyway.
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: 8890
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

PreviousNext

Return to Games and Emulators

Who is online

Users browsing this forum: No registered users and 4 guests