New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Callee Side audio issue and Audiounit Can't work with iOS CallKit #784
Comments
which version of iOS and Xcode are you using ? can you find out what this reason value means:
|
Hello @alfredh In the above i mentioned issue 2 is fixed. it's due to i called the ua_answer method inside iOS Callkit -> performAnswerCallAction method. Now am calling the ua_answer inside Callkit -> didActivateAudioSession callBack method. its working fine with Callkit. But still am having the Audio issue in Callee side pls look into it. i tried with this old lib https://github.com/miche-atucha/taresip. it's working fine. am able to hear the audio in both side. Current version having the issue. i compiled from this link for ios These are the version am using iOS Version : 12.3.1 audiounit: AudioRouteChange - reason 8
here is the link for the print |
how did you build baresip for ios? did you use this project: https://github.com/alfredh/baresip-ios if I change the target version to 7.0 we get some warnings:
perhaps it is time to upgrade the audiounit module to use more recent APIs ? https://developer.apple.com/documentation/audiotoolbox/1618360-audiosessioninitialize https://stackoverflow.com/questions/19710046/a-fix-for-audiosessioninitialize-deprecated |
i didn't change the target version. i build the same target version as you defined 6.0. yes we have to update the AudioUnit module to use the latest API. i will try to build with 7.0 target and update you.. Update!!! modules/audiounit/sess.c:72:2: warning: 'AudioSessionRemovePropertyListenerWithUserData' is deprecated: first deprecated in iOS 7.0 - no longer supported [-Wdeprecated-declarations] |
can you please try to replace calls to deprecated functions with calls |
Hello @alfredh |
did you manage to update the code ? I also noticed some other strange things in your logs:
the value
the error code means AVAudioSessionErrorCodeInsufficientPriority |
if the Hardware Sample rate is 0.0 Hz then the recording will probably could you please test this patch: diff --git a/modules/audiounit/recorder.c b/modules/audiounit/recorder.c
index 4b891f6..2bd80e0 100644
--- a/modules/audiounit/recorder.c
+++ b/modules/audiounit/recorder.c
@@ -268,7 +268,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as,
ret = AudioUnitGetProperty(st->au_in,
kAudioUnitProperty_SampleRate,
- kAudioUnitScope_Input,
+ kAudioUnitScope_Output,
inputBus,
&hw_srate,
&hw_size); an AudioUnit has 2 "scopes", input and output. for the recording audiounit I have tested the patch on OSX and it reports the correct Hardware samplerate. |
Hello @alfredh i updated your patch and recompiled the lib. But still am facing the same issue
am i missing something? audio: Set audio decoder: PCMA 8000Hz 1ch |
on iOS the following then encode start working and stop having garbled audio, I know this not the solution, but work for now! |
Hello @CanaJalil Thank you so much for your work around. Its working fine now. in your comments some typo in code. Below code is working fine.
|
thanks for the patch can you please test this patch: diff --git a/modules/audiounit/recorder.c b/modules/audiounit/recorder.c
index 4b891f6..b212a79 100644
--- a/modules/audiounit/recorder.c
+++ b/modules/audiounit/recorder.c
@@ -266,6 +266,10 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as,
goto out;
#endif
+#if TARGET_OS_IPHONE
+ hw_srate = prm->srate;
+ (void)hw_size;
+#else
ret = AudioUnitGetProperty(st->au_in,
kAudioUnitProperty_SampleRate,
kAudioUnitScope_Input,
@@ -274,6 +278,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as,
&hw_size);
if (ret)
goto out;
+#endif
debug("audiounit: record hardware sample rate is now at %f Hz\n",
hw_srate); please test the following:
|
Hello @alfredh I tested the patch. its working fine in iOS devices. Thanks for your update. you can close the issue. |
Great, I pushed the patch to master. Thanks for reporting the bug. |
Hi,
No audio in Callee side. Caller side can able to hear the audio. this issue is having in iOS only. the same library version for android it just works fine in both side audio.
audiounit: AudioRouteChange - reason 8
�[31mmain: long async blocking: 853>100 ms (h=0x10078c5dc arg=0x2819e45c0)
�[;maudiounit: AudioRouteChange - reason 8
audiounit: AudioRouteChange - reason 8
audio: Set audio decoder: PCMA 8000Hz 1ch
audio: player started with sample format S16LE
audio: Set audio encoder: PCMA 8000Hz 1ch
audiounit: AudioRouteChange - reason 8
audiounit: AudioRouteChange - reason 8
audiounit: record: enable resampler 0.0 -> 8000 Hz
2019-08-26 16:02:30.808738+0530 App[1590:593027] [aid] AudioIssueDetectorNode.cpp:161:Initialize: Caught analyzer graph exception 1718775073 !mrf slice duration must be set before configure. in /BuildRoot/Library/Caches/com.apple.xbs/Sources/AudioDSP/AudioDSP-251.70.4.1/CoreAudioUtility/Source/CADSP/DSPGraph/DSPGraph_Graph.cpp:597
audio: source started with sample format S16LE
audio tx pipeline: audiounit ---> vumeter ---> PCMA
audio rx pipeline: audiounit <--- vumeter <--- PCMA
stream: incoming rtp for 'audio' established, receiving from xxx.xxx.xxx.xxx:54504
XXXX@XXX.XXX.XXX.XXX: Call established: sip:XXXX@XXX.XXX.XXX.XXX
2019-08-26 16:02:30.838917+0530 App[1590:593027] ua event (CALL_ESTABLISHED) sip:XXXX@XXX.XXX.XXX.XXX
audiounit: AudioRouteChange - reason 8
audiounit: AudioRouteChange - reason 8
2019-08-26 16:02:31.070211+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.071446+0530 App[1590:593027] handleStatus = event = call established uap = 4318049984 callp = 4316077984
audiounit: AudioRouteChange - reason 8
�[31mmain: long async blocking: 1627>100 ms (h=0x10078c5dc arg=0x2819e45c0)
�[;m2019-08-26 16:02:31.138418+0530 App[1590:593027] ua event (VU_TX_REPORT) -44.72
stream: incoming rtp for 'audio' established, receiving from 192.168.113.173:54504
2019-08-26 16:02:31.139566+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.162756+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.185926+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.209104+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.232365+0530 App[1590:593158] 55: EXCEPTION (-1): ""
[0:00:01] audio=0/0 (bit/s)
2019-08-26 16:02:31.255618+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.278882+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.302090+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:31.325543+0530 App[1590:593158] 55: EXCEPTION (-1): ""
[0:00:04] audio=354868/0 (bit/s)
2019-08-26 16:02:34.275237+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:34.298633+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:34.321680+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:34.345052+0530 App[1590:593158] 55: EXCEPTION (-1): ""
[0:00:07] audio=354868/0 (bit/s)
2019-08-26 16:02:37.084999+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.108330+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.131440+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.154925+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.166286+0530 App[1590:593027] ua event (VU_TX_REPORT) -41.90
2019-08-26 16:02:37.167796+0530 App[1590:593027] ua event (VU_RX_REPORT) -59.71
2019-08-26 16:02:37.177911+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.200468+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.224164+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.247441+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.270688+0530 App[1590:593158] 55: EXCEPTION (-1): ""
[0:00:07] audio=351882/63552 (bit/s)
2019-08-26 16:02:37.293810+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.317203+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.340251+0530 App[1590:593158] 55: EXCEPTION (-1): ""
2019-08-26 16:02:37.363525+0530 App[1590:593158] 55: EXCEPTION (-1): ""
getting this error with ios callkit for incoming call. outgoing call it works fine.
and also i checked without callkit its working fine for both incoming and outgoing calls. when using callkit only having this issue.
answering call from sip:xxxx@xxx.xxx.xxx.xxx with 200
audio: Set audio decoder: PCMA 8000Hz 1ch
�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_player failed (audiounit.nil): Function not implemented
�[;maudio: Set audio encoder: PCMA 8000Hz 1ch
�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_player failed (audiounit.nil): Function not implemented
�[;m�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_source failed (audiounit.nil): Function not implementedaudio: Set audio decoder: PCMA 8000Hz 1ch
�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_player failed (audiounit.nil): Function not implemented
�[;maudio: Set audio encoder: PCMA 8000Hz 1ch
�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_player failed (audiounit.nil): Function not implemented
�[;m�[31maudiounit: AudioSessionSetActive: 561017449
�[;m�[31maudio: start_source failed (audiounit.nil): Function not implemented
The text was updated successfully, but these errors were encountered: