Sunday, 2 August 2015

Installing Madsonic on Centos

Some notes on how I ported my Madsonic install from Windows to Centos.

I've put the OS on one disk and my music will live on the other. Set the 2nd disk up and copy my music across first:
pvcreate /dev/vdb1
vgcreate vg_mymusic /dev/vdb1
lvcreate -n lv_mymusic --extents 100%FREE vg_mymusic
mkfs.ext4 /dev/mapper/vg_mymusic-lv_mymusic
Edit fstab & mount to /mymusic
smbclient -L //media1
mount -t cifs //media1/media /mnt -o user=paul
cp -rf /mnt/* /mymusic

I have Madsonic runing on 4040 & 4443 (sssl) so open the firewall
Set FQDN & hostname in hosts or DNS.

Add a user to run it and make sure it can write to the music directory
useradd madsonic
chmod -R 770 /mymusic
chgrp -R madsonic /mymusic
Install & change options in /etc/sysconfig/madsonic
yum localinstall 20141017_madsonic-5.1.5200.rpm
MADSONIC_ARGS="--https-port=4443"
MADSONIC_USER=madsonic
Log into web interface and configure some options:
  • Change admin password
  • Set the media folder
    • Music /mymusic Index 1(all) Music-Artists Music Enabled
  • Scan the media folder
  • Update last.fm - artist cover sync & artist summary sync
  • Disable the guest user
  • I just have these icons available to normal users
    • Home, Artist, Playing, Starred, Genre, Random, Settings, Playlists, Playlists Editor
  • When creating users make sure you check "User is allowed to use last.fm feature" otherwise they won't see artist details.
  • I change the welcome message: 
__Welcome to Paul's Music Library!__
\\ \\
Play at your peril.....
Update the SSL cert by replacing subsonic.keystore in /usr/share/madsonic/madsonic-booter.jar
It's the same file that was used on the Windows version.

It appears that some of my wma files have the album cover art embedded into the audio file(??!!) This confuses ffmpeg when Madsonic attempts to convert them to mp3 to play. This can be fixed by updating the transcode options Madsonic passes to ffmpeg. This forces ffmpeg to transcode the first audio track rather than just the first track (which is the cover art)
  • For the audio->mp3 options change -map 0:0 to -map 0:a:0

Tip: If you're having problems playing some files - this is how I fixed my wma file problem
  • Turn the logging level up to debug (In general options Logfile logging level) to see what options are being passed to ffmpeg. Log file is /var/madsonic/madsonic.log
  • Pass these options manually to ffmpeg with debug logging flag to get extra detail
    • Eg: /var/madsonic/transcode/ffmpeg -i myfile.wma -map 0:0 -b:a 128k -v 0 -f mp3 -loglevel debug /tmp/myoutputfile.mp3

No comments:

Post a Comment