ITunes

From openSUSE

Contents

The Short Way (for desktop users)

Prepare

1. Install amarok and mt-daapd.

2. We need to let the service's traffic through your firewall: open YaST and go to Security & Users » Firewall » Allowed Services, click Advanced and add 3689 to the TCP and UDP boxes and click OK, next etc. to apply your settings.

Share

1. Run amarok and choose Settings » Configure Amarok » Media Devices, click Add Device and choose Music Sharing.

2. Go to your music collection and you will see a "share my music" button. Use it to, well, share your music.

Access the shares with amarok

To view your share, or any other, go to the media devices section, choose "Shared Music" from the drop-down and use the connect button. With the small configure button on the right you can choose a different machine.

The Long Way

Introduction

Note: This is shamelessly stolen from SBLUG article on this topic. I modified sections relevant to setting this up on opensuse 10.2.

If you follow the directions below you will have a daapd or "iTunes" music server using the DAAP protocol. This allows you to share a playlist and shared drive to all iTunes or compatible players (such as Amarok and Banshee). You can share not only the actual raw mp3 streams but *.mp4 *.m4a *.aac and *.ogg.

Getting what you need

Install the following packages:

  • mt-daap - mt-daapd - Multi-Threaded DAAP Daemon
  • mDNSResponder - Multicast DNS Services (Apple Rendezvous)
  • libid3tag - ID3 Tag Manipulation Library
  • mpeg4ip - and dependent libraries for acc/mp4 support

Configuration

The example config is pretty self explanatory. The following is an example used on a testbed server that should give you a good idea of what you need to change:

web_root        /usr/share/mt-daapd/admin-root
Port            3689
ServerName     Music Server
admin_pw        blah
db_dir          /var/cache/mt-daapd
mp3_dir         /mnt/crapola/music
servername      Music Server
playlist        /etc/mt-daapd.playlist
#password       mp3
rescan_interval 300
compress 1

The main things here are the web_root which allows a web interface to run on http://host:3689 This is handy for when you add more music but don't want to restart the service. The admin_pw is the actual password you will need to login to the web interface. The mp3_dir is going to be where your share of mp3s are hiding. Point this to the top level directory. Make sure to put playlist pointing to the mt-daapd.playlist as this will allow us to create "Smart Playlists" If you want to password your daapd music shares have the #password uncommented. The rescan_interval causes the daemon to go out and look for new music every 300 seconds. This is good if people are downloading new music into the directories. Compress is a must when you start transferring that 15 MiB playlist across the network.

Start the server

Issue the following commands to make sure the service starts on boot:

chkconfig --add mt-daapd
chkconfig --add mdnsd

The start the services:

service mt-daapd start
service mdnsd start

We have now started the actual daemon that controls the daap protocol and the Apple DNS responder A.K.A. Rendezvous A.K.A ZeroConf Fire up iTunes and you should see Music Server listed on the left side. If you do not see this chances are you do not have iTunes set to listen for shares. Navigate to preferences and check the box that listens for music shares.

Great one playlist...this stinks!

As you can tell there is just one playlist called Recently Added if you used the default /etc/mt-daapd.playlist. You can edit this file and add your own settings. Chances are you want Smart Playlists that sorts the music based on genre or artist. The example has very good examples of the many ways to do this. The following is an example from the test bed server:

"Acoustic" {
  genre includes "Acoustic"
}

"Big Band" {
  genre includes "Big Band"
}

"Blues and Jazz" {
  genre includes "Blues"
}

"Christian" {
  genre includes "Religious" ||
  genre includes "Christian Rap" ||
  genre includes "Contemporary Christian"
}

"Christian Praise" {
  genre includes "Contemporary Christian"
}

"Christian Rap" {
  genre includes "Christian Rap"
}

"Christian Rock" {
  genre includes "Religious"
}

"Country" {
  genre includes "Country"
}

"Pop" {
  genre includes "Pop"
}

"Rock" {
  genre includes "Rock"
}

"Soul" {
  genre includes "Soul"
}

"Soundtrack" {
  genre includes "Soundtrack"
}

"Techno" {
  genre includes "Techno" ||
  genre includes "Electronic"
}

"Top 40" {
   genre includes "Top 40"
}

You can use things like artist includes "Third Day" instead of genre. If you want to string "and" to the playlist use the || at the end of a line. After you have done a major chance restart the services!

What else?

Using the Rendevous Proxy you can actually use this across the internet to keep your music accessible anywhere. This is not a method to pirate music. This is simply a way to keep all the computers on your network on the same music database. This would be great for a house with 3 or 4 computers and a linux server. Other uses are the SlimDevices network mp3 players that hook into stereo equipment.