moonlight-stream / moonlight-android

GameStream client for Android
GNU General Public License v3.0
3.71k stars 589 forks source link

About MediaTek Breguet 8100 hardware decoding delay #1176

Open zxc3123857948 opened 1 year ago

zxc3123857948 commented 1 year ago

The soc of my tablet is MediaTek Tiangui 8100, and its latency is much higher than my phone's Qualcomm Snapdragon 870 when using hardware decoding h264, the decoding latency of Qualcomm Snapdragon 870 is only 5-8ms at 40Mbps bit rate 1080 resolution, but MediaTek has 20-25ms latency, is there any solution?

svishchev commented 1 year ago

I have a similar problem with mediatek g99 (Infinix Note 12 2023). Decoding time 1080p 60 20mbps - 35-40ms. Image twitches, even if you select the maximum smoothness in the settings. Input lag seems to be higher. Using the steam link, I have about 30ms with the same video parameters with a smooth image and almost imperceptible delay.

cgutman commented 1 year ago

Have you tried both with HEVC enabled and disabled?

svishchev commented 1 year ago

HEVC enabled and disabled?

Yes. I also tried using Parces where there was a 6-8 decode delay and a smooth image. I really want the same results in Moonlingt

think2011 commented 1 year ago

I have MediaTek Tiangui 9000, same problem

moonlight: 20-30ms latency parsec: 5~8ms latency

svishchev commented 1 year ago

I found out that it is not possible to set low latency mode for the c2.mtk.hevc.decoder. It looks like there is no option in MediaCodecHelper.java that is suitable for our decoder (if we completely clear the "setDecoderLowLatencyOptions" function, the result does not change). Also in the "findKnownSafeDecoder" function, the decoder is defined as not supporting FEATURE_LowLatency. At the same time, in Parsec and SteamLink, the delays are many times less and work perfectly (they also use c2.mtk.hevc.decoder). I hope there is a way to reduce latency on our devices. Infinix Note 12 2023 (Android 12).

ktm-91 commented 11 months ago

I have the same issue on my OnePlus Nord 3 5G (Mediatek Dimensity 9000), I get around 30 ms of decoding time regardless of resolution, FPS or bitrate. On my Sony Android TV, which also has a (I definitely think way less powerful) Mediatek SoC I get a fantastic 3 ms. On the overlay I see that the OnePlus uses the c2.mtk.hevc.decoder, while the Sony uses the OMX.MTK.VIDEO.DECODER.HEVC

AceZero925 commented 9 months ago

Same issue here. Parsec decoding latency is far better than moonlight, just curious if there is any low latency options or code is hidden and we still didn't find out.

peacepenguin commented 8 months ago

I think this is a duplicate of this issue: https://github.com/moonlight-stream/moonlight-android/issues/1241

There's more traction on it over there, i suggest we close this and track all these Mediatek specific issues over there. They seem to be related to the switch in newer android versions to use: c2.mtk.hevc.decoder instead of the good ol: OMX.MTK.VIDEO.DECODER.HEVC

The omx api had the magic flag vdec-lowlatency passed through via undocumented workarounds. Seems we need to do the same workaround for the new decoder: c2.mtk.hevc.decoder . It seems like parsec has successfully done this as all these devices with this problem appear to have good parsec performance but poor moonlight performance for the same decoder.