Skip to content
This repository has been archived by the owner on Sep 28, 2019. It is now read-only.

Crash on startup #1

Closed
sm4rk0 opened this issue Dec 17, 2016 · 10 comments
Closed

Crash on startup #1

sm4rk0 opened this issue Dec 17, 2016 · 10 comments

Comments

@sm4rk0
Copy link

sm4rk0 commented Dec 17, 2016

Motorola Moto X (2013), Lollipop 5.1 + Xposed

logcat -d | grep 30276:

E/AndroidRuntime(30276): FATAL EXCEPTION: main
E/AndroidRuntime(30276): Process: click.dummer.rickapp, PID: 30276
E/AndroidRuntime(30276): java.lang.RuntimeException: Unable to start activity ComponentInfo{click.dummer.rickapp/click.dummer.rickapp.RickActivity}: java.lang.IllegalArgumentException: Invalid audio buffer size.
E/AndroidRuntime(30276): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339)
E/AndroidRuntime(30276): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
E/AndroidRuntime(30276): at android.app.ActivityThread.access$800(ActivityThread.java:155)
E/AndroidRuntime(30276): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
E/AndroidRuntime(30276): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(30276): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(30276): at android.app.ActivityThread.main(ActivityThread.java:5343)
E/AndroidRuntime(30276): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(30276): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(30276): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime(30276): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
E/AndroidRuntime(30276): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
E/AndroidRuntime(30276): Caused by: java.lang.IllegalArgumentException: Invalid audio buffer size.
E/AndroidRuntime(30276): at android.media.AudioRecord.audioBuffSizeCheck(AudioRecord.java:428)
E/AndroidRuntime(30276): at android.media.AudioRecord.(AudioRecord.java:318)

@no-go
Copy link
Owner

no-go commented Dec 17, 2016

Hi sm4rk0,
thanks for submitting this issue. I try to fix it in the next version. I think it is a good way to check the available buffer sizes in my code.

@no-go
Copy link
Owner

no-go commented Dec 17, 2016

I think, I fix the issue. I read on stackoverflow that it is better to multiply the minimal buffer size with two. The reason is a bit strange: I used a function to get the minimal buffer size from the system, but the result of this function is for 8bit and not for 16bit sampling. Because it is a minimal value, there is no problem to make it two times bigger. The App still works on my Wileyfox Swift (6.0) and Nexus S (Kitkat).

If you want to test the new APK from https://github.com/no-go/RickApp/tree/master/app, please remove the old one! I sign it with a new, different key.

:-D

@sm4rk0
Copy link
Author

sm4rk0 commented Dec 17, 2016

Thanks for a quick response, but there's the same exception again:

I/ActivityManager( 1228): Start proc 14887:click.dummer.rickapp/u0a259 for activity click.dummer.rickapp/.RickActivity
W/XPrivacy(14887): Hooking package=click.dummer.rickapp
W/art (14887): Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable E/MediaPlayer(14887): Should have subtitle controller already set E/AudioSystem(14887): AudioSystem::getInputBufferSize failed sampleRate 4000 format 0x1 channelMask 10
E/AudioRecord(14887): AudioSystem could not query the input buffer size for sampleRate 4000, format 0x1, channelMask 0x10; status -22
D/AndroidRuntime(14887): Shutting down VM
E/AndroidRuntime(14887): FATAL EXCEPTION: main
E/AndroidRuntime(14887): Process: click.dummer.rickapp, PID: 14887 E/AndroidRuntime(14887): java.lang.RuntimeException: Unable to start activity ComponentInfo{click.dummer.rickapp/click.dummer.rickapp.RickActivity}: java.lang.IllegalArgumentException: Invalid audio buffer size.
E/AndroidRuntime(14887): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2339)
E/AndroidRuntime(14887): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
E/AndroidRuntime(14887): at android.app.ActivityThread.access$800(ActivityThread.java:155)
E/AndroidRuntime(14887): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
E/AndroidRuntime(14887): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(14887): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(14887): at android.app.ActivityThread.main(ActivityThread.java:5343)
E/AndroidRuntime(14887): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14887): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(14887): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime(14887): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
E/AndroidRuntime(14887): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:102)
E/AndroidRuntime(14887): Caused by: java.lang.IllegalArgumentException: Invalid audio buffer size.
E/AndroidRuntime(14887): at android.media.AudioRecord.audioBuffSizeCheck(AudioRecord.java:428)
E/AndroidRuntime(14887): at android.media.AudioRecord.(AudioRecord.java:318)
E/AndroidRuntime(14887): at android.media.AudioRecord.(AudioRecord.java:226)
E/AndroidRuntime(14887): at click.dummer.rickapp.RickActivity.onCreate(RickActivity.java:107)
E/AndroidRuntime(14887): at android.app.Activity.performCreate(Activity.java:6010) E/AndroidRuntime(14887): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
E/AndroidRuntime(14887): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292) E/AndroidRuntime(14887):
... 11 more
I/Process (14887): Sending signal. PID: 14887 SIG: 9
I/ActivityManager( 1228): Process click.dummer.rickapp (pid 14887) has died

@no-go
Copy link
Owner

no-go commented Dec 17, 2016

Okay, but the hint "getInputBufferSize failed" is new for me. I will try to fix it in the next 2 or 3 day. But it is hard to fix, because there is no possibility for me to simulate this special Motorola Device :-S

@no-go
Copy link
Owner

no-go commented Dec 17, 2016

Maybe, it could be a permission problem. Did you have a special App or Manager to allow/forbid the permissions on your android system? try to check the microphone access of RickApp ;-)

@sm4rk0
Copy link
Author

sm4rk0 commented Dec 18, 2016

Only XPrivacy, but it's the same when I disable it for RickApp. Only things the XPrivacy logs, when it's enabled, are IPackageManager:getPackageInfo, Serial, Configuration.MCC and Configuration.MNC which are usually requested for all possible applications, probably by some system library, not the RickApp.

@no-go
Copy link
Owner

no-go commented Dec 19, 2016

I think, that Motorola has no default call recording and this makes all the trouble. Please try the echo App. Parts of the echo App Code is very similar to RickApp. If the echo App did not start on your phone, I will not find a solution for you :-(

@sm4rk0
Copy link
Author

sm4rk0 commented Dec 19, 2016

Echo app is working. Yes, there are some difficulties with call recording on Moto X. The only app that worked for me (with root) is CallRecorder by skvalex.

@no-go
Copy link
Owner

no-go commented Dec 20, 2016

I changed some important parts to make it more like "echo App":

  • 8kHz sampling instead of 4kHz
  • MIC input device instead of DEFAULT
  • 5MB buffer size, if MinBufferSize is lower
  • error handling if audio state is not initialized
    :-D

@sm4rk0
Copy link
Author

sm4rk0 commented Dec 20, 2016

It works! Thanks!

@sm4rk0 sm4rk0 closed this as completed Dec 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants