Specify or limit core usage in HQPlayer

Since there are 2 typical usage modes for HQPlayer on a PC: on a dedicated computer or on the computer you use for other things, you could consider having a setting for that. On a Ryxen CPU, the best would be to stay away from the so-called preferred cores, since those are used more than other cores by Windows (I would assume the same is true for Linux). Not sure how you query that from code, but you can see them in for example Ryzen Master.

Or maybe a combobox with these choices:

  • Use as many cores as possible
  • Use all cores except preferred ones (for Ryzen, not sure if Intel has those)
  • Use half of the available cores (on Ryzen, these should not include the preferred cores)
  • Use 2 cores only

That way you get a minimal GUI footprint but still add some nice functionality, and you could use this instead of the current Multicore setting which since its a 3-step checkbox is somewhat confusing.

This info is not provided by Windows.

I don’t see a very good objective reason for this.

You already get close to this by unchecking “Multicore DSP”. But doing explicit 2 cores would make things bad for multichannel or matrix cases. Let’s not get stuck to a very basic stereo setup but include all the possible variations.

For example my current Merging Hapi output is stereo/multichannel source to 4 channel stereo output.

You may have 2 channel to 2 channel, 5.0/5.1 channel to 2 channel, 2 channel to 5.0/5.1 channel output, 2 channel to 4 channel output, 2 channel to 2.1 channel output…

I don’t think it is particularly confusing because it is “off” (unchecked), “auto” (grayed), “full” (checked).

Please also note that in addition to restricting available cores to certain subset, the Multicore DSP setting still has the same effect. The internal processing structure is totally different for example Multicore DSP checked or unchecked. Regardless of how many cores are available.

Just a suggestion, but having a combobox with the multicore settings allows you to add more settings more easily, including things like “use half the cores” which certainly is useful for people like me who use HQPlayer on the same computer they use for other tasks. And since it’s sometimes a performance increase as well, it makes it even more useful.

But I would rather have less settings. Things are already complicated enough in the GUI. If you want to do advanced things, environment variables are perfect for such without polluting the GUI. In addition, with environment variables, when I want to add new settings, I don’t need to touch the GUI code. And it works the same for both Desktop and Embedded.

And remember that this core setting is orthogonal to the Multicore DSP setting. So one doesn’t replace the other. So now you have three settings for “Multicore DSP”, if you would have “Use half of the cores” setting, you would have six different possible combinations already. You can see how the number of possible combinations quickly explode to high numbers.

I do too, I’m typically developing HQPlayer, writing these responses, etc. While playing music with HQPlayer at the same time. But I have still not seen it necessary to do such things.

Rarely… I have not seen such cases. I see it more like extra potential for making things not work.

You get more efficient CPU usage with fewer cores in some cases. Right now I am using this:
image
In my case, I am using all cores on chip-2 except the ones favored by windows. And when I ran my benchmark (1 min of a 96/24 tune playing to null), the time went from 34 seconds using all cores to 25 seconds with this core setup (the computer was not doing anything else during the benchmark).

So using fewer cores definitely removes some overhead and gives an overall increase in performance. and with this in mind, it makes sense to let users select fewer cores, especially for us who use computers for other tasks at the same time. But also for users with passive cooling that wants to keep temperatures down.

Yes, you already have the option to control this!

This is sometimes most notable with GPU offload, because using less cores gives you higher turbo boost on the remaining cores.

This is not straightforward. Having for example 2 high loaded cores with high clock frequency and 6 low loaded cores running at low clock frequency can be more efficient than having 2+4 high loaded cores running at higher clock frequency. Even more so when you have performance and efficiency cores like 12th or 13th Gen Intel or Apple’s M1/M2.

OTOH, sometimes having 2 high load and 6 low load cores gives you higher upsampling rate capability, because the 2 high load cores can gain higher turbo boost clocks than when you would have for example 2+4 high load cores. Lower the number of high loaded cores, higher the achievable clock speeds for the high load ones.

Another way to do it is to split the processing load between CPU and GPU. Because when you move filter processing to a GPU, you lift that load off the CPU altogether.

Another way to test this is to check what is the highest rate you can achieve while still having processing time less than length of the content, meaning that you could run it in realtime.