Installing and Configuring MPV in Cubian Base with a Cubietruck

Step 1: Log in as root
We're not going to dick around with sudo in this tutorial, so set your root password and log in as root.
Then, update for kicks.
cubie@Cubian:~$ sudo passwd root Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully cubie@Cubian:~$ exit Cubian login: root Password: root@Cubian:~# apt-get update root@Cubian:~# apt-get upgrade
Step 2: Write stuff in config files
Since MPV isn't part of Debian Wheezy, first add the Debian Jessie repo to /etc/apt/sources.list. 
root@Cubian:~# cd /etc/apt root@Cubian:/etc/apt# nano sources.list
On the bottom of the page add the following line
deb jessie main
Now press ctrl + x It will ask if you want to save. Press y. It will ask what filename to use. Press enter. Now update atp-get again.
root@Cubian:/etc/apt# apt-get update

Change the amount of memory dedicated to the VPU from 80 megabytes to 256 megabytes.
root@Cubian:/etc/apt# cd /boot/ root@Cubian:/boot# nano uEnv.txt
The last line of uEnv.txt should start with "extraargs=". Add
to the file. Save it. By default the VPU only has access to 80 megs of memory. Now it has access to 256.
Change some user permissions for video and audio
root@Cubian:/boot# cd /lib/udev/rules.d root@Cubian:/lib/udev/rules.d# nano 90-sunxi-disp-permission.rules
Add the following lines
KERNEL=="disp", MODE="0777", GROUP="video" KERNEL=="cedar_dev", MODE="0777", GROUP="video" KERNEL=="g2d", MODE="0777", GROUP="video"
Save and exit nano. Now add the default user "cubie" to the some needed groups. Alternatively if you have a different user prepared for this, use that.
root@Cubian:/lib/udev/rules.d# usermod -G sudo,video,audio cubie

Enable the sunxi VDPAU driver and it's experiment OSD support.
root@Cubian:/lib/udev/rules.d# cd /etc/ root@Cubian:/etc# nano environment
Add these lines:
Step 3: Install stuff
Use apt-get to grab almost everything you need.
root@Cubian:/etc# apt-get install xorg build-essential git libvdpau-dev mpv
Once that finishes use git to get the latest source for the video driver and then compile the drivers.
root@Cubian:/etc# cd ~ root@Cubian:~# git clone root@Cubian:~# cd libvdpau-sunxi root@Cubian:~/libvdpau-sunxi# make root@Cubian:~/libvdpau-sunxi# make install
Step 4: More configuration and Testing
All the necessary software should be installed at this point. 
Let's throw some basic configuration at MPV.
root@Cubian:~/libvdpau-sunxi# cd /etc/mpv root@Cubian:/etc/mpv# nano mpv.conf
Add these lines:
vo=vdpau hwdec=vdpau hwdec-codecs=all ao=alsa:device=[hw:1,0], pulse slang=en, fs=yes force-rgba-osd-rendering=yes
root@Cubian:/etc/mpv# reboot
Now we're ready to test MPV with your favorite video file. Login as cubie or whoever you usermodded above. Then try playing a video file.
cubie@Cubian:~$ cd ~/yourmoviesfolder cubie@Cubian:~/yourmoviesfolder$ startx -e "mpv yourvideofile.mkv"