<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

AAC

From SqueezeboxWiki

Revision as of 04:08, 15 November 2010 by Paul Guijt (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

General

Note: AAC files come in two forms: M4A and DRM protected M4P. M4A files are created by a user on iTunes from a CD; M4P files are bought from the iTunes Music Store. SlimServer cannot play DRM protected M4P files. SlimServer will play M4A files but it streams them in an uncompressed format - which is fine on a local wired network but will use too much bandwidth over wireless and the internet. To convert AAC files to MP3 on the fly so that they stream in a more usable compressed format, follow these steps:

AAC on Windows

  1. Make sure QuickTime is installed on the machine running your Squeezebox Server. This is required to decode the AAC format.
  2. Download the latest stable LAME
  3. Place lame.exe (not the other files) in the c:\Program Files\Squeezebox\server\Bin\MS...Win32 folder
  4. Restart the Squeezebox Server service
  5. Go to the Player Settings > Audio page and check under BitRateLimiting for this text "The LAME encoder appears to be installed correctly on your system." (You can't test this until you have a player installed.)

Note: You can't use FFWD and RWD files that are converted on the fly.

AAC on Linux

/Note that these instructions only allow playing of unprotected AAC files - DRM-protected files (such as those bought from the iTunes shop) cannot be played in this way./

SlimServer requires additional software before the AAC format can be played. On Windows this can be done by installing QuickTime on the computer running SlimServer, but on Linux slightly more work is required.

SlimServer recognises files with the following extensions as AAC files:

The first step is to make sure that you have both FAAD2 and LAME installed - neither of these is packaged with SqueezeCenter out-of-the-box. These may come pre-packaged and configured for your particular flavour of Linux (they are in the standard Portage tree for Gentoo Linux, for example), or else they can be compiled from source from the individual projects' websites.

Note: On ARM devices such as Buffalo Linkstation Pro you have to install a fixed point version of FAAD. Often a floating point version is installed. You can create one by configuring and compiling FAAD with –without-fp –npf. If this does not work in libfaad/config.h uncomment #DEFINE FIXED_POINT

Note: mplayer can decode AAC formatted files and Apple Lossless files. See AppleLosslessUnix for information on installation and configuration.

Note: As of 2005-12-27 there is a bug in the faad2-package which may produce noise while decoding AAC files. See Project Bug Entry for a patch-proposal and this slimdevices forum thread for slimserver-specific information.

Note: There is a known bug in FAAD that may cause the FAAD proccess to hang when AAC files are skipped. When the FAAD process(es) hang, this may lead to stuttering, no sound and/or to an less or unresponsive system. See bug 9463, as well as the associated forum post for more information.

Once you have those installed and available in your path, you can add the following lines to your slimserver-convert.conf file (present in /usr/local/slimserver, or wherever you installed the server):

Note:

There can be up to 3 files which control transcoding:

  • /etc/squeezecenter/convert.conf
  • /usr/local/squeezecenter/custom-convert.conf (path may differ based on where you installed)
  • /usr/local/squeezecenter/squeezecenter-convert.conf (path may differ based on where you installed)

SqueezeCenter takes its transcoding rules from these three files with the first file taking precedence and moving down from there.

Note, in the entries below, depending on your version of LAME the -x option may or may not be needed to swap the byte order coming out of FAAD. See associated forum post#26 for more details. Otherwise, you'll just get static on playback. On big endian platforms (such as powerpc-based Mac Minis. Use this command to find out: perl -V | awk -F= '$6 ~ /4321/ {print "bigendian"} $6 ~ /1234/ {print "littleendian"}') do NOT give the -x option! Please note the format of the convert.conf file has changed in SqueezeCenter 7.3.

# Transcoding for AAC files.
# SC 7.3+
mov flc * *
   # F
   [faad] -w -f 2 $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian little --sign signed --channels 2 --bps 16 --sample-rate 44100 -
mov mp3 * *
   # FB:{BITRATE=-B %B}
   [faad] -w -f 2 $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ $BITRATE$ -x -r - -
mov wav * *
   # F
   [faad] -w -f 2 $FILE$
# Transcoding for AAC files.
# SC <= 7.2.1 only!
mov flc * *
    [faad] -w -f 2 $FILE$ | [flac] -cs --totally-silent --compression-level-0 --endian little --sign signed --channels 2 --bps 16 --sample-rate 44100 -
mov mp3 * *
    [faad] -w -f 2 $FILE$ | [lame] --resample 44100 --silent -q $QUALITY$ -b $BITRATE$ -x -r - -
mov wav * *
    [faad] -w -f 2 $FILE$

Note that this configuration file is not present by default, so create one if you don't already have one.

These two entries ensure that uncompressed audio will be streamed to a player such as a Squeezebox or SoftSqueeze if possible, but will transcode down to MP3 if the player settings require it. This transcoding will occur if the player is configured with a bandwidth limit, such as a remote SoftSqueeze operating over a broadband connection, or a wireless Squeezebox where the conditions don't support the necessary bandwidth for uncompressed audio.

That should be all that is required - restart the server and any AAC files there should now be playable. If you have any trouble then try running SlimServer with the ''–d_formats'' option to try to trace the problem.

AAC on OSX

  1. download and install iTunes-LAME from http://blacktree.com/apps/iTunes-LAME/
  2. iTunes-LAME should go in ~/Library/iTunes/Scripts
  3. Restart the SlimServer service
  4. Go to the Player Settings > Audio page and check under BitRateLimiting for this text "The LAME encoder appears to be installed correctly on your system."

AAC on Synology Disk Station

This is a short description of how to make AAC (m4a, etc.) files playable with SqueezeCenter 7.3.2 on a Synology Disk Station DS207+:

  1. Get the ipkg pakage manager (if not already installed). A description of how to get it can be found at http://forum.synology.com/wiki/index.php/How_to_Install_Bootstrap
  2. Install faad2 like 'ipkg install faad2'
  3. In the '/volume1/@appstore/SqueezeCenter/Bin' folder create a symbolic link to '/opt/bin/faad' like 'ln -s /opt/bin/faad faad'
  4. Change the owner of the new link like 'chown -h admin.users faad'
  5. Change the owner of the faad executable like 'chown -h admin.users /opt/bin/faad'
  6. Change the owner of the faad libraries like 'chown -h admin.users /opt/lib/libfaad*'
  7. Finally edit the convert.conf according to the AAC on Linux description (Synology's SqueezeCenter package does not load the custom-convert.conf). Please note that the only line needed for the SqueezeBox receiver is the 'mov wav * *' line.

Please remeber to restart the SlimServer services before testing :-)


All Platforms

Once LAME is installed, go to SlimServer / SqueezeCenter's Settings -> Advanced > File Types and select the LAME option for each of the file types you need to transcode to MP3. Otherwise if you set your player to limit the bitrate but the file type is set to Disabled on the server, it will just skip files it can't transcode.

See Also

This FAQ: http://slimdevices.com/su_faq.html#troubleshooting-aacwireless