aws-samples / amazon-ivs-broadcast-android-sample

MIT No Attribution
9 stars 8 forks source link

Mobile Network Connection Issues #65

Open jlatenser opened 1 month ago

jlatenser commented 1 month ago

We're implementing the broadcast SDK for our Android application and noticing an issue for certain Android devices connected to a Stage on mobile networks. The network strength degrades almost instantly and the user is presented with a network outage. Here is an example of the outage UI on an Android device connected to mobile data.

image

Currently, the SDK is being implemented in parallel to a foreground service to allow users to keep listening while the app is pushed to the foreground. Removing the foreground service did not seem to relieve the network issues on mobile.

To be clear, this does NOT happen while connected to WIFI.

Current build implementation // IVS broadcast implementation 'com.amazonaws:ivs-broadcast:1.16.0:stages@aar'

All mobile participants are given SUBSCRIBE capabilities only with AUDIO_ONLY

`@NonNull
@Override
public List<LocalStageStream> stageStreamsToPublishForParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) {
    return new ArrayList<>();
}

@Override
public boolean shouldPublishFromParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) {
    return false;
}

@Override
public Stage.SubscribeType shouldSubscribeToParticipant(@NonNull Stage stage, @NonNull ParticipantInfo participantInfo) {
    return Stage.SubscribeType.AUDIO_ONLY;
}`

If I change the SubscribeType to NONE, the network issue will not reproduce, but the app doesn't allow the user to hear the broadcast.

We're NOT currently opted into Simulcast

Thanks for any help with this! Jon

jlatenser commented 1 month ago

From what we can tell this appears to only impact Google Pixel phones running Android 14...

bclymer commented 1 month ago

Hey @jlatenser , this is an exceptionally weird bug. We do have some changes to our network interface management coming through soon. This isn't a behavior we've seen in house (and we test on a google amount of pixel devices on cellular connections), so hopefully these interface changes help.

I'll leave a follow up comment here when that version is available.