Under The Microscope

Archive for September, 2013

Airfoil for Windows 3.5.2 Restores Apple TV Compatibility

Airfoil for Mac IconLast week, we posted about an incompatibility between the 6.0 software update for Apple TVs and our audio streamer Airfoil. On Wednesday, we released Airfoil for Mac 4.8.1, which resolved the issue for Mac users. Today, we’re pleased to provide a fix for Airfoil for Windows as well. With Airfoil for Windows 3.5.2, just released, you can stream audio to Apple TVs running the latest software (as well as all other AirPlay-compatible devices).

All Airfoil for Windows users should update to version 3.5.2 immediately. It’s a free update, so download it directly from the Airfoil for Windows page. Once you’ve got the update, you’ll be safe to update your Apple TV to version 6.0 as well.

Airfoil for Mac 4.8.1 Restores Apple TV Compatibility

Airfoil for Mac IconLast week, we posted about an incompatibility between the 6.0 software update for Apple TVs and our audio streamer Airfoil. Today, we’re happy to say that issue has been resolved in Airfoil for Mac. Airfoil 4.8.1, just released, works fine with the new Apple TV update (and all other AirPlay-compatible devices).

All Airfoil for Mac users should update to version 4.8.1 immediately. You can select “Check for Update” from the Airfoil menu, or download it directly from the Airfoil for Mac page. Once you’ve got the update, you’ll be safe to update your Apple TV to version 6.0 as well.

Airfoil for Windows Update in the Works

Airfoil for Windows 3.5.2 has now been released, and restores the ability to stream to Apple TVs.

The Apple TV 6.0 update also broke the ability of Airfoil for Windows to stream to the device. Airfoil for Windows 3.5.2 is also in the works, and we hope to have it out shortly. So, Windows users, watch for an update very, very soon.

Special Thanks

Musicality IconWe need to take a moment to thank Jason over at Industrious One, makers of the Pandora/Last.fm/Grooveshark audio player Musicality (which has great integration with Airfoil, Airfoil Speakers, and Airfoil Remote). Jason clued us in to the fix here, and we’re terrifically grateful.

If you’re a Pandora, Last.fm, or Grooveshark listener, give Musicality a whirl, with a free trial right from the Industrious One site.

Warning on Apple TV version 6.0

Update (September 25th, 2013): Woo! Airfoil 4.8.1 handles this, restoring the ability to stream audio to all Apple TVs. See this link for more details or just get the update now.

Update (September 29th, 2013): Airfoil for Windows 3.5.2 also handles this, restoring the ability to stream audio to all Apple TVs. See this link for more details or just get the update now.

The information below is now deprecated, and left only for historical purposes.


Summary

We recommend that Airfoil users who stream audio to their Apple TVs do not update to Apple TV version 6.0 at this time. Read on for further details.

The Issue and Workaround

On September 20th, 2013, Apple released version 6.0 of the software for the AppleTV. Unfortunately, Apple TVs running version 6.0 will refuse to play audio sent to them by Airfoil. Attempting to send audio to an updated Apple TV will result in this error:

Airfoil's Message

To continue being able to stream audio to the Apple TV, we recommend that you do not update your Apple TV to version 6.0 at this time.

Further Details

We are still investigating the issue and further research will be required to determine if a workaround is possible. At this time, it is clear that the new Apple TV software demands Apple’s proprietary FairPlay encryption in order to be allowed to send audio to it. This limitation was not present in older versions of the Apple TV software. Figuring a way around this encryption, or if it’s possible at all, may take some time.

Staying Informed

For updates, stay tuned to this blog or follow us on Twitter. We hope to have more news in the coming weeks.

Hear (and See) All About Us: Talking Intermission on MacVoices

Intermission IconOver at MacVoices, I joined Chuck Joiner to talk software. We dove deep on our newest app Intermission, and discussed development in general as well. If you’ve been looking for more details on Intermission, this is a great way to get them. So head over to MacVoices to check out the episode.

And of course, you can check out Intermission itself with a free trial.

Playing Sound Effects the Right Way

When you use your Mac, you’re likely to hear a chorus of sound effects, from the chime of new email to the ding of a new IM. Mac OS X actually handles these sound effects differently from other audio content. Open the Sound System Preference, and you’ll see the Sound Effects tab, where users can set a distinct output device for sound effects. This is handy when a user has a second audio device (such as USB speakers) for playing music, but don’t want beeps overlaid on their audio. To avoid that, effects can be set to play through the built-in speaker, where they won’t cause a deafening interruption.

Doing It Right

Unfortunately, many applications do not currently play their sound effects properly, ignoring the user’s Sound Effects output selection. The end result for users is that audio snippets which are in fact sound effects incorrectly play through the main audio output. Luckily, fixing the problem is quite simple. Below, we show example code for playing back audio with Cocoa’s NSSound, on the system alert device.

// Alert Sound Playback Snippet // With thanks to Guy English for initial draft of this code #import <CoreAudio/CoreAudio.h> @interface NSSound (AlertAudioAdditions) + (NSString*)_alertSoundAlertDeviceIdentifier; + (id)alertSoundNamed: (NSString*)name; @end @implementation NSSound (AlertAudioAdditions) + (NSString*)_alertSoundAlertDeviceIdentifier { AudioDeviceID deviceID = 0; UInt32 size = sizeof( AudioDeviceID ); // get the system default audio output device … AudioObjectPropertyAddress address = { kAudioHardwarePropertyDefaultSystemOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; OSStatus error = AudioObjectGetPropertyData( kAudioObjectSystemObject, &address, 0, NULL, &size, &deviceID ); if ( error != noErr ) return nil; // … then, since one exists, get the unique identifier … UInt32 stringSize = sizeof( CFStringRef ); CFStringRef deviceUniqueIdentifier = NULL; address.mSelector = kAudioDevicePropertyDeviceUID; address.mScope = kAudioObjectPropertyScopeGlobal; address.mElement = kAudioObjectPropertyElementMaster; error = AudioObjectGetPropertyData( deviceID, &address, 0, NULL, &stringSize, &deviceUniqueIdentifier ); if ( error != noErr ) return nil; return [(NSString*) deviceUniqueIdentifier autorelease]; } + (id)alertSoundNamed: (NSString*)name { NSSound *sound = [NSSound soundNamed: name]; [sound setPlaybackDeviceIdentifier: [self _alertSoundAlertDeviceIdentifier]]; return sound; } @end // example usage: [[NSSound alertSoundNamed: @"Moof.aiff"] play]


Note: For code which doesn’t use NSSound, the key point is to use kAudioHardwarePropertyDefaultSystemOutputDevice to get the alert device id, and then perform playback through there.

Self-Interest

Intermission IconGetting this fixed is a good thing for all, but we do have a bit of self-interest here as well, tied to our new application Intermission. Intermission lets you pause and rewind audio on your Mac, but when it comes to sound effects we specifically work to not buffer those noises. To avoid the confusion of things like getting an alert for a “new” IM 30 minutes after it was received, Intermission passes sound effects through live at all times, instead of buffering them. This works great with Mail.app, Messages, Adium, and more. Currently, however, many third-party apps don’t behave quite so well. We’re hoping to convince developers to improve that.

Real-World Example

Napkin IconAs a quick test case, we worked with our friends at Aged & Distilled to get their visual communication tool Napkin updated. Former Rogue Amoeba Guy English spent just a few minutes updating the app’s sound playing code to getting it working as it should, with Sound Effects playing through the correct device and passing through Intermission unbuffered. Perfect!

Their next update will include this fix, and yours could too. Just check out the sample code above to get started.

Update (September 16th, 2013): As C-Command’s Michael Tsai points out, the more modern AudioServicesPlayAlertSound API (new in OS X 10.5!) will play sounds on the alert device and honor the user’s alert volume setting. For new code, it’s likely the best bet (while the above code may work better with existing NSSound-based code). Here’s a quick example of how to use it:

#import static void _AlertAudio_PlaybackCompleted( SystemSoundID soundID, void* clientData ) { AudioServicesDisposeSystemSoundID( soundID ); } BOOL AlertAudio_Play( NSString* name ) { NSURL* url = [[NSBundle mainBundle] URLForResource: [name stringByDeletingPathExtension] withExtension: [name pathExtension]]; if( !url ) return NO; SystemSoundID soundID; OSStatus err = AudioServicesCreateSystemSoundID( (CFURLRef)url, &soundID ); if( err ) return NO; (void)AudioServicesAddSystemSoundCompletion( soundID, NULL, NULL, _AlertAudio_PlaybackCompleted, NULL ); AudioServicesPlayAlertSound( soundID ); return YES; } AlertAudio_Play( @”Moof.aif” );