The MacValley blog

 

Welcome to the MacValley blog, your first stop for all the latest MacValley news and views.

 

Tom Briant

The MacValley blog

Editor: Tom Briant

 

Click here to email Tom

Click here for Tom's profile

 

 

To search the blog posts please use the box below

Saturday, May 10, 2014

The OS X Friendly Linux Music Server-I try it again

Posting a preview of a MacValley Voice article about the forked-daapd Linux music software and how to install it from the Debian Linux repositories into Ubuntu Linux has proven my most popular article. When  I Google myself on this topic, I see that my old post pops to the top of the listings. 

I feel some embarrassment about this. forked-daapd has not kept up with the times. It stops playing a streamed track from a Linux iTunes music server after a few minutes. I can only apologize to those of you who read my article in hopes of solving the iTunes music server conundrum, only to find yourselves thwarted. My apologies. 

So I’ve looked for a solution to this problem. I’ve looked for an update to forked-daapd past the 0.19 model in the Ubuntu Linux repository from other writers. They may well have solved the puzzle, but I haven’t found it in an easily installable format that I could recommend.

But now, I have found an answer that I found easy to install and doesn’t stall after a few minutes. That answer is called Tangerine. It’s in the Ubuntu Linux software repositories. 

Building on two previous articles, one by Arvind Srinivasan in Mac|LIfe online and another by Isa Raffee on their WordPress blog; I built a music serving system that works with the latest version of iTunes. Now, it may not work with future versions of iTunes, so be forewarned. But enjoy it for now.

To begin with, you need a PC. Maybe it’s one that you used to run Windows XP or Windows Vista or 7. In any event, it’s just serving as an end table in your workspace. 

 

So first off, you need to install Linux. I used the light-weight Lubuntu Linux. It derives from the mainstream Linux, but uses a less demanding GUI called LXDE. You can use several other lightweight versions of Linux in its place, such as LXLE, a derivative of Lubuntu, or Zorin OS, which mimics the look and feel of Windows 7 or Windows XP. 

You’ll need to make an installer. You can make a DVD or a USB flash drive as your installer. 

To make an installer, first download the .iso file of the Linux distribution you choose to use. You can either download them directly or as a BitTorrent download. Now BitTorrent is notorious as a method of downloading pirate files, but in this case, you can rest assured you’re perfectly legitimate. In fact, you are helping the developers of the Linux distribution if you choose to let your BitTorrent client continue running after you finish your initial download. You’re spreading the word!

Anyway, back to the topic. You’ve finished downloading your .iso file. If you have Windows 7, you have the built-in capability to burn an ISO to a DVD. If you have a Mac, you can use Disk Utility to burn an .iso to a DVD. If you still have Windows XP, you can download and install the free Infrarecorder DVD-burning program. 

Now I personally prefer to install Linux distress using DVD-R/W disks. You won’t fill a landfill making DVD’s of old distributions. Just erase the old distro and re-record. 

I use USB flash drives to install OS X nowadays. I don’t have to figure with any BIOS screen settings for setting the boot order in OS X. In Windows, you would have to fiddle with the BIOS in most cases to get a USB drive recognized as the new boot drive to start from. It’s up to you.

You’ve made your installer, your BIOS will boot from it, and away you go. Restart the computer by selecting “Restart” from the Start menu or by quickly pressing the hardware restart button. 

You should have no trouble with the Lubuntu installer. It’s as easy as the OS X installer. It will ask you if you want to install Linux side-by-side with the existing operating system (Windows, most likely) or wipe out the old system and set up Linux as the sold system. I’ll leave it to you to decide which route you choose to go. 

Install Lubuntu Linux

 

Set the time zone for LA

 

 

Setup user name password and machine name

 

If you keep a rump installation of Windows, you can open it up in Linux through its file manager. This is one of the benefits of Linux, you can use it with Windows. You might want to keep it to rip audio CD’s in iTunes. You might want to run Quicken in it. 

After you’ve made your choices, you can wait for Lubuntu to install. In 30 minutes, it’s ready to go. Just restart and eject the installation media. 

 

Installing the Music Software Software

 

First, you need to run the system updates. Since the developers decided on the Gold Master for this version, they’ve made improvements. You want your system to run with the latest stuff.

So, now for some Linux keyboard shortcuts. Hold down the Control and Alt keys with one hand. Now press the letter T.  Up comes a Terminal window! 

Now type in sudo apt-get update  You’ll see a screenful of text scroll up the screen. When it finishes, you’ll return to your screen prompt. 

 

Second, and  this is cool but optional, you can run the music server from your client Mac. You can put the music server out of sight in someplace well-ventilated and cool.

You can use SSH (Secure Shell) to run it from it from afar. 

Do that keyboard command of Control+Alt+T to bring up a Terminal. Now enter this command sudo apt-get install ssh 

Again, you’ll see a screenful of text scroll up your screen. If the screen asks you whether you want to proceed, type ‘Y’ or ‘yes'

 

Authenticating SSH with Ubuntu the first time

When you return to your command prompt, enter this command ifconfig 


IFCONFIG shows the IP address

You will see a lot of text, but you want this inet addr:  

Next to that is your machine’s IP address. 

Now for the fun part. Open up your Mac’s Terminal. It’s in Applications>Utilities. Enter this command ssh {your user name on linux}@{Linux IP address}

It’ll look like this ssh thomas@192.168.1.99 Note the space between ssh and the user name. Note that you don’t put spaces between the user name and the IP address. 

It should ask you if you want to add the RSA key to a list of trusted ones, Type ‘yes'

Now you can type commands from your Mac and away from the server. This is very cool.

 

Third, you need to have access to your access to your server from your Mac without typing in commands. A very neat program called netatalk does this.

 

At a terminal, type in sudo apt-get install netatalk  A screenful of text scrolls down your screen. Answer ‘yes’ if you are asked whether to instal the program. 

Now this is the most difficult part of the installation. You need to edit a configuration file.

Go back to the Terminal. Type in sudo nano /etc/netatalk/atalkd.conf

You get the nano text editor on your screen with a lot of text displayed.

 

Nano in action editing netatalk conf file

Scroll all the way to the bottom by pressing the Down arrow key. 

Now type in this short line of text eth0


Netatalk conf editied with eth0

That’s a zero and not an oh at the end. 

You should see an icon of a screen appear in your Finder’s Shared section. 

If you don’t see it within a minute, click on the Mac’s Finder and press the Command and K keys together. On the command line enter this:

 

afp://{IP address of Linux server} 

An example would be afp://192.168.1.99 

See if the icon now appears in your Finder’s Shared section of the SideBar.

 

Now click on that icon. You should see a folder displayed named the Home folder.

 

Home Directory of Ellery Linux

 

 

Folders within Home Directory on Ellery Linux

Click on it and you should see folders for various categories of Files. Hmm, it resembles the Mac’s User folder doesn’t it? Yes, it does;  because the Mac and Linux have common ancestry in UNIX.

Just drop and drag music files into Music. You can drop these types of files: mp3, m4a, and m4p. 

 

 

Fourth, time to install the actual Tangerine music server

 

To install the Tangerine music server, go back to the Terminal. Enter this command sudo apt-get install tangerine

A screenful of text scrolls by. If asked whether to install, type ‘y’ or ‘yes’ as requested.

 

When you return to the screen prompt, now it’s time to set up Tangerine.

 

Fifth, setting up Tangerine

 

On Lubuntu, you’ll find Tangerine under Sound and Video. Click on it and this is your setup screen.

 

Where to find Tangerine in the LInux Start menu

 

 

The Tangerine GUI

 

Change the name to suit your fancy.

 

Set the music source to your Music folder. 

 

Decide if you want to limit access to your music server. Do you want to limit the number of listeners and require them to log in with a password?

Now for some command-line tricks to make life easier.

You will notice that if you add music to the Music folder on the Linux server after you start running Tangerine, it doesn’t automatically pick it up. In fact, some times you click on the Tangerine server in iTunes and see nothing. What do you do?

If you’re allergic to the command line altogether, you can open up Tangerine and change the name of the share. Alternate between “Hot music to listen to” and Cool music to listen to”  This forces Tangerine to re-read the music folder. You will see the previous blank music share still displayed in iTunes.

To really clean up the situation, you use the command line. Enter sudo pkill tangerine. The terminal will then ask you for your administrative password, which you created when you set up Linux. Remember, you had to enter it twice? 

Well, enter it here and you get temporary root access. When you enter it, you won’t see anything displayed in order to protect your privacy. Press the ENTER key. If you didn’t make a mistake, Linux will shut down Tangerine. The shared music will disappear from iTunes.

So add as much music to the Music folder as you please. Copy it over in the original folders. You don’t have to dump it into your Music folder as one big mess of files. Tangerine will go through your folders and display all your music in iTunes. 

Now enter this command sudo tangerine .tangerine & and press the ENTER key. You may have to enter your password again. This command will restart Tangerine

I want to point out the structure of this command.

sudo means you have temporary root access. It comes at the beginning of a command

tangerine is the name of the program you want to run. Note that you put a space between it and sudo and between it and the following command.

.tangerine refers to Tangerine’s configuration file. The period at the front of it means this is ordinarily a hidden file that  you can’t see. 

& means the command keeps running but it moves to the background. You get control over your terminal back. 

 

I want to thank Isa Raffee for showing me these commands in their Wordpress blog post. 

 

Notes:

Tangerine does not transcode your music. If iTunes won’t play the file format, such as a FLAC file, it won’t work. 

I have tested Tangerine with both 32-bit Lubuntu and 64-bit Lubuntu. Both gave the same performance. I have also tested it with the 64-bit Ubuntu derivative running the KDE desktop, Kubuntu. Again, fine performance. 

Again, every program I have mentioned is free. So who knows how long Apple will let this work? 

I welcome your comments. 

 

Tom Briant

Editor, MacValley Blog

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 


 


 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

No comments:

Post a Comment

 

 

Blog Archive