Logitech Media Server on Cubox

by Michael Birch

Setting up Logitech Media Server and Squeezelite player on a Cubox.

In a previous post I described how I installed Debian hardfp headless server on my Cubox

I followed the Solid Run instructions and also Complete Logitech LMS setup on Cubox.

First, update the package manager and install some dependencies

apt-get update
apt-get upgrade
apt-get install libjpeg8 libpng12-0 libgif4 libexif12 libswscale2 libavcodec53

Download LMS

wget http://downloads.slimdevices.com/LogitechMediaServer_v7.7.2/logitechmediaserver_7.7.2_all.deb

Install LMS

dpkg -i logitechmediaserver_7.7.2_all.deb

Patch hardfp Linux version

apt-get install patch
/etc/init.d/logitechmediaserver stop

wget http://allthingspi.webspace.virginmedia.com/files/lms-rpi-raspbian.tar.gz
tar -zxvf lms-rpi-raspbian.tar.gz
patch /usr/share/perl5/Slim/bootstrap.pm lms-rpi-bootstrap.patch
mv arm-linux-gnueabihf-thread-multi-64int /usr/share/squeezeboxserver/CPAN/arch/5.14/
mv libmediascan.so.0.0.0 libfaad.so.2.0.0 /usr/local/lib
mv /usr/share/squeezeboxserver/Bin/arm-linux/faad /usr/share/squeezeboxserver/Bin/arm-linux/faad.old
mv faad /usr/share/squeezeboxserver/Bin/arm-linux
ln -s /usr/local/lib/libmediascan.so.0.0.0 /usr/local/lib/libmediascan.so
ln -s /usr/local/lib/libmediascan.so.0.0.0 /usr/local/lib/libmediascan.so.0
ln -s /usr/local/lib/libfaad.so.2.0.0 /usr/local/lib/libfaad.so
ln -s /usr/local/lib/libfaad.so.2.0.0 /usr/local/lib/libfaad.so.2
ldconfig
chown -R squeezeboxserver:nogroup /usr/share/squeezeboxserver/

Found that I needed to install libexpat1 and nfs-common as recommended on http://www.solid-run.com/phpbb/viewtopic.php?f=4&t=1043&start=20#p7373

apt-get install libexpat1
apt-get install nfs-common

I plugged a FAT USB HDD in the lower USB on the Cubox and mounted using:

fdisk -l 
mkdir /music
mount /dev/sda1 /music

To make this work on boot I learnt about the /etc/fstab file.

/dev/sda1 /music vfat auto,user,iocharset=utf8 0 0

Installing the Squeezelite player

Install the required dependencies

apt-get install libasound2 libflac-dev libfaad2 libmad0
wget http://squeezelite.googlecode.com/files/squeezelite-armv6hf
chmod +x squeezelite-armv6
mv squeezelite-armv6 /usr/bin

Download the squeezelite init script and install it:

wget http://server.vijge.net/static/cubox/squeezelite-initd-script.sh
chmod u+x squeezelite-initd-script.sh
mv squeezelite-initd-script.sh /etc/init.d/squeezelite
update-rc.d squeezelite defaults

List the output options:

squeezelite-armv6hf -l

This showed the default:

default:CARD=DAC               - USB Audio DAC, USB Audio - Default Audio Device

Edit the init script file

vi /etc/init.d/squeezelite
SLOPTIONS="-o hw:CARD=DAC"

Got it working but the sound was dropping out. I found more information about squeezelite and added Alsa parameters:

SLOPTIONS="-o hw:CARD=DAC -a 80:4:16:0"

Also did this fix: fixing LMS for Cubox with transcode support

apt-get install sox flac
mv /usr/share/squeezeboxserver/Bin/arm-linux/sox /usr/share/squeezeboxserver/Bin/arm-linux/sox.old
mv /usr/share/squeezeboxserver/Bin/arm-linux/flac /usr/share/squeezeboxserver/Bin/arm-linux/flac.old
cp /usr/bin/sox /usr/share/squeezeboxserver/Bin/arm-linux
cp /usr/bin/flac /usr/share/squeezeboxserver/Bin/arm-linux

chown -R squeezeboxserver:nogroup /usr/share/squeezeboxserver/

Network share the mounted USB hard drive

apt-get install samba
cd /etc/samba
cp smb.conf smb.conf.bak

http://www.ghacks.net/2010/03/16/connect-to-a-samba-share-from-os-x/

rm smb.conf
touch smb.conf

The IP address for my MacBook Pro is 192.168.1.2 and is fixed. Get the netbios name and workgroup from system preferences -> network -> advanced

add these lines to smb.conf

vi smb.conf
[global]
netbios name = MACBOOKPRO
workgroup = WORKGROUP
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
interfaces = 192.168.1.2
[SHARE]
comment = COMMENT
path = /music
writeable = yes
create mode = 0750
locking = yes
smbpasswd -L -a root

Enter root password for the cubox

restart Samba

/etc/init.d/samba restart

Controlling the player

I usually use my laptop to control the player, via the web interface at http://mikes-cubox:9000/. I have also installed the Logitech Squeezebox Controller on my Android phone.

blog comments powered by Disqus