Under The Microscope

Archive for February, 2012

Sending Any Audio to Android Devices via AirPlay, With Airfoil

Update (December 12th, 2012): The information below is somewhat deprecated. We now recommend our own free Airfoil Speakers for Android.

As Android has grown, we’ve received more than a few requests to bring both Airfoil and Airfoil Speakers to the platform. It only makes sense – people with Android devices want to be able to send audio from those devices out to AirPlay receivers, just like iOS users can. They also want to be able to turn their Android devices into AirPlay receivers, to receive audio sent from their Macs or PCs. Right now, however, we have no concrete plans to bring either of these apps to Android.

AirBubble IconThat doesn’t mean you can’t receive audio from Airfoil on your Android phone though! As it turns out, there’s a third-party AirPlay receiver for Android called AirBubble. Much like Airfoil Speakers Touch on iOS, AirBubble turns your Android device into an AirPlay receiver. It can then receive audio from your Mac or PC can play, thanks to Airfoil.

To check out AirBubble, just download it from the Android Market. The free version will let you try it out, and receive audio for 30 minutes per launch. If you plan to keep using it, you’ll probably want to purchase the $2 AirBubble License app to unlock unlimited audio playback.

Like the Boxee Box previously discussed, AirBubble running on Android does not play audio in sync with other outputs. That means you won’t be able to include your Android device in a multi-output system if you want everything to play in sync. However, if you just want to send from a Mac or PC to your Android device, you’ll be all set.

We’ll be keeping an eye on the Android platform for future opportunities. For now though, if you want to play any audio from your Mac or PC to your Android phone, check out AirBubble in conjunction with Airfoil.

The Evolution of Piezo

Powerful and flexible enough for all kinds of tasks, Audio Hijack Pro has been the go-to application for audio recording and manipulation on the Mac for years. But with its power comes complexity, and we’ve long wanted to give people a streamlined way to record any audio on their Mac. More recently, we also wanted to test the waters of the Mac App Store. And so the idea for Piezo was born — we decided to make audio recording on the Mac simple and fun for everyone.

Grant had just joined our team, and Piezo was the first project we worked on together. It was also the first app I designed from the ground up here at Rogue Amoeba. Exciting! So here’s a rundown of how it progressed, from the early sketches to the final shipping product.

The very first interface was a work of programmer art, humble but functional. After coding up the application’s backend and getting things working in a basic state, Grant gave the GUI a working first pass:

Piezo's Humble Origins
Grant’s Primordial Piezo

As you can see, the title bar hints at Piezo’s origins. But “Simple Audio Hijack” was just a placeholder name, keeping the seat warm until the day our friendly support technician Chris suggested we call it “Piezo.” Anyway, that’s what the app looked like the very first time I used it. After playing with this tech demo a bit, the team got together and hashed out the scope and functionality for the true version 1.0.

We wanted the app to be obvious, convenient and fun. I knew from the beginning that I wanted it to have analog VU meters with bouncing needles, a clearly-labeled source selector, and a big, friendly record button. I also knew I did not want multiple buttons for simple recording options. A binary system was far preferable to the unnecessarily complicated array of options you see in, say, elevators in two-story buildings1.

The first Piezo wireframe
The First Piezo Wireframe

I laid out everything in descending order of importance in a simple wireframe. From the top, there’s the audio source and big friendly record button, then the recording settings, recording name, and time counter. The VU meters are at bottom, along with stripes on the lower right which would eventually be speaker lines. These were a nod to the fantastic Braun radios designed by Dieter Rams, like the RT-20 which ultimately inspired Piezo’s black front panel and wooden frame:

Braun RT-20 Radio
The Braun RT-20: I love the simple face and contrasting wood and black plastic.
Photo courtesy of Teddy

After the initial wireframe was accepted, I started work on a more sophisticated rendering of the app. While searching for various examples of VU meters upon which to base my own, Grant suggested we move the meters to the top of the window, and I immediately agreed. It was such a simple and obvious idea; I had put them down below because it seemed the audio source and record button were the things to focus on, but looking at analog devices, I saw that the meters were consistently the most prominent feature. With the flow of the app shifted slightly, I also moved some other things around and began to play (haphazardly) with textures:

Piezo Mock #2

So now we had something that looked like Piezo. Of course, cringing looking at this now, some problems immediately stand out to me:

Notes on Piezo Mock #2

The iterations continued, and I played with adding the wood frame and changing the color of the hours and minutes portion of the time counter:

Piezo Mock #5

This was closer, but this walnut texture was no good, coloring the “Hours:Minutes” section of the counter wasn’t working, and the rough texture I gave the plastic was all wrong. Next:

Piezo 1.0's final UI

After a bit more fiddling with colors, textures and overall brightness, I was happy enough with this to ship it. Looking at it now, there are so many things I’d like to improve. I’d love to take another crack at the plastic texture, and I’d widen the counter (the numbers are just slightly off-center, due to differences in how OS X and Photoshop render text2). I also want to work with Grant on improving the settings popover, to better integrate it with the rest of the app. The great thing about software is that it’s never really finished, so I can keep tweaking these pixels for future updates.

I had to stop somewhere, though, and it was time to move on to the icon. I sketched some ideas and used a high-tech scanner (i.e. my iPhone’s camera) to pass them on to Paul, Quentin and Grant:

Icon Sketches

I still like the net-catching-soundwave idea on the left. With all of the audio capturing we do, I just might get to use it for another app some day, so don’t go stealing it. The middle one is a reference to the name “Piezo” (which comes from piezoelectricity) as well as Superman’s Fortress of Solitude. We decided the one on the right was the best for Piezo, though, and I set to work on it.

Ugly Initial Icons

Umm…nope. Nuh-uh. These were definitely not good. This was a problem, because while we all liked the concept, for use on Mac OS X, the icon needed to approximately fit into a square, making the face way too tall (regardless of whether I emphasized the VU meter or the record button). Oy vey! I went back to the reference images I had originally collected, and realized what it needed:

Piezo's icon, with a handle!
A handle!

The handle made all the difference. It totally solved the height problem while keeping the icon square. Success! After a few more tweaks, the final version looked like this:

Piezo's final icon

With icon and interface finalized (for now!), we continued to test and tweak the app until it was ready for release.

So there it is, the process from programmer cut-and-paste art to a final, shipping app. Piezo was a super fun project, and I look forward to continuing to improve it – I have tons of ideas for it. For now though, I hope you’ve enjoyed this tour through the evolution of Piezo, and I can’t wait to show you our next project. Soon!

Until then, check out Piezo now!


Footnotes:

1. If a building has only two floors, an elevator only ever has one travel option (to the floor opposite the current one), so why even bring the numbers “1” and “2” into it? Not to mention that the “Close” button never responds, “Open” is pointless – ARGH!

In Alice’s world, “the books would be nothing but pictures,” and in mine, elevators in two-story buildings would have no buttons at all. When passengers stepped in, the doors would close, the elevator would move to the opposite floor, and the doors would again open. I can see a case for keeping the button marked “Alarm”. Maybe. 

2. Why doesn’t Photoshop use OS X’s font-rendering? Who knows! 

Send Audio From iOS to Multiple Speakers With Airfoil

With the latest versions of iOS, it’s possible to send audio directly from an iPhone, iPod Touch, or iPad out to AirPlay devices like an Apple TV or AirPort Express. You can now beam music directly from most apps out to a stereo or TV and that’s very cool. However, if you’ve used this functionality, you know it has one big drawback – it can’t send to multiple outputs! After many requests for help with this, I’ve written up a great workaround for this shortcoming. Using Airfoil and Airfoil Speakers, it’s possible to send audio from iOS to multiple outputs.

Due to Apple’s restrictions, we can’t do anything directly in iOS to provide this functionality. The AirPlay picker in iOS (seen below) will only allow you to select one audio output, and we can’t improve that directly. But with a simple two-step process, we can work around it to send audio to multiple devices.

Instead of sending from iOS to multiple outputs, we’ll send from iOS to a Mac or PC running Airfoil Speakers1, then use Airfoil running on that same machine to send to multiple outputs.

The audio flow

Audio flows from the iOS device to the computer, via Airfoil Speakers. It’s then captured by Airfoil and sent out to multiple outputs.

Need a quick walkthrough? Let’s go:

Step 1: Send from iOS to your computer

First up, be sure you’ve got the latest versions of Airfoil and Airfoil Speakers installed on your Mac or PC. Then, launch both applications on the same machine. On the iOS device, tap the AirPlay icon in the audio app you’re using. The Airfoil Speakers instance you just launched will appear as an output option, and you can choose it. Below, we’re sending from an iPhone to Airfoil Speakers running on a MacBook Air:

Sending from Music.app to Airfoil Speakers on the Mac

And here, we see Airfoil Speakers on the MacBook Air, receiving the audio stream from the iPhone:

Receiving with Airfoil Speakers on the Mac

Step 2: Send from your Mac or PC to all your audio outputs

With the audio flowing from the iOS device to our Mac, we’re halfway to sending that audio to multiple outputs. The feat is ultimately accomplished with the help of Airfoil. In Airfoil, simply select Airfoil Speakers as your audio source, then transmit to any outputs you like. Below, you can see that the audio originally from the iPhone is being pulled from Airfoil Speakers and sent out to an Apple TV and an AirPort Express:

Sending via Airfoil

Now, the audio from the iPhone is being heard throughout the house, via multiple audio outputs. Nice!

Enjoy

By sending audio from iOS to your Mac or PC running Airfoil Speakers, then capturing Airfoil Speakers with Airfoil, and broadcasting it out, you can send audio from one iOS device out to multiple speakers via AirPlay. Happy listening!


Footnotes:

1. Don’t remember Airfoil Speakers? It’s the free companion to Airfoil, which lets you turn any computer into an audio receiver for Airfoil. Airfoil Speakers is part of the Airfoil download, but you can also download stand-alone versions here

Enhanced Control of More Sources with Airfoil

When we unveiled Airfoil 4.5 last year, it included some handy new functionality. In addition to sending audio, Airfoil now also passes along metadata for many sources. That means the when you transmit from a supported source, you’ll see album art as well as track information.

Airfoil Speakers with enhanced metadata and remote control

As well, when you’re sending audio to Airfoil Speakers, Airfoil Speakers Touch, or an Apple TV, you can remotely control the source. Audio can be paused, and you can skip forward and back between tracks on your playlist. It’s very handy, and makes for a great experience when listening to audio.

Today, we’re very happy to announce compatibility with several new applications. We’ve worked with these developers to integrate their applications with Airfoil, and we’re delighted to have them on board.

Mog IconFirst up, we’ve now got support for the MOG music service and their Mac client. MOG is a subscription service with a catalog of over 14 million tracks. If you’re already a MOG user, just be sure to grab the latest Airfoil and the latest version of the MOG client, then get streaming. If you haven’t used MOG yet, you can get started right here. They have a free ad-supported plan, as well as an ad-free computer-only plan for $4.99, and a $9.99 plan that includes access on mobile devices too.

Muse Controller IconMeanwhile, if you’re a Pandora fan, several new clients have popped up to make using the service on your Mac better than ever. First up, we previously mentioned Muse Control, a remote control for Airfoil. It’s since added Pandora playback to its Mac portion, Muse Controller. When transmitting Muse Controller via Airfoil, enhanced metadata and remote control are now available

Pandoras Box IconThe popular Pandoras Box application, from Francisco Garza, runs right in your menubar and provides Pandora audio playback. It’s been well-reviewed in the Mac App Store, and we had several requests for support. Before we had a chance to contact Francisco, however, he emailed us. To our surprise, the integration was already done and it worked like a charm. Excellent!

Muse IconMusicality IconFinally, Jason Perkins from Industrious One worked with us to add support to both his audio playback apps, Muse and Musicality. Muse can be found exclusively in the Mac App Store, and is a stand-alone Pandora player. Musicality, meanwhile, is something of a big brother to Muse. It supports Last.fm and Grooveshark playback, in addition to Pandora. With the newest versions, to be released within a few days, they’ll both work great with Airfoil as well.

We’ve got a full list of supported sources, so take a look. If your favorite app is on there, great – just stream it with Airfoil to get enhanced metadata and remote control. If your favorite audio player isn’t listed there, get in touch with the developer, and send them to this page. That’ll get them started integrating with Airfoil.

Recording Skype With Audio Hijack Pro or Piezo Is Again Fully-Functional

Last week, we had an issue with Skype and our two audio recording applications, Audio Hijack Pro and Piezo. Mac OS X 10.7.3 broke the ability of these applications to launch Skype and record its audio. Using the Instant On extra, Audio Hijack Pro was still able to capture and record from Skype. However, Piezo users and Audio Hijack Pro users who hadn’t installed that optional component were left unable to record Skype.

Audio Hijack Pro IconPiezo IconFirst, let me say that we’ve already resolved the problem. Download the latest Audio Hijack Pro from our site, or the latest Piezo from us or from the Mac App Store. Get that set, then read on for more information.

We know many users depend on these two apps to record Skype, including hundreds of podcasters, so we set to work on getting this fixed right away. The problem was quite bizarre, as our applications hadn’t changed at all, and neither had Skype. The only difference was Mac OS X 10.7.3 itself. Our audio capture code is very robust, so minor updates to Mac OS X almost never have any impact at all. Something was most certainly amiss here.

To figure out what was happening, we actually had to look back to January of 2011, when version 5 of Skype first shipped. The executable code for Skype 5 is strange, due to some incredibly non-standard code obfuscation measures they’ve put in place. Specifically, the actual binary file in Skype.app/Contents/MacOS/Skype is encoded, and only decodes itself at runtime by rewriting itself as it runs. In short, the program seen on disk is not the program which actually runs. This causes the library-loading order in Skype to be rather odd; libraries would appear to load at launch, but not be truly loaded until later in the launch process.

Ammo Shooting Bugs ImageUnfortunately, this non-standard behavior confused our audio capturing code. Problems occurred when things our code expected to be there (like the important-for-audio-capture CoreAudio library) weren’t loaded. We investigated, and fortunately, the workaround at the time was simple enough. We made Audio Hijack Pro ask dyld, the dynamic linker for Mac OS X which loads all code, to notify it whenever a library was loaded. Audio Hijack Pro then waited until CoreAudio was present before going off and doing its thing. This cured the problems with a minimum of fuss. That fix worked just fine on Mac OS X 10.6 (as well as the later-released Mac OS X 10.7), and we rapidly shipped a small update to restore recording from Skype.

Alas, with the release of Mac OS X 10.7.3, Apple made a small-but-critical change to the aforementoned dyld. The explanation of this change is a bit technical: In an apparent attempt to fix some threading issues, Apple added a thread lock to dlopen(). While this likely fixed their bug, it had the unintended side effect of causing a deadlock when our apps launched Skype, as the previous Skype fix used dlopen() from within a dyld callback. The end result was that with the existing versions of Audio Hijack Pro and Piezo, launching Skype to record audio did not work correctly on Mac OS X 10.7.3.

Not wanting to leave our customers hanging, we again worked rapidly to solve the issue. The new workaround is actually very similar to the previous one – we simply delay calling dlopen() until Skype is further initialized and we are no longer in a dyld callback. The fix took a few hours of hard work, and shortly after, we shipped Audio Hijack Pro 2.10.1. However, we also ran straight into one of the downsides of the Mac App Store as it stands now – we couldn’t ship a fix for Piezo nearly so rapidly. Our update was eventually approved, and Piezo 1.1.2 also restores the ability to record Skype on all compatible versions of Mac OS X.

Ultimately, while capturing audio from Skype at launch time can be a tricky proposition, it’s well worth the effort to satisfy our users. While these hassles have been frustrating for us, they’ve really just been a two small hiccups throughout years and years of quality audio recording. Our users can be confident that our tools will work, and that if a problem does arise, we’ll work rapidly to get it fixed.

So, if you need to record audio from Skype on your Mac, either the latest Piezo or the latest Audio Hijack Pro will get you set.