felixpalmer / android-visualizer

Takes the input from the Android MediaPlayer and displays visualizations, like in iTunes or WinAmp
815 stars 277 forks source link

Visualizer class crashes on Android 9 #35

Open mobilevisuals opened 5 years ago

mobilevisuals commented 5 years ago

There seems to be audio issues with Android 9. It could also be that the audio playing model has been changed in Android 9, but I can not find any information about this. The only audio related change seems to be "HD Audio: Improved performance and support for HD audio delivering clearer, sharper, and richer quality sound."

It is not only our apps that have issues with Android 9. I tested all the 10 top rated music visualizers. 40% of them have audio issues on Android 9, which makes the audio playing or the visualization not work anymore. I tested the same apps on a device with Android 8, where none of these problems appeared. This will cause big problems for the customers, when 40% of their music visualizer apps no longer work. Here are descriptions and stacktraces of the errors:

1) Visualizer data capture issue signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) android::RefBase::incStrong(void const*) const backtrace:

00 pc 000000000000bc30 /system/lib64/libutils.so (android::RefBase::incStrong(void const*) const)

01 pc 000000000000f7a8 /system/lib64/libutils.so (android::Thread::run(char const*, int, unsigned long)+124)

02 pc 00000000000bd028 /system/lib64/libmedia.so (android::Visualizer::periodicCapture()+224)

03 pc 00000000000bcdd8 /system/lib64/libmedia.so (android::Visualizer::CaptureThread::threadLoop()+88)

04 pc 000000000000f9d4 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)

05 pc 00000000000bc9cc /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)

06 pc 0000000000083840 /system/lib64/libc.so (__pthread_start(void*)+36)

07 pc 0000000000023d80 /system/lib64/libc.so (__start_thread+68)

I have debugged and researched and found that setDataCaptureListener in Visualizer causes this problem. This is probably not a driver problem, since I see on the Play console that it happens on both Samsung and Motorola.

2) Radio streaming no longer starts E/MediaPlayerNative: error (1, -2147483646) E/MediaPlayer: Error (1,-2147483648) E/ContentValues: onError
The '1' value corresponds to the constant in MediaPlayer.MEDIA_ERROR_UNKNOWN. -2147483648 corresponds to hexadecimal 0x80000000 which is defined as UNKNOWN_ERROR in frameworks/native/include/utils/Errors.h. This shows that the error's source is hard to pin down as it is quite a generic return value, thrown by codec and compatibility issues, but also thread cancellations and several other types.

mobilevisuals commented 5 years ago

The issue is reported here: https://issuetracker.google.com/issues/124357879

mobilevisuals commented 5 years ago

seems to be no activity on this website .......