A while back I decided to turn a old Dell Inspiron Mini 10 netbook into a XBMC radio for the kitchen. My requirements where,
- Stream music from my server
- Stream online radio
- Remote control from my other devices
- Push media to device
- Low power consumption
Installing XBMC from ppa
First add the XBMC ppa repository to your apt-get list and then install XBMC
Configure for low power consumption
I am a big fan of turning off my devices when I do not use them. I am going to use the laptop for less than a hour on average each day so I do not want it running 24/7. In Linux there are two powersaving modes: Suspension and Hibernation. During suspension the machine is still running and uses a bit of power. In hibernation the RAM is dumped to the harddrive and no power is used.
When you use a normal kitchen radio you just flick the power switch when you leave. I really wanted that feature in this device. Since I am using a laptop it can survive on battery power for a couple of hours. So I wrote a small script that detects if there is a active external power connection to the netbook and shutdown if the user turns of the power (on the wall socket).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
Here i use the upower tool in Ubuntu to check current power status. The path (/org/freedesktop/UPower/devices/line_power_ACAD) may vary between systems. You can determine it by running the UPower command,
When the power is cut it will stop whatever is playing using the xbmc-send command (Full command list) and put the system into hibernation. The script is run in a while loop so the status is checked every 10 seconds. To run the script on boot save it to disk and edit /etc/rc.local (works on Ubuntu). The file should look something like this,
1 2 3 4 5
Setting up streaming and media push functions
Music streaming works out out-of-the-box in XBMC. Just hook-up your server via a NFS or SMB connection to the client. To get streaming Danish TV/radio I normally install the addons developed by Tommy Winther.
If you have several devices you can push content using the UPnP features build into XBMC settings (UPnP/Client). With this I can push music from my laptop/server to the radio with zero setup. I do however need XBMC installed on the device that sends contents.
If you want complete control of the radio without having a monitor attached I suggest using the web interface build into XBMC. There are some nice addons available to improve on the web experience (Chorus).