Ross van der Harst | Linux for the Blind: Suppress mpv Console Output


Linux for the Blind: Suppress mpv Console Output

Without an updated config for mpv, the user has to silence Orca every time he uses is in the terminal. One option to avoid having to silence Orca, especially if accessing a video file, is to run mpv foo.mp4 & exit. This way, Orca doesn’t speak the output that mpv is printing because the terminal has been closed. Also, mpv has opened the video player and you can now control mpv through keyboard bindings. However, if what you are playing is an audio file and you have now backgrounded the process and exited the terminal, there is no remote you can use to control mpv. This is fine if you don’t play to pause or seek, or adjust the play speed. If all you want to do is listen to the file from beginning to end, or possible quit out of it halfway through with a pkill mpv command, provided you have no other instances of mpv running.

Another hack might to to run something like xterm -e /bin/bash -c "mpv foo.mp3". While this isn’t exactly a time-saver, it could be a way to get around silencing Orca because it opens up the mpv player in a new Xterm terminal, the output of which Orca will not read. So you can listen to the file while doing whatever else, and simply cycle back to the Xterm terminal when you need to control mpv.

However, these solutions are less then ideal, so to suppress all of mpv’s output, let’s edit mpv.conf.

First, make sure mpv’s configuration directory exists:

mkdir -p ~/.config/mpv

Next, we tell mpv to restrict all its normal output:

echo "--really-quiet" >> ~/.config/mpv.conf

If we now play a file with mpv, we may still get an error something to the effect of [E] pw.loop [loop.c:69 pw_loop_new()] 0x5bc9d8e155d0: can’t make support.system handle: No such file or directory. If that is the case, we need to forcibly set the audio-output. To see all the output options available, run mpv --ao=help.

If your system is using PulseAudio, you will set your audio output to pulse.

echo "--ao=pulse" >> ~/.config/mpv/mpv.conf

And now you can run mpv without having to silence Orca.