Another often-desired use case for Banana Pi is a media center. Kodi—formerly known as XBMC—and is the de facto standard for media centers. Therefore, people want to get Kodi on their devices.
The bad news is that to date, for several reasons, it is not possible to get hardware-accelerated video playback within the default player of Kodi on Banana Pi. It is also meaningless to just install the Kodi package from the Raspbian repository as it is compiled for the Raspberry Pi (just like VLC). Therefore, it does not work on the Banana Pi hardware.
However, we can compile Kodi from source and configure an external player to play 1080p content. Like in the previous recipe, this is also quite a complex and time-consuming task.
In this recipe, we are going to build a Kodi setup with working accelerated video playback by an external video player. To do this, it is necessary that you have configured at least one working hardware-accelerated video player (MPlayer or VLC) from the previous recipe.
The following ingredients are required to get Kodi working on Banana Pi:
The building of Kodi itself is relatively simple if you have completed the steps of the previous recipe. Let's do it:
Install the following packages:
$ sudo apt-get install automake autopoint bison build-essential ccache cmake curl cvs default-jre gawk gdc gettext git-core gperf libasound2-dev libass-dev libavcodec-dev libavfilter-dev libavformat-dev libavutil-dev libbluetooth-dev libbluray-dev libbluray1 libboost-dev libboost-thread-dev libbz2-dev libcap-dev libcdio-dev libcec-dev libcec1 libcurl3 libcurl4-gnutls-dev libcwiid-dev libcwiid1 libdbus-1-dev libenca-dev libflac-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libglew-dev libiso9660-dev libjasper-dev libjpeg-dev libltdl-dev liblzo2-dev libmad0-dev libmicrohttpd-dev libmodplug-dev libmp3lame-dev libmpeg2-4-dev libmpeg3-dev libmysqlclient-dev libnfs-dev libogg-dev libpcre3-dev libplist-dev libpng-dev libpostproc-dev libpulse-dev libsamplerate-dev libsdl-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libshairport-dev libsmbclient-dev libsqlite3-dev libssh-dev libssl-dev libswscale-dev libtiff-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libva-egl1 libva-tpi1 libvdpau-dev libvorbisenc2 libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils nasm pmount python-dev python-imaging python-sqlite swig unzip yasm zip zlib1g-dev gcc-4.8 libtag1-dev
Y
to continue the installation of the dependencies.$ git clone -b Helix https://github.com/xbmc/xbmc.git
$ cd xbmc
$ ./bootstrap
$ export CC=gcc-4.8 $ export CFLAGS='-march=armv7-a -mfloat-abi=hard'
$ ./configure --disable-debug --disable-vdpau --disable-vaapi
While configuring, various essential components for Kodi are built from source. The configuration will take up to one hour to complete.
$ make
The building process of Kodi takes a lot of time (a few hours). Eventually the shell will output the following message:
----------------------- Kodi built successfully -----------------------
$ sudo make install
Once Kodi is installed successfully, we can configure Kodi to use a video player as an external player.
playercorefactory.xml
file within your Kodi configuration directory:$ nano ~/.kodi/userdata/playercorefactory.xml
<playercorefactory> <players> <player name="smplayer" type="ExternalPlayer" audio="true" video="true"> <filename>/usr/bin/smplayer</filename> <args>-minigui -close-at-end -fullscreen "{1}"</args> <hidexbmc>false</hidexbmc> </player> </players> <rules action="prepend"> <rule filetypes="mkv" filename="*.*" player="smplayer"/> </rules> </playercorefactory>
The following screenshot shows the external player configuration of Kodi within the nano editor:
$ kodi
The following screenshot shows the Kodi logo while loading the media center on Banana Pi:
You have successfully installed Kodi on Banana Pi and configured an external player to bypass the hardware acceleration problem.
Just like in the previous recipe, we build the Kodi media center from the source code. As Kodi has a huge number of features, it requires a lot of packages pre-installed before we can build it along with its components.
Once these dependency packages are installed, we are ready to clone the source codes and initiate the building. The bootstrap script sets up the upcoming configuration script. The configuration script makes sure that all the required dependencies are met and begins the building of helper components that are needed for Kodi (for example, the multimedia solution FFmpeg
). The building of Kodi itself is a time-consuming task on Banana Pi, since it is such a comprehensive media center solution.
Unfortunately, to date, it is not possible to use the internal player of Kodi for hardware-accelerated video playback on Banana Pi. The chances that this will be solved in the future are good, but until then, we need to work around the problem. Luckily, Kodi offers the concept of external players. By using an external player that is configured in the playercorefactory.xml
file, we instruct Kodi to open specific multimedia files with external programs. In our case, we make use of SMPlayer we built in the previous recipe to play 1080p videos hardware accelerated while still having the functionalities of Kodi.
Consequently, the interface of the SMPlayer is not really integrated into Kodi. This means that you cannot use the features of Kodi while playing videos via SMPlayer. In my opinion however, the method used in this recipe offers the best possible solution to get a stable media center experience on Banana Pi.
If you prefer to run your Banana Pi as a media center only, you may start Kodi automatically after booting your device.
To start Kodi on boot, do the following:
~/.config/lxsession/LXDE
directories if not existent:$ mkdir -p ~/.config/lxsession/LXDE
~/.config/lxsession/LXDE/autostart
file:$ nano ~/.config/lxsession/LXDE/autostart
@kodi-standalone
$ sudo shutdown -r now
Kodi should start automatically on boot from now on. To disable Kodi on boot, simply remove the @kodi-standalone
line in the autostart
file or delete that file.
playercorefactory.xml
file at http://kodi.wiki/view/External_players3.135.221.17