Background IOS audio issue

wyvasi

Member
Good day!
We are trying to answer call using {audio: true, video: true} from background on IOS and from switching to app video can be turned on successfully, but audio there is no audio sent at all from IOS.
I set rtp_activity_video=false for video to work but I need a solution for audio. I also tried rtp_activity_audio=false without success.
I don't see why video can be swiched on/off without a problem but audio never works when video: true from background.
Can you have a look I also attached report and udp packets. Name of the broadcaster with issues is 'vc-joedo'
 
Last edited:

Max

Administrator
Staff member
Good day.
We checked the report. According to client logs and traffic dump, an application successfully sends media packets (we can play the stream from traffic dump), but audio packets are sent with empty payload (0 bitrate). So you should remove the following lines from flashphoner.properties:
1686706550867.png

A/V generator is used in SIP calls only, so you should not enable it.
Seems like your application has no access to microphone when running in background, so empty audio data packets are sent. Please look at Call Kit Demo example (description, source code), it shows how to answer a SIP call from background.
 

wyvasi

Member
Made the changes still not working.
If background constraints contains { audio: true, video: true } audio won't work at all. Is this IOS fault or is your SDK fault?

If we start in background { audio: true, video: true } there is no audio and no video -> if I unlock the phone (without closing, creating any new connection or calling any function to publish again) and video from is added, how can video be added latter and sound doesn't exist at all?

If we start with { audio: true, video: false } audio works correctly but video can't be added latter. I don't want to do any tricks like publishing twice or republishing.
 
Last edited:

Max

Administrator
Staff member
If background constraints contains { audio: true, video: true } audio won't work at all. Is this IOS fault or is your SDK fault?
iOS SDK uses WebRTC library without modifications (just built from sources). The library established WebRTC connection and sends media packets correctly, but audio packets contains empty media payload as we checked above. So this seems to be iOS issue, not Flashphoner iOS SDK. This is the common iOS problem to capture media from background: Apple forbids it due to security reasons.
Again, we recommend to look at Call Kit Demo example (description, source code). The application should receive push notification, go to foreground and then publish a stream.
 
Top