I would like to build mpv from source for the raspberry pi. This is turning out to be quite difficult.
Error
pi@raspberrypi:~ $ ./mpv-build/mpv/build/mpv --hwdec=mmal --vo=rpi --log-file=~/mpv.log small.mp4
Playing: small.mp4
(+) Video --vid=1 (*) (h264 560x320 30.000fps)
(+) Audio --aid=1 --alang=eng (*) (aac 1ch 48000Hz)
Using hardware decoding (mmal).
VO: [rpi] 560x320 mmal
libEGL warning: DRI2: failed to authenticate
[vo/rpi] Could not create EGL surface!
[vo/rpi] EGL/GLES initialization for OSD renderer failed.
Could not initialize video chain.
Video: no video
[ao/oss] Can't open audio device /dev/dsp: No such file or directory
[ao] Failed to initialize audio driver 'oss'
Could not open/initialize audio device -> no sound.
Audio: no audio
Exiting... (Errors when loading file)
Setup & Procedure
OS: Raspbian Stretch 2018-06-27
Hardware: Raspberry Pi 3B/3B+
sudo apt-get update -y
sudo apt-get upgrade -y
sudo rpi-update
in raspi-config, go to advanced > memory split: 256
reboot now
sudo apt-get install -y gperf bison flex autoconf automake make texinfo help2man libtool libtool-bin ncurses-dev git yasm mercurial cmake cmake-curses-gui libfribidi-dev checkinstall libfontconfig1-dev libgl1-mesa-dev libgles2-mesa-dev gnutls-dev libsmbclient-dev libpulse-dev libbluray-dev libdvdread-dev libluajit-5.1-dev libjpeg-dev libv4l-dev libcdio-cdda-dev libcdio-paranoia-dev libmp3lame-dev libx264-dev
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build
export LIBRARY_PATH=/opt/vc/lib
export PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/
export CPATH=/opt/vc/include
# export LDFLAGS="-L/opt/vc/lib"
echo "--enable-libx264
--enable-omx-rpi
--enable-libmp3lame
--enable-mmal
--enable-gpl
--enable-nonfree
--disable-v4l2-m2m" > ffmpeg_options
echo "--enable-rpi
" > mpv_options
./update
./rebuild -j4
sudo scripts/mpv-install
Things I've tried
Links like this
sudo ln -s libbrcmEGL.so libEGL.so sudo ln -s libbrcmGLESv2.so libGLESv2.so
Links like this, (source)
sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so sudo ldconfig
Neither worked, so then I rebooted and did some more searching. I found some posts saying it was an opengl problem so I tried to install new opengl packages
sudo apt-get install -y libglu1-mesa-dev freeglut3-dev mesa-common-dev
That didn't work, so I thought maybe it couldn't find packages I already had installed. I tried exporting the variables that were used in the install
export LIBRARY_PATH=/opt/vc/lib
export PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/
export CPATH=/opt/vc/include
still nope.
Next I found a guide saying there needed to be an rpi-update. I had run one at the beginning, but I decided to try again.
sudo rpi-update
no luck!
Found another post that led to this
sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so
sudo ln -fs /opt/vc/lib/libEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1
sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so
sudo ln -fs /opt/vc/lib/libGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
After this point desperation and frustration sink in and further attempts go undocumented. Needless to say, nothing I tried worked, which leads me to post here
sudo apt install mpv
?