linphone-developers
[Top][All Lists]
Advanced

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

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


From: Guillaume BIENKOWSKI
Subject: Re: [Linphone-developers] iOS - Activate Audio Output in Background
Date: Thu, 22 Jan 2015 11:47:00 +0100

I think the app has to be in the foreground to be able to open audio or video input, this is a (welcome) Apple limitation.

When the audio is already running, this will work but the user *has* to place the app to the foreground at least when the session starts the first time.


Imagine the privacy consequences of allowing the audio input without the user having the choice to react.


Guillaume BIENKOWSKI

address@hidden



On Thu, Jan 22, 2015 at 11:38 AM, Guillaume BIENKOWSKI <address@hidden> wrote:

I think the app has to be in the foreground to be able to open audio or video input, this is a (welcome) Apple limitation.
When the audio is already running, this will work but the user *has* to place the app to the foreground at least when the session starts the first time.

Imagine the privacy consequences of allowing the audio input without the user having the choice to react.

Guillaume BIENKOWSKI
address@hidden


On 22 Jan 2015, at 11:05, powerqian wrote:

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.

_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers


reply via email to

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