Open saucetom opened 2 months ago
I don't regularly work on a linux machine. Would you be open to taking a look and putting up a PR?
Which API levels have you seen this on?
I just tried this on a mac with -gpu swiftshader_indirect
and forced RenderMode to hardware and it seemed to render fine
With the latest version of lottie-android I'm seeing this on all API levels >= 26, but yes it only happens on Linux machines.
It seems like it would make sense to default to Software Rendering if GPU hardware acceleration is not enabled, I'll take a look and see if that would be straightforward to implement.
@gpeal I don't think I'm able to detect from the code whether the test is running on an emulator using software graphics emulation. However I was able to trace the crash to this specific call to drawLayer. If I comment out that line the emulator doesn't hit the segfault.
I'm not familiar enough with the code to make any guesses about why that is, is there anything about this block of code or that specific drawLayer call that sticks out to you?
I will keep digging but any help or direction you could offer would be very appreciated.
@saucetom That's basically the root method that'll draw everything in your animation so it doesn't narrow it down much.
What I like to do in cases like this is to progressively remove parts of the original animation to narrow down which part of it is crashing.
Lottie is definitely frequently used on Linux with software rendering so there has to be something specific to your linux distro, emulator, or animation that is triggering this.
For what it's worth, Lottie's CI snapshots run on linux and snapshot >2k animations using both software and hardware rendering without any issue.
Lottie is supported and developed on nights and weekends. Issues from Lottie sponsors will be prioritized.
Checklist
Link to fork with a repro in the issue-repro module https://github.com/saucetom/lottie-android
Describe the bug Android emulators on Linux machines using software graphics rendering crash when rendering Lottie Animations. This happens when trying to render multiple animations at once or when rendering a large animation. We've confirmed this behavior on various machines running Linux.
If we set
renderMode = RenderMode.SOFTWARE
in theLottieAnimation
calls the crash doesn't happen. The crash also doesn't happen if we setandroid:hardwareAccelerated="false"
in the AndroidManifest.xml file. I wonder if the logic in theuseSoftwareRendering
method should detect that the emulator is not using hardware acceleration and default toRenderMode.SOFTWARE
? https://github.com/saucetom/lottie-android/blob/master/lottie/src/main/java/com/airbnb/lottie/RenderMode.java#L16Steps To Reproduce Steps to reproduce the behavior:
-gpu swiftshader_indirect
flagPlease let me know if there's any more information I can provide that would help facilitate resolving this bug. Thanks!