Jump to content

We are ready to offer a Bountysource donation to Armbian


maximumsettings

Recommended Posts

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 by maximumsettings
Link to comment
Share on other sites

  • Igor pinned and featured this topic

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 by maximumsettings
Link to comment
Share on other sites

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 by SvOlli
Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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 by royk
Duplicate/added moonlight-qt
Link to comment
Share on other sites

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 by maximumsettings
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

pcdesktop.thumb.png.5e52895ac090b19f1c152074745a4090.png

We hope to offer more bounties in the near future to improve some of these metrics, if feasible.
 

Link to comment
Share on other sites

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


 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Screenshotfrom2023-02-1914-47-18.thumb.png.79b1098a121146eca7b2aa8aa75ab952.png

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines