Reader small image

You're reading from  Banana Pi Cookbook

Product typeBook
Published inJun 2015
Publisher
ISBN-139781783552443
Edition1st Edition
Right arrow
Author (1)
Ryad El-Dajani
Ryad El-Dajani
author image
Ryad El-Dajani

Ryad El-Dajani is a software engineer and passionate technology enthusiast. He developed an interest in computers when he was 10 years old. Soon thereafter, he began to learn his first programming languages. After he had completed his training as an IT specialist, he worked on several e-commerce Internet projects. Currently, he is studying business computing and works for a big IT company in Germany, realizing various IT projects based on Java or .NET technologies. Besides the classic application development, he has professional experience in realizing projects based on web frameworks such as Spring, Play, Symfony, eZ Publish, and Magento. Moreover, he has been excited about all kinds of Unix-like embedded systems since the revolutionary SheevaPlug.
Read more about Ryad El-Dajani

Right arrow

Chapter 6. Multimedia

In this chapter, we will cover:

  • Configuring the audio device

  • Getting accelerated video playback

  • Setting up Kodi

  • Setting up an infrared remote control using LIRC

Introduction


Multimedia can be quite challenging on Banana Pi, and a lot of people are frustrated because of advanced low-level problems regarding hardware-accelerated video playback. Therefore, this chapter deals with multimedia-related problems. The two audio outputs (analog and HDMI) are configured. We will discuss and solve the hardware acceleration problem by compiling the important Video Decode and Presentation API for Unix (VDPAU) library. Using the previously mentioned components, we are going to configure the video players MPlayer (and its GUI frontend SMPlayer) and VLC. Furthermore, we are going to build Kodi (previously, XBMC) and work around the acceleration problem by using SMPlayer as an external player. Also, we want to introduce the reader to the IR interface, which we are going to configure using the LIRC.

Configuring the audio device


There are two common ways to output audio on Banana Pi. You can pass-through the digital audio signal via HDMI to your television or audio/video receiver, or you can output the signal via the analog line out.

Getting ready

The following ingredients are required to handle audio on Banana Pi:

  • A Linux system on Banana Pi

  • Access to the shell

  • Either an HDMI connection to your TV, audio/video receiver, or…

  • A set of stereo headphones or stereo jack cable to any analog audio receiving device with 3.5 mm jack

How to do it…

We are configuring both the HDMI pass-through and the analog audio output in this recipe. In both cases, we have to configure the audio output via the system configuration file /etc/asound.conf (also called asoundrc).

Configuring HDMI pass-through

The following steps explain how to enable the HDMI pass-through of the digital sound signal:

  1. Open a shell.

  2. With an editor such as nano, edit or create the system configuration file called /etc/asound.conf:

    $ sudo nano...

Getting accelerated video playback


Many people want to be able to play videos on their Banana Pi in 1080p. Unfortunately, this is quite a complex task, as there are unresolved issues with the software and drivers on Linux. However, it is possible to get accelerated video playback working if you know the required tricks.

In this recipe, we are going to get accelerated video playback working. To do so, we need to perform the following tasks:

  1. Build the accelerated Xorg video driver and configure the Xorg server.

  2. Build various libraries.

  3. Install and configure our video players.

We are going to go through the required tasks step by step.

Note

This recipe is complex because there are a lot of dependencies and configurations involved. It works on the Raspbian operating system for Banana Pi and Banana Pro. However, on other distributions, the required steps may differ.

Getting ready

The following ingredients are needed to get hardware-accelerated videos working on Banana Pi:

  • A Linux system on Banana Pi

  • Access...

Setting up Kodi


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...

Setting up an infrared remote control using LIRC


In the last recipe of this book, we will discover the possibilities of setting up an infrared remote control using the LIRC application.

Getting ready

The following components are needed to set up a remote control on Banana Pi:

  • A Linux system on Banana Pi

  • A remote control sending infrared signals

  • An HDMI connection to your TV

  • A keyboard and mouse connected to your Banana Pi

This recipe is valid for most remote controls. We are using a remote control (shown in the following picture) of a well-known manufacturer:

In most cases, any other remote control should work just fine if it emits infrared signals.

How to do it…

As a first step, we need to set up LIRC to recognize each button pressed on your remote control. Afterwards, we need to configure what should happen when we press buttons on the remote control.

Configuring LIRC to recognize the remote control

The following steps explain how to set up a remote control with LIRC:

  1. Boot your Banana Pi into the desktop...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Banana Pi Cookbook
Published in: Jun 2015Publisher: ISBN-13: 9781783552443
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ryad El-Dajani

Ryad El-Dajani is a software engineer and passionate technology enthusiast. He developed an interest in computers when he was 10 years old. Soon thereafter, he began to learn his first programming languages. After he had completed his training as an IT specialist, he worked on several e-commerce Internet projects. Currently, he is studying business computing and works for a big IT company in Germany, realizing various IT projects based on Java or .NET technologies. Besides the classic application development, he has professional experience in realizing projects based on web frameworks such as Spring, Play, Symfony, eZ Publish, and Magento. Moreover, he has been excited about all kinds of Unix-like embedded systems since the revolutionary SheevaPlug.
Read more about Ryad El-Dajani