moonlight-android
moonlight-android copied to clipboard
[Issue]: 30 ms decoding latency on Mediatek Dimensity 9000
Describe the bug
On my OnePlus Nord 3 5G (Mediatek Dimensity 9000 high-end SoC) I get around 30 ms of decoding latency with both H.264 and H.265. It's a lot, considering that on my Sony Android TV (also with a Mediatek SoC) I get around 3 ms. I already tried changing resolution, FPS and bitrate but it won't get better latencies.
Steps to reproduce
none
Affected games
any
Other Moonlight clients
PC
Moonlight adjusted settings
Yes
Moonlight adjusted settings (please complete the following information)
tried many combinations of resolution, FPS and bitrate
Moonlight default settings
Yes
Gamepad-related connection issue
Yes
Gamepad-related input issue
Yes
Gamepad-related streaming issue
Yes
Android version
13
Device model
OnePlus Nord 3 5G
Server PC OS version
Windows 10 22H2
Server PC GeForce Experience version
3.27.0.112
Server PC Nvidia GPU driver version
537.13
Server PC antivirus and firewall software
Windows Defender
Screenshots
Relevant log output
No response
Additional context
No response
I'd like to get some codec information to see if there's a way to reduce the latency.
- Please install https://play.google.com/store/apps/details?id=com.parseus.codecinfo
- Open Codec Info app and navigate to the Video tab
- Find "c2.mtk.hevc.decoder" in the list and take screenshots of the properties page for that codec
- Find "c2.mtk.avc.decoder" in the list and take screenshots of the properties page for that codec
- Attach the screenshots here.
Sure, here they are:
hey, i have same issue with my oneplus pad, when i use wifi im between 25-35ms but when i plug rj45 im between 13-20ms
The only MediaFormat option I see that Steam Link sets and we don't is KEY_PRIORITY
. I never saw any advantage for setting it on any of my non-MediaTek devices, but maybe it helps for your MediaTek devices.
Here is a test build you can try: https://drive.google.com/file/d/1BjsjTvQ-UZEznufincc2FTfph7FUQIQx/view?usp=sharing
Unfortunately it doesn't get better. FYI I also tried Steam Link and I get the same 30 ms decoding delay. I can't believe that such a high end SoC can't do better than this :(
Noob question: would it be possible to use the OMX.MTK.VIDEO.DECODER.HEVC decoder instead, as my TV does? Apparently it has way better latency performance
Here is a test build you can try: https://drive.google.com/file/d/1BjsjTvQ-UZEznufincc2FTfph7FUQIQx/view?usp=sharing
Didn't work on my Infinix Note 12 2023 with Mediatek G99. Is it possible to see how this is implemented in Parces? There's a decoding delay of about 6-8ms on my device.
@svishchev if you can collect adb logcat
logs of Parsec and Moonlight streaming on your device, I could take a look at them and see if anything looks different between the two logs.
I have the same issue as well with my phone xiaomi 11T non pro version using Dimensity 1200. Getting the same decoding latency of 15-20ms as well on Moonlight. If i use Parsec the decoding latency is much faster at around 5ms.
@cgutman
This is my logcat file by using Parsec v3.150.085.00 and Moonlight v11.0 on Android 13 with my Xiaomi 11T running mediatek dimensity 1200 Hope it helps.
Thanks, here's another build to try: https://drive.google.com/file/d/1f7YJpgtchqRuYwdhN2fFkwPeUiZaQlGM/view?usp=sharing
I tweaked a few things to be closer to what Parsec does.
Since Sunshine is variable frame rate, please also try moving the mouse around to get 60 FPS from the host and see if latency goes down.
@cgutman Just tried with no luck at all, the result are still the same with both H.254 and HEVC. one more things i notice is that i can't choose AV1 as decoder it says AV1 decoder not found but my soc supports it.
I am inface having the same issue with my oneplus pad. around 30ms decode time no matter what option i choose.
Same with my Firestick 4K Max, anything between 20-30ms decoding latency regardless of bitrate, resolution, fps etc.
Getting 0-1ms on my Rog Ally so I know it's not anything Sunshine related.
My Redmi Pad (MediaTek G99) also encountered the same problem, the decoding latency fluctuated between 20ms-40ms, regardless of using HEVC or H.264.
@ZachShaw Are you using the new 2023 Firestick 4K max? or the older one from 2021?
On my older 2021 Firestick 4k max, things work perfectly, 4-5ms decode time for HEVC.
Also for reference, the older stick is running fire os 7 (android 9), the newer one is fire os 8 (android 11).
The older one uses: OMX.MTK.VIDEO.DECODER.HEVC
It appears the new one uses: C2.MTK.HEVC.DECODER
I see in the logcat of the dimensity: "no c2 equivalents for vdec-lowlatency"
So might be that the 'magic' mediatek specific 'vdec-lowlatency' flag can no longer be used with the C2 decoder.
Android 11 introduced a 'standard' approach to signaling low latency video: MediaCodecInfo.CodecCapabilities.FEATURE_LowLatency
Perhaps mediatek or amazon in the case of the fire stick 4k max 2023, didn't implement the new feature, so now were stuck on these newer android versions until they fix the driver? Or maybe we can find another way to use the older OMX.MTK decoder on the newer android OS so we can continue to pass the old magic flag: vdec-lowlatency.
https://source.android.com/docs/core/media/low-latency-media
This shouldn't be happening, but I found out that wifi 6 goes around the issue, in my case at least.
With my wifi 5 router and 360mbps ftth, my Mi Mix 2 from 2017 with Snapdragon 835 was smooth sailing, while my current Xiaomi 13T with Dimensity 8200 Ultra was having connection issues.
I went to my gf's house with a 50mbps vdsl connection and lo and behold, no issues. The difference? Her router is wifi 6.
After that I bought a wifi 6 mesh system and even though the decoding latency is higher than the Snapdragon, I get no connection issues and it's super smooth.
FYI, My Xiao Mi 11T non pro has AV1 decoder functions but on the newest version of moonlight 12.0.2 it shows that there are no AV1 decoder.
So there is no solution yet? Just bought a cheap tablet that use Mediatek chip and want to use it strictly for streaming. And now I am doubting my life choice lul.
My Redmi Pad (MediaTek G99) also encountered the same problem, the decoding latency fluctuated between 20ms-40ms, regardless of using HEVC or H.264.
I'm considering buying a newly released Samsung Tab A9 (G99) for Moonlight but @bsdayo comments makes me hesitate.
@tristan-k For 8inch-ish tablet, just go for a Lenvo Y700 (S870/ 8+1) instead ig. And here is an unlucky Galaxy Tab A9 user lul. I should do more research before pulling the trigger.
@donlonW For some reason the Lenvo Y700 isn't available in Germany and it's much more expensive. So my everlasting quest for a 8-9 Inch Tablet for moonlight streaming continues :(
@tristan-k It still work OK in third-person game with the 20-30ms decoding latency if you have low internet latency(stably under 10ms). But can't really play any serious 2D platformer until this issue is solved.
The folks on Github are discussing and trying to solve the issue. https://github.com/moonlight-stream/moonlight-android/issues/1276
Also experiencing high decode latency on mediatek D1200 (AYANEO Pocket Air/Android 12), around 20ms (h264, h265, and AV1 are all similar results). Happy to help test or provide any data related.
@bassderek can you run parsec from and to the same devices and see what parsec reports for decode latency? with HEVC particularly?
@peacepenguin I unfortunately don’t have access to the device anymore, but when I tested with parsec it was about 5ms. Overall worse stream quality than moonlight though other than latency being better.
Just got a Helio G99 Android 13 tablet - I believe as per previous posters have also reported, I get approx 25ms decoding time shown in Moonlight for both H265 and H264. Parsec reports between 2 and 3ms. It's the C2.MTK.HEVC.DECODER (or C2.MTK.AVC.DECODER) in use on Moonlight.
Happy to try and help with any further information where I can.
I have the same issue on my Iplay 50 mini pro, running the mediatek helios G99 cpu - around 35ms average decoding time, with much much less when using Parsec. Can also provide information or tests if you want.
Same problem with mtk d1100. Hoping it will be fixed soon.
I have the same problem with MediaTek Kampanio 1300T in my Lenovo Tab P11 pro gen 2. Looks like it is also using the c2.mtk.hevc.decoder.
These are the latency times I tend to get:
1080p60fps - 16-20ms average decode time 1440p60fps - 30-32ms average decode time
I tested out 1080p60fps on Parsec on this device, and I was seeing around ~5ms on both AVC and HEVC decoders.