NFS
(Definition of NFS from Wikipedia)
"Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in
1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage
is accessed."
In Yamp, NFS client software is used to play audio files located on other computers which have NFS server software.
Yamp can also copy files from these computers to the iPad. Writing to files on NFS servers is not supported by Yamp.
NFS server software is pre-installed on Apple Mac computers, most Linux and UNIX-based distributions as well as
some NAS (Network Attached Storage) products. Note: FAT32-partitioned file systems typically cannot be
exported by NFS.
Important Considerations in Using NFS
- Using NFS requires a basic understanding of NFS plus the ability to configure the NFS server.
Configuration in Yamp requires the adding of
records for the "mounts".
- NFS should not be used unless the security implications are fully understood.
- The reference configuration that was used to test Yamp with NFS is as follows. iPad: 1st-generation iPad
(iOS 5.X) and iPad Mini (iOS 6.1X). NFS server: Mac Mini i7 2.6 GHz (Mountain Lion) with USB 3.0 external hard-drive
wired to an Airport
Extreme WiFi router. Use of less capable hardware, heavy usage of hardware components, less than optimal
configurations (for example, having the NFS server connected to the router via WiFI) will negatively impact
Yamp NFS performance.
- NFS can only be used with WiFi.
- Yamp will work with NFS servers that have drives that go to sleep, provided that the system can respond
to a request for data within 15 seconds or so. Audio may pause depending on how much data there is in the
buffers and how quickly the server responds. If the server is set to sleep, it may not respond to Yamp
requests for data.
- Using NFS does not have have a noticeable detrimental effect on battery usage. In testing NFS, playing
1-3/4 hours (2 CD's) without auto-lock (sleeping), using NFS resulted in a 1% increased battery use playing
using NFS vs. playing using local storage on a iPad Mini. On a 1st-generation iPad there was no difference.
The biggest factor in battery usage in Yamp is whether or not the iPad is put to sleep (or auto-locked) or not.
Playing the 1-3/4 hours of music without auto-lock took 11% of the battery charge vs. about 1% when the system
is put in sleep mode after starting play.
Setting up NFS
To setup up NFS, press the "Remote" tab button with the "NFS" graphic at the bottom of the screen. The screen
will flip to the NFS configuration screen.
To add an NFS mount to Yamp, press the "Add" button in the upper right corner of the screen. The following will
appear:
Enter the following:
- Mount Point: The name of the file system from the remote computer as it will appear in Yamp.
- Server: The name of the remote computer. In typical home networking applications and cases
where the remote computer is not listed in the DNS server that the iPad uses, the IP address of the
remote computer needs to be entered.
- Path: The full path that is exported by the remote computer. On recent Apple computers
and other Linux/Unix-based computers, this is usually contained in the /etc/exports file on the remote computer.
- Mount at Startup: If the switch is set to the "On" position, the file system will be mounted
when Yamp starts. If any NFS file systems have the "Mount at Startup" option enabled, an empty "Home"
folder will appear at startup while the NFS mounts take place. The Home directory will appear after
the mounts are complete.
- Confirm Copy: If the switch is set to the "On" position, NFS copies will be confirmed by doing a
second download. Doing a confirmed copy takes twice as long as a non-confirmed copy.
- Cache Folder Listings: If the switch is set to the "On" position, Yamp will cache longer directory
listings for the NFS mount being edited. The cache will refresh when the Yamp is started.
(It can also be refreshed by switching the switch to "Off" and then "On" again.)
After entering the information required, the mount can be tested before it is saved by pressing the
"Test Mount" button. Once a NFS mount has been added, an entry will appear in the NFS Mounts table.
To mount or unmount an NFS file system, press or slide the switch for the coresponding file system.
There is a switch just below the "Add" and "Edit"
buttons. "If WiFi stops when system sleeps" should be set to the "On" position if WiFi shuts down
when the system sleeps (auto-lock, not app termination). When this is done, Yamp will do an orderly
shutdown of the NFS file systems
when the system sleeps and remount the NFS file systems when the system wakes up.
Using NFS
In the Home directory, any NFS file systems that have been mounted will appear in the third section
(Tracks are in the first section, Folders are in the second section). The NFS file systems can be navigated
in the same way local folders are. The differences between using local files and NFS files are:
- Track Numbers: Track numbers will appear in red to indicate that it is an NFS track.
- Only Copy Available: NFS tracks and folders can be copied to the local iPad. Moving, deleting and creating
folders in NFS folders cannot be done with Yamp. Copying files using NFS is about 50% slower than
http or FTP (using the reference hardware).
- Non-FLAC Tracks: The equalizer and Volume Boost features are not available when playing NFS non-FLAC
tracks. If
these features are needed, copy the tracks to the iPad and play them locally.
NFS and Playlists
Considerations in using playlists with NFS include:
- Auto Mount and Unmount: The NFS file systems required by the playlist will be mounted (if it isn't
already mounted) upon opening the playlist and unmounted when the playlist is closed.
- Playlists use the Mount Point: The name of the mount point of the NFS file system of the track is
saved when the playlist is created/saved. If the server name and/or path changes and those changes are made
to the Yamp "NFS Mount Edit" record, the playlist will remain valid.
However, if the mount point name is changed, the playlist track will no longer be valid.
- Playlists must be stored locally in order to be played.
Download 2 Play
Yamp has a feature called "Download 2 Play" whereby the NFS files in a Folder or in a Playlist can be downloaded
while playing a track in the Folder/Playlist. This feature is useful if most or all of the Folder/Playlist is
going to be played and/or if there are problems with the WiFi connection and/or NFS server (dropouts or
stuttering occur).
In order to use this feature, navigate to the Folder/Playlist
and press the Loop button (the fourth black button from the top left of the screen). Choices of "Download 2 Play NFS"
and "Loop Mode" appear. Press the "Download 2 Play NFS" button and Yamp will take a moment to setup the files and
start downloading. Once the AlertView box disappears, any track can be played.
Considerations in using Download 2 Play:
- Track Number Color Change: The track numbers will turn color from red to gray as the download of
a track is complete.
- Seek: If a track is being played while it is being downloaded, the seek can only be set to whatever
has been downloaded.
- Cancelling the Download: The download can be cancelled by navigating to a different folder.
- Download Location: Downloaded files are saved to the /Web Downloads/~nfs-download-2-play folder.
All contents of this folder are deleted when the app terminates or when another Download 2 Play is started.
Files in this folder can be moved or copied.
- Battery Usage: Using Download 2 Play does not result in improved battery usage vs. not using
Download 2 Play.
Handling Network Disruptions
NFS was originally developed for stable hard-wire network environments and as such, there is no built-in support
for handling the type of network disruptions which can be common in a mobile wireless environment. Once a request
for data cannot be fulfilled, Yamp does a network check and presents options for dealing with the network
disruption. On the iPad, the effect of a network disruption happens fairly quickly but system notification
of a WiFi outage (loss of signal, wireless router failure or lost of connectivity to the Internet) takes
considerably longer. Yamp attempts to determine if the disruption is due to WiFi failure, loss of server
connectivity or NFS issues on the server and as such, it may take some time before an acknowledgement of NFS
failure is presented.
Setting up an Apple Mac NFS server (Snow Leoppard and later)
The "root" user must be enabled and the root password has to be known. See
http://support.apple.com/kb/ht1528 if the root user has
not been enabled.
The following instructions require the "Terminal" application. Unless otherwise noted, the commands
are entered on the command line of the "Terminal" application.
1) Creating/editing the exports file. You can edit the /etc/exports file by using TextEdit (or another text editor).
To use TextEdit, enter the following:
sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit
Enter the name of the file system that will be exported, one per line, for example:
/Volumes/mydisk1
/Volumes/mydisk2
if you have two attached drives partitioned with the name "mydisk1" and "mydisk2". A couple of options which
would provide more security would be -mapall=[username] and -ro where the "mapall" option specifies that access
to the exported file system will have the same credentials as [username]. The "ro" option specifies that clients
accessing the file system will only be able to read from the file system. (Yamp does not support writing to NFS files.)
With these two options, the /etc/exports file will look like:
/Volumes/mydisk1 -mapall=username -ro
/Volumes/mydisk2 -mapall=username -ro
2) While TextEdit is still open from the command line, edit the /System/Library/LaunchDaemons/com.apple.nfsd.plist
file. It should appear (or something similar)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>PathState</key>
<dict>
<key>/etc/exports</key>
<true/>
</dict>
</dict>
<key>Label</key>
<string>com.apple.nfsd</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/nfsd</string>
=============== ADD THE FOLLOWING LINE: ===============
<string>-N</string>
=============== END OF LINE TO ADD ===============
</array>
</dict>
</plist>
Add the line was indicated by the directions (do not include the lines starting with "====").
3) Enable and start the NFS service by entering the following:
sudo nfsd enable
sudo nfsd start
If changes are made to the /etc/exports file later, enter:
sudo nfsd update
to have NFS recognize the changes.
Other useful nfsd commands include restart, stop, status, disable.
To see what file systems are available for export, type:
showmount -e
Setting up an NFS Server on Other Computers
Yamp uses the NFS client code used in XBMC. The directions for setting up NFS servers for use with XBMC
should work with Yamp. See http://wiki.xbmc.org/?title=NFS for more
information.
More information on Yamp and NFS can be found at
http://findclassmusic.net/yamp-nfs.html