178 | | |
179 | | === Unable to accept incoming call in background mode (iOS4) === |
180 | | |
181 | | If while in the background, ipjsua (or your application) is unable to detect if there is an incoming call and display the local notification: |
182 | | 1. Note that background feature only works with TCP. |
183 | | 2. Make sure that voip is included in the required background modes (UIBackgroundModes) in the application’s Info.plist file. |
184 | | 3. Make sure that the TCP socket is successfully wrapped with CFReadStreamRef (check if there is a message: "Failed to configure TCP transport for VoIP usage"). |
185 | | 4. Check whether you can accept the incoming call by bringing the app to the foreground. If yes, make sure that the incoming call request comes from the wrapped TCP socket (check the log for the INVITE request). |
186 | | |
187 | | Note: these steps do not troubleshoot audio problems. |
205 | | === Audio issue (no audio) (iOS7) === |
206 | | |
207 | | There are a few reports that the audio is not working on iOS 7 (so far it's only reported to happen in iPhone 5) after getting the following error: |
208 | | |
209 | | {{{ |
210 | | iPhone mediaserverd[45] <Error>: 10:53:59.986 ERROR: [0x240b000] 740: _vp: initialize hw input: fs mismatched! REF=0.000000Hz, MIC=44100.000000Hz |
211 | | iPhone mediaserverd[45] <Error>: Resampler2 bad sample rate(s) : 0.00 16000.00 |
212 | | }}} |
213 | | |
214 | | One solution is to set the sound device's clock rate to 44100 Hz as to avoid resampling. |
215 | | |
216 | | === Audio issues (inability to mute, volume control center synchronization, playback reduced volume) (iOS7) === |
217 | | |
218 | | There are several issues with the use of Voice Processing IO Audio Unit in iOS 7, such as unable to mute the volume using the side volume button, unable to synchronize with the control center volume slide bar, significantly reduced volume for audio playback to speaker after a call. Currently there is no workaround for this. Please refer to ticket #1697 for more details. |
219 | | |
220 | | === Supporting multiple architectures (armv6, armv7, armv7s, arm64, and so on) === |
221 | | |
222 | | You need to compile separately for each architecture. If your iPhone SDK has '''{{{llvm-gcc}}}''' compiler (which is the supported compiler starting iOS SDK 5) or '''{{{clang}}}''', then you need to set '''{{{ARCH}}}''' environment variable to the desired architecture before running {{{configure-iphone}}}, for example: |
223 | | {{{ |
224 | | export ARCH="-arch arm64" |
225 | | }}} |
226 | | |
227 | | Then you need to combine the resulting libraries using the '''{{{lipo}}}''' command. For example: |
228 | | |
229 | | {{{ |
230 | | lipo -arch armv6 lib/armv6/libpjlib.a -arch armv7 lib/armv7/libpjlib.a -create -output lib/libpjlib.a |
231 | | }}} |
232 | | |
233 | | === Unable to support Bluetooth input === |
234 | | |
235 | | Since Bluetooth input support is only available for iOS 3.1 or later, you need to specifically specify that your deployment target is iOS 3.1 or above. You can do this either in '''{{{user.mak}}}''': |
236 | | {{{ |
237 | | export CFLAGS += -D__IPHONE_OS_VERSION_MIN_REQUIRED=30100 |
238 | | }}} |
239 | | or in '''{{{config_site.h}}}''': |
240 | | {{{ |
241 | | #define __IPHONE_OS_VERSION_MIN_REQUIRED 30100 |
242 | | }}} |
243 | | You need to recompile PJSIP after this. |
244 | | |
245 | | === Problem with interruption (by a phone call or an alarm), headset plug/unplug, or Bluetooth input === #interruption |
| 208 | === Crash after calling PJLIB APIs using Grand Central Dispatch (GCD) === #gcd-crash |
| 209 | |
| 210 | PJLIB API should be called from a registered thread, otherwise it will raise assertion such as "Calling pjlib from unknown/external thread...". With GCD, we cannot really be sure of which thread executing the PJLIB function. Registering that thread to PJLIB seems to be a simple and easy solution, however it potentially introduces a random crash which is harder to debug. Here are few possible crash scenarios: |
| 211 | - PJLIB's {{{pj_thread_desc}}} should remain valid until the registered thread stopped, otherwise crash of invalid pointer access may occur, e.g: in {{{pj_thread_check_stack()}}}. |
| 212 | - Some compatibility problems between GCD and PJLIB, see #1837 for more info. |
| 213 | |
| 214 | If you want to avoid any possibility of blocking operation by PJLIB (or any higher API layer such as PJMEDIA, PJNATH, PJSUA that usually calls PJLIB), instead of dispatching the task using GCD, the safest way is to create and manage your own thread pool and register that thread pool to PJLIB. Or alternatively, simply use PJSUA timer mechanism (with zero delay), see {{{pjsua_schedule_timer()/pjsua_schedule_timer2()}}} docs for more info. |
| 215 | |
| 216 | === Audio lost or other issues with interruption (by a phone call or an alarm), headset plug/unplug, or Bluetooth input === #interruption |
316 | | === Crash after calling PJLIB APIs using Grand Central Dispatch (GCD) === #gcd-crash |
317 | | |
318 | | PJLIB API should be called from a registered thread, otherwise it will raise assertion such as "Calling pjlib from unknown/external thread...". With GCD, we cannot really be sure of which thread executing the PJLIB function. Registering that thread to PJLIB seems to be a simple and easy solution, however it potentially introduces a random crash which is harder to debug. Here are few possible crash scenarios: |
319 | | - PJLIB's {{{pj_thread_desc}}} should remain valid until the registered thread stopped, otherwise crash of invalid pointer access may occur, e.g: in {{{pj_thread_check_stack()}}}. |
320 | | - Some compatibility problems between GCD and PJLIB, see #1837 for more info. |
321 | | |
322 | | If you want to avoid any possibility of blocking operation by PJLIB (or any higher API layer such as PJMEDIA, PJNATH, PJSUA that usually calls PJLIB), instead of dispatching the task using GCD, the safest way is to create and manage your own thread pool and register that thread pool to PJLIB. Or alternatively, simply use PJSUA timer mechanism (with zero delay), see {{{pjsua_schedule_timer()/pjsua_schedule_timer2()}}} docs for more info. |
323 | | |
| 280 | == Other Problems (problem specific to a particular iOS version/device/simulator) == |
| 281 | |
| 282 | === Unable to accept incoming call in background mode === |
| 283 | |
| 284 | Starting in iOS 9, this method to accept incoming call in bg is deprecated, please have a look at [#bg-call]. |
| 285 | |
| 286 | If while in the background, ipjsua (or your application) is unable to detect if there is an incoming call and display the local notification: |
| 287 | 1. Note that background feature only works with TCP. |
| 288 | 2. Make sure that voip is included in the required background modes (UIBackgroundModes) in the application’s Info.plist file. |
| 289 | 3. Make sure that the TCP socket is successfully wrapped with CFReadStreamRef (check if there is a message: "Failed to configure TCP transport for VoIP usage"). |
| 290 | 4. Check whether you can accept the incoming call by bringing the app to the foreground. If yes, make sure that the incoming call request comes from the wrapped TCP socket (check the log for the INVITE request). |
| 291 | |
| 292 | Note: these steps do not troubleshoot audio problems. |
| 293 | |
| 294 | === Audio issue (no audio) (iOS7) === |
| 295 | |
| 296 | There are a few reports that the audio is not working on iOS 7 (so far it's only reported to happen in iPhone 5) after getting the following error: |
| 297 | |
| 298 | {{{ |
| 299 | iPhone mediaserverd[45] <Error>: 10:53:59.986 ERROR: [0x240b000] 740: _vp: initialize hw input: fs mismatched! REF=0.000000Hz, MIC=44100.000000Hz |
| 300 | iPhone mediaserverd[45] <Error>: Resampler2 bad sample rate(s) : 0.00 16000.00 |
| 301 | }}} |
| 302 | |
| 303 | One solution is to set the sound device's clock rate to 44100 Hz as to avoid resampling. |
| 304 | |
| 305 | === Audio issues (inability to mute, volume control center synchronization, playback reduced volume) (iOS7) === |
| 306 | |
| 307 | There are several issues with the use of Voice Processing IO Audio Unit in iOS 7, such as unable to mute the volume using the side volume button, unable to synchronize with the control center volume slide bar, significantly reduced volume for audio playback to speaker after a call. Currently there is no workaround for this. Please refer to ticket #1697 for more details. |
| 308 | |
| 309 | === Unable to support Bluetooth input === |
| 310 | |
| 311 | Since Bluetooth input support is only available for iOS 3.1 or later, you need to specifically specify that your deployment target is iOS 3.1 or above. You can do this either in '''{{{user.mak}}}''': |
| 312 | {{{ |
| 313 | export CFLAGS += -D__IPHONE_OS_VERSION_MIN_REQUIRED=30100 |
| 314 | }}} |
| 315 | or in '''{{{config_site.h}}}''': |
| 316 | {{{ |
| 317 | #define __IPHONE_OS_VERSION_MIN_REQUIRED 30100 |
| 318 | }}} |
| 319 | You need to recompile PJSIP after this. |
| 320 | |
| 321 | === Sound not working in the simulator === |
| 322 | |
| 323 | Go to System Preferences > Sound > Sound Effects and then uncheck and recheck "Play user interface sound effects". If it still doesn't work, you can try some other suggestions [http://stackoverflow.com/questions/302399/sound-not-working-in-iphone-simulator here]. |