moonlight-stream / moonlight-qt

GameStream client for PCs (Windows, Mac, Linux, and Steam Link)
GNU General Public License v3.0
10.62k stars 621 forks source link

Hardware acceleration on PinePhone Pro #1024

Closed Shatur closed 1 year ago

Shatur commented 1 year ago

Describe the bug

On PinePhone Pro the application says that there is no hardware acceleration. But the phone itself have hardware acceleration in gstreamer. And since the application is written in Qt, it uses gstreamer, but have some issues with detection.

Steps to reproduce Just install it on PPP and the application informs that there is not hardware acceleration. Streaming works, but it's done on CPU.

Other Moonlight clients

Client PC details (please complete the following information)

Moonlight Logs (please attach) log.txt

Shatur commented 1 year ago

My phone have RK3399S and looks like it should work judging by https://github.com/moonlight-stream/moonlight-qt/issues/509#issuecomment-787171748 @cgutman is something changed recently?

cgutman commented 1 year ago

Moonlight uses FFmpeg for decoding, so you'll need a build of FFmpeg that has hardware acceleration on your platform.

I don't know which Rockchip multimedia stack that your PinePhone Pro is using. If it's the old Rockchip MPP stack, you should enable h264_rkmpp and hevc_rkmpp decoders in your FFmpeg build. If it's using a newer V4L2 stateless decoder, you will need a build of FFmpeg that includes the out-of-tree patches for that API (like this).

Since you're on Arch, the AUR might have you covered. I see ffmpeg-v4l2-request-git and ffmpeg4.4-mpp AUR packages that look promising.

Shatur commented 1 year ago

ffmpeg-v4l2-request-git is just what I need, thank you!

WisdomCode commented 1 year ago

While its great to have a solution for Arch Linux, I have a similar problem (Pinephone instead of Pinephone Pro) with debian (or mobian, more precisely, although its about 20 packages from them, the rest is debian bookworm, including ffmpeg). From the solution I take that it has to be compiled by yourself, hardly a well suited solution for all users on Mali GPUs. Maybe it would be possible to add the according options to the flatpak as a quick, OS-independent fix? Am I correct that this file would need to add the parameters for that to work? https://github.com/flathub/com.moonlight_stream.Moonlight/blob/master/com.moonlight_stream.Moonlight.json I am willing to test this, but beside the fact that I probably have no permission to change that I also have no experience in building a flatpak. With a few directions I would be willing to help debugging as well.

Just for completeness sake, a pinephone has an Allwinner A64 With a Mali400 (yes, I now thats horrible, but h264 hardware decoding is supported)

WisdomCode commented 1 year ago

Well, looks like this can't be done by simply adding the flags and running flatpak-build, the v4l2-request flag is not known to the ffmpeg code used here...

Shatur commented 1 year ago

I don't think that flatpak discussion should take place here. You should ask the flatpak package maintainers about it.

WisdomCode commented 1 year ago

The flatpak is built from the code of moonlight-qt, the manifest was last edited by cgutman, who answered this question, in the general flathub repo (so not specific to moonlight), so while I can't find how this file is submitted there, I think at least this repo is the right place for talking about the issue. I do however agree that this becomes a separate issue with that. I was hoping that this could be resolved by simply adding two lines for everyone sharing this problem, looks like I was mistaken. I will open a separate issue, sorry to bother you.

Shatur commented 1 year ago

Oh, I didn't know it, sorry :( Yes, I would recommend to fill a separate issue just for better discoverability, yes.