I've tried to install mpv for raspberry pi using mpv-build (with maal, 256 graphics mem) because I would like to modify the code.

it seemed like it was finally a success until I tried to run something, and I received an error:

Playing: Downloads/big_buck_bunny.mp4
 (+) Video --vid=1 (*) (h264 640x360 23.962fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 22050Hz)
[vo/rpi] Could not get DISPMANX objects.
* failed to add service - already in use?

1 Answer 1


You are using Raspbian which is a flavour of Debian. It has a big repository with precompiled and configured software packets that fits best into the distribution. It is not recommended to compile software by yourself except you want to modify and/or develop it. It is very likely you run into problems like yours. You have to fit the installation from source to the distribution.

But you can find the mpv video player in the repository with:

rpi ~$ apt show mpv

You can simply install it with:

rpi ~$ sudo apt update
rpi ~$ sudo apt full-upgrade
rpi ~$ sudo apt install mpv

Before doing this you should clean up your installation from mpv-build.

OK, you want to modify the code. The best way to do this is to use Debians source packages. This also fit best into the distribution and you can use the build tools from Debian. I used Raspbian Stretch Lite 2018-06-27. First you have to enable access to the source repositories. On a standard Raspbian installation just uncomment the line beginning with #deb-src in the sources.list so it looks like this:

rpi ~$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi

This will use the stretch version which is stable. You can choose newer sources. If you like then replace stretch with testing or unstable in the deb-src line. For this I use default stretch (stable). Update the installation with:

rpi ~$ sudo apt update
rpi ~$ sudo apt full-upgrade

If there where some drivers or firmware installed through full-upgrade then reboot.

Install the needed build tools with:

rpi ~$ sudo apt install build-essential fakeroot devscripts

Make a working directory for building the sources and get the sources from mpv:

rpi ~$ mkdir -p ~/src/debian/
rpi ~$ cd ~/src/debian/
rpi ~$ apt source mpv

Now build the program from source:

rpi ~$ cd mpv-0.23.0/
rpi ~$ sudo apt build-dep mpv
rpi ~$ debuild -b -uc -us

This finishes without error, only a warning that lintian cannot adjust a line of a man page. That is marginal. I get the Raspbian packets for installing mpv in ~/src/debian/. Now you can modify the code and do what you want and rebuild with debuild -b -uc -us. For further information look at BuildingTutorial.

  • definitely useful to know. I would like to modify the code, however
    – Alter
    Commented Jul 9, 2018 at 12:38
  • @Alter Have asked to add this info to your question.
    – Ingo
    Commented Jul 9, 2018 at 13:00
  • @Alter I have updated my answer to build mpv from Debian sources.
    – Ingo
    Commented Jul 10, 2018 at 12:31
  • Do you if this comes with MAAL hardware acceleration?
    – Alter
    Commented Jul 10, 2018 at 20:07
  • @Alter I'm unsure if I understand your question but I don't know nothing about development of mpv. Now you can look into the sources if it uses acceleration.
    – Ingo
    Commented Jul 10, 2018 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.