Closed ghost closed 7 years ago
I just read your response to issue #14 "Endless echo using MIDI playback on Nexus 9 5.x".
You state the fix is to not build/remove the 64 bit libraries, but I'm not sure how to do this.
Would this be the fix, then? If so, how would I execute it?
I just read your response to issue #11 "Noise on android lollipop 5.1+".
There you say a solution is to use 7z to remove the 64-bit files from the APK. If this is the solution here, is there a way to do this with the files that Gradle downloads for the v1.11 dependency, instead of removing them from the APK?
However, that issue is almost two years ago, prior to the v1.11 release, so perhaps the advice given there is no longer relevant...?
It looks like your device is using the broken built in 64 bit library rather than the fixed one provided in the driver. I have changed the name of the sonivox library in the driver so this is no longer possible.
Thank you for your prompt turnaround. v1.12 solves this Galaxy S-6 issue.
A new issue has appeared with v1.12 on a Nexus Galaxy II running 4.1.2 (API 16). Here is the relevant log output from your MidiTest app:
From Nexus Galaxy II running 4.1.2 (API 16) [mididdriver v.1.12] executing "MidiTest"
04-06 17:38:34.544 17526-17526/? D/dalvikvm: Trying to load lib /data/data/org.billthefarmer.miditest/lib/libmidi.so 0x41ffcf80
04-06 17:38:34.544 17526-17526/? W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/billthefarmer/mididriver/MidiDriver;
04-06 17:38:34.549 17526-17526/? D/AndroidRuntime: Shutting down VM
04-06 17:38:34.549 17526-17526/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x415af2a0)
04-06 17:38:34.549 17526-17526/org.billthefarmer.miditest E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at org.billthefarmer.miditest.MainActivity.onCreate(MainActivity.java:68)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1825 could not load needed library 'libsynth.so' for 'libmidi.so' (load_library[1094]: Library 'libsynth.so' not found)
at java.lang.Runtime.loadLibrary(Runtime.java:370)
at java.lang.System.loadLibrary(System.java:535)
at org.billthefarmer.mididriver.MidiDriver.<clinit>(MidiDriver.java:102)
at org.billthefarmer.miditest.MainActivity.onCreate(MainActivity.java:68)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
It looks like I can't win. Devices running 4.2.2 (API 17) and below can't load a second native library unless it's built in. Devices running 7.0 (API 24) and above don't allow the use of unsupported built in native libraries. Devices running 64 bit 5.01 or 5.1.1 may have a broken 64 bit version of the sonivox native library and will use the broken built in version rather then the fixed version in the driver. It looks like the only solution that will work on all devices is to not rename the sonivox library and only provide a 32 bit version of the driver.
What would be the downside if I use only the 32-bit drivers without the renamed sonivox library?
From what you wrote above, it seems the other solution is to use the current v1.12 and increase my min SDK version from 15 to 18. From the Android Dashboards stats and several other places I googled today a min SDK version of 18 still represents 90% of the devices out there. Do you feel it would be worth it to move to a min SDK of 18 in order to use the 64-bit drivers in their current configuration?
I examined the releases and it looks like 1.08 is 32-bit only. I did some testing with versions 1.08, 1.11, and 1.12, and 1.08 worked in all circumstances. It seems I would be able to use the version 1.08 32-bit only driver without experiencing any drawbacks (except the loss of improvements in future releases, unless there is a way to remove the 64-bit drivers from the releases?).
Does this match your expectation or am I missing something?
In case you find it helpful here are the testing details.
G: means Google Pre-launch test. D: means I tested it on that device.
Device and Version | v1.08 - 32 bit | v1.11 - 64 bit | v1.12 - fix for (1) |
---|---|---|---|
Emulator (7.1.1 - 25) | - | - | - |
G: Moto G 2nd Gen (4.4 - 19) | - | - | - |
G: zeroflte (5.1 - 22) | - | - | - |
G: Moto G 1st Gen (4.4 - 19) | ? | - | - |
G: Moto X 2nd Gen (4.4 - 19) | - | - | - |
G: LG G3 (4.4 - 19) | ? | - | - |
G: Nexus 5 (4.4 - 19) | - | - | - |
G: Nexus 5 (5.1 - 22) | - | - | - |
G: HTC One (M8) (4.4 - 19) | - | - | - |
G: Nexus 7 (5.0 - 21) | - | - | - |
G: Nexus 9 (5.0 - 21) | - | - | - |
G: Galaxy Note3 (4.4 - 19) | - | - | - |
D: Moto E (5.1 - 22) | - | - | - |
D: Galaxy II (4.1.2 - 16) | - | - | (2) |
D: Galaxy III (4.4.2 - 19) | - | - | - |
D: Galaxy S4 mini (4.4.2 - 19) | - | - | - |
D: Galaxy S5 (5.0 - 21) | - | - | - |
D: Galaxy S6 (5.1.1 - 22) | - | (1) | - |
D: Alcatel 4060A (5.1.1 - 22) | - | - | - |
D: 7" Galaxy (4.4.4 - 19) | - | - | - |
D: 10" Insignia (6.0.1 - 23) | - | - | - |
? = Device not available for testing at the time.
(1) = Uses broken built in 64-bit library, generates reverb noise.
(2) = UnsatisfiedLinkError: could not load needed library 'libsynth.so' for 'libmidi.so' (load_library[1094]: Library 'libsynth.so' not found)
Version 1.08 is 32 bit only, so should be ok. I have uploaded 32 bit versions of version 1.11 and 1.12. The only change in 1.12 was to rename the sonivox library which caused link errors in older versions of android. I am working on getting Gradle to build 32 bit native libraries only so JitPack will work for all devices.
I have pushed a new 32 bit only version which should work fine via JitPack .
Yes, v1.13 via JitPack works on all devices. Thank you very much for your prompt responses and quick turnaround time - I really appreciate it!
Hi billthefarmer.
First of all, thank you so much for writing this useful driver - I appreciate your work very much!
I've upgraded to v1.11, referenced in Gradle via
"compile 'com.github.billthefarmer:mididriver:v1.11'".
Proir to this I was using the previous version, stored locally, and referenced in Gradle via:
"compile project(':MidiDriver-all-release')"
which resolved to the local file "MidiDriver-all-release.aar".While testing the new version v1.11 by running your "miditest", I encountered an aberration running on a Galaxy S-6 with the following specs:
When I quickly press and release the "C chord" button, the chord briefly sounds but then a low reverb-like echoing noise starts, rapidly becoming louder until distorted, and continues indefinitely until I switch away from the app.
This was not present in the old driver.
In the notes for the v1.11 release I see you state that Google fixed a "64 bit reverb bug". The description "reverb bug" seems like it might refer to what I am experiencing, but since this has been fixed, I am not sure if the problem is with the S-6, the Android OS it has installed, or the Midi Driver.
What do you think?
I ran the Midi Test on the S-6 using the old driver (no infinite reverb echo noise) and using the new v1.11 driver (infinite reverb echo noise) with a log level of VERBOSE and have included the output here in case this is helpful to you:
Thank you for your time and help.
Rodney Ryan