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

MIT No Attribution
10 stars 8 forks source link

Unable to broadcast if amazon ivs broadcast only exist inside DFM module #15

Open doniwinata0309 opened 2 years ago

doniwinata0309 commented 2 years ago

Broadcast not working if library only implemented inside DFM (Dynamic Feature Delivery) module. It will works if base module implement it, and all SO files are inside Base APK. Details:

Android broadcast SDK: 1.2.0 Gradle: 7.3 Android Gradle Plugin 7.0

Assume I have 2 modules, module A is application module and module B is Dynamic Feature Module. Amazon Broadcast only implemented inside DFM module B, to help reduce our main APK size.

When starting broadcast, it show blank black screen with this repeated error:


022-01-17 16:33:23.662 16578-16578/com.traveloka.android.staging W/AmazonIVS: External cameras are not supported on this device, not listing USB devices
2022-01-17 16:33:23.663 16578-16578/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1,777778)
2022-01-17 16:33:23.663 16578-16578/com.traveloka.android.staging D/AmazonIVS: Using size 1920x1080 (1,777778)
2022-01-17 16:33:23.670 16578-29746/com.traveloka.android.staging E/AmazonIVS: FATAL: No opengl configurations: 
2022-01-17 16:33:23.685 16578-29746/com.traveloka.android.staging I/AmazonIVS: Surface=0x9d821a60 window=0xa7acd008
2022-01-17 16:33:23.709 16578-29746/com.traveloka.android.staging I/AmazonIVS: Surface=0x9767c180 window=0xa7e63008 display=0x1 config=0x2
2022-01-17 16:33:23.752 16578-16578/com.traveloka.android.staging I/AmazonIVS: create http client okhttp
2022-01-17 16:33:23.759 16578-29746/com.traveloka.android.staging I/AmazonIVS: Surface=0xa0801f80 window=0xa7ad5008
2022-01-17 16:33:23.782 16578-29750/com.traveloka.android.staging D/AmazonIVS: Using fps range 5->30
2022-01-17 16:33:23.817 16578-16578/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1,777778)
2022-01-17 16:33:23.818 16578-16578/com.traveloka.android.staging D/AmazonIVS: Using size 1920x1080 (1,777778)
2022-01-17 16:33:23.819 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:23.820 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:23.821 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502
2022-01-17 16:33:24.124 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.125 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.133 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502
2022-01-17 16:33:24.156 16578-29746/com.traveloka.android.staging I/AmazonIVS: Surface=0x9767e520 window=0xa7b1a808
2022-01-17 16:33:24.159 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.160 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.163 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502
2022-01-17 16:33:24.179 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.179 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.185 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502
2022-01-17 16:33:24.198 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.199 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.219 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502
2022-01-17 16:33:24.257 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.258 16578-29746/com.traveloka.android.staging E/AmazonIVS: Shader compilation failed
2022-01-17 16:33:24.262 16578-29746/com.traveloka.android.staging E/AmazonIVS: 337 glGetError=502

However, if we add amazon broadcast SDK dependencies to our application module the issue is gone. This is the logcat from it:

2022-01-17 16:30:57.253 31672-31672/com.traveloka.android.staging D/AmazonIVS: Found library broadcastcore
2022-01-17 16:30:57.256 31672-31672/com.traveloka.android.staging W/AmazonIVS: External cameras are not supported on this device, not listing USB devices
2022-01-17 16:30:57.267 31672-31672/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1.777778)
2022-01-17 16:30:57.268 31672-31672/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1.777778)
2022-01-17 16:30:57.282 31672-32010/com.traveloka.android.staging E/AmazonIVS: FATAL: No opengl configurations: 
2022-01-17 16:30:57.294 31672-32010/com.traveloka.android.staging I/AmazonIVS: Surface=0x77c8c460 window=0x6b7ff008
2022-01-17 16:30:57.368 31672-32010/com.traveloka.android.staging I/AmazonIVS: Surface=0x77c8c1f0 window=0x6ad5c008 display=0x1 config=0x2
2022-01-17 16:30:57.441 31672-31672/com.traveloka.android.staging I/AmazonIVS: create http client okhttp
2022-01-17 16:30:57.473 31672-32010/com.traveloka.android.staging I/AmazonIVS: Surface=0x775d3dd0 window=0x6b7ff808
2022-01-17 16:30:57.531 31672-32005/com.traveloka.android.staging D/AmazonIVS: Using fps range 5->30
2022-01-17 16:30:57.559 31672-31672/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1.777778)
2022-01-17 16:30:57.561 31672-31672/com.traveloka.android.staging D/AmazonIVS: Using size 1280x720 (1.777778)
2022-01-17 16:30:57.866 31672-32010/com.traveloka.android.staging I/AmazonIVS: Surface=0x6b6f2d50 window=0x6b5ff808

In this case, all SO files and SDK from amazon broadcast are move to base apk, and probably because of that this log is showing up D/AmazonIVS: Found library broadcastcore.

However put amazon broadcast dependencies to our base APK will adding 2 MB to our download and install size.

Do you have some idea if it issue from amazon broadcast SDK(maybe not supporting DFM yet) or something I can do to make it works with only DFM module implementation?

Let me know if you need additional information. Thank you in advance

caleighm commented 2 years ago

Hi @doniwinata0309 , thanks for reporting this. We have not tested the Broadcast SDK with DFM so it's possible there are issues leading to lack of support. I've opened an internal ticket to track and investigate it.

In the DFM logs, do you see the following log? It would show up very early:

Failed to load library broadcastcore

It looks like the broadcast library is, in fact, loading, even in DFM. Instead I believe the issue has to do with a failure to find the fragment shaders (Shader compilation failed), which are simple raw resource text files. There is a previously-reported issue (https://github.com/aws-samples/amazon-ivs-broadcast-android-sample/issues/6) that led to the same problem, although a different cause.

Thanks for bringing this to our attention! I will update this post when I have more information.

doniwinata0309 commented 2 years ago

Hi @caleighm I did not see this "Failed to load library broadcastcore" showing up on logcat. As additional info, this also happen on our debug environment where R8 is disabled. Thank you for quick response and feedback, let me know if something I can help.

caleighm commented 2 years ago

Hi @doniwinata0309 , thanks for this additional information. To help investigate this further, could you also please reach out to AWS Support (https://console.aws.amazon.com/support/home) and let them know that you would like escalate this behavior to the IVS team?

I may have further follow-up questions here, too, but I will only post as needed (or with updates on our end).

doniwinata0309 commented 2 years ago

Hi @caleighm we already send it to AWS support about this issue. Sure, let me know if something I can help, thank you for your help