MinimServer Forum

Full Version: Isolate FFMPEG on a dedicated CPU
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi Simon,

I'm still working on tests with Minimserver and Linux, with the main purpose to test anything I'm think about.

Recently, after having installed a RT kernel, fix CPU freq and latency using frequtils, I got a real improvement on the sound.

Today I tried to use taskset to assign specific CPUs to minimserver and ffmpg.

So I had "isolcpus=2,3" to grub conf reserve the 2 last cores of my CPU to this purpose.
Then it was easy to set minimserver to use cpu 3 using "taskset -cp 3 MinimServer_ID"

Problems comes when I wanted to dedicate cpu 2 to ffmpeg. Because ffmpeg is launched at each song, with a different ID each time.

so I'd like to know if there is way to force ffmpeg to always use CPU2, whatever happen ?

Also, I didn't look at the way to get minim running on CPU 3 at each boot. Is this possible ?

Last thing : do you think that this is the right thing to do ?

Per default, when minimserver run on an "affected" CPU, FFMPEG sometime use the same core due to it PPID. If I assign 2 CPUs to minim, FFMPEG still use the same CPU than Minim, or not...

Maybe can I "pass" an option from minim when it launch FFMPEG ?
From a quick look at the taskset commend, you can use it to change the affinity of a running process, so you could try changing the affinity of the ffmpeg process while it is transcoding a song to see if you can hear any difference between running FFmpeg on the same CPU as MinimServer and running FFmpeg on a different CPU. If the song is quite long, you can switch back and forth to confirm your impressions. I think this should be the first step before trying anything else.

I think it is possible that processor affinity might make a difference to sound quality and I think it is useful for you to try these experiments.
Thank Simon,

I must admit that there is no gap here. I will test at a colleague home because he have a better audio system than mine. Mine is correct, but not high-end.

The fixed processor speed is more noticeable with his system than with mine. So maybe the CPUs affectation is the same...

I'll update the post when I'll fixed about this.

Last : to allow the CPU choice to be fixed at startup without typing any command line, I have to add


to the miniserver service script. Where do I need to add this please ?

Correction : I didn't apply the correct CPU isolation at begining of the tests.

Using it in the correct way improve sound (not many, but anything is good to grab).

Difficult to me to explain the impress in English, but the flow is more soft...
The service file is located at /usr/lib/systemd/system/minimserver.service
(12-01-2020 22:45)simoncn Wrote: [ -> ]The service file is located at /usr/lib/systemd/system/minimserver.service

In my debian 10, there is not such a file at this location. If I use "find" I have files here :

root@audio:/usr/lib/systemd/system# find / -name minimserver.service

How did you enable automatic startup for MinimServer? If you do this using the minimserver/bin/setup command on a system that supports systemd, it should put a minimserver.service file at the location I described.
I think I used "startc" script rather than "setup". Unsure...
(13-01-2020 14:10)lafuente Wrote: [ -> ]I think I used "startc" script rather than "setup". Unsure...

I redo my setup and confirm that I used ./setup
Pages: 1 2 3
Reference URL's