Saturday, July 30, 2011

AirPlay from OS X Lion iTunes to Apple TV 2

One day, shortly after getting a brand new Apple TV 2, I wanted to use Airplay to play music from iTunes on my iMac to both the iMac speakers and through TV via Apple TV. Seems easy enough....start playing some tunes, then select both the iMac and the Apple TV from iTunes' speaker selection menu. Right?.....wrong!

When I selected Apple TV on the speakers menu, I got a popup saying "Connecting to 'Apple TV'...". It stayed up for a few seconds, then went away -- but no music on the TV. What the ? I tried again with no luck...this time noticing that the Apple TV selection in the iTunes speaker selection menu had a lock icon next to it. I assume that means I need to enter the Apple TV's Airplay password...but I haven't been prompted for it.

After googling for awhile I came across this blog post which described how IPv6 settings in OS X affected (i.e. completely freakin' broke) AirPlay from iTunes to Apple TV.  The solution outlined in the blog post was to go into System Preferences » Network, and in the settings for your network connection (i.e. AirPort, Ethernet, etc.) set Configure IPv6 to "Off" in the Advanced... menu.

This solution was going along fairly smoothly right up to the point where there wasn't an "Off" option in the Configure IPv6 menu. The only visible options were "Automatically", "Manually" and "Link-local only".  Uh oh...what now?

Well, it turns out that the OS X Lion update changed things a bit here.  The "Off" option is no longer available. So how do you disable IPv6? You "hack it" of course.  As I found in this forum post, although the "Off" option is no longer visible through the System Preferences user interface, it is still a valid option.  Here's how you get it back (Warning: this involves command line geek stuff...not for the faint of heart):

  1. Open Terminal
  2. Type cd /Library/Preferences/SystemConfiguration
  3. Type sudo vi preferences.plist. This opens the preferences.plist file in an old-school Unix text editor called vi.
  4. Hit the "a" key.  This puts vi in "insert mode".
  5. Using the arrow keys, navigate to the section in the file that looks similar to below for the network connection you're using (i.e. AirPort, Ethernet, etc.), and change whatever value is there to "__INACTIVE__".

    <key>IPv6</key>
    <dict>
        <key>ConfigMethod</key>
        <string>Automatic__INACTIVE__</string>
    </dict>
  6. Hit the "Esc" key.  This gets you out of "insert mode" in vi and back into "command mode".
  7. type "wq" and hit "Enter". This saves your changes and quits vi.
  8. Reboot.
  9. You're IPv6 should now be disabled!


At this point, your iTunes to Apple TV should now work as expected.  When you try to select Apple TV as a "speaker" for AirPlay you will get prompted for the Apple TV's password...which never happened before the fix.

Enjoy, and again thanks to the dudes from these two posts for showing me the light:

1 comment:

Michael Neale said...

Wow, thank you so much for this post! I was totally stuck. I use my Apple TV 1 as a music server only - optical output to a separate DAC. However, Airplay from my computer was totally broken by Lion.

I am wondering if I need IVP6 for anything else though, and would need to undo your changes if I did.

Post a Comment