"gpu_mem=128" might not be enough
I've tuned gpu_mem to 128mb, which is mentioned in many posts as a suggested value for 1080p video playback. And it worked fine until I tried to play a video like this:
Video: MPEG4 Video (H264) 1920x1032 (480:259) 23.976fps 2246kbps [V: h264 high L5.1, yuv420p, 1920x1032, 2246 kb/s]
Audio: AAC 48000Hz 6ch 383kbps [A: English [eng] (aac lc, 48000 Hz, 5.1, 383 kb/s)]Kodi will just hung there. Checking /var/lib/kodi/.kodi/temp/kodi.log gave me this clue:
ERROR: COMXCoreComponent::DecoderEventHandler OMX.broadcom.egl_render - OMX_ErrorInsufficientResources, insufficient resourcesAnd set gpu_mem to 192 solve the problem.
ass subtitle memory leak
Basically, this is a annoying bug since at least Kodi 14.2 that has not been fixed yet.
Playing video along with aas subtitle will ultimately drain all memory and make RPi freeze then reboot.
ps. this seems not a platform specific bug, which means, all platform should behave the same way. It is worse on RPi because its memory is limited.
pss. srt subtitle seems good at the time.