iPhone audio hardware changing during my app's run
iPhone audio hardware changing during my app's run
- Subject: iPhone audio hardware changing during my app's run
- From: Evan Olcott <email@hidden>
- Date: Mon, 9 Mar 2009 13:11:17 -0500
I have noticed something very strange happening with RemoteIO on the
iPhone, and I wanted to know if this is worthy of a bug report of if
there's something I'm missing:
My application senses whether it's getting mono or stereo input from
RemoteIO's 2-channel stream (via AudioUnitRender) by checking to see
if the samples in the right channel are not 0 and different from the
left channel. I build an AudioBufferList that reflects and wraps this,
then passes it on to the rest of the app. This makes it dynamic, even
though AudioUnitRender always wants an AudioBufferList that has 2
channels in it (RemoteIO doesn't like to be configured, it seems, and
even with the mono microphone source, the AudioSession says there's 2
channels, and AudioUnitRender requires that I request 2 channels from
RemoteIO).
Anyhow - before the app run, I plug the iPhone into a device that
feeds it 2 channels of different data - a true stereo device (we've
been testing with the Alesis ProTrack). I run the app, and indeed I
see two channels worth of data.
Then I unplug the iPhone from the device, which changes the route to
it's built-in audio input (ReceiverAndMicrophone /
SpeakerAndMicrophone). My input stream stops, some rudimentary route
checks happen, then the input stream starts up again. The data that I
get from RemoteIO is *still stereo*. And this isn't any fake stereo -
this is "both channels have different non-zero data" in them.
I would expect to get a stream that is the same as what I got if I had
started up the app *outside* of the stereo device I plugged it into -
a mono stream coming through a stereo AudioBufferList (one empty
channel).
Is there something I'm missing in here? Do I need to call
AudioUnitReset() on the RemoteIO? Is this a legitimate bug?
The easy workaround is, of course, to tell users: "don't change audio
hardware while the app runs".
This is also one of the toughest things to debug, as you can't have
the audio hardware plugged in and have the iPhone plugged in to XCode.
Not only that, it seems like NSLog messages are throttled to 1 per
second, so you miss a lot when doing things "in the stream" like this
- are there any tips anyone has for this?
TIA
Ev
Technical Knowledge Officer
Head Programmer/Designer
Audiofile Engineering
http://www.audiofile-engineering.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden