MacOS – How to avoid lags when listening to music on a Mac

command linemacosmplayermusicperformance

On a Mac 10.13.6 I am usually listening to music using the command line command mplayer. However, when the computer is under rather heavy load, the music sometimes stops for a fraction of a second up to a second (or even longer) all the time.

The music is mp3 files stored locally and I’m guessing the CPU scheduling to priority is what is causing this interruption. In my use case, everything else the computer is doing is less relevant so I want to promote this app to the best performance.

The version is:

MPlayer 1.3.0-4.2.1

Can I change how I run this app to avoid slowdowns when the CPU gets busy?

Best Answer

Check out nice and renice which work on the command line.

You can change the priority level of processes, but to change other users processes you have to be admin level...

Just to provide a link with examples, see https://www.lifewire.com/uses-of-commands-nice-renice-2201087