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

scrcpy runs for few seconds then closed #424

Closed
Majesticb19 opened this issue Feb 5, 2019 · 9 comments
Closed

scrcpy runs for few seconds then closed #424

Majesticb19 opened this issue Feb 5, 2019 · 9 comments
Labels

Comments

@Majesticb19
Copy link

Majesticb19 commented Feb 5, 2019

Hello.

I use scrcpy for my Redmi 4A. Android 9 Havoc Os 2.1 . After input adb devices command and scrcpy command it runs, but in a few seconds,it closes. In command prompt this happened.

ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
        at android.media.MediaCodec.native_stop(Native Method)
        at android.media.MediaCodec.stop(MediaCodec.java:2084)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:7
5)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:28)
        at com.genymobile.scrcpy.Server.main(Server.java:110)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:342)

And when i use scrcpy and adb logcat command, this happened.

02-05 09:09:20.709 26810 26810 D AndroidRuntime: >>>>>> START com.android.intern
al.os.RuntimeInit uid 2000 <<<<<<
02-05 09:09:21.183 26810 26810 D AndroidRuntime: Calling main entry com.genymobi
le.scrcpy.Server
02-05 09:09:21.200 26810 26810 I app_process: Thread[1,tid=26810,Native,Thread*=
0x7138c14c00,peer=0x12c01e28,"main"] recursive attempt to load library "/system/
lib64/libmedia_jni.so"
02-05 09:09:21.200 26810 26810 D MtpDeviceJNI: register_android_mtp_MtpDevice
02-05 09:09:21.201 26810 26810 I app_process: Thread[1,tid=26810,Native,Thread*=
0x7138c14c00,peer=0x12c01e28,"main"] recursive attempt to load library "/system/
lib64/libmedia_jni.so"
02-05 09:09:21.201 26810 26810 I app_process: Thread[1,tid=26810,Native,Thread*=
0x7138c14c00,peer=0x12c01e28,"main"] recursive attempt to load library "/system/
lib64/libmedia_jni.so"
02-05 09:09:21.211 26810 26821 I OMXClient: IOmx service obtained
02-05 09:09:21.214   712  1844 I OMXMaster: makeComponentInstance(OMX.qcom.video
.encoder.avc) in omx@1.0-service process
02-05 09:09:21.227   712  1844 I OMX-VENC: Video encode perflock acquired,handle
=-1
02-05 09:09:21.333   712  1844 I OMX-VENC: Component_init : OMX.qcom.video.encod
er.avc : return = 0x0
02-05 09:09:21.341   712 12519 E OMXNodeInstance: setParameter(0xf3d03dc4:qcom.e
ncoder.avc, OMX.google.android.index.allocateNativeHandle(0x7f00005d): Output:1
en=0) ERROR: UnsupportedSetting(0x80001019)
02-05 09:09:21.341   712 12519 W OMXNodeInstance: [0xf3d03dc4:qcom.encoder.avc]
component does not support metadata mode; using fallback
02-05 09:09:21.341 26810 26821 W OMXUtils: do not know color format 0x7fa30c04 =
 2141391876
02-05 09:09:21.342 26810 26821 W OMXUtils: do not know color format 0x7f000789 =
 2130708361
02-05 09:09:21.355 26810 26821 I ACodec  : setupAVCEncoderParameters with [profi
le: Baseline] [level: Level32]
02-05 09:09:21.360 26810 26821 I ACodec  : [OMX.qcom.video.encoder.avc] cannot e
ncode HDR static metadata. Ignoring.
02-05 09:09:21.360 26810 26821 I ACodec  : setupVideoEncoder succeeded
02-05 09:09:21.363 26810 26821 W OMXUtils: do not know color format 0x7f000789 =
 2130708361
02-05 09:09:21.364   712  1844 E OMXNodeInstance: getConfig(0xf3d03dc4:qcom.enco
der.avc, ConfigLatency(0x6f800005)) ERROR: UnsupportedIndex(0x8000101a)
02-05 09:09:21.373   712 12519 E OMXNodeInstance: getConfig(0xf3d03dc4:qcom.enco
der.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
02-05 09:09:21.375   712 17540 E OMXNodeInstance: getParameter(0xf3d03dc4:qcom.e
ncoder.avc, ParamConsumerUsageBits(0x6f800004)) ERROR: UnsupportedIndex(0x800010
1a)
02-05 09:09:21.376   712 17540 D GraphicBufferSource: setting dataspace: 0x104,
acquired=0
02-05 09:09:21.378   712  1844 E OMXNodeInstance: getParameter(0xf3d03dc4:qcom.e
ncoder.avc, ParamConsumerUsageBits(0x6f800004)) ERROR: UnsupportedIndex(0x800010
1a)
02-05 09:09:21.378   712 17540 D GraphicBufferSource: requesting color aspects (
R:2(Limited), P:1(BT709_5), M:1(BT709_5), T:3(SMPTE170M))
02-05 09:09:21.379 26810 26810 D OpenGLRenderer: Skia GL Pipeline
02-05 09:09:21.401   408   408 I HWC2    : Creating virtual display
02-05 09:09:21.401   377 16411 I SDM     : HWCDisplayVirtual::Create: Creating v
irtual display: w: 720 h:1280 format:0x1
02-05 09:09:21.402   377 16411 I SDM     : HWDevice::GetHWPanelMaxBrightnessFrom
Node: Max brightness level = 255
02-05 09:09:21.403   377 16411 I SDM     : HWDevice::GetHWPanelMaxBrightnessFrom
Node: Max brightness level = 255
02-05 09:09:21.403   377 16411 I SDM     : HWDevice::Init: access(/dev/graphics/
fb1) successful
02-05 09:09:21.403   377 16411 I SDM     : HWDevice::GetHWPanelMaxBrightnessFrom
Node: Max brightness level = 255
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: Device
 type = 2, Display Port = 3, Display Mode = 2, Device Node = 1, Is Primary = 0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: Partia
l Update = 0, supported roi_count =1, Dynamic FPS = 0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: Align:
 left = 0, width = 0, top = 0, height = 0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: ROI: m
in_width = 0, min_height = 0, need_merge = 0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: FPS: m
in = 0, max =0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: Ping P
ong Split = 0
02-05 09:09:21.404   377 16411 I SDM     : HWDevice::PopulateHWPanelInfo: Left S
plit = 0, Right Split = 0
02-05 09:09:21.404   377 16411 I SDM     : HWCDisplay::Init: Display created wit
h id: 3
02-05 09:09:21.404   377 16411 I SDM     : DisplayBase::SetDisplayState: Set sta
te = 1, display 2
02-05 09:09:21.404   377 16411 I SDM     : StrategyImpl::SetIdleTimeoutMs: Idle
timeout not supported for display = 2, mode = 0
02-05 09:09:21.404   377 16411 I SDM     : StrategyImpl::SetIdleTimeoutMs: Idle
timeout not supported for display = 2, mode = 2
02-05 09:09:21.404   377 16411 I SDM     : DisplayVirtual::SetActiveConfig: Virt
ual display resolution changed to[720x1280]
02-05 09:09:21.404   377 16411 I SDM     : DisplayBase::SetFrameBufferConfig: Ne
w framebuffer resolution (720x1280)
02-05 09:09:21.404   377 16411 I SDM     : HWCDisplay::SetFrameBufferResolution:
 New framebuffer resolution (720x1280)
02-05 09:09:21.404   377 16411 I SDM     : HWCSession::CreateVirtualDisplay: Cre
ated virtual display id:3 with res: 720x1280
02-05 09:09:21.405   408   408 I HWC2    : Created virtual display
02-05 09:09:21.406   377 16411 I SDM     : HWCDisplay::GetHdrCapabilities: HDR i
s not supported
02-05 09:09:21.406   377 16411 I SDM     : HWCDisplay::GetHdrCapabilities: HDR i
s not supported
02-05 09:09:21.406   408   408 E HWComposer: getSupportedPerFrameMetadata: getSu
pportedPerFrameMetadata failed for display 3: Unsupported (8)
02-05 09:09:21.407   408   408 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:612>
: EGL_BAD_ATTRIBUTE
02-05 09:09:21.418   366   366 W AshmemAllocator: ashmem_create_region(8) return
ing hidl_memory(0x7d2782c100, 8)
02-05 09:09:21.440   366   366 I chatty  : uid=1000(system) allocator@1.0-s iden
tical 7 lines
02-05 09:09:21.442   366   366 W AshmemAllocator: ashmem_create_region(8) return
ing hidl_memory(0x7d2782c100, 8)
02-05 09:09:21.448   366   366 W AshmemAllocator: ashmem_create_region(1382400)
returning hidl_memory(0x7d2782c100, 1382400)
02-05 09:09:21.451   366   366 I chatty  : uid=1000(system) allocator@1.0-s iden
tical 2 lines
02-05 09:09:21.453   366   366 W AshmemAllocator: ashmem_create_region(1382400)
returning hidl_memory(0x7d2782c100, 1382400)
02-05 09:09:21.456   712 26827 D GraphicBufferSource: got buffer with new dataSp
ace #104
02-05 09:09:21.457   712 26827 I OMX-VENC: open Color conv forW: 720, H: 1280
02-05 09:09:21.458   712 26829 D OMXNodeInstance: Codec resolved it to (R:2(??),
 P:3(??), M:3(??), T:3(??)) err=0(NO_ERROR)
02-05 09:09:21.458 26810 26821 D ACodec  : dataspace changed to 0x10c10000 (R:2(
Limited), P:3(BT601_6_625), M:3(BT601_6), T:3(SMPTE170M)) (R:2(Limited), S:2(BT6
01_625), T:3(SMPTE_170M))
02-05 09:09:22.241   408   408 E HWComposer: presentAndGetReleaseFences: present
 failed for display 0: NotValidated (7)
02-05 09:09:22.252   377 16411 E SDM     : HWDevice::Commit: ioctl MSMFB_ATOMIC_
COMMIT, device = 2 errno = 22, desc = Invalid argument
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: mdp_commit
: flags = 0, release fence = ffffffff
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: left_roi:
x = 0, y = 0, w = 0, h = 0
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: right_roi:
 x = 0, y = 0, w = 0, h = 0
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: layer = 0,
 pipe_ndx = 10, z = 0, flags = 4
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: src_width
= 736, src_height = 1280, src_format = 13
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: src_rect:
x = 0, y = 0, w = 720, h = 1280
02-05 09:09:22.252   377 16411 I SDM     : HWDevice::DumpLayerCommit: dst_rect:
x = 0, y = 0, w = 720, h = 1280
02-05 09:09:22.252   377 16411 E SDM     : HWCDisplay::CommitLayerStack: Commit
failed. Error = 11
02-05 09:09:22.256   408   408 E HWComposer: presentAndGetReleaseFences: present
 failed for display 0: NotValidated (7)
02-05 09:09:22.260   712 26827 E OMX-VENC: Failed to qbuf (etb) to driver
02-05 09:09:22.261   712 26827 E OMX-VENC: ERROR: ETBProxy: dev_empty_buf failed

02-05 09:09:22.261   712 26827 E OMX-VENC: ERROR: ETBProxy() failed!
02-05 09:09:22.261   712 26827 E OMX-VENC: ERROR: send OMX_ErrorHardware to Clie
nt
02-05 09:09:22.261 26810 26821 E ACodec  : [OMX.qcom.video.encoder.avc] ERROR(0x
80001009)
02-05 09:09:22.261 26810 26821 E ACodec  : signalError(omxError 0x80001009, inte
rnalError -2147483648)
02-05 09:09:22.261 26810 26820 E MediaCodec: Codec reported err 0x80001009, acti
onCode 0, while in state 6
02-05 09:09:22.264 26810 26810 D AndroidRuntime: Shutting down VM
02-05 09:09:22.267   712 26829 E GraphicBufferSource: onInputBufferEmptied: buff
er not recognized (bufferId=8)
02-05 09:09:22.267 26810 26810 E AndroidRuntime: FATAL EXCEPTION: main
02-05 09:09:22.267 26810 26810 E AndroidRuntime: PID: 26810
02-05 09:09:22.267 26810 26810 E AndroidRuntime: java.lang.IllegalStateException

02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at android.media.MediaCo
dec.native_stop(Native Method)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at android.media.MediaCo
dec.stop(MediaCodec.java:2084)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at com.genymobile.scrcpy
.ScreenEncoder.streamScreen(ScreenEncoder.java:75)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at com.genymobile.scrcpy
.Server.scrcpy(Server.java:28)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at com.genymobile.scrcpy
.Server.main(Server.java:110)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at com.android.internal.
os.RuntimeInit.nativeFinishInit(Native Method)
02-05 09:09:22.267 26810 26810 E AndroidRuntime:        at com.android.internal.
os.RuntimeInit.main(RuntimeInit.java:342)
02-05 09:09:22.268 26810 26810 E scrcpy  : Exception on thread Thread[main,5,mai
n]
02-05 09:09:22.268 26810 26810 E scrcpy  : java.lang.IllegalStateException
02-05 09:09:22.268 26810 26810 E scrcpy  :      at android.media.MediaCodec.nati
ve_stop(Native Method)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at android.media.MediaCodec.stop
(MediaCodec.java:2084)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at com.genymobile.scrcpy.ScreenE
ncoder.streamScreen(ScreenEncoder.java:75)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at com.genymobile.scrcpy.Server.
scrcpy(Server.java:28)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at com.genymobile.scrcpy.Server.
main(Server.java:110)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at com.android.internal.os.Runti
meInit.nativeFinishInit(Native Method)
02-05 09:09:22.268 26810 26810 E scrcpy  :      at com.android.internal.os.Runti
meInit.main(RuntimeInit.java:342)
02-05 09:09:22.354   712 26827 E OMX-VENC: Failed to qbuf (etb) to driver
02-05 09:09:22.354   712 26827 E OMX-VENC: ERROR: ETBProxy: dev_empty_buf failed

02-05 09:09:22.354   712 26827 E OMX-VENC: ERROR: ETBProxy() failed!
02-05 09:09:22.427   712  1844 E OMXNodeInstance: !!! Observer died. Quickly, do
 something, ... anything...
02-05 09:09:22.436   408   408 I HWC2    : Destroying display 3
02-05 09:09:22.437   377 16411 I SDM     : HWCSession::DestroyVirtualDisplay: De
stroying virtual display id:3

Is my phone doesn't support scrcpy or my computer doesn't support it?my computer specs is Windows 7 professional 64 bit,Intel core 2 duo e4500 2.2ghz with 3gb of rams.

@rom1v
Copy link
Collaborator

rom1v commented Feb 5, 2019

Could you try with a lower definition and bitrate?

scrcpy -m800 -b2M

@rom1v rom1v added the codec label Feb 5, 2019
@infernix
Copy link

infernix commented Mar 28, 2019

I have crashes as well, after mere seconds. Log shows:

03-28 16:11:55.254   958 11175 E OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
03-28 16:11:55.269   624   624 W libEGL  : EGLNativeWindowType 0x6b7529c010 disconnect failed
03-28 16:11:55.465   958 11175 I OMX-VENC: Component Deinit
03-28 16:11:55.465   958 11175 I OMX-VENC: Video encode perflock released

This even happened with -b256k -m400. After updating another app (Cerberus in my case), problem went away for a few minutes, but then returned. Also tried older version (1.3), same issue.

@kvernNC
Copy link

kvernNC commented May 28, 2019

Hi,
Got same issue using scrcpy for the first time, stopping after 30s, allowing me to use it a little.
I installed it using flatpak method here.

$ cat /proc/version && flatpak run com.Genymobile.Scrcpy -v
Linux version 5.0.16-300.fc30.x86_64 (mockbuild@bkernel03.phx2.fedoraproject.org) (gcc version 9.1.1 20190503 (Red Hat 9.1.1-1) (GCC)) #1 SMP Tue May 14 19:33:09 UTC 2019

scrcpy 1.8

dependencies:
 - SDL 2.0.9
 - libavcodec 58.35.100
 - libavformat 58.20.100
 - libavutil 56.22.100

Changing usb port from dock station to one from my laptop resolved the issue.

@rom1v rom1v closed this as completed Jun 25, 2019
@infernix
Copy link

Was this fixed?

@rom1v
Copy link
Collaborator

rom1v commented Jun 25, 2019

I am doing a pass on open issues, and I saw:

Changing usb port from dock station to one from my laptop resolved the issue.

so I closed.

I didn't see the comment was not from the original author of the post :)

For info, does it work with:

adb screenrecord /sdcard/file.mp4

?

@infernix
Copy link

infernix commented Jul 5, 2019

FYI I've tested this on my new oneplus 7 pro and could not reproduce; previously reproduced on Pixel 2 XL.

@Bezouro
Copy link

Bezouro commented Aug 20, 2020

08-20 12:51:08.313   788   861 E SDM     : HWDevice::Commit: ioctl MSMFB_ATOMIC_COMMIT, device = 2 errno = 22, desc = Invalid argument
08-20 12:51:08.313   788   861 I SDM     : HWDevice::DumpLayerCommit: mdp_commit: flags = 2000, release fence = ffffffff
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: left_roi: x = 0, y = 0, w = 0, h = 0
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: right_roi: x = 0, y = 0, w = 0, h = 0
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: layer = 0, pipe_ndx = 40, z = 0, flags = 0
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: src_width = 1088, src_height = 2288, src_format = 45
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: src_rect: x = 0, y = 0, w = 1080, h = 2280
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: dst_rect: x = 0, y = 0, w = 1080, h = 2280
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: layer = 1, pipe_ndx = 2, z = 1, flags = 0
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: src_width = 1088, src_height = 2280, src_format = 13
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: src_rect: x = 0, y = 0, w = 1080, h = 2280
08-20 12:51:08.314   788   861 I SDM     : HWDevice::DumpLayerCommit: dst_rect: x = 0, y = 0, w = 1080, h = 2280
08-20 12:51:08.314   788   861 E SDM     : HWCDisplay::CommitLayerStack: Commit failed. Error = 11
08-20 12:51:08.318  1235 24807 E OMX-VENC: Failed to qbuf (etb) to driver
08-20 12:51:08.318  1235 24807 E OMX-VENC: ERROR: ETBProxy: dev_empty_buf failed
08-20 12:51:08.318  1235 24807 E OMX-VENC: ERROR: ETBProxy() failed!
08-20 12:51:08.318  1235 24807 E OMX-VENC: ERROR: send OMX_ErrorHardware to Client
08-20 12:51:08.319  1235 24809 E GraphicBufferSource: onInputBufferEmptied: buffer not recognized (bufferId=5)
08-20 12:51:08.319 24740 24799 E ACodec  : [OMX.qcom.video.encoder.avc] ERROR(0x80001009)
08-20 12:51:08.319 24740 24799 E ACodec  : signalError(omxError 0x80001009, internalError -2147483648)
08-20 12:51:08.319 24740 24798 E MediaCodec: Codec reported err 0x80001009, actionCode 0, while in state 6

on nokia 6.1 plus with adb over network
Havoc OS 3.7

Scrcpy 1.16 on ArchLinux installed via aur

@rom1v
Copy link
Collaborator

rom1v commented Aug 20, 2020

@Bezouro Does it work over USB? Does it work with scrcpy -m1024?
What is the problem you observe exactly?

@Bezouro
Copy link

Bezouro commented Aug 21, 2020

@Bezouro Does it work over USB? Does it work with scrcpy -m1024?
What is the problem you observe exactly?

Same problem over USB,
I just changed rom for RROS and it worked, apparently the problem is with havoc

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

No branches or pull requests

5 participants