ijkplayer cannot play on Android 12, crashes

When playing audio on Android 12, it cannot be played, and it always crashes. It is not particularly obvious to look at the log to find the reason.
Later, after many tests, it was found that the following log will always be printed every time the flashback occurs:

Fatal signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xfffffffe in tid 28393 (ff_read), pid 27351 (oft.dingdongfm3)

Through the search, it is found that the main reason is that ijkplayer is not compatible with the android mobile phone version of the v8a architecture.

Reason: The MTE mechanism used by the hardware of some models of android phones with the v8a architecture adds a memery tag to each allocated memory space during the use of the native layer. When calling, it will detect whether the memery tag has been changed ( Mainly for security reasons, refer to hacker attack means buffer overflow)

Solution:

1. Native adds 4 as the memery tag to the highest bit every time it allocates space (too troublesome, bloggers can’t do research)

2. Add the android:allowNativeHeapPointerTagging="false" attribute in the AndroidManifest.xml file, as shown in the figure:
insert image description here
Finally, I am very grateful to the author of this article: https://python.iitter.com/other/91575.html, for providing a valuable solution.

Guess you like

Origin blog.csdn.net/xiaoduzi1991/article/details/123232930