alongubkin / phonertc

WebRTC for Cordova apps - No longer active
http://phonertc.io
Apache License 2.0
867 stars 305 forks source link

Phonertc demo crash in android6 #191

Closed malaniz closed 8 years ago

malaniz commented 8 years ago

I'm using cordova 6.0.0, cordova@android 5.1.0, Android 6 SO. My app is working and the demo in the plugin code too with cordova 6.0.0, cordova@android 5.1.0 and android 5.x.x. https://github.com/alongubkin/phonertc/tree/master/demo/client But I build the app and demo for android 6 (on nexus5) and it crashes when you start the videochat. Anyone have this problem?

venkataramireddyalla commented 8 years ago

i am also facing same issue

rodneyworkman291 commented 8 years ago

I am having the same issue. App crashes when I initiate a call on line "var session = new cordova.plugins.phonertc.Session(config);". I am using cordova 6.1.0 with Android 5.1.

alongubkin commented 8 years ago

probably need to recompile WebRTC https://github.com/pristineio/webrtc-build-scripts

if you have time to do it, please pull request :) thanks.

Mgonand commented 8 years ago

Hi. This is the output from adb logcat when videocall have to show up:

04-20 13:28:26.739 19809 19809 I ServiceManager: Waiting for service AtCmdFwd...

04-20 13:28:26.753 22105 22510 D WEBRTC-JC: Camera TS 4007633. Duration: 34 ms. FPS: 30

04-20 13:28:27.533   931  4328 D NetlinkSocketObserver: NeighborEvent{elapsedMs=4008412, 192.168.1.1, [8C0CA3450A4E], RTM_NEWNEIGH, NUD_STALE}

04-20 13:28:27.739 19809 19809 I ServiceManager: Waiting for service AtCmdFwd...

04-20 13:28:27.753 22105 22510 D WEBRTC-JC: Camera TS 4008633. Duration: 34 ms. FPS: 30

04-20 13:28:27.975 22105 22105 I Choreographer: Skipped 76 frames!  The application may be doing too much work on its main thread.

04-20 13:28:28.113   513  2919 D audio_hw_primary: out_set_parameters: enter: usecase(5: audio-ull-playback) kvpairs: routing=1

04-20 13:28:28.126   513  2919 D audio_hw_primary: select_devices: out_snd_device(1: handset) in_snd_device(0: none)

04-20 13:28:28.126   513  2919 D msm8974_platform: platform_send_audio_calibration: sending audio calibration for snd_device(1) acdb_id(7)

04-20 13:28:28.126   513  2919 I ACDB-LOADER: ACDB AFE returned = -19

04-20 13:28:28.126   513  2919 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x1 of type 0 for Event 1

04-20 13:28:28.127   513  2919 D audio_hw_primary: enable_snd_device: snd_device(1: handset)

04-20 13:28:28.127   513  2919 D audio_hw_primary: enable_audio_route: apply and update mixer path: audio-ull-playback speaker

04-20 13:28:28.129 22105 22689 D MediaCodecVideo: InitEncodeOnCodecThread 1280 x 720. Bitrate: 300 kbps. Fps: 60

04-20 13:28:28.129 22105 22689 D MediaCodecVideoEncoder: Java initEncode: 1280 x 720. @ 300 kbps. Fps: 60. Color: 0x0

04-20 13:28:28.129 22105 22689 D MediaCodecVideoEncoder: Found candidate encoder OMX.qcom.video.encoder.vp8

04-20 13:28:28.130 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7fa30c04

04-20 13:28:28.130 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7f000789

04-20 13:28:28.131 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7f420888

04-20 13:28:28.131 22105 22689 D MediaCodecVideoEncoder:    Color: 0x15

04-20 13:28:28.131 22105 22689 D MediaCodecVideoEncoder: Found target encoder OMX.qcom.video.encoder.vp8. Color: 0x15

04-20 13:28:28.131 22105 22689 D MediaCodecVideoEncoder:   Format: {mime=video/x-vnd.on2.vp8, frame-rate=60, color-format=21, height=720, width=1280, bitrate=300000, i-frame-interval=100, bitrate-mode=2}

04-20 13:28:28.136 22105 22691 I OMXClient: Using client-side OMX mux.

04-20 13:28:28.226   513   513 E OMX-VENC: Setting session priority failed

04-20 13:28:28.228   513   513 I OMX-VENC: Component_init : OMX.qcom.video.encoder.vp8 : return = 0x0

04-20 13:28:28.230   513  2928 E OMX-VENC: set_parameter: metamode is valid for input port only

04-20 13:28:28.230   513  2928 W OMXNodeInstance: [3c:qcom.encoder.vp8] component does not support metadata mode; using fallback

04-20 13:28:28.230 22105 22691 E ACodec  : [OMX.qcom.video.encoder.vp8] storeMetaDataInBuffers (output) failed w/ err -1010

04-20 13:28:28.231 22105 22691 W ACodec  : do not know color format 0x7fa30c04 = 2141391876

04-20 13:28:28.231 22105 22691 W ACodec  : do not know color format 0x7f000789 = 2130708361

04-20 13:28:28.236   513  4262 E OMXNodeInstance: getParameter(3c:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.237 22105 22691 I ACodec  : setupVideoEncoder succeeded

04-20 13:28:28.239   513   513 E OMXNodeInstance: getParameter(3c:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.273 22105 22689 D MediaCodecVideoEncoder: Input buffers: 12. Output buffers: 4

04-20 13:28:28.289 22105 22689 V MediaCodecVideoEncoder: setRates: 300 kbps. Fps: 60

04-20 13:28:28.293 22105 22689 D MediaCodecVideo: EncoderRelease: Frames received: 0. Frames dropped: 0.

04-20 13:28:28.293 22105 22689 D MediaCodecVideoEncoder: Java releaseEncoder

04-20 13:28:28.304   513  4010 I OMX-VENC: Component Deinit

04-20 13:28:28.313 22105 22689 D MediaCodecVideo: InitEncodeOnCodecThread 480 x 640. Bitrate: 300 kbps. Fps: 60

04-20 13:28:28.314 22105 22689 D MediaCodecVideoEncoder: Java initEncode: 480 x 640. @ 300 kbps. Fps: 60. Color: 0x15

04-20 13:28:28.314 22105 22689 D MediaCodecVideoEncoder: Found candidate encoder OMX.qcom.video.encoder.vp8

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7fa30c04

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7f000789

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder:    Color: 0x7f420888

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder:    Color: 0x15

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder: Found target encoder OMX.qcom.video.encoder.vp8. Color: 0x15

04-20 13:28:28.315 22105 22689 D MediaCodecVideoEncoder:   Format: {mime=video/x-vnd.on2.vp8, frame-rate=60, color-format=21, height=640, width=480, bitrate=300000, i-frame-interval=100, bitrate-mode=2}

04-20 13:28:28.320 22105 22705 I OMXClient: Using client-side OMX mux.

04-20 13:28:28.321 22105 22704 D MediaCodecVideo: InitEncodeOnCodecThread 1280 x 720. Bitrate: 300 kbps. Fps: 60

04-20 13:28:28.321 22105 22704 D MediaCodecVideoEncoder: Java initEncode: 1280 x 720. @ 300 kbps. Fps: 60. Color: 0x0

04-20 13:28:28.321 22105 22704 D MediaCodecVideoEncoder: Found candidate encoder OMX.qcom.video.encoder.vp8

04-20 13:28:28.323 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7fa30c04

04-20 13:28:28.323 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7f000789

04-20 13:28:28.323 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7f420888

04-20 13:28:28.324 22105 22704 D MediaCodecVideoEncoder:    Color: 0x15

04-20 13:28:28.324   513  3540 E OMX-VENC: Setting session priority failed

04-20 13:28:28.324 22105 22704 D MediaCodecVideoEncoder: Found target encoder OMX.qcom.video.encoder.vp8. Color: 0x15

04-20 13:28:28.324 22105 22704 D MediaCodecVideoEncoder:   Format: {mime=video/x-vnd.on2.vp8, frame-rate=60, color-format=21, height=720, width=1280, bitrate=300000, i-frame-interval=100, bitrate-mode=2}

04-20 13:28:28.325   513  3540 I OMX-VENC: Component_init : OMX.qcom.video.encoder.vp8 : return = 0x0

04-20 13:28:28.327 22105 22710 I OMXClient: Using client-side OMX mux.

04-20 13:28:28.327   513  4262 E OMX-VENC: set_parameter: metamode is valid for input port only

04-20 13:28:28.327   513  4262 W OMXNodeInstance: [3d:qcom.encoder.vp8] component does not support metadata mode; using fallback

04-20 13:28:28.328 22105 22705 E ACodec  : [OMX.qcom.video.encoder.vp8] storeMetaDataInBuffers (output) failed w/ err -1010

04-20 13:28:28.331   513   513 E OMX-VENC: Setting session priority failed

04-20 13:28:28.332   513   513 I OMX-VENC: Component_init : OMX.qcom.video.encoder.vp8 : return = 0x0

04-20 13:28:28.333 22105 22705 W ACodec  : do not know color format 0x7fa30c04 = 2141391876

04-20 13:28:28.334 22105 22705 W ACodec  : do not know color format 0x7f000789 = 2130708361

04-20 13:28:28.335   513  4010 E OMX-VENC: set_parameter: metamode is valid for input port only

04-20 13:28:28.335   513  4010 W OMXNodeInstance: [3e:qcom.encoder.vp8] component does not support metadata mode; using fallback

04-20 13:28:28.335 22105 22710 E ACodec  : [OMX.qcom.video.encoder.vp8] storeMetaDataInBuffers (output) failed w/ err -1010

04-20 13:28:28.335 22105 22710 W ACodec  : do not know color format 0x7fa30c04 = 2141391876

04-20 13:28:28.335 22105 22710 W ACodec  : do not know color format 0x7f000789 = 2130708361

04-20 13:28:28.342   513  4010 E OMXNodeInstance: getParameter(3d:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.345 22105 22705 I ACodec  : setupVideoEncoder succeeded

04-20 13:28:28.345   513  2928 E OMXNodeInstance: getParameter(3e:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.349 22105 22710 I ACodec  : setupVideoEncoder succeeded

04-20 13:28:28.350   513  4262 E OMXNodeInstance: getParameter(3d:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.353   513  4262 E OMXNodeInstance: getParameter(3e:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.372 22105 22689 D MediaCodecVideoEncoder: Input buffers: 12. Output buffers: 4

04-20 13:28:28.382 22105 22704 D MediaCodecVideoEncoder: Input buffers: 12. Output buffers: 4

04-20 13:28:28.390 22105 22704 V MediaCodecVideoEncoder: setRates: 300 kbps. Fps: 60

04-20 13:28:28.394 22105 22704 D MediaCodecVideo: EncoderRelease: Frames received: 0. Frames dropped: 0.

04-20 13:28:28.394 22105 22704 D MediaCodecVideoEncoder: Java releaseEncoder

04-20 13:28:28.397   513 22713 E OMXNodeInstance: onFillBufferDone(3e:qcom.encoder.vp8, 0 [1413120@0xe8965000 (8227756..+0) f=20 ts=-1471747015745624 fc=-1]) ERROR: BadParameter(0x80001005)

04-20 13:28:28.397   513 22713 E OMXNodeInstance: onFillBufferDone(3e:qcom.encoder.vp8, 0 [1413120@0xe880c000 (8227756..+0) f=20 ts=-1471747015745624 fc=-1]) ERROR: BadParameter(0x80001005)

04-20 13:28:28.397   513 22713 E OMXNodeInstance: onFillBufferDone(3e:qcom.encoder.vp8, 0 [1413120@0xe86b3000 (8227756..+0) f=20 ts=-1471747015745624 fc=-1]) ERROR: BadParameter(0x80001005)

04-20 13:28:28.406   513  4262 I OMX-VENC: Component Deinit

04-20 13:28:28.411 22105 22704 D MediaCodecVideo: InitEncodeOnCodecThread 480 x 640. Bitrate: 300 kbps. Fps: 60

04-20 13:28:28.412 22105 22704 D MediaCodecVideoEncoder: Java initEncode: 480 x 640. @ 300 kbps. Fps: 60. Color: 0x15

04-20 13:28:28.412 22105 22704 D MediaCodecVideoEncoder: Found candidate encoder OMX.qcom.video.encoder.vp8

04-20 13:28:28.413 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7fa30c04

04-20 13:28:28.414 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7f000789

04-20 13:28:28.414 22105 22704 D MediaCodecVideoEncoder:    Color: 0x7f420888

04-20 13:28:28.414 22105 22704 D MediaCodecVideoEncoder:    Color: 0x15

04-20 13:28:28.414 22105 22704 D MediaCodecVideoEncoder: Found target encoder OMX.qcom.video.encoder.vp8. Color: 0x15

04-20 13:28:28.414 22105 22704 D MediaCodecVideoEncoder:   Format: {mime=video/x-vnd.on2.vp8, frame-rate=60, color-format=21, height=640, width=480, bitrate=300000, i-frame-interval=100, bitrate-mode=2}

04-20 13:28:28.419 22105 22715 I OMXClient: Using client-side OMX mux.

04-20 13:28:28.423   513  2928 E OMX-VENC: Setting session priority failed

04-20 13:28:28.426   513  2928 I OMX-VENC: Component_init : OMX.qcom.video.encoder.vp8 : return = 0x0

04-20 13:28:28.430   513  3539 E OMX-VENC: set_parameter: metamode is valid for input port only

04-20 13:28:28.430   513  3539 W OMXNodeInstance: [3f:qcom.encoder.vp8] component does not support metadata mode; using fallback

04-20 13:28:28.430 22105 22715 E ACodec  : [OMX.qcom.video.encoder.vp8] storeMetaDataInBuffers (output) failed w/ err -1010

04-20 13:28:28.432 22105 22715 W ACodec  : do not know color format 0x7fa30c04 = 2141391876

04-20 13:28:28.432 22105 22715 W ACodec  : do not know color format 0x7f000789 = 2130708361

04-20 13:28:28.439   513  3540 E OMXNodeInstance: getParameter(3f:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.439 22105 22715 I ACodec  : setupVideoEncoder succeeded

04-20 13:28:28.443   513   513 E OMXNodeInstance: getParameter(3f:qcom.encoder.vp8, ParamVideoAndroidVp8Encoder(0x6f600007)) ERROR: UnsupportedIndex(0x8000101a)

04-20 13:28:28.463 22105 22704 D MediaCodecVideoEncoder: Input buffers: 12. Output buffers: 4

04-20 13:28:28.470 22105 22105 D VideoRendererGui: VideoRendererGui.setView

04-20 13:28:28.472 22105 22105 D AndroidRuntime: Shutting down VM

04-20 13:28:28.473 22105 22105 E AndroidRuntime: FATAL EXCEPTION: main

04-20 13:28:28.473 22105 22105 E AndroidRuntime: Process: com.yyyyyyy.xxxxxxxx , PID: 22105

04-20 13:28:28.473 22105 22105 E AndroidRuntime: java.lang.RuntimeException: Incorrect window parameters.

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at org.webrtc.VideoRendererGui.create(VideoRendererGui.java:635)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at com.dooble.phonertc.PhoneRTCPlugin.refreshVideoView(PhoneRTCPlugin.java:371)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at com.dooble.phonertc.PhoneRTCPlugin.addRemoteVideoTrack(PhoneRTCPlugin.java:295)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at com.dooble.phonertc.Session$PCObserver$2.run(Session.java:283)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5422)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)

04-20 13:28:28.473 22105 22105 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

04-20 13:28:28.475   931   947 W ActivityManager:   Force finishing activity  com.yyyyyyyyy.xxxxxxxx/.MainActivity

04-20 13:28:28.559   931  3092 I OpenGLRenderer: Initialized EGL, version 1.4

04-20 13:28:28.634   931   940 I art     : Background partial concurrent mark sweep GC freed 34042(2MB) AllocSpace objects, 93(1860KB) LOS objects, 32% free, 32MB/48MB, paused 2.145ms total 139.024ms

04-20 13:28:28.740 19809 19809 I ServiceManager: Waiting for service AtCmdFwd...

04-20 13:28:28.749 22105 22510 D WEBRTC-JC: Camera TS 4009629. Duration: 30 ms. FPS: 31

04-20 13:28:29.003   931   949 W ActivityManager: Activity pause timeout for ActivityRecord{471b27f u0 com.yyyyyyyyy.xxxxxxxx/.MainActivity t335 f}

04-20 13:28:29.393   931   949 I ActivityManager: Killing 18222:com.google.android.apps.photos/u0a62 (adj 15): empty #17

04-20 13:28:29.741 19809 19809 W Atfwd_Sendcmd: AtCmdFwd service not published, waiting... retryCnt : 4

04-20 13:28:29.756 22105 22510 D WEBRTC-JC: Camera TS 4010635. Duration: 35 ms. FPS: 30

04-20 13:28:30.752 22105 22510 D WEBRTC-JC: Camera TS 4011631. Duration: 33 ms. FPS: 30

And if I try to build the app with the latest revision of WebRTC I get this error:

:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:compileDebugJavaWithJavac/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:69: error: cannot find symbol
VideoRendererGui.getEGLContext()),
               ^
  symbol:   method getEGLContext()
  location: class VideoRendererGui
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:170: error: cannot find symbol
VideoRendererGui.getEGLContext()),
               ^
  symbol:   method getEGLContext()
  location: class VideoRendererGui
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:282: error: cannot find symbol
VideoCapturer capturer = VideoCapturer.create(name);
                                     ^
  symbol:   method create(String)
  location: interface VideoCapturer
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:321: error: method setView in class VideoRendererGui cannot be applied to given types;
VideoRendererGui.setView(_videoView);
               ^
  required: GLSurfaceView,Runnable
  found: VideoGLView
  reason: actual and formal argument lists differ in length
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:372: error: cannot find symbol
VideoRendererGui.ScalingType.SCALE_FILL, true)));
               ^
  symbol:   variable ScalingType
  location: class VideoRendererGui
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/PhoneRTCPlugin.java:388: error: cannot find symbol
VideoRendererGui.ScalingType.SCALE_FILL,
               ^
  symbol:   variable ScalingType
  location: class VideoRendererGui
/Users/marcosgonzalez/Proyectos/xxxxxx/Mobile/App/platforms/android/src/com/dooble/phonertc/Session.java:254: error: Session.PCObserver is not abstract and does not override abstract method onIceCandidatesRemoved(IceCandidate[]) in Observer
private class PCObserver implements PeerConnection.Observer {
       ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

So... what can I do?

alongubkin commented 8 years ago

https://github.com/alongubkin/phonertc/commit/899f604482d407fcad924bf6ce558418fefb4ca7

d1bug commented 6 years ago

probably need to recompile WebRTC https://github.com/pristineio/webrtc-build-scripts

if you have time to do it, please pull request :) thanks.

Hello,I recompiled it ,but the plugin webrtc-build-scripts is already deprecated fot the lastest webrtc source code.