Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: MTK decoding latency semi-solution #113

Open
uniqueUsernameIsNotAvailable opened this issue Feb 1, 2025 · 19 comments
Open
Labels
enhancement New feature or request

Comments

@uniqueUsernameIsNotAvailable
Copy link

uniqueUsernameIsNotAvailable commented Feb 1, 2025

I want to consider the well-known problem of increased latency on mtk chips.
I have Lenovo Pad 12.7 2025 (Mediatek Dimensity 8300), the average decoding delay - 20 ms (no difference in codecs, settings and other. h264 is faster by about 2 ms, which is insignificant).
Device supports c2.mtk. “codec_name”.decoder.lowlatency.

I noticed that the latency is software limitation, namely, if you do some work in the background (split-screen), it can easily go down to 14-15 ms.
But most importantly, if you open the initial page of Antutu Benchmark in the same split-screen, the latency drops to an incredible 6-10 ms (i.e. two or three times less than initially). Closing the benchmark, we get the standard and unpleasant 20ms.
The influence on power consumption is unexplored.
Maybe it is possible to bypass these artificial power management limitations?

Describe the solution you'd like

Is it possible to change the Artemis package name to mimic the benchmark utility?
But of course it would be interesting to invent some advanced tweak.

Describe alternatives you've considered

Split-screen with benchmark app.

Screenshots

No response

@uniqueUsernameIsNotAvailable uniqueUsernameIsNotAvailable added the enhancement New feature or request label Feb 1, 2025
@ClassicOldSong
Copy link
Owner

Reports say that use Warp Drive or Warp 2 drops the latency on these MTK chips to 5ms. Have you tried that?

@uniqueUsernameIsNotAvailable
Copy link
Author

Reports say that use Warp Drive or Warp 2 drops the latency on these MTK chips to 5ms. Have you tried that?

Maybe that works for less powerful chips or chips w/o lowlatency codec, but for me warp drive introduces +2ms decoding and unstable decoding latency, warp 2 is more stable, but still somewhere at 22-24ms. Even Antutu split-screen is not helping them so much (10ms).
So, "experimental" pacing settings are not effective for me

@ClassicOldSong
Copy link
Owner

They're on 9300 iirc, and it's using the correct low latency decoder.

Package name wise you have to modify it yourself though, it's not possible for an app to change package name on its own.

@uniqueUsernameIsNotAvailable
Copy link
Author

uniqueUsernameIsNotAvailable commented Feb 1, 2025

Those power limitations is crazy. If I do CPU Throttling Test in split screen delay goes from 22ms -> 8ms.
Probably, there is a way to keep CPU/GPU awake without dealing real work?
By default I have 7 cores at 0.5 - 0.9GHz (and 1 heavy loaded core at 3.35GHz)(wrong - see FIX section) -> 20ms,
after test started 4x2.1GHz + 3x2.9GHz + 3.05GHz -> 8-9ms.

They're on 9300 iirc, and it's using the correct low latency decoder.

Oh, then... there are probably two cases: codec related (when Warp is efficient) and power management related (when background work is effective, but no impact from settings/codecs)

FIX:
By default I have 7 cores at 0.5 - 0.9GHz and sometimes 1-3 jumps to 1.7GHz -> 20ms (used wrong monitoring).
So. my CPU is very sleepy at streaming session. Only side job is bumping freqs, leading to decreased decoding delay,
I understand, that GPU monitoring info is more useful, but I have no info about GPU monitoring without root (which is problematic with my device)

@uniqueUsernameIsNotAvailable
Copy link
Author

uniqueUsernameIsNotAvailable commented Feb 1, 2025

Detailed CPU monitoring info:
Dimensity 8300 - 1x 3.35 GHz – Cortex-A715, 3x 3.2 GHz – Cortex-A715, 4x 2.2 GHz – Cortex-A510, Mali-G615 MP6 (actually MP5, as device info apps say)
Testing with N of threads loaded with benchmark:

Threads CPU Configuration Effect on Decoding Time Decoding Time
1 BIG core at 3.3GHz No effect 20ms
2 BIG core at 3.3GHz + Medium cores at 2GHz -10% on decoding time 18ms
5 BIG core at 3.3GHz + Medium cores at 2GHz + LITTLE cluster -50% (-10ms) on decoding time 10ms
8 BIG core at 3.3GHz + Medium cores at 2GHz + LITTLE cluster -12ms on decoding time 8ms

@uniqueUsernameIsNotAvailable
Copy link
Author

uniqueUsernameIsNotAvailable commented Feb 1, 2025

Package name wise you have to modify it yourself though, it's not possible for an app to change package name on its own.

Modified Artemis apk with ApkTool to mimic Antutu.
Well, we have the results...
Decoding time - LOWEST what I have ever seen = 6-7ms! But, paid the price - all cores are at full freq.

@derflacco
Copy link

derflacco commented Feb 4, 2025

Hi, i have an Alldocube Iplay 50 mini pro, with an mtk g99.
My device doesn't support low latency decoding (well, parsec uses it, but in the mediacodec info i don't have it).
Despite that, i m able to stream 1400*900 120fps 60mbs 10-11ms with apollo\artemis warp2.
To achieve that i had to root, set both cpu clusters to performance, and force the foreground and top app cpu sets to big clusters (in my case 6-7). Also, Warp 2 plays a major role in that, as without it i have more than 16ms ( 14ms with Warp). Hope it helps.
Edit: with a poco x6 pro, with an mtk 8300-Ultra and low latecy decoding, i have the same without any mods (as i m not rooted), by swtiching to Warp 2, wich is a godbless!

@uniqueUsernameIsNotAvailable
Copy link
Author

For me, with Lenovo Tab 12.7 2025, Warp2 gives unlocked FPS, so when it goes up to 200fps - I get 60ms at overlay, but it feels like 300ms delay. FPS is locked at the options, btw.
Warp Drive unlocks fps up to 120 with 24ms of delay. So min latency is only option for me.

@ClassicOldSong
Copy link
Owner

Try the latest Apollo, it now has frame rate limit enabled by default.

@uniqueUsernameIsNotAvailable
Copy link
Author

Try the latest Apollo, it now has frame rate limit enabled by default.

Well done, now Warp Drive/2 is stable, but 20ms - still my maximum without background CPU load for waking cores up.

@derflacco
Copy link

Try the latest Apollo, it now has frame rate limit enabled by default.

Well done, now Warp Drive/2 is stable, but 20ms - still my maximum without background CPU load for waking cores up.

Sadly you need a way to set all the cores to perf governor, or atleast put your top app/foreground cpusets to the big cores. If you are rooted you can do it with smarpatpack kernel manager, or with any kernel manager wich gives you the option to add custom tunables. Or, you can just find the Max fps that will give you the min latency (in my case is 160hz) and create a custom resolution with the desired Hz. Im using a hdmi dummy to do that, i dont know if you can do it with the virtual display.
Its harsh with an mtk device to have a good experience, but with some time its possibile to achieve good results. I just completed tiny Tina wonderlands with apollo/artemis, it was impossibile to play decently with moonlight or parsec with this chip (despite parsec shows 3ms decoding latency).
Ps sorry for my English.

@Shiva95-GitHub
Copy link

Poco x7 pro here. The codec being used is low latency, and at 60fps 1080p 20mbps, I have 20ms of delay. At 120fps 40mbps, the delay is 7ms when I touch the screen, but if I use the gamepad, it goes back to 20ms.

In my opinion, this is a bad reading; even with 20ms, I don't experience input lag compared to playing locally on a monitor.

@farika
Copy link

farika commented Feb 15, 2025

Mmh i didn't explore the powersaving path. On my Xiaomi 14T pro i have a better decode time when i put the "ultimate" performance mode in battery settings. So perhaps there is the decoder issue but perhaps also a powersaving thing...
On the other hand, on my S10 ultra tablet I was unable to obtain better results by running a 3dmark or a geekbench in parallel.

What's weird, though, is that quickly bringing up and closing the notification bar lowers the decoding time!

Frankly, now that mediatek are the #1 chipset on sale (they've overtaken qualcomm), wouldn't it be possible to put pressure on them to look into this bug?

@Shiva95-GitHub
Copy link

We have to put pressure on. Yes.. But how?

@Shiva95-GitHub
Copy link

However I repeat. I don't know if the problem is real (at least for those who have low latency working) or is a latency calculation error. I don't see a big difference, in fact I don't see it at all, from playing directly on a PC.

@farika
Copy link

farika commented Feb 16, 2025

There is a big difference on fast paced game like FPS. Test a overwatch or a valorant and you can't even hit.
Mediatek have a contact here https://corp.mediatek.com/about/contact-us
But the first step is to report the bug to the product manufacturer. Samsung / Xiaomi and consorts

@Shiva95-GitHub
Copy link

Shiva95-GitHub commented Feb 17, 2025

Package name wise you have to modify it yourself though, it's not possible for an app to change package name on its own.

Modified Artemis apk with ApkTool to mimic Antutu. Well, we have the results... Decoding time - LOWEST what I have ever seen = 6-7ms! But, paid the price - all cores are at full freq.

Post your apk please

@uniqueUsernameIsNotAvailable
Copy link
Author

uniqueUsernameIsNotAvailable commented Feb 17, 2025

Post your apk please

Here it is. Probably right version, but probably not.

ArtemisMod_v12.1.250118(43)_mod.zip

@Shiva95-GitHub
Copy link

Post your apk please

Here it is. Probably right version, but probably not.

ArtemisMod_v12.1.250118(43)_mod.zip

Nothing.. same latency for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants