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

Sunday, July 9, 2017

Forked-daapd rides again! Installing Forked-Daapd (at last!) and some ancillary software to make life easier

Hello again! At this point you should have read my previous articles.

I hope you installed Linux Mint or another Ubuntu-derived Linux distro, on your external USB hard drive connected to your Windows 10 computer. You have it up and running.

Now for installing the forked-daapd iTunes music server and other software. Installing forked-daapd itself is easy, but you have to take some time editing the configuration file. I’ll walk you through that process.

 

Installing Forked-Daapd: Two different ways

You can install forked-daapd in two different ways. The first way is through a graphical Software Manager, the equivalent of the Windows 10 Store or the Mac/iOS App Store. 

54 the GUI software manager

If you don’t see it when you click on the Start Menu, click on the System Menu (the one with the Mac System Preferences icon!) and look for it there. 

In any case, double click on the Software Manager icon. First, though, you have to enter your Linux password. It’s the equivalent of your Mac’s administrative password. So remember it!

 

55 the GUI Software Manager screen

 

You will see twelve categories of apps to choose from. 

Enter forked-daapd into the search box with the magnifying glass in the upper right-hand corner. Press the ENTER key.

 

58 forked daapd found

 

You will see it appear. Now double-click on it.

 

59 the forked daapd page ready to install

 

You will see a description of the forked-daapd app. Now click on the Install button to start.

 

60 installing forked daapd

 

Now forked-daapd is installed. This was the easiest part. 

 

66 editing the name to use with forked daapd

 

You need to open the Terminal in a moment to edit the forked-daapd configuration file to give it a name to display on iTunes and to point to the directory (folder) in which you keep the music files.

Linux Mint has a keyboard shortcut for opening the Terminal. It’s Control+Alt+T

When you get to the prompt, enter this command sudo nano /etc/forked-daapd.conf

Let me explain the parts of this command!

“Sudo” is a UNIX command found also in macOS that gives you 15 minutes of super powers over Linux. You are a temporary root user.

“Nano” is the name of a terminal based text editor. It’s very simple, a lot simpler to use than the big text editors VIM and Emacs.

“/etc/forked-daapd.conf” is the path to the configuration file, which is forked-daapd, as you probably guessed.

So here are the two parts you need to edit. Read this first before editing!!!

Under “#Library configuration, you can edit the name you give to your server when it shows up on iTunes. I called mine “My Hot Music on %h” 

Just pick a short name you can remember.

 

Now the tougher part, indicating the path to the music directory (folder).

 

69 name for proper direcotry edited

 

This is the section you will need to edit. Don’t start editing until I give you a tip on how to do it right the first time.

You don’t need to edit the # Directories to index line, as it’s just a comment.

You do need to edit the directories = { “home/thomas/Music” } line. Here’s how to do it.

 

Before!-before you start editing this line at all, go to the Terminal prompt:

 

72 list of commands use this

 

This screenshot shows you what you need to do. As you probably think it’s Sanskrit at this point, I’ll explain it to you.

The first line shows the command ls This is short for “list directories” Press the Enter key to execute it.

The second line shows the subdirectories ls found within the Home Directory of this Linux Mint installation. The Home Directory, like the macOS User folder, is indicated with a ~

One of those subdirectories is called Music. Note that it is spelled with a capital M at the start. Remember, Linux, unlike macOS, is case-sensitive.

To change directories and get into the Music directory, you enter the command cd Music Press the Enter key to execute the command.

Now that you have entered the Music directory, the Terminal prompt changes from just ~ to ~/Music

Now for the million dollar command that will solve your problems! Enter pwd (print working directory path) and press the Enter key

The line in white shows the path that you need to enter into the # Directories to index. Copy and paste it if necessary. I spent several months bungling around trying to enter the right path before I found the pwd command. Use it.

Now, and only now, can you open the forked-daapd.conf file to edit it with nano. 

To exit nano and save the file, press Control + O (the letter O, not a zero) and then press the Enter key. To exit nano, press Control + X and the Enter key.

 

Terminal commands for forked-daapd

Let me emphasize that forked-daapd runs from the Terminal and not from a nice GUI. 

Here are three commands to operate it from the Terminal

Sudo /etc/init.d/forked-daapd stop

You need this command to halt forked-daapd. 

Sudo /etc/init.d/forked-daapd start

You need this command to start forked-daapd

Sudo /etc/init.d/forked-daapd restart

This command restarts forked-daapd. You need to run this command if you add more music to it while it is running. It does not automatically update its music database.


How to control your Linux machine from your Mac via SSH

You can use your Mac’s Terminal to run Linux Terminal commands via the SSH (Secure Shell) protocol. Here’s how to set it up between the two machine.

First you need to install SSH on your Linux machine. It will act as a client, but lacks a server by default. 

So go to the Terminal with Control+Alt+T. Now enter this command sudo apt-get install ssh Now press the Enter key to execute the command.

74 install ssh all of it


When you return to the Terminal prompt, run this command ifconfig


75 finding the IP4 address with ifconfig

 

You want to find this line in all that ifconfig spat out: init addr 

 

After that, you will see your IPv4 address looking something like 192.168.1.12. You’re looking for four groups of numbers separated by periods. 

Now go over to your Mac, which you should have connected to the Linux machine via a router at some point. 

 

89 Terminal SSH login to Linux

 

Now open your Mac’s Terminal app. 

Enter this command ssh (your linux user name)@(your Linux iPv4 address) and press the ENTER key. Follow the steps outlined above. 

 

Type “yes” to tell your Linux machine you trust it. 

Now type in your Linux administrative password. 

When you succeed, you’ll get a message Welcoming you to the Linux machine. You can put the Linux machine off your main desk for now. 

 

Now for some graphic interface elements between you and your Linux machine!


You need to add music from your Mac or CD collection to your /home/(your user name)/Music folder on your Linux machine. How to do that?

First, you need netatalk. Netatalk sets up an Apple File Protocol server on your Linux machine that your Mac can easily log into. 

 

On your Linux machine, you can install Netatalk through the software manager as I showed you for forked-daapd.

Now you need to edit its configuration file, atalkd.conf

Go to the Terminal and enter sudo nano /etc/netatalk/atalkd.conf 

Now press the ENTER key to execute.

 

65 Terminal for editing netatalk correctly

 

Press the down arrow key to move your cursor all the way to the very bottom. You only have to enter one phrase.

 

eth0


That’s letter e, letter t, letter h, and the number zero and not the letter o


Press Control + O (the letter O in this case) to save your file and then press the ENTER key to execute

Press Control + X to exit nano. Press the Enter key if necessary to execute.

 

That is it on the Linux side.

 

On the Mac side, do this:

 

80 On Mac connect to Server

 

 Go to your Finder and its Go menu. 

Scroll all the way to the bottom for the Connect to Server… command or just hit Command + K

 

81 the Server connect window

This is the window you see on your Mac. Click on the Browse button for the AFP server Netatalk.

 

 

82 found the right AFP server

 

There you see the AFP server with the Linux machine’s name. Double-click on it to start connecting.

 

83 logging into AFP server for the first time

 

You’re not connected yet. Look for the Connect As… button in the upper right-hand corner. It’s below the Search box. Now click on Connect As...


84 oops can t use Mac login credentials

 

Now when you get the verification box, it will have your Mac’s user name (this is a fake).

You need to delete that name and replace it with your Linux user name and your Linux administrative password. Then click on Connect.

 

86 properly logged in using Linux credentials

When you see the Home Directory displayed, you’re in like Flynn. Treat the Home Directory as you would an external hard drive plugged into your Mac.

 

87 Directories within the home directory

Double-click on the Home Directory to display the various subdirectories within it. One of them is Music!

 

88 how it should look when it all works

 

This is how your Finder’s Sidebar should look with the AFP Netatalk server connected to it. 

 

91 Music I placed in Music directory

 

Now I copied some music from my iTunes directory into the Music directory on the Linux machine. Will it play back to me over forked-daapd?

 

93 the albums show up in iTunes

 

Yes, it does! Notice that the source of the music is My Hot Music not the iTunes directory itself and iTunes displays the albums. I can tell you they sound fine.

 

How to install the Asunder CD ripper


To install the Asunder CD ripper, go back to the Software Manager and follow the instructions I showed you for forked-daapd. You just have to substitute asunder in the search box.

I laid out instructions in an earlier blog post here. 

 

I’ll give you some more tips here, then I’ve got to go to bed.

 

83 Asunder preferences

 

These are the Asunder general preferences. Note that the destination folder is the /home/thomas folder. You want to drop down the menu on the right-hand side to show the Music folder. Click on that to route ripper music into that folder. Otherwise, forked-daapd can’t find it!

And you probably want to eject the CD when you’re done ripping it. Just click on the box for Eject disk when finished


Asunder doesn’t need any Terminal work for its preferences. 

 

So have fun, send me e-mail if you need questions answered, and now you can put all your music on an iTunes server instead of trying to shoehorn it into just 256 GB on a MacBook!

 

Tom Briant

Editor, MacValley Blog

 

 

 

 

 

No comments:

Post a Comment

 

 

Blog Archive