Home Network Music Server

Objective of this class

  • DCMA / DRM / Palladin / Software Patents
  • Computer music playing
  • Where to get Music (Legally)
  • How to server music inside the house

DCMA / DRM / Palladium / Software Patents

You might wonder why as a teacher of Linux, I spend so much time and energy discussing things like DMCA (Digital Millium Copywrite Act) / DRM (Digital Rights Management). The answer is surprisingly simple. If many of these schemes succeed, it could be the end of Linux, by locking the Open Source Software out of the computer. I don’t want to see that happen, so I am trying to educate people on the issues. Clear?

This is another twist on the big companies trying to control your computer. Actually it involves two issues.

Software Patents

I am going to focus this on the European Union for the time being, because the EU is looking to codify the patient process for software, where the US is already going. The problem is that in the past software was handled just like math formulas. Ideas were not considered patientable. The idea was ideas can not be documented and controlled the way manufacturing designs can. The problem is that some companies are now using the patient process to lock others out of using an idea. You might think I am exaggerating, let me draw your attention to two cases as presented by John C. Dvorak in Patent Riots of 2003

The first is the Ugly TrueType and OpenType Font Display Patent.
According to the FFII site: "Rendering of Fonts is ugly and slow on Free
Software Systems. This is because when the TrueType standard was
promoted by Apple and Microsoft, they held a few patents which they
never asserted. The FreeType project has asked Apple to clarify the
situation, but did not get an answer. Instead, fearful customers of
Linux distributors such as SuSE and Redhat (sic) have demanded that any
possibly infringing FreeType features be disabled on these
distributions. TrueType is the dominating font standard and it is also a
part of new standards such as OpenType, in which Adobe participates.
Adobe also holds a few patents on which OpenType infringes. These
formats must be supported if GNU/Linux/XFree users are to be able to use
existing fonts on their platform of choice." <br>

And then there is one of many Adobe actions. This one is good since it
impinges on GIMP (GNU Image Manipulation Program): "In summer 2001 Adobe
attacked Macromedia for infringing on its US patent no. 5546528 which
lays claim to the idea of adding a third dimension to menus by grouping
them as tabbed palettes one behind the other. The European Patent Office
(EPO) has illegally granted EP0689133 with exactly the same set of
claims and priority date of 1994-06-23 on 2001-08-06, after five years
of examination period. Many programs, including free software such as
The GIMP, infringe on this patent and will therefore be at the mercy of
Adobe, if the EPO's practice of granting software patents is made
enforceable by a Directive from the European Commission."

For More information I suggest you have a look at: the Foundation for Free Information Infrastructure

DRM / Palladium

Could Microsoft design the next version of Office to prevent other companies from reading their *.doc files? Well it seems that is part of the planning. Have a look at Microsoft palladium threat just around the corner now.

If this does not scare you, please discuss your ideas with the rest of the group. This appears to be another unintended result of the DMCA law.

Computer music playing

I don’t know if you like to listen to music when you are at the computer or not, but I do. Linux has long supported programs for playing music CDs such as KsCD, Kaboodle, Aimux, or XMMS. These programs can play a number of music formats from *.wav, to *.midi, and many others inbetween.

The format used on most music CDs is called wav format. These files are relative large but the music reproduction is quite good. You will get an idea of their size by realizing that a CD can hold up to 640 Megabytes of information. Yes I know that some go even higher. Now consider that a music normally plays for only 45 minutes which works out to 640 / 45 or 14.22 Meg/minute. Another popular format is the MP3 format. This format came from Motion Picture standard 3. It creates music files of about 1 Meg/minute size.

This size reduction is valuable when you are moving music around on the internet. Now to be honest, there is some loss of quality when converting *.wav files to *.mp3 files. But I can barely hear it using high quality headphones. Since you asked, there is a program in Linux called sox , “Sound eXchange : universal sound sample translator”, which can convert from one music format to another. It supports these file formats: aiff al au auto avr cdr cvs dat vms gsm hcom la lu maud nul ossdsp raw sb sf sl smp sndt sph 8svx sw txw ub ul uw voc vorbis wav wve.

The easiest way to play a file is to start XMMS and see if it will play it. This program is the best supported player on Linux, but even it will not handle all the formats.

OK, suppose you have music in *.mp3 format. You can play it on your computer by using the XMMS program directly. There is one other program which works well on Linux, it is zinf. It is another mp3 player which I will discuss more about later.

Suppose you want to store the *.mp3 files on your linux server and share them to the other computers in your house. There are two methods I use, one is better for windows, and the other for Linux. You can implement either or both.

Music directory sharing for Linux

For Linux I use a method called NFS (Network File System). This allows me to designate some directories for remote mounting by other Linux computers. Lets suppose I have a directory tree starting at /opt/music that I wish to share with the house as defined in our home network. I would first create the file /etc/exports to say:

        /opt/music  192.168.1.5(ro) 

Next we should define the computers which are allowe to use this scheme. We start by denying access to everyone in the file /etc/hosts.deny:

        portmap:ALL

Next we grant permission to our Linux user to mount the filesystem in /etc/hosts.allow:

        portmap: 192.168.1.5

OK, if the configuration files are ready, and if you have the rpm package nfs-utils installed, you should be able to issue the command service nfs start as root. You can check that the program is running with the command rpcinfo -p look for the lines labeled nfs in the output.

Music directory sharing for Windows

So the question next is how can we allow the windows workstations see the music files? The answer is of course, via samba. In the samba config file you add a section which looks something like this:

[music]
   comment = Music Share Point
   path = /opt/music
   public = yes
   writable = no
   printable = no
   write list = @staff

Once your samba configuration file is modified issue the command service smb restart as root.

Connecting to the Music server with a Linux workstation

Lets start by assuming you are using the Home Network we configured. Your workstation is Apollo, and your server is Wizard. Now that we have Wizard configured to serve the music from /opt/music using NFS, we need to mount that directory on Apollo.

First lets create the directory /mnt/music. This is a convient place to connect the NFS mount. The /mnt directory is the common place to mount other file systems. Now you use the command mount -v -t nfs -o ro wizard.home.org:/opt/music /mnt/music . That will mount the NFS directory /opt/music from the server onto /mnt/music on your local workstation.

Connecting to the Music server with a Windows workstation

Now your windows users will see the directory in the windows explorer window. You can even use the Tools menu in the explorer to map this directory to a drive letter for easier access. You will note that I made this directory read only for both of the workstations. This setting is up to you, depending on who you want to add music to the directory.

Where to get Music (Legally)

Now I know about Kazaa, and Napster, but for this presentation I am going to show you how to get mp3 music files legally for what I think is a good price. In addition they support linux access to the music.

The web site I found quite good is Emusic . They sell music on a subscription basis. You can signup for 3 Months or 12 Months at a time. If you sign up or 3 months it costs $14.99/month, or 12 months at $9.99/month. They also have a trial period of 14 days or 50 songs. This lets you try them out before you commit to one of the subscription plans.

A couple of things I liked about Emusic are that you pay by the month not the song. So for example, I had a 3 month subscription in which I downloaded about 80 albums of music. In my case that comes out to about 1408 files. For $45, I think that is a good deal. Another thing I like is you can down the album over and over. They keep a record of the music you downloaded and allow you to download it again. So I can download something at home, and then again at work to listen to there. The mp3s do not contain DRM or other restrictions, so I can make my own CD’s of MP3 files.

No I am not a sales man for Emusic, but I think they have a good deal for online music, legally.

Music Players

I said Emusic supports Linux, what they have are two music players they support. One of them is the program zinf , which used to be known as freeamp. They have another music player called MusicMatch Jukebox but it is only for Windows. By the way, zinf also works under windows, so if you want a consistent look, use the same program in both environments.

The reason they have supported players is because their web site uses a download manager built into these two music players. When you select to download an album, the web browser signals the download manager in the player, which handles the download of all the mp3 files in the album. This simplifies the downloading since it steps through the whole album one mp3 at a time.

The mp3 files contain information which zinf uses to show you the name of the artist, and the titles. Here is the display as seen from the button My Music in zinf.

This application has the ability to create play lists by adding music to the right side and then clicking on the save playlist button.

OK, now we know how to play music on the computers inside the house, but how can I play these on my HiFi system?

How to server music inside the house

The key to playing MP3s on a hifi system is getting the music to the Sound System. For this I use a product called Extreamer .

This little box is about the size of a pack of cigarettes. It basically connects to the computer network through a network cable. It then connects to the sound system using a pair of RCA cables. It also has a jack for a headphone or a set of amplified speakers as used on a computer. For those of you with Wireless, there is wireless version of the box now.

The key to the system is a program called zServer . This is the software which controls the box. The program is written in Java, so it runs happily on a Linux server. Any yes, the zserver is opensource so if you want to rework it, write them.

Configuring the zServer

The server comes as a .exe or a .zip file. I recommend you download the .zip file. Next you need to unzip it in convient place. I chose /usr/local/extreamer.

One thing I would recommend before you install the Zserver is to make a place for your playlists and MP3 files. I added a new partition to my system and mounted it in /mnt/emusic.

Extra credit for those who know how to partition a hard disk, make file system on it, and add it to the system mount table.

I then created a directory /mnt/emusic/playlists to save the play lists created with Zinf. When ever I download music I place it in a series of folders under the /mnt/emusic root. For example, I downloaded an album by the artist Sukay and the album was called “Andean Pan-Pipes”. So I created the directory structure /mnt/emusic/Sukay/Andean_Pan-Pipes/ and placed the MP3 files in this directory. This by the way, is the default operation of the download manager in Zinf.

If you do not have Java ver 1.4.0 installed on your system, you should down load and install this first, If you do not have java installed go to The Source for Java Technology Once it is installed you should have the java executable in your $PATH statement. Of not you can simply add the full path name of the java file to your scripts.

The configz.bat file looks like this:

@ECHO OFF
ECHO **********************************************************
ECHO Download first Java Virtual Machine at least version 1.3.0
ECHO available free at java.sun.com.
ECHO **********************************************************
ECHO ____________________________________________
ECHO Press any key to continue or Ctrl-C to abort
PAUSE
@ECHO ON
java -jar -classpath .; ExstreamerSetup.jar

Since we are running Linux we can ignore all but the last line. If the java executable is in your path, you can just run the last line as root, with this change.

java -jar -classpath . ./ExstreamerSetup.jar

Notice I removed the semicolon and added a ./ to the jar file. This is because the semicolon is interperted by the shell, and the current directory is not part of the normal path. Otherwise, I was able to run the batch file as written.

To start the zserver at boot up, I created a file startz.sh with the following contents. This is modled on the startz.bat file supplied.

    #!/bin/sh
    # File: /usr/local/extreamer/startz.sh
    # Date: Wed Jan 29 21:51:41 EST 2003
    # Last Revised: Time-stamp: <2003-03-02 19:45:19 root> maintained by emacs
    # Description: Startup file for zserver
    # $Id: $ 
    # ===================================================================

    # Set the Path first
    set PATH=$PATH:/usr/java/j2re1.4.0/bin

    cd /usr/local/extreamer

    /usr/java/j2re1.4.0/bin/java -jar -showversion -classpath . ./zServer.jar >/dev/null

The first part of the file is just comment. I then include the java path in the local path statement. Finally I set the -classpath to the current directory, or .(dot). I then include the jar file zServer.jar by indicating that it is in the current directory. The final step is to modify the file /etc/rc.d/rc.local to run this script at startup. The modified part of rc.local looks like:

    # Start the Java server for Pan
    /usr/local/extreamer/startz.sh &

Playing Music

On my system at home, the web page for the music box, which I call Pan looks like this:

I set up the box so it sits on top of the HiFi system. It connects to the audio input labeled Video. So to play one of the albums listed, you just go to the web page and double click on the album title. Pan then plays the music through the sound system. To access pan I just go to the URL: http://pan, the zServer software does the rest.

Closing Remarks

There are many other sound tools available for Linux, from players to synthesizers. I am not going to go into all of these. The environment is rich with tools and flexable in how you use it.

I want to point out how a company like Emusic puts the lie to the RIAA (Recording Industry Association of America) claims of how expensive music is. I figure someone is making money on Emusic which is associated with MP3.com. If I only downloaded one album per week for a year, I would get 52 CDs worth of music for $120.00 or about $2.31 per CD. So go figure how much the music is worth. Yes I know there might be more to this, but when the RIAA starts sueing 12 year olds, I begin to wonder about the business model.



Written by John F. Moore

Last Revised: Wed Oct 18 11:01:35 EDT 2017

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
HTML5 Powered with CSS3 / Styling, and Semantics