Low processor utilization, audio only transcode

Started by azazel1024, March 15, 2023, 03:13:46 PM

Previous topic - Next topic

azazel1024

Something I've noticed with several versions of Avidemux (testing last night) is that the CPU utilization is dependent upon the power plan I have set in Windows.

If I am set to power saver, it'll only ever hit about 15% CPU utilization and go very slow. This is on an AMD Athlon 300GE pro processor. Looking at the per core, it looks like the audio transcode, AAC-FDK from AAC source, remixing to 5.1 audio from 7.1. This also applies to AAC-LAV

If I enable balanced power plan, it'll run ~30% utilization, with one core (bounces between which core) running 60-80%. Balanced actually looks like it is sharing the load on two cores, but half the total utilization, 15%.

Any idea what the heck could be going on with that? Part of the issue too is with the power saver power plan, the processor load is too low for it to move off the parked frequency. So it all runs at mostly 1.39GHz. Balanced, a slightly load clocks it up. So it'll run at around 2.8-3.2GHz. So it runs a lot faster.

So power saver seems to be running multithreaded (2 threads), but at low per core utilization, and throttled frequency. Balanced seems to be running single threaded (1 thread bouncing between cores), with might higher individual core utilization and much higher frequencies. A 4k video runs about 12 minutes to transcode the audio (remix, whatever the term is there), with no video transcoding in power saver, afterburner no, AAC-FDK. With balanced if completes in about 5 minutes.

I've noticed in general things that lean on the processor lightly tend to not cause it to step up frequency. But plenty of stuff that cause a high processor load, do fully utilize the processor and cause it to throttle up. I can run two instances of Aivdemux and it does cause the processor to throttle up, and both complete faster than a single one running on its own. I'd prefer not to have to switch my power plan just to run Avidemux. If I do, I do. Just hoping for some kind of a possible solution in the app as this sounds more like a decoder/encoder issue and less a Windows issue since everything else seems to work okay in Windows.

Thanks!

PS as an example, I can run Prime95, and it'll load all cores to 100% and throttle up to 3.36GHz. I can run handbrake and as soon as it starts transcoding, it hits 99-100% utilization and 3.36GHz. If I can run anything that wants to peg any logical thread over 50%, it throttles up. But Avidemux just isn't doing that. It is not a hard drive limitation. I've tested off the M.2 SSD as well as the RAID0 array.

azazel1024

Just as an update, as one unafraid to dive right into the guts of the registry, I may have literally unlocked the solution. I enabled all Processor Power settings from the registry where the value was different between the power saver, balanced and high power.

A lot to unpack, literally. All I've messed with is the first two, which are something along the lines of the minimum processor state to promote the frequency and the minimum processor state to demote the frequency. I am pretty sure it is per logical core, not overall processor load. I'll repost later exactly what the setting is in case someone ever has this issue for this. Or on the internet and finds this thread crawled by a search engine.

Power saver is 90% for promote and 60% for demote...

And yeah, that feels about right looking at application behavior frequency response, and logical core utilization.

Balanced is 30% and 10% respectively...

So I tweaked it to 40% and 15% for my "experimental" power plan.

Power saver, 1.36-1.5GHz on an audio transcode AAC 7.1 to 5.1, using AAC-FDK 14 minute estimate run time for a 4k video.

Experimental, 2.46-3.12GHz for the same with an estimated 7 minute time run for the same file. I didn't have a chance to check balanced against that, but I think it runs a bit faster with higher frequency range.

A TON more processor settings to change, from how aggressive it demotes frequency. How quickly to park a core or unpark a core. Etc. I am hoping I can tune it to keep idle power just as low, but get it to unpark and throttle up better for real workloads. I don't mind if it is slightly "laggier" to throttle up and unpark, so long as it can get to the same place in the end for everything except very light workloads. I don't want it throttling up if something is coming along and hitting 10% of one core with something.

It was doing that for heavy workloads like Prime95 and handbrake in testing. I just need to figure out the right tuning to get it there for moderate workloads like Avidemux audio transcoding and probably some other similar stuff, application launching and what not, windows boot. A lot of that stuff only really runs to like 30-70% of one or more cores. Sometimes for only a large fraction of a second, so it stays parked because the pooling interval is also really high for power saver. That is more okay as it is sustained workloads I care about more. If it takes an application 2 seconds to load rather than 1 because it doesn't throttle up, no problem.

But I suspect tightening up some of the pooling intervals slightly, but keeping it less often than the balanced and high performance plans can keep the general idle, low utilization power consumption just as low as the power saver default plan does, but let the process jump much faster and higher in frequency for medium loads. For example, looking at the behavior, with the 40/15% processor promotion/demotion settings, the frequency SEEMS to be dropping further than I think it is with the balanced plan, and coming back up slower too. So its running much closer in the frequency band, but I think it isn't going as high and is going lower because the amount it promotes is lower and the amount it demotes is higher. So if it dips below the core load %, it demotes maybe in 300MHz steps, rather than 100MHz. So it might drop 300, 600MHz, before the next pooling interval sees that the CPU load percent has increased over the threshold again and it only promotes 100MHz. Then another 100. Then another 100, and then it drops again 300. Rinse and repeat. I think the balanced is promoting at 200, 300, 400MHz at a time, but only demoting 100 or 200MHz.

Numbers approximate, but I think that is part of why I am not seeing it goes as high and has a wider range than sticking in 3.12-3.37GHz like balanced I think does. Will confirm.

Anyway, fun stuff!