linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] iOS - Activate Audio Output in Background


From: powerqian
Subject: [Linphone-developers] iOS - Activate Audio Output in Background
Date: Thu, 22 Jan 2015 03:05:49 -0700 (MST)

Hi Linphone Developer,

Recently I came across an issue that the call won't have audio input or
output if the call is AUTO answered in BACKGROUND, e.g. the call is
answered, connected, stream running completely in background without user
doing anything.

My app have a requirement that the call can be auto answered based on some
condition checking, and user won't need to unlock the phone to hear the
remote party's voice. When I do this, there are errors like the followings
constantly showing in console:

**** console output start ****
AudioUnit could not be started, current hw output latency [0.012766] input
[0.000000] iobuf[0.023220] hw sample rate [44100.000000]

19:09:15.293 ERROR:     [0x541a000] >aurioc> 806: failed: '!pla' (enable 2,
outf< 1 ch,      0 Hz, Float32> inf< 1 ch,      0 Hz, Float32>)

AudioUnit error for AudioUnitInitialize(card->io_unit): ret=unkown error
(561015905)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:454)

io unit initialized

I/O unit latency [0.000000], quality [64]

AudioSession error for
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputLatency
,&hwinputlatencySize , &hwinputlatency):
ret=kAudioSessionBadPropertySizeError (561211770)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:486)

19:09:15.296 ERROR:     [0x541a000] >aurioc> 806: failed: '!pla' (enable 2,
outf< 1 ch,      0 Hz, Float32> inf< 1 ch,      0 Hz, Float32>)

AudioUnit error for (auresult = AudioOutputUnitStart(card->io_unit)):
ret=unkown error (561015905)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:501)

AudioUnit could not be started, current hw output latency [0.012766] input
[0.000000] iobuf[0.023220] hw sample rate [44100.000000]

19:09:15.404 ERROR:     [0x541a000] >aurioc> 806: failed: '!pla' (enable 2,
outf< 1 ch,      0 Hz, Float32> inf< 1 ch,      0 Hz, Float32>)

AudioUnit error for AudioUnitInitialize(card->io_unit): ret=unkown error
(561015905)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:454)

io unit initialized

I/O unit latency [0.000000], quality [64]

AudioSession error for
AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareInputLatency
,&hwinputlatencySize , &hwinputlatency):
ret=kAudioSessionBadPropertySizeError (561211770)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:486)

19:09:15.408 ERROR:     [0x541a000] >aurioc> 806: failed: '!pla' (enable 2,
outf< 1 ch,      0 Hz, Float32> inf< 1 ch,      0 Hz, Float32>)

AudioUnit error for (auresult = AudioOutputUnitStart(card->io_unit)):
ret=unkown error (561015905)
(/Users/Shared/Jenkins/Home/workspace/linphone-ios/submodules/build/..//linphone/mediastreamer2/src/audiofilters/msiounit.m:501)

AudioUnit could not be started, current hw output latency [0.012766] input
[0.000000] iobuf[0.023220] hw sample rate [44100.000000]
**** console output end ****

Those error messages are only shown after answering the call in background.

I'm sure that iOS can allow the app to do that since I've seen some app
achieved this. I've tried many things to on Objective-C level such as

        NSError *setCategoryErr = nil;
        NSError *activationErr  = nil;

        [[AVAudioSession sharedInstance] setCategory:
AVAudioSessionCategoryPlayback error: &setCategoryErr];
        [[AVAudioSession sharedInstance] setActive: YES error:
&activationErr];
        [[UIApplication sharedApplication]
beginReceivingRemoteControlEvents];

 to active audio in background when receiving and answering the call, but
with no luck. 

I also tried to set playback device to Audio Queue and Audio Unit, but all
failed.

I understand this may not related to Linphone's use case, but I have
completely no clue. Would you please provide me some guidance on how to
achieve my purpose? Or maybe where to take a look and modify the source code
in linphone library?

Thanks!



--
View this message in context: 
http://nongnu.13855.n7.nabble.com/iOS-Activate-Audio-Output-in-Background-tp195304.html
Sent from the linphone-developers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]