Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes #3

Open
RAIERIN opened this issue Aug 11, 2022 · 10 comments
Open

App Crashes #3

RAIERIN opened this issue Aug 11, 2022 · 10 comments

Comments

@RAIERIN
Copy link

RAIERIN commented Aug 11, 2022

The app is crashing in some phone when ScreenRecorder.start() is called for new version of android. And the error log shows this.

D/scrcast: createRecorder() E/SensorManager: registerListenerImpl sensorName:BMI160_ACCELEROMETER Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: io.ionic.starter,callingPid:9852,callingUid:10945 E/MediaRecorder: prepare failed: -2147483648 E/AndroidRuntime: FATAL EXCEPTION: main Process: io.ionic.starter, PID: 9852 java.io.IOException: prepare failed. at android.media.MediaRecorder._prepare(Native Method) at android.media.MediaRecorder.prepare(MediaRecorder.java:1178) at dev.bmcreations.scrcast.internal.recorder.service.RecorderService.createRecorder(RecorderService.kt:159) at dev.bmcreations.scrcast.internal.recorder.service.RecorderService.access$createRecorder(RecorderService.kt:32) at dev.bmcreations.scrcast.internal.recorder.service.RecorderService$recordInternal$1.invokeSuspend(RecorderService.kt:227) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:233) at android.app.ActivityThread.main(ActivityThread.java:8068) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)

Android version:
Screenshot_20220811-140609_Settings

@riderx
Copy link
Collaborator

riderx commented Aug 11, 2022

Thanks for the report, i will check soon it's maybe link to the lib i use : bmcreations/scrcast#58

@RAIERIN
Copy link
Author

RAIERIN commented Aug 12, 2022

Is there any way i can fix the issue?

@riderx
Copy link
Collaborator

riderx commented Aug 14, 2022

@RAIERIN for now i don't see a way, the issue is in scrcast.
maybe i could find other plugin with better support

@riderx
Copy link
Collaborator

riderx commented Aug 14, 2022

maybe i could try to migrate to https://github.com/HBiSoft/HBRecorder

@RAIERIN
Copy link
Author

RAIERIN commented Aug 14, 2022

@riderx if you could migrate when will you do that.

@riderx
Copy link
Collaborator

riderx commented Aug 14, 2022

i will check it next week

@RAIERIN
Copy link
Author

RAIERIN commented Aug 15, 2022

Okay! Thanks

@kolyneh
Copy link

kolyneh commented Aug 31, 2022

For this error: E/MediaRecorder: prepare failed: -2147483648
It's BAD_TYPE in native error codes.
Maybe it's because of the outputFormat/videoEncoder/videoFrameRate/videoSize params.
Mostly it's the resolution you set, use a resolution less than 1080P to check if it's working.

@riderx
Copy link
Collaborator

riderx commented Aug 31, 2022

@kolyneh there no option to set the resolution in scrcast where i we could change it ?

@kolyneh
Copy link

kolyneh commented Aug 31, 2022

Hi, check this in scrcast:

https://github.com/bmcreations/scrcast/blob/9cc8deea768dedf746c41e35c153db83aeb68b74/library/src/main/java/dev/bmcreations/scrcast/config/Options.kt#L73-L89

It's part of Options.
In DSL like:

options{
    video{
         width = 1920
         heigh = 1080
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants