Multimedia on the Raspberry Pi with omxplayer - Page 1
Introduction
The Raspberry Pi is a credit-card sized computer board,
designed to inspire a new generation of computer users to become
interested in programming. However, this single-board computer also has
lots of potential to be used in different areas.
There are an increasing number of distributions that are
available for the Raspberry Pi. Besides the ones listed
on Raspberry Pi's Downloads page (Debian
"squeeze", Arch Linux ARM and QtonPi) users can download Fedora Remix,
IP Fire, OpenELEC, Raspbmc, Bodhi Linux, amongst others. There are also
lots more distributions in the pipeline. Bear in mind that all of the
distributions have one thing in common; they are all works in progress
and nowhere near ready for mainstream use.
The video capabilities of the Raspberry Pi have led to
interest in the device being used as a home media centre. This
interest has been generated because the Pi's VideoCore IV GPU
offers Open GL ES 2.0, hardware-accelerated OpenVG, and 1080p30 H.264
high-profile decoding. The GPU is capable of 1Gpixel/s, 1.5Gtexel/s or
24GFLOPs with texture filtering and DMA infrastructure.
Having experimented with most of the distributions, we keep
gravitating back to Raspbian. It feels the most responsive in X
Windows, and is a bit more polished than the others. The
aim of Raspbian is to make available tens of thousands of Debian
packages specifically optimized for the Raspberry Pi hardware. There
has not been an official release of Raspbian to date, but the
unofficial Pisces image goes some way to provide a good configured
system.
Nevertheless, there were a number of things we needed to
manually configure in Raspbian to provide a good foundation for
multimedia adventures. The first modification is to remove the
unwelcome
black border from around the screen. This required the following
commands to be inserted into the file /boot/config.txt.
overscan_left=-40
overscan_right=-40
overscan_top=-40
overscan_bottom=-40
Next, we needed to get sound working. The ALSA drivers are still
in an alpha stage of development so have not been configured. To
install the ALSA utilities - which include amixer (a command line
mixer), alsamixer (curses mixer), and aplay, arecord (command line
playback
and recording), we type:
$ sudo apt-get install alsa-utils
We then need to install and enable the sound driver module. In the
example below, we have chosen to have the audio output routed to the
headphone socket.
$ sudo modprobe snd_bcm2835
$ sudo amixer cset numid=3 1
So that the sound driver module is loaded at boot time, we need to add
the following text to the /etc/modules file (using an editor such as
nano, pico, or vi).
snd_bcm2835
By default, Raspbian Pisces allocates 32MB of RAM to
the video with the remaining 224MB to the operating system. However,
this allocation of RAM prevents omxplayer running.
To watch videos with oxmplayer, we need to allocate at least
64MB of RAM to video. To do this, we replace the start.elf file
(which dictates the allocation of RAM) by
typing the following commands at the shell prompt:
$ cd /boot
$ sudo cp arm192_start.elf start.elf
After rebooting the Pi, the system allocates 64MB to the
video which is sufficient for omxplayer to play video files.
We also wanted to configure Raspbian to access our NAS drive.
The quickest way to access shares on the NAS is to add the following
line to the bottom of /etc/fstab, having first created a /media/nas
directory with the appropriate permissions.
//192.168.1.103/share_name /media/nas cifs
username=XXX,password=YYY
We also experimented with installing FuseSmb. There is a good
guide to configure FuseSmb on Ubuntu's website
(at https://help.ubuntu.com/community/FuseSmb). In addition, it
was useful to resize the ext4 partition on the SD card so that the
Raspberry Pi can access the entire card, to test playing
files direct from the SD card itself.
Next Page: Installing omxplayer
& more
Read ahead
1. Introduction
2.
Installing omxplayer & more
3. In
Operation & Summary
Last Updated Sunday, June 17 2012 @ 01:36 PM EDT |