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

MediaCodec$CodecException: Error 0xfffffff4 #833

Open
aiamuzz opened this issue Oct 1, 2019 · 18 comments
Open

MediaCodec$CodecException: Error 0xfffffff4 #833

aiamuzz opened this issue Oct 1, 2019 · 18 comments
Labels

Comments

@aiamuzz
Copy link

aiamuzz commented Oct 1, 2019

Hi,

I am facing the following error on a custom ROM ... and i am connected over wifi adb

$ scrcpy
INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 0.1 MB/s (22546 bytes in 0.146s)
adb: error: more than one device/emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
27183
INFO: Initial texture: 1536x2048
[server] ERROR: Exception on thread Thread[main,5,main]
android.media.MediaCodec$CodecException: Error 0xfffffff4
	at android.media.MediaCodec.native_configure(Native Method)

@rom1v
Copy link
Collaborator

rom1v commented Oct 1, 2019

Does it work better with a lower definition:

scrcpy -m1024

?

@aiamuzz
Copy link
Author

aiamuzz commented Oct 1, 2019

Nope !

$ scrcpy -m1024
INFO: scrcpy 1.10 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 0.6 MB/s (22546 bytes in 0.033s)
adb: error: more than one device/emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
27183
INFO: Initial texture: 768x1024
[server] ERROR: Exception on thread Thread[main,5,main]

@rom1v
Copy link
Collaborator

rom1v commented Oct 1, 2019

Are there any errors in adb logcat?

@aiamuzz
Copy link
Author

aiamuzz commented Oct 1, 2019

Are there any errors in adb logcat?

Please find the output on adb logcat when i attempt to launch scrcpy ...


10-01 18:18:34.041 10486 10486 E adbd    : failed to connect to socket 'localabstract:scrcpy': Connection refused
10-01 18:18:34.365 10486 10486 I chatty  : uid=2000(shell) /system/bin/adbd identical 3 lines
10-01 18:18:34.476 10486 10486 E adbd    : failed to connect to socket 'localabstract:scrcpy': Connection refused
10-01 18:18:34.494 13653 13653 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
10-01 18:18:34.580 10486 10486 E adbd    : failed to connect to socket 'localabstract:scrcpy': Connection refused
10-01 18:18:34.687 10486 10486 E adbd    : failed to connect to socket 'localabstract:scrcpy': Connection refused
10-01 18:18:34.768 13653 13653 I app_process: The ClassLoaderContext is a special shared library.
10-01 18:18:34.791 10486 10486 E adbd    : failed to connect to socket 'localabstract:scrcpy': Connection refused
10-01 18:18:34.875 13653 13653 D AndroidRuntime: Calling main entry com.genymobile.scrcpy.Server
10-01 18:18:34.921  1089  1984 I PowerManagerService: Waking up from sleep (uid=1000 reason=android.policy:POWER)...
10-01 18:18:34.929  1089  1984 E FlounderPowerHAL: Error writing to /sys/devices/system/cpu/cpufreq/interactive/boostpulse: Bad file descriptor
10-01 18:18:34.935  1089  1984 E LightsService: Light requested not available on this device. 2
10-01 18:18:34.936  1089  1170 I DisplayPowerController: Blocking screen on until initial contents have been drawn.
10-01 18:18:34.943  1089  1168 I DisplayManagerService: Display device changed state: "Built-in Screen", ON
10-01 18:18:34.947   157   157 D SurfaceFlinger: Set power mode=2, type=0 flinger=0x7233a44000
10-01 18:18:34.947   157   157 D hwcomposer: hwc_blank: display 0: unblank
10-01 18:18:34.947   157   157 D hwcomposer: hwc_blank_display: display 0: [1 -> 0]
10-01 18:18:34.947   157   157 D hwcomposer: Display 0 layer clip is 1536 x 2048
10-01 18:18:34.947   157   157 D hwcomposer: Display 0 device clip is 1536 x 2048
10-01 18:18:34.963  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:34.966  1089  1305 W LocalDisplayAdapter: Unable to find color mode 0, ignoring request.
10-01 18:18:34.964  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:34.991  1089  1353 I InputReader: Reconfiguring input devices.  changes=0x00000004
10-01 18:18:34.999  1089  1585 I WindowManager: Suppressed redundant power key press while already in the process of turning the screen on.
10-01 18:18:35.011 13653 13653 I app_process: Thread[1,tid=13653,Native,Thread*=0x79c3e5aa00,peer=0x12c01d00,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
10-01 18:18:35.012 13653 13653 D MtpDeviceJNI: register_android_mtp_MtpDevice
10-01 18:18:35.012 13653 13653 I app_process: Thread[1,tid=13653,Native,Thread*=0x79c3e5aa00,peer=0x12c01d00,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
10-01 18:18:35.013 13653 13653 I app_process: Thread[1,tid=13653,Native,Thread*=0x79c3e5aa00,peer=0x12c01d00,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
10-01 18:18:35.019   202   202 I WifiHAL : Got channel list with 11 channels
10-01 18:18:35.025 13653 13665 I OMXClient: Treble IOmx obtained
10-01 18:18:35.025  1068  1120 I OMXMaster: makeComponentInstance(OMX.Nvidia.h264.encoder) in [email protected] process
10-01 18:18:35.026   202   202 I WifiHAL : Got channel list with 9 channels
10-01 18:18:35.028   202   202 I WifiHAL : Got channel list with 13 channels
10-01 18:18:35.029  1068 13602 E OMXNodeInstance: setParameter(0xf4a194a0:Nvidia.h264.encoder, OMX.google.android.index.enableAndroidNativeBuffers(0x7fc00004): Output:1 en=0) ERROR: BadParameter(0x80001005)
10-01 18:18:35.029  1068 13602 E OMXNodeInstance: setParameter(0xf4a194a0:Nvidia.h264.encoder, OMX.google.android.index.allocateNativeHandle(0x7fc00019): Output:1 en=0) ERROR: NotImplemented(0x80001006)
10-01 18:18:35.030  1068 13602 W OMXNodeInstance: [0xf4a194a0:Nvidia.h264.encoder] component does not support metadata mode; using fallback
10-01 18:18:35.031 13653 13665 W OMXUtils: do not know color format 0x7f000789 = 2130708361
10-01 18:18:35.031  1068 13603 D NvOsDebugPrintf: Framerate set to : 60 at NvxVideoEncoderSetParameter
10-01 18:18:35.033  1068 13603 E OMXNodeInstance: getParameter(0xf4a194a0:Nvidia.h264.encoder, ParamVideoAvc(0x600000d)) ERROR: InsufficientResources(0x80001000)
10-01 18:18:35.033 13653 13665 E ACodec  : [OMX.Nvidia.h264.encoder] configureCodec returning error -12
10-01 18:18:35.033 13653 13665 E ACodec  : signalError(omxError 0x80001001, internalError -12)
10-01 18:18:35.033 13653 13664 E MediaCodec: Codec reported err 0xfffffff4, actionCode 0, while in state 3
10-01 18:18:35.034 13653 13653 E MediaCodec: configure failed with err 0xfffffff4, resetting...
10-01 18:18:35.039 13653 13665 I OMXClient: Treble IOmx obtained
10-01 18:18:35.040  1068  1119 I OMXMaster: makeComponentInstance(OMX.Nvidia.h264.encoder) in [email protected] process
10-01 18:18:35.043  1063  1762 E ProcessInfo: pid 13653 invalid OOM adjustments value -10000
10-01 18:18:35.043  1063  1762 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 13653
10-01 18:18:35.043  1063  1762 E ProcessInfo: pid 13653 invalid OOM adjustments value -10000
10-01 18:18:35.043  1063  1762 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 13653
10-01 18:18:35.044  1063  1762 E ProcessInfo: pid 13653 invalid OOM adjustments value -10000
10-01 18:18:35.044  1063  1762 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 13653
10-01 18:18:35.044 13653 13653 D AndroidRuntime: Shutting down VM
10-01 18:18:35.047 13653 13653 E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: main
10-01 18:18:35.047 13653 13653 E AndroidRuntime: android.media.MediaCodec$CodecException: Error 0xfffffff4
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at android.media.MediaCodec.native_configure(Native Method)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at android.media.MediaCodec.configure(MediaCodec.java:1943)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at android.media.MediaCodec.configure(MediaCodec.java:1872)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:157)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:67)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.genymobile.scrcpy.Server.scrcpy(Server.java:32)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.genymobile.scrcpy.Server.main(Server.java:133)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
10-01 18:18:35.047 13653 13653 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:287)
10-01 18:18:35.048 13653 13653 E scrcpy  : Exception on thread Thread[main,5,main]
10-01 18:18:35.048 13653 13653 E scrcpy  : android.media.MediaCodec$CodecException: Error 0xfffffff4
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at android.media.MediaCodec.native_configure(Native Method)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at android.media.MediaCodec.configure(MediaCodec.java:1943)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at android.media.MediaCodec.configure(MediaCodec.java:1872)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:157)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:67)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.genymobile.scrcpy.Server.scrcpy(Server.java:32)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.genymobile.scrcpy.Server.main(Server.java:133)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
10-01 18:18:35.048 13653 13653 E scrcpy  : 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:287)
10-01 18:18:35.055 10486 13652 E adbd    : error reading protocol FD 63: Connection reset by peer
10-01 18:18:35.065  1068  1120 E OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
10-01 18:18:35.067  1089  1170 I DisplayPowerController: Unblocked screen on after 131 ms
10-01 18:18:35.157   198   229 D BrcmNciX: 20020401b90100
10-01 18:18:35.168  1985  1985 D MoPub   : Loading ad from: http://ads.mopub.com/m/ad?id=0&nsv=4.19.0&dn=HTC%2CNexus%209%2Cflounder&bundle=com.launcher.nl&z=%2B0530&o=p&w=1536&h=2048&sc_a=2.0&ct=2&av=4.6&udid=mp_tmpl_advertising_id&dnt=mp_tmpl_do_not_track
10-01 18:18:35.179   198   229 D BrcmNciR: 4002020000
10-01 18:18:35.193   198   229 D BrcmNciX: 2103050200018001
10-01 18:18:35.196   198   229 D BrcmNciR: 41030100
10-01 18:18:35.228 10753 10753 I DeviceStatusMonitor: onReceive() : Action = android.intent.action.SCREEN_ON
10-01 18:18:35.237  1089  1526 D WificondControl: Scan result ready event
10-01 18:18:35.245  1089  1447 D SurfaceControl: Excessive delay in setPowerMode()
10-01 18:18:35.246  1089  1170 W PowerManagerService: Screen on took 333 ms
10-01 18:18:35.504  1985  1985 D MoPub   : Native ad request failed.
10-01 18:18:35.504  1985  1985 D MoPub   : com.mopub.network.MoPubNetworkError: Ad Unit is warming up.
10-01 18:18:35.504  1985  1985 D MoPub   : 	at com.mopub.network.AdRequest.a(Unknown Source:19)
10-01 18:18:35.504  1985  1985 D MoPub   : 	at com.mopub.volley.NetworkDispatcher.run(Unknown Source:137)
10-01 18:18:36.889  1985 13687 W System.err: java.io.FileNotFoundException: http://onb9w37jw.bkt.clouddn.com/nl_c_cfg.txt
10-01 18:18:36.890  1985 13687 W System.err: 	at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251)
10-01 18:18:36.890  1985 13687 W System.err: 	at com.lib.a.n.c(Unknown Source:129)
10-01 18:18:36.893  1985 13687 W System.err: 	at com.lib.a.n.a(Unknown Source:0)
10-01 18:18:36.893  1985 13687 W System.err: 	at com.lib.ch.ChargingVersionService.onHandleIntent(Unknown Source:18)
10-01 18:18:36.893  1985 13687 W System.err: 	at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76)
10-01 18:18:36.893  1985 13687 W System.err: 	at android.os.Handler.dispatchMessage(Handler.java:106)
10-01 18:18:36.893  1985 13687 W System.err: 	at android.os.Looper.loop(Looper.java:164)
10-01 18:18:36.893  1985 13687 W System.err: 	at android.os.HandlerThread.run(HandlerThread.java:65)
10-01 18:18:40.289  1089  1170 E LightsService: Light requested not available on this device. 2
10-01 18:18:44.914  1089  1170 I PowerManagerService: Going to sleep due to screen timeout (uid 1000)...
10-01 18:18:44.915  1089  1170 I PowerManagerService: Sleeping (uid 1000)...
10-01 18:18:45.447  1089  1170 I DisplayPowerController: Blocking screen off
10-01 18:18:45.452  1089  1170 I DisplayPowerController: Unblocked screen off after 5 ms
10-01 18:18:45.493  1089  1168 I DisplayManagerService: Display device changed state: "Built-in Screen", OFF
10-01 18:18:45.494  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:45.494  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:45.497   157   157 D SurfaceFlinger: Set power mode=0, type=0 flinger=0x7233a44000
10-01 18:18:45.497   157   157 D hwcomposer: hwc_blank: display 0: blank
10-01 18:18:45.497   157   157 D hwcomposer: hwc_blank_display: display 0: [0 -> 1]
10-01 18:18:45.500  1089  1305 W LocalDisplayAdapter: Unable to find color mode 0, ignoring request.
10-01 18:18:45.507  1089  1353 I InputReader: Reconfiguring input devices.  changes=0x00000004
10-01 18:18:45.822  1089  1447 D SurfaceControl: Excessive delay in setPowerMode()
10-01 18:18:45.853  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:45.877  1498  1498 I chatty  : uid=10022(com.android.systemui) identical 2 lines
10-01 18:18:45.878  1498  1498 D StatusBar: disable<e i a s b H R c s q >
10-01 18:18:45.911   198   229 D BrcmNciX: 21060100
10-01 18:18:45.932   198   229 D BrcmNciR: 41060100
10-01 18:18:45.947 10753 10753 I DeviceStatusMonitor: onReceive() : Action = android.intent.action.SCREEN_OFF
10-01 18:18:45.949 10753 10753 I VoiceImeUtils: S3 recognizer enabled.

@rom1v rom1v added the codec label Oct 1, 2019
@rom1v rom1v changed the title Error while connecting over wifi adb ... MediaCodec$CodecException: Error 0xfffffff4 Oct 1, 2019
@rom1v
Copy link
Collaborator

rom1v commented Oct 1, 2019

android.media.MediaCodec$CodecException: Error 0xfffffff4

(this is the same error code as #73)

@aiamuzz
Copy link
Author

aiamuzz commented Oct 1, 2019

android.media.MediaCodec$CodecException: Error 0xfffffff4

(this is the same error code as #73)

oh ... i tried running with scrcpy -b2M -m800 from #73 ... it still fails for me !!!

@rom1v
Copy link
Collaborator

rom1v commented Oct 1, 2019

Also #545

@BigDogBoy
Copy link

BigDogBoy commented Jun 12, 2020

While running it over a number of times, sometimes it works, sometimes it comes up with a whole range of errors many of which include the one above.
scrcpy output.txt
I'm using the prebuilt snap package for Linux, on Ubuntu 20.04, over USB, and the only way I've managed to get around this issue, has been to issue a snap remove, and snap install then, again; effectively just reinstalling it; and then restarting my computer.

@radixs
Copy link

radixs commented Dec 28, 2020

I have Lenovo Yoga Smart Tab and am getting the same error. It runs on Android 9 and I am debugging via USB cable. I have Ubuntu 18.04.

When using just scrcpy it tries to use the native resolution 1920x1200 and it fails:

INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 4.3 MB/s (33622 bytes in 0.007s)
[server] INFO: Device: LENOVO Lenovo YT-X705L (Android 9)
INFO: Renderer: opengl
INFO: OpenGL version: 3.0 Mesa 20.0.8
INFO: Trilinear filtering enabled
INFO: Initial texture: 1920x1200
[server] ERROR: Exception on thread Thread[main,5,main]
android.media.MediaCodec$CodecException: Error 0xfffffff4
	at android.media.MediaCodec.native_configure(Native Method)
	at android.media.MediaCodec.configure(MediaCodec.java:1960)
	at android.media.MediaCodec.configure(MediaCodec.java:1889)
	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:205)WARN: Device disconnected

	at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:84)
	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:55)
	at com.genymobile.scrcpy.Server.scrcpy(Server.java:76)
	at com.genymobile.scrcpy.Server.main(Server.java:225)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)

but when doing scrcpy -m1024 it runs fine, just with an obviously crap resolution in the window. Same with fullscreen.

Here is the log:

12-28 19:14:05.394   586   586 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
12-28 19:14:05.395   586   586 I chatty  : uid=1000(system) /system/bin/surfaceflinger identical 2 lines
12-28 19:14:05.395   586   586 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
12-28 19:14:05.530  1201  1210 I system_server: Background concurrent copying GC freed 233204(11MB) AllocSpace objects, 214(13MB) LOS objects, 42% free, 31MB/55MB, paused 1.180ms total 290.970ms
12-28 19:14:06.532 17304 17304 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-28 19:14:06.666 17304 17304 W main    : type=1400 audit(0.0:763964): avc: denied { read } for name="u:object_r:vendor_mpctl_prop:s0" dev="tmpfs" ino=15520 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_mpctl_prop:s0 tclass=file permissive=0
12-28 19:14:06.679 17304 17304 E libc    : Access denied finding property "ro.vendor.at_library"
12-28 19:14:06.689 17304 17304 D AndroidRuntime: Calling main entry com.genymobile.scrcpy.Server
12-28 19:14:06.690 17304 17304 I scrcpy  : Device: LENOVO Lenovo YT-X705L (Android 9)
12-28 19:14:06.710 17304 17304 I app_process: Thread[1,tid=17304,Native,Thread*=0x7e3660dc00,peer=0x12c02028,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
12-28 19:14:06.711 17304 17304 D MtpDeviceJNI: register_android_mtp_MtpDevice
12-28 19:14:06.711 17304 17304 I app_process: Thread[1,tid=17304,Native,Thread*=0x7e3660dc00,peer=0x12c02028,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
12-28 19:14:06.711 17304 17304 I app_process: Thread[1,tid=17304,Native,Thread*=0x7e3660dc00,peer=0x12c02028,"main"] recursive attempt to load library "/system/lib64/libmedia_jni.so"
12-28 19:14:06.725 17304 17319 I OMXClient: IOmx service obtained
12-28 19:14:06.725   723 17199 I OMXMaster: makeComponentInstance(OMX.qcom.video.encoder.avc) in [email protected] process
12-28 19:14:06.733   723 17199 I OMX-VENC: Video encode perflock acquired,handle=14503
12-28 19:14:06.842   723 17199 I OMX-VENC: Component_init : OMX.qcom.video.encoder.avc : return = 0x0
12-28 19:14:06.849   723   723 E OMXNodeInstance: setParameter(0xedef4504:qcom.encoder.avc, OMX.google.android.index.allocateNativeHandle(0x7f00005d): Output:1 en=0) ERROR: UnsupportedSetting(0x80001019)
12-28 19:14:06.849   723   723 W OMXNodeInstance: [0xedef4504:qcom.encoder.avc] component does not support metadata mode; using fallback
12-28 19:14:06.849 17304 17319 I ExtendedACodec: setupVideoEncoder()
12-28 19:14:06.850 17304 17319 W OMXUtils: do not know color format 0x7fa30c04 = 2141391876
12-28 19:14:06.851 17304 17319 W OMXUtils: do not know color format 0x7f000789 = 2130708361
12-28 19:14:06.855   723   723 E OMX-VENC: VIDIOC_S_FMT OUTPUT_MPLANE Failed
12-28 19:14:06.855   723   723 E OMX-VENC: ERROR: venc_set_param input failed
12-28 19:14:06.855   723   723 E OMXNodeInstance: setParameter(0xedef4504:qcom.encoder.avc, ParamPortDefinition(0x2000001)) ERROR: InsufficientResources(0x80001000)
12-28 19:14:06.856 17304 17319 E ACodec  : [OMX.qcom.video.encoder.avc] failed to set input port definition parameters.
12-28 19:14:06.856 17304 17319 E ExtendedACodec: [OMX.qcom.video.encoder.avc] configureCodec returning error -12
12-28 19:14:06.856 17304 17319 E ACodec  : signalError(omxError 0x80001001, internalError -12)
12-28 19:14:06.856 17304 17319 E ACodec  : [OMX.qcom.video.encoder.avc] configureCodec returning error -12
12-28 19:14:06.856 17304 17319 E ACodec  : signalError(omxError 0x80001001, internalError -12)
12-28 19:14:06.856 17304 17318 E MediaCodec: Codec reported err 0xfffffff4, actionCode 0, while in state 3
12-28 19:14:06.857 17304 17318 E MediaCodec: Codec reported err 0xfffffff4, actionCode 0, while in state 0
12-28 19:14:06.857 17304 17304 E MediaCodec: configure failed with err 0xfffffff4, resetting...
12-28 19:14:06.860   723   723 I OMX-VENC: Component Deinit
12-28 19:14:06.860   723   723 I OMX-VENC: Video encode perflock released
12-28 19:14:06.868 17304 17319 I OMXClient: IOmx service obtained
12-28 19:14:06.868   723   723 I OMXMaster: makeComponentInstance(OMX.qcom.video.encoder.avc) in [email protected] process
12-28 19:14:06.878   723   723 I OMX-VENC: Video encode perflock acquired,handle=14504
12-28 19:14:06.885   723   723 I OMX-VENC: Component_init : OMX.qcom.video.encoder.avc : return = 0x0
12-28 19:14:06.890   689 27201 E ProcessInfo: pid 17304 invalid OOM adjustments value -10000
12-28 19:14:06.890   689 27201 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 17304
12-28 19:14:06.891   689 27201 E ProcessInfo: pid 17304 invalid OOM adjustments value -10000
12-28 19:14:06.891   689 27201 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 17304
12-28 19:14:06.892   689 27201 E ProcessInfo: pid 17304 invalid OOM adjustments value -10000
12-28 19:14:06.892   689 27201 E ResourceManagerService: getLowestPriorityBiggestClient_l: can't get process priority for pid 17304
12-28 19:14:06.893 17304 17304 D AndroidRuntime: Shutting down VM
12-28 19:14:06.896 17304 17304 E AndroidRuntime: FATAL EXCEPTION: main
12-28 19:14:06.896 17304 17304 E AndroidRuntime: PID: 17304
12-28 19:14:06.896 17304 17304 E AndroidRuntime: android.media.MediaCodec$CodecException: Error 0xfffffff4
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at android.media.MediaCodec.native_configure(Native Method)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at android.media.MediaCodec.configure(MediaCodec.java:1960)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at android.media.MediaCodec.configure(MediaCodec.java:1889)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:205)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:84)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:55)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.genymobile.scrcpy.Server.scrcpy(Server.java:76)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.genymobile.scrcpy.Server.main(Server.java:225)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
12-28 19:14:06.896 17304 17304 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)
12-28 19:14:06.896 17304 17304 E scrcpy  : Exception on thread Thread[main,5,main]
12-28 19:14:06.896 17304 17304 E scrcpy  : android.media.MediaCodec$CodecException: Error 0xfffffff4
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at android.media.MediaCodec.native_configure(Native Method)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at android.media.MediaCodec.configure(MediaCodec.java:1960)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at android.media.MediaCodec.configure(MediaCodec.java:1889)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:205)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:84)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:55)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.genymobile.scrcpy.Server.scrcpy(Server.java:76)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.genymobile.scrcpy.Server.main(Server.java:225)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
12-28 19:14:06.896 17304 17304 E scrcpy  : 	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:340)
12-28 19:14:06.935   723   723 E OMXNodeInstance: !!! Observer died. Quickly, do something, ... anything...
12-28 19:14:06.937   723   723 I OMX-VENC: Component Deinit
12-28 19:14:06.937   723   723 I OMX-VENC: Video encode perflock released
12-28 19:14:07.072 17313 17313 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-28 19:14:07.186 17313 17313 W main    : type=1400 audit(0.0:763965): avc: denied { read } for name="u:object_r:vendor_mpctl_prop:s0" dev="tmpfs" ino=15520 scontext=u:r:shell:s0 tcontext=u:object_r:vendor_mpctl_prop:s0 tclass=file permissive=0
12-28 19:14:07.200 17313 17313 E libc    : Access denied finding property "ro.vendor.at_library"
12-28 19:14:07.210 17313 17313 D AndroidRuntime: Calling main entry com.genymobile.scrcpy.CleanUp
12-28 19:14:07.213 17313 17313 I scrcpy  : Cleaning up
12-28 19:14:07.214 17313 17313 I scrcpy  : Restoring normal power mode
12-28 19:14:07.217   586   586 D SurfaceFlinger: Set power mode=2, type=0 flinger=0x708d43d000
12-28 19:14:07.218 17313 17313 D AndroidRuntime: Shutting down VM

Looks like it tries to retrieve some settings but is denied access to them. Maybe some developer debug settings needs to be on hmm.

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2021

Does it work with another encoder?

@tobecci
Copy link

tobecci commented Jun 9, 2021

Does it work better with a lower definition:

scrcpy -m1024

?

this worked my vivo y51, thank you so much.

i was getting the following error

[server] ERROR: Exception on thread Thread[main,5,main]
android.media.MediaCodec$CodecException: Error 0xfffffff4
        at android.media.MediaCodec.native_configure(Native Method)
        at android.media.MediaCodec.configure(MediaCodec.java:2127)
        at android.media.MediaCodec.configure(MediaCodec.java:2043)
        at com.genymobile.scrcpy.ScreenEncoder.configure(ScreenEncoder.java:232)
        at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:89)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:60)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
        at com.genymobile.scrcpy.Server.main(Server.java:252)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:433)
INFO: Renderer: opengl
INFO: OpenGL version: 3.0 Mesa 21.0.3
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2408
WARN: Device disconnected
WARN: Killing the server...

@TheGodCode
Copy link

TheGodCode commented Sep 16, 2021

@tobecci ohh it worked thanks

@rom1v
Copy link
Collaborator

rom1v commented Jan 15, 2022

Could you test #2947 please?

@yeikel16
Copy link

yeikel16 commented Oct 1, 2022

I have a Xiaomi Redmi Note 11 and the same problem happens to me. I tried the resolution using -b2M -m800 and the error persists.

[server] INFO: Device: Xiaomi 2201117TL (Android 12)
INFO: Renderer: direct3d
INFO: Initial texture: 360x800
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalStateException
        at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
        at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:3535)
        at com.genymobile.scrcpy.ScreenEncoder.encode(ScreenEncoder.java:114)
        at com.genymobile.scrcpy.ScreenEncoder.internalStreamScreen(ScreenEncoder.java:95)
        at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:61)
        at com.genymobile.scrcpy.Server.scrcpy(Server.java:80)
        at com.genymobile.scrcpy.Server.main(Server.java:255)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:363)

@JuanMusic1
Copy link

I have the same Model of Redmi Note 11, When I run the scrcpy with the last update of MIUI i has the same problem, but, when i did a downgrade to MIUI 13.0.12 the exception android.media.MediaCodec$CodecException: Error 0xfffffff4raises, but the program doesn't die

@KesleyDavid
Copy link

scrcpy -m1024

worked perfectly for me on motorola moto g32

@slemonslim
Copy link

hi guys i am new to scrcpy 2.1.1
i want to ask when i connect my NOKIA 3.4 phone via wirelessly.
i got screecopy on my PC wirelessly in same network (like HOME is my wifi name) of my NOKIA phone.
but once my phone disconnected from HOME wifi and get reconnect within same network again
i cannot able reaccess or screencopy my phone
however, i have to make all process again from the 1st step like this.
1==> go to phone settings/developer mode/usb debugging mode=ON
2==> connect phone to PC / allow alwaz this mobile
3==> open scrcpy terminal cmd
4==> adb devices (device serial number shown under)
5==> next
6==> adb tcpip 5555
7==> restarting in TCP mode port: 5555
8==> adb connect 192.168.10.7:5555
9--> connected to 192.168.10.7:5555

I have to remake all these processes again n again after once device disconnected from Wi-Fi and reconnected again in same network.
after reconnected if i make again this command
8==> adb connect 192.168.10.7:5555
it's given me error.
cannot connect to 192.168.10.7:5555: No connection could be made because the target machine actively refused it. (10061)

can somebody have a proper solution for this?
that i don't want to connect my phone again n again
Whynot it can save always for once.

Thanks in advance.
slemon slim

@ravihlb
Copy link

ravihlb commented Oct 11, 2023

What fixed this error for me was to set USB to "File Transfer" mode on Android 12.
Once connected via USB, my device shows a persistent notification, which by default says "Charging this device via USB". I clicked it, changed the "Use USB for" option to "File Transfer" and was able to record without an issue.

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