rss

USB Audio From An iPad...

From the original Analog Industries archive. Some links and images from that era no longer resolve.

This post is more for the benefit of people searching for this information than regular readers, who (I assume) already know this. I conducted some experiments with this a few days ago for an article I was writing for CM, and have since figured out some new things, so I thought I’d share them.

Q: Can I use a USB audio interface with an iPad?
A: Yup. There are some caveats, and they need to be paid attention to, but in general it Just Works.

Q: Caveats? You’re gonna drop Latin in to this shit?

A: That’s how I roll. Seriously, though, as far as my experimentation shows, the following information is true: first, the interface has to be class-compliant. That means that it needs to work in an OS X computer without a driver install. Second, it has to be USB1.0-compatible. No USB2.0-only interfaces. And finally, it has to either use less than 200ma of power or be externally powered.

Q: Hold on, let me get my… what?

A: A safe rule of thumb is that if it has mic pres (especially if it’s able to provide phantom power) it’s going to need a wall wart or something.

Q: Okay. Got it. What else do I need?

A: Pop over to the nearest Apple store and get yourself a Camera Connection Kit. This otherwise useless US$39.00 adaptor plugs in to the 30-pin docking port and gives you a USB port, ostensibly for hooking up cameras that have only on-board memory. As a camera connection kit, it’s kind of stupid, because you can buy SD cards now that have as much storage as even a maxed-out iPad, so I’m unclear as to its stated purpose and the usefulness thereof. But as an audio adapter, it works fine.

Q: Okay. Last question. Does every audio app just shit its sound out the interface when it is plugged in?

A: Nope.

Long answer: there are several ways to give a program sound in Cocoa Touch. These are, on the whole, the same ways as in OS X proper. You can use OpenAL, but that’s just a sample playback engine, really. There is also a system sound engine, or you can programically access the part of the OS concerned with playing back MP3s/AAC/whatever if you’d like. The final method, and the one that gives you bit-level access to the outputs, is to talk to CoreAudio, just like in OS X.

This final method is poorly documented and hideously complex, and even big companies fuck it up occasionally. But this is, as far as I can ascertain, the only method by which the USB outputs are utilized.

So, long story short: any App that uses CoreAudio for its playback, and does a good job of using it, automatically shunts its inputs (if it has ’em) and outputs to the USB device. Applications that use OpenAL (games for the most part, but some audio programs like the ridiculous-bordering-on-stupid Magic Piano, and many sample playback apps of that ilk) send the audio to the headphone jack or the onboard speakers only. Apps that use the system sound engine or access the iTunes library in some crafty way also can’t access this method.

One exception to this rule is Korg’s iElectribe. As I said, CoreAudio in Cocoa Touch is incredibly complicated and poorly documented, and even big companies mess it up. iElectribe is an example of that. iElectribe _must_ use CoreAudio; it wouldn’t work any other way. However, when a USB audio device is plugged in, iElectribe crashes on start-up. This will no doubt bum some people out.

And last but not least: all that shit I said about the iPad above? It also applies to the iPhone. (And I assume the iPod Touch, although I’ve not verified this.) I will say, however, that I have OS4 in my iPhone, so I can’t say for certain that it works with OS3.1. If someone has a CCK and an iPhone with OS3.1 and wants to verify this, that would be cool.

EDIT: I just tried it with my wife’s iPhone, which is running 3.1, and it DOES NOT WORK. So if you were planning on going to get a Camera Connection Kit just to use audio from your iPhone or iPod Touch, you need to wait until OS4 is released for this to work. It works fine with OS4, though, essentially the same as with the iPad.

11 comments

  1. BirdFLU

    With that camera adapter, do you think USB MIDI is possible?

  2. Chris Randall

    I don't see why it wouldn't be, as long as the hooks are there. I'll give it a whirl, but there aren't any MIDI apps so I'll have to whittle one.

    -CR

  3. BirdFLU

    It'd be nice if you didn't have to route WIFI from the Ipad to another computer and then to MIDI.

  4. fussylizard

    Is it audio out only, or can you suck audio into the iPad also, as in, suck in audio, do cool stuff to it, and send it back out?

  5. Chris Randall

    Assuming that There's An App For That, then I don't see why not. I haven't, as yet, come across one that would facilitate such a thing, but I'm fairly certain I Am T-Pain would work in that regard.

    -CR

  6. inverseroom

    I would LOVE to control iPad synths with an external keyboard, and to use the iPad to sequence hardware via MIDI. Seems like that's getting closer. Thanks for this.

  7. Chris Randall

    Just for the record, I've plugged in a class compliant 1x1 MIDI interface, and the lights came on and the iPad didn't throw an error. This leads me to believe that CoreMIDI can be accessed in the iPad. I'm going to give it a whirl here in a bit and see if I can't get MIDI to talk to Dronestation. I'll let you know how it goes.

    -CR

  8. RichardL

    Alas, there is no CoreMIDI in the iPhone OS on the iPad or iPhone.

  9. RichardL

    Nicely informative write up by the way. Thanks.

  10. neB

    Thanks for this!

  11. dtb200

    There is also the Line 6 MIDI Mobilizer but obviously that's MIDI only, I assume it will work with iPad??
    http://line6.com/midimobilizer/

Comments are closed on this post.