maximumsettings Posted February 13, 2023 Share Posted February 13, 2023 (edited) Greetings everyone. I hope to receive some assistance here. Our company is a small Linux cloud gaming provider that uses the Cinnamon edition of Linux Mint for our cloud gaming services https://maximumsettings.com/ . We are searching for an affordable local streaming device that we can recommend to our clients, capable of decoding H.265 at 4K - 80Mbps. The Orange Pi 5 is a perfect fit for this role, and the Armbian Cinnamon desktop is well-suited since our clients already use Linux Mint Cinnamon edition on the cloud Gaming PC. However, there is currently no support for our open-source streaming client, Moonlight, which we use as the default option for our clients. This is where we hope to receive your help. We are willing to offer a $1000 Canadian Bountysource donation to Armbian if someone can create a binary version of the Moonlight streaming client https://moonlight-stream.org that can be easily installed by a novice Linux user on the Orange Pi 5 with the Armbian Cinnamon desktop edition OS. Ideally, without the requirement of using the terminal. I should mention that the Moonlight client would require full hardware decoding support for both H.264 and H.265. Edited February 13, 2023 by maximumsettings 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 13, 2023 Author Share Posted February 13, 2023 (edited) For context, we've been advocating the use of affordable Android set-top boxes that utilize the Amlogic S905X4 to our clients. However, with the growing prevalence of 4K TVs and high refresh rate monitors, these devices have become obsolete. The Amlogic S905X4 is unable to decode H.265 streams exceeding 20Mbps, which poses a challenge since our 1080p stream at 120fps requires 40Mbps and our 4K stream at 60fps calls for 80Mbps. Advising a client to purchase a PC just to decode the stream goes against the purpose of cloud gaming. Additionally, we have tried testing the Orange Pi 5 with its Android build and found that it could decode an 80Mbps H.265 stream, but with extremely high decoding times, reaching over 45ms in some cases. Even when lowering the bit rate to 20Mbps, the decoding times remained high, leading us to believe it's a software issue. The Amlogic S905X4 can decode streams in less than 5ms, while a regular PC can do so in less than 1ms. As an example, you can see in this demo https://www.youtube.com/watch?v=nosQPD6MPfg that the average decoding times are under 0.10ms. We are optimistic that we can achieve similar performance with the Pi 5 Armbian build, or at least under 5ms. Edited February 13, 2023 by maximumsettings 0 Quote Link to comment Share on other sites More sharing options...
SvOlli Posted February 14, 2023 Share Posted February 14, 2023 (edited) This might be the thing to get you going: try flatpak/flathub. Command line version, since this is the quickest (run as root): apt-get install -y flatpak-builder flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo flatpak install flathub moonlight Installation works, but during start I got the message: "No functioning hardware accelerated video decoder was detected by Moonlight." Since Moonlight is containered, it might be not having access to the driver of the host system. It might be that I was running it on Wayland. Between daytime job and other duties, I'm lacking the time to come up with a full solution, but one option I see is to for the original moonlight in an own hub, where it also depends on the libraries required for accelerated video. Hope this helps, SvOlli Edit: reading the second post, which I missed somehow, I see this doesn't help. Sorry. Edited February 14, 2023 by SvOlli 0 Quote Link to comment Share on other sites More sharing options...
Marvin Rösch Posted February 14, 2023 Share Posted February 14, 2023 @maximumsettings I have personally been interested in getting Moonlight running on the Orange Pi 5 myself and have invested a lot of time in it already. So, depending on the feature set you want to have supported by the streaming client, the work involved varies significantly. Getting a working build of moonlight-qt is very straightforward if you have the ffmpeg version from ppa:liujianfeng1994/rockchip-multimedia installed, as it can use that for decoding through Rockchip MPP. However, neither HDR nor surround sound will work out of the box. For surround sound, configuration of the ALSA sound system (and potentially PulseAudio for channel mapping) is required. Even after that, it was still not working properly with moonlight-qt. HDR I have not been able to get working at all with moonlight-qt, as the Rockchip kernel uses a non-standard name for the required 10 bit color format and doesn't create DRM overlay planes for Moonlight to use. I have had more success with getting moonlight-embedded working on my Orange Pi 5, but that also required small modifications. Surround sound worked out of the box, while HDR support still remains elusive even with some custom modifications to support the non-standard pixel format. I was able to get my display to switch to HDR mode and to at least get a picture out of Moonlight, but the colors were completely off. The embedded version obviously lacks a GUI, though, and you'd probably want that for your customers. Performance-wise, moonlight-embedded has been working very well for me, but I still have encountered some issues where occasionally the stream would just stop and everything froze on the last frame, such that I had to manually kill the process. In order for my wireless Xbox controller to be supported, I also had to manually install the xone DKMS module, which was problematic because the kernel header package for the Rockchip kernel doesn't work correctly out of the box. So as a user, the experience with moonlight on the Orange Pi 5 has been lackluster at best so far and a lot of effort has to be put in in order to get it user-friendly. 0 Quote Link to comment Share on other sites More sharing options...
martivo Posted February 14, 2023 Share Posted February 14, 2023 @Marvin RöschI am not sure if it is relevant here, but I was also unable to get surround sound to work in pulseaudio - I resorted to using a52(DolbyDigital) alsa plugin(dcaenc is also an option). It created pulse audio sinks that will send compressed audio over HDMI or DP resulting in Surround sound working. Ansible role that I used on the OPi5 to get Surround sound to work: https://github.com/martivo/armbian-orange-pi-5-ansible/tree/main/roles/hdmi-audio-dts-a52 https://github.com/alsa-project/alsa-plugins (a52, branch v1.2.6, https://github.com/alsa-project/alsa-plugins/blob/master/doc/a52.txt) <-currently using due to my TV lacking DCA support https://github.com/darealshinji/dcaenc <-i know it works but not using atm. 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 14, 2023 Author Share Posted February 14, 2023 @SvOlli Unfortunately, when we tried the flatpack version, we were unable to achieve more than 20fps, even with relatively low bit-rates, since hardware acceleration was not available. However, if someone could enable hardware acceleration on the flatpack version, it would be ideal because it is relatively easy to install. 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 14, 2023 Author Share Posted February 14, 2023 @Marvin Rösch I would be open to trying the moonlight-qt version, since HDR and surround sound are not currently essential features. The GUI is necessary since the majority of our clients lack experience with terminals. If you are interested in testing your Moonlight build directly with our service, please let me know, and I would be delighted to provide some demos accounts (this goes for anyone). This is assuming that the latency from your location is not too high. 0 Quote Link to comment Share on other sites More sharing options...
NicoD Posted February 14, 2023 Share Posted February 14, 2023 This installs moonlight with hardware decoding for RK3588. https://forum.radxa.com/t/introduction-to-rockchip-multimedia-ppa-for-ubuntu-jammy/14537 @amazingfate Is the one who does this. 0 Quote Link to comment Share on other sites More sharing options...
royk Posted February 14, 2023 Share Posted February 14, 2023 (edited) moonlight-embedded is in the ppa of liujianfeng1994: https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+packages sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia sudo apt install moonlight-embedded The same as NicoD said Here is Moonlight-qt I'd compiled, it's unfortunately not a deb package. To compile it yourself with hardware acceleration you'll need to patch a file, you could find how to somewhere in the issues page of the github of moonlight: https://easyupload.io/a9gkdh Edited February 14, 2023 by royk Duplicate/added moonlight-qt 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 14, 2023 Author Share Posted February 14, 2023 Great, I'll give it a go later tonight. 0 Quote Link to comment Share on other sites More sharing options...
amazingfate Posted February 15, 2023 Share Posted February 15, 2023 I just added moonlight-qt to my ppa: https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 15, 2023 Author Share Posted February 15, 2023 (edited) I wanted to provide a quick update on my testing of Moonlight embedded. I was pleasantly surprised by its performance, and I used the following presets: moonlight xx.xx.xxx.xxx -app Desktop -1080 -bitrate 40000 -fps 120 -codec h265 Although I was unable to bring up the stats overlay using "Ctrl+Alt+Shift+S", I did not experience any visual artifacts or micro stutters while using the desktop or playing a bit of Doom Eternal. Based on this performance, I believe Moonlight shows great promise for the Orange Pi 5. In fact, it outperformed any small form factor device I have previously tested, including the Nvidia Shield, which was one of the better-performing options. As suggested, I plan to test the Moonlight-qt versions tomorrow. Thank you to everyone who provided suggestions. Edited February 15, 2023 by maximumsettings 0 Quote Link to comment Share on other sites More sharing options...
royk Posted February 15, 2023 Share Posted February 15, 2023 That's great, now @amazingfate has created a package for moonlight-embedded as well as for Moonlight -QT I guess he earned the $ 1000,- like you've promised? 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 15, 2023 Author Share Posted February 15, 2023 Although I have not yet tested the Moonlight-QT build on the Orange Pi 5, I plan to do so tonight. I will be contacting amazingfate regarding the bounty. I consider this to be the best $1000 I have ever spent, and I hope it marks the beginning of a long-term relationship between Maximumsettings and the Orange Pi 5 Armbian community. The Pi 5 will provide us with one the most affordable and superior streaming device available in the market. Just so you know, our organization has many ideas, but we lack the internal resources to implement them. I am optimistic that we can create a situation where everyone benefits, a win-win scenario. I am hopeful that the approach of offering bounties for adding new features and fixing bugs will be successful within the Armbian community. 2 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 16, 2023 Author Share Posted February 16, 2023 The Moonlight-qt version failed to load. Below is the output information from the terminal. 0 Quote Link to comment Share on other sites More sharing options...
amazingfate Posted February 16, 2023 Share Posted February 16, 2023 There are missing dependencies, use this command to install those: sudo apt install qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 These deps are not detected by dh_shlibs. I will add them later. 1 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 16, 2023 Author Share Posted February 16, 2023 Thank you for resolving the dependency issues. Additionally, I was able to successfully display the stats overlay and the performance seems decent. You can refer to the link below for a quick demonstration. Unfortunately, I couldn't simultaneously record locally on the Orange Pi 5 and stream from the cloud, so I had to use an external camera to capture the stats overlay. I apologize for the poor video quality. https://maximumsettings.com/VID_20230216_011130.mp4 The average decoding times are slightly over 2ms, which is the best I've seen on these single board devices. However, there is still some room for improvement when compared to a decently powered PC. Please refer to the picture below for comparison. I plan to conduct further testing over the weekend with different resolutions and bitrates. This current test was done at a bitrate of 60Mbps with h.265. We hope to offer more bounties in the near future to improve some of these metrics, if feasible. 2 Quote Link to comment Share on other sites More sharing options...
luizkun Posted February 17, 2023 Share Posted February 17, 2023 Hi @maximumsettings , how can you enable overlay stats like that , i don't see any option to do that in moonlight-qt , and how much bit rate you used with 1920x1080p 120 FPS ? 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 17, 2023 Author Share Posted February 17, 2023 After establishing a connection to the host, you have the option to press Ctrl+Alt+Shift+S. In this demonstration 60Mbps was utilized, but it is possible to achieve decent results with 40Mbps at a resolution of 1920x1080p and a frame rate of 120 FPS. For this demo, a resolution of 1440p and a frame rate of 165fps has been configured, utilizing an 80Mbps stream. We typically use the CBR preset in most of our demos. https://www.youtube.com/watch?v=0wY-wWP8lnE&t=674s 1 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 18, 2023 Author Share Posted February 18, 2023 I was able to perform another quick test last night using h.264 at 1080p with a 40Mbps bitrate and 120fps. To my surprise, during the test, the average decoding time for h.264 was about 1ms longer than that of average h.265, which is typically the other way around. Unfortunately, the video quality is poor due to my inadequate setup for external recording. However, I plan to conduct the next few tests by recording directly on the VM. https://maximumsettings.com/?p=2504 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 18, 2023 Author Share Posted February 18, 2023 (edited) Is anyone else experience difficulty in connecting a monitor using a DVI to HDMI cable? The cable signal cannot be detected. Furthermore, one of my LG TVs is unable to detect the HDMI signal even when using an HDMI-to-HDMI cable. Edited February 18, 2023 by maximumsettings 0 Quote Link to comment Share on other sites More sharing options...
amazingfate Posted February 19, 2023 Share Posted February 19, 2023 @maximumsettings You can try obs in my ppa to record the desktop. I'm using pipewire to capture the window or desktop and obs-gstreamer plugin to do the hardware encoding. I'm using gnome wayland as my desktop environment. `sudo apt install obs-studio obs-plugins obs-gstreamer xdg-desktop-portal-gnome`. As for the LG TV issue, some resolutions such as 1440p are not well supported by the video output driver of rockchip's kernel. We have to wait for a fix. 0 Quote Link to comment Share on other sites More sharing options...
royk Posted February 19, 2023 Share Posted February 19, 2023 About the DVI adapter, maybe it's an uni directional one for the wrong direction? 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 19, 2023 Author Share Posted February 19, 2023 I confirmed that the HDMI to DVI Cable is indeed labeled as Bi-Directional. https://www.amazon.ca/dp/B009W8EWOG?ref=ppx_yo2ov_dt_b_product_details&th=1 The LG TV is a standard 1080p display. To be precise, the TV is quite old and has a VGA connector. I will attempt to connect it using a VGA to HDMI cable and see if it works. Additionally, I bought a USB-C to DisplayPort cable, and I intend to test it out with my 1440P and 4K monitors. https://www.amazon.ca/dp/B01J6DT070?ref=ppx_yo2ov_dt_b_product_details&th=1 I'll try out the obs-gstreamer plugin with hardware encoding, and I hope it doesn't impact the stream decoding. 0 Quote Link to comment Share on other sites More sharing options...
royk Posted February 19, 2023 Share Posted February 19, 2023 (edited) I've tried a hdmi to vga adapter on a beamer and this one works at least: Amazon link If you didn't already you could try different resolutions/refresh rates for the HDMI/DVI cable Edited February 19, 2023 by royk wrong link 0 Quote Link to comment Share on other sites More sharing options...
Werner Posted February 20, 2023 Share Posted February 20, 2023 Just as a general experience from myself I never had good success on any kind of converter adapters regarding DP, HDMI, DVI or VGA when using with ARM boards. No idea what the cause is. Maybe general lack in drivers to mitigate such configurations... If somehow possible try to connect native. 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 20, 2023 Author Share Posted February 20, 2023 I was able to successfully setup my 21:9, 3440x1440 monitor with a USB-C to DisplayPort cable, and it supports a refresh rate of 144Hz. Standard 4K @ 3840x2160 with a 60Hz refresh rate functioned properly as well. I need to confirm the HDMI versions of the non-functional TV's since the problem may be associated with their older HDMI specifications. I think they are utilizing either HDMI version 1.3 or 1.4. I am trying to identify which display devices are compatible, given that our client base uses a diverse range of screens and monitors, some of which may date back to the mid-late 2000s 0 Quote Link to comment Share on other sites More sharing options...
martivo Posted February 20, 2023 Share Posted February 20, 2023 My HDMI 1.4 LG TV works just fine at 4k 60Hz on HDMI port. 0 Quote Link to comment Share on other sites More sharing options...
maximumsettings Posted February 22, 2023 Author Share Posted February 22, 2023 The HDMI to VGA converter is functioning properly with those older LG TV's. Moreover, I was able to use the obs-gstreamer plugin to record at 60fps. However, when Moonlight captures the entire screen, it only records a black background. I will need to investigate this further as I had a similar experience in the past while using Linux Mint on a x86-64 desktop. 0 Quote Link to comment Share on other sites More sharing options...
amazingfate Posted February 23, 2023 Share Posted February 23, 2023 I use gnome wayland and use pipewire plugin to capture the screen. I can record the moonlight screen. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.