bugged.be

"Think outside the [B0X]"
Icon

Headless ubuntu server cd player/ripper

Goal

Create a headless device to rip and play cds.

Required hardware

  • Cpu that can run Ubuntu server 12.10 LTS
  • Hard disk big enough to store all your music
  • Network

Required software

  • Ubuntu server 12.10 LTS
  • abcde (A Better CD Encoder)
  • halevt
  • mpd (Music player daemon)
  • ajenti
  • alsa

1 Install OS

Install Ubuntu with only ssh and samba (select somewhere at the end).

2 abcde

install:

sudo apt-get install abcde

Add or edit /etc/abcde.conf

PADTRACKS=y
INTERACTIVE=n
METAFLACOPTS=""
ACTIONS=cddb,read,encode,tag,move,clean
CDROM=/dev/cdrom
OUTPUTDIR=/music
WAVOUTPUTDIR=/music/tmp
OUTPUTTYPE=flac
OUTPUTFORMAT='${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}-${TRACKFILE}'
VAOUTPUTFORMAT='Various Artists/${ALBUMFILE}/${ALBUMFILE}-${TRACKNUM}-${ARTISTFILE}-${TRACKFILE}'
EJECTCD=y

3 halevt

install:

sudo apt-get install halevt

Add or edit /etc/halevt/halevt.xml

<halevt:Device match="hal.volume.disc.has_audio = true">
 <halevt:Insertion exec="/usr/bin/cd_autorip.sh"/>
</halevt:Device>

<halevt:Device match="hal.volume.disc.has_audio = false">
 <halevt:Insertion exec="/usr/bin/cd_eject.sh"/>
</halevt:Device>

Create script files that will be called when cd event occurs:
/usr/bin/cd_autorip.sh:

#/bin/bash

PATH=/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
/usr/bin/abcde -NV 2>&1 | tee /home/all/log/abcde-auto.log

exit

/usr/bin/cd_eject.sh:

#/bin/bash
#add 3 secs to allow cdrom the init
sleep 3
/usr/bin/eject
exit

4 mpd

install:

sudo apt-get install mpd

Edit lines in /etc/mpd.conf:

music_directory        "/home/all/music"
user                "root"

5 Ajenti

This step is optional but makes managing users and shares a bless.

install:

wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update && apt-get install ajenti
service ajenti restart

The panel will be available on HTTPS port 8000. The default username is root, and the password is admin

(Ref.:http://support.ajenti.org/topic/349868-installing-on-ubuntu/)

6 Alsa

This is optional if other sound system is used.

sudo apt-get install alsa-base alsa-tools

7 Add users to sudoers

halevt  ALL=(ALL:ALL) ALL
avahi   ALL=(ALL:ALL) ALL
mpd     ALL=(ALL:ALL) ALL

Category: Linux, server

Tagged: