Raspberry Pi Multi Media Server
A very useful application for the Rasperry Pi is a Multi Media Center.
The most promising version looks like the XBMC distribution, see RaspBMC.
Update 2015-01-17: Version 14 (kodi) is out. The benefits you can read on the official web site. I will write about the bugs I found in kodi.
It looks like, that the analog Audio output (Headphone Jack 3.5 mm) in the Raspberry Pi B+ is improved, so you may no longer need an USB-Audio interface, see Links #12-14.
If you just want to listen to music, the Squeezelite player might be an alternitive, see Links #15.
Project XBMC, Media Server
A very good article was posted http://t3n.de/news/raspbmc-baust-mediaplayer-50-452902/ (in German).
Power supply 5 V, 1 A with cable with micro USB plug type Micro-B.
Housing for the raspberry pi, e.g. in transparent.
SD-card 8 GB, class 10, e.g. for about 7,30 EUR.
- Keyboard with USB plug
- Mouse with USB plug
- LAN patch cable
The easiest and most flexible distribution is http://raspbmc.com, in version 12.2 (Frodo). Under menu Download you will find two options:
Network Image (recommended) – the default installer image, always gets the latest version of Raspbmc.
Standalone Image – If you just want a standalone image that can be booted without a network connection for initial setup, then you can get the latest image here. This image will resize your SD card partitions to use the full size of your card on bootup. This image should only be used as a last resort, say if you live in a rural area and are planning to download the image at work.
I decided for the recommended alternative and downloaded the file installer.img.gz (network image, 17.1 MB).
After expanding the file you will get the file installerBMC.img (76,9 MB).
Next step was to bring the image file to the SD-card. For Mac OS X a good GUI program is Pi Filler, written in AppleScript by Ivanx.
- Now insert the SD-card in the slot of the rapsberry pi, connect the network, all the peripherals and power up.
- The installer fills the SD-card by about 764 MB. That takes about 10-15 minutes. Please watch that process on the connected screen.
- XBMC userdata is stored in /home/pi/.xbmc/.
Here I will describe, what bugs I found.
Network-Manager GUI missing
In order to work, you have to plug in a USB-WiFi/WLAN adapter, which is known to raspbian, see at WLAN.
Unfortunately the Network-Manager GUI I did not found in raspbian version 14 (kodi). That I am not alone, I could see at a forum thread, see at Links #3, titled Raspberry Pi network-manager zip download required. In post #5 I found a link to a zip archive Links #5, a Python Add-on, adopted to kodi. The download was successful:
$ wget --no-check-certificate https://github.com/downloads/vikjon0/script.linux.nm/script.linux.nm-0.1.4.zip Saving to: `script.linux.nm-0.1.4.zip'
Then I tried with options->settings->Addons Install from ZIP file.
# select: Home folder # select: script.linux.nm-0.1.4.zip # Answer: The requirements are not fulfilled, contact your ...
What requirements are needed are not told. So, I tried an installation by an example of a provided add-on.
# move the zip file $ mv script.linux.nm-0.1.4.zip .kodi/addons/packages # change directory $ cd .kodi/addons/packages/ # unzip archive $ unzip script.linux.nm-0.1.4.zip -d .. # reboot
Now you can find in Programm Addons the Network-Manager. It tells not compatible, but when you click on execute you get a window with the title WiFi Connections. When you click on Add, you get a list of Available Access Points, see the picture on the right (click to enlarge).
Double click on your own Access Point. The next window is titled Enter ecryption key. Enter with the virtual keyboard the WiFi/WLAN password and click on Ready/OK. Next click on X for closing this window.
In the mask Available Access Points click on Refresh. Under the field Name SSID you will see a > character in front of your Access Point if the password was OK. Next close this window with a click on the X. In the window WiFi Connections you will see now your Access Point, and click on X to close the window.
Next start Program->Settings and select in the Network Mode the mode Wireless (WiFi) Network. Then pull out the LAN cable and do a reboot.
Now have a look at Options->Information if you got another (WiFi/WLAN) IP number via DHCP.
Setup: per SSH:
- Find out in the router (e.g. Fritz.box) which IP address was assigned by DHCP to the raspberry pi.
- Login via Terminal, and change password:
# for example: $ ssh email@example.com password: raspberry
# change password $ sudo passwd pi #type new password
Setup: Under System in the GUI you can localize XMBC:
locales: for Germany: de_DE-UTF-8 UTF-8
Unfortunately the localization does not work, de_DE-UTF-8 is expected:
$ locale LANG= LANGUAGE= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= # tried an update $ sudo apt-get update # from http://forum.stmlabs.com/showthread.php?tid=8545 # it says update: yes, upgrade: NO
keyboard layout: In order to change the keyboard layout you have to do -
$ sudo dpkg-reconfigure keyboard-configuration Keyboard model: Generic 105-key (Intl) PC - OK Keyboard layout: German - OK Key to function as AltGr: The default for the keyboard layout - OK Compose key: No compose key - OK # but you get an error message: insserv: Service mountkernfs has to be enabled to start service keyboard-setup insserv: exiting now! update-rc.d: error: insserv rejected the script header # searching by google gives: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=621077 $ sudo apt-get install initscripts ... Preparing to replace initscripts 2.88dsf-34 (using .../initscripts_2.88dsf-41_armhf.deb) ... Unpacking replacement initscripts ... Processing triggers for man-db ... Setting up initscripts (2.88dsf-41) ... Installing new version of config file /etc/init.d/mountall.sh ... # Then dpkg-reconfigure keyboard-configuration works without problem # BUT the special keys, e.g. ÄÖÜß still did not work
Android Remote Control
It is possible to Remote Control XBMC via an Android App
As an USB WLAN dongle it was recommended Edimax EW-7811Un 150Mbps Wireless 802.11b/gn. You can plug in the WLAN dongle instead of the keyboard. First power down the raspberry pi, change device and power up again.
The first action is to install Add-on (Program) Network-Manager. Then start the Network-Manager and look for your WLAN Router. If you see it in the list, click on Add. Next you will be asked for the password. Enter that with the virtual keyboard. If it does not work, do a restart with the raspberry pi, and try again, or look in the troubleshooting section.
# First try a restart and check again the WLAN status in the Network manager. # check for the USB device $ lsusb Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] # check for interface "wlan0", see if an "inet address" is there. $ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:4a:3c:35 ... wlan0 Link encap:Ethernet HWaddr 80:1f:02:82:2e:84 inet addr:192.168.17.184 Bcast:192.168.17.255 Mask:255.255.255.0 inet6 addr: fe80::821f:2ff:fe82:2e84/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:163 errors:0 dropped:222 overruns:0 frame:0 TX packets:150 errors:0 dropped:1 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:35009 (34.1 KiB) TX bytes:42778 (41.7 KiB) # Have a look in the WLAN router, if the raspberry pi is seen in the WLAN section.
In order to connect the audio signal to an amplifier, HDMI is not very good suited. The Headphone Jack Analog Output (3.5 mm) is not so good, regarding sound quality. So, the solution is an USB-Audio interface. You can by them for under 10 EUR, see the pictures on the right. In order to find out, what it is, do:
$ lsusb -v ... Bus 001 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter ... # Input Terminal wTerminalType 0x0201 Microphone ... # Output Terminal wTerminalType 0x0301 Speaker ... # AudioControl bDescriptorSubtype 4 (MIXER_UNIT)
To get it into use, you have to go to Options->Settings->System->Audio-Output.
Audio Output Device: Select between HDMI and ALSA: Default(Generic USB Audio Device Analog).
An external sound module must be enabled in Program->Raspbmc Settings->System Configuration->System Upgrades
Select Enable external soundcards (blue marker)
In order to see, if USB-Audio is working, do:
$ cat /proc/asound/modules 0 snd_usb_audio 1 (null)
If you have a stuttering in the sound, please see at the Links #6-11
In order to get an Audio-Mixer for the USB-Audio device, go to Options->settings->Addons. Then click on Search.
Type in the search mask: audio mixer, and you will get XBMC Audio Mixer (version 2.0.5, type: Script). Click on Install. The addon will be downloaded and installed.
You can control just the microphone input and the speaker output level.
Beware: Once you have started the program, you need a keyboard to stop it with the ESC key. With the mouse only you can not stop the program (GUI). In version 3 (Kodi Audio Mixer) you will find now an OK button to exit with the mouse, thanks to ronie.
Airplay is also discussed in the XBMC forum.
Another hint from a forum recommends to change the system name from XBMC (raspbmc) to raspbmc.local, and reboot. But that did not help to make Airplay work, it just shows the presence in iTunes.
# show installed network services. $ networksetup -listallnetworkservices Gigaset Generic CDCACM Device SAMSUNG_Android SAMSUNG Modem Ethernet Adaptor (en0) FireWire # disable the IPv6 addresses $ sudo networksetup -setv6off "Ethernet Adaptor (en0)" # to switch IPv6 back on, or in System Preferences/Network/Options/ to "automatic": $ sudo networksetup -setv6automatic "Ethernet Adaptor (en0)"
That finally helped to stream from iTunes (version 11.02, on Mountain Lion 10.8.3) to the raspbmc (version 12.2), see picture.
List of pages in this category:
-- RudolfReuter 2013-04-30 15:10:35