iPhone input

This is a continuation of a previous iPhone audio post.
I saw that the Truphone guys did a live VoIP iPhone show at DEMO.. here’s some sketchy video. If this is true (I have no real reason to doubt it) it represents the first example of using the audio input on the phone. By the screenshot posted, it looks like they are patching the actual phone application. I never once tried to do this– I’m not interested in VoIP and I want the phone to always act like a phone — but I do wonder if that’s the key to getting anything but blank PCM frames out of the queue.
My first impression of this VoIP app is that they’ve patched the binary somewhere where the queue frames come in from the baseband mic (not in AVRecorder, probably somewhere in CommCenter or likewise.) It would be nice if they posted more info so we can get our real audio apps on but I am not holding my breath… [redacted — it’s bothersome but I’m not going to get publicly angry about it today.]
I am still working on my own methods, keep an eye here.
October 5th, 2007 at 1:13 pm
Went deeper with using AudioQueue, and what happens is that you need to set the Infineon device routing properly. All multimedia handling is done through that device.
By default, the RoutingCategory is “playback.audiovideo”, which only does a “AudioQueue”=>OutputDevice routing, which is why AudioQueueOutput works perfectly fine, but AudioQueueInput does not, since there’s not Something=>AudioQueue routing being set up.
One the other hand, if you the AVRecord features of Celestial framework, it will internally set the RoutingCategory to “record.standard” which does a micrphone/HeadsetBT=>”AudioQueue” routing, and if you run your AudioQueueInput code sample while AVRecord is being used… you will actually get VALID samples from your microphone
By intercepting the Calls to MeCCA.Framework done by mediaserverd… it clearly calls MeCCA_AudioRoutingPolicy::setRoutingPolicy(char const*). Hope this help
November 14th, 2007 at 11:06 am
Hello Mr. Whitman,
while trying to get the iphone audio with AudioQueue working I found your interersting site. It helped me quite a lot, thanks.
Did you find something new about iphone audio input? I tried quite a lot but I always got the same problem you’ve got with empty buffers.
If you have a tip or even a solution, that would help me immensely.
Thanks in advance,
Christian Beer
November 28th, 2007 at 12:27 pm
Please be patient if this sounds dumb: how can I call MeCCA_AudioRoutingPolicy::setRoutingPolicy(char const*)?
I am not a good C/obj-C coder so I don’t know… Maybe you could give a hint or help me with this?
Does it help you to get mic input?
Thanks,
Christian
December 2nd, 2007 at 8:31 pm
Okay. Found out how to call C++ methods. Now as I call that method. How do I know if it worked? It doesn’t seem to change anything… Do you have some other tips?
December 4th, 2007 at 9:38 pm
I’ve been fooling with input, but I usually can’t even get the AudioQueueStart to execute without an error. Is there perhaps some sample code available? (Including how to access these MeCCA methods…where are the headers for these?) thanks, JLA
December 9th, 2007 at 6:00 pm
I’ve got the same problem, too. I always got the error “Error: AudioQueueStart failed (-536870184)”. My fierst Test-Programm works though. Don’t know where the difference is. Checked all line of code twice.
I’ve only got the sample code from the apple page. There is a sample called aqrecord.c.Checked against that code twice, too.
I think they locked the microphone input.
December 9th, 2007 at 6:00 pm
“My first Test-Programm works though. Don’t know where the difference is. Checked all line of code twice.” … with “works” I mean: “doesn’t give that error but only gives empty data”
December 11th, 2007 at 8:12 pm
I’ve been able to get non-blank buffers thanks to iFunk’s advice. Check the iPhone dev wiki–article is AudioQueue. It’s still screwy, but it works.
December 13th, 2007 at 5:48 am
J.L. Allen, did you use the Celestial Tip or the MeCCA-Tip? Tried both but non works for me. What Version of iPhone do you have? I have got 1.1.1.
December 16th, 2007 at 9:17 am
Christian,
How did you called the MeCCA_AudioRoutingPolicy::setRoutingPolicy(char const*) method ?
January 22nd, 2008 at 6:11 pm
I was able to successfully call to MeCCA_AudioRoutingPolicy::setRoutingPolicy(”record.standard”, “record.standard”, “record.standard”) after which getRoutingPolicy() returns “record.standard” as a result ad also getAudioInputDeviceUID() returns “device.microphone”. But, I still receiving blank frames which means settng up audio routing is not the final problem to solve before we get mic recoding working
Another problem I discovered is that if you try to connect a headset, the whole AudioQueue algorithm stops working, AudioQueueStart() returns error -536870184, which is odd. Unplugging headset “fixes” makes it working again. Does anybody else faced the same efect with headsets ?
January 26th, 2008 at 12:05 am
There is already a SIP app out for iPod touch — check out http://touchmods.wordpress.com/
February 5th, 2008 at 1:36 am
The VoIP program for the iPod Touch uses default routes, so it doesn’t need to route…the microphone is external, and apparently the default input is LineIn. And I believe they kill the mediaserverd process.
For Funiculus, I use the approach where you start up an input audio queue and then call [AVRecorder activate], which does the microphone routing for me.
The error you speak of (I think) is the device-not-ready error. I found I was able to “rehabilitate” this by starting an AudioOutputQueue (letting the system do the thread), and then destroying it by calling AudioQueueDispose(false…etc). And then I start another input queue with the AVRecorder trick.
We used to have a lot of this info on a wiki page on fiveforty.net before it shut down…I may revive that page on my own site. I’ve currently posted some stuff about routing on http://www.iphonedevdocs.com/forum/showthread.php?t=411 .
As far as the commands needed to route the audio, I ran into an error message that someone posted on the blog that seemed to detail a series of commands about routing. I’ve posted it on the iphonedevdocs forum page…