Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Consumer closed input channel or an error occurred. events=0x8

D/AndroidRuntime(11752): 
D/AndroidRuntime(11752): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime(11752): CheckJNI is ON
D/dalvikvm(11752): creating instr width table
E/jdwp    (11752): pipe failed
W/ProcessState(11752): Opening '/dev/binder' failed: Too many open files
D/AndroidRuntime(11752): Calling main entry com.android.commands.am.Am
I/Mamarduke_Diag( 1726): Data is available now.
I/Mamarduke_Diag( 1726): exec result -->>> java.lang.NullPointerException
I/DMIC    ( 1726):  ---> java.lang.NullPointerException
I/System.out( 1726): *****wifi state end=1
D/dalvikvm( 1726): GC_EXPLICIT freed 31K, 41% free 7507K/12551K, external 1625K/2137K, paused 58ms
D/dalvikvm( 1726): GC_EXPLICIT freed 0K, 41% free 7507K/12551K, external 1625K/2137K, paused 58ms
I/System.out( 1726): ***run in test i=7,camera
I/System.out( 1726): ***run in test i=8,cec
I/System.out( 1726): ***run in test i=9,edid
I/System.out( 1726): *****wifi state start=1
I/Mamarduke_Diag( 1726): Data is available now.
I/Mamarduke_Diag( 1726): exec result -->>> 
I/System.out( 1726): *****wifi state end=1
D/dalvikvm( 1726): GC_EXPLICIT freed 36K, 41% free 7474K/12551K, external 1625K/2137K, paused 57ms
D/dalvikvm( 1726): GC_EXPLICIT freed 0K, 41% free 7474K/12551K, external 1625K/2137K, paused 58ms
I/System.out( 1726): ***run in test i=10,iris
I/System.out( 1726): *****wifi state start=1
I/ActivityManager( 1491): Starting: Intent { act=com.android.camera.irison flg=0x10000000 cmp=com.ianc.apd/.testcase.cameraex.ImageCamera } from pid 1726
I/System.out( 1726): onCreate
I/System.out( 1726): onResume
I/System.out( 1726): test irist on
I/System.out( 1726): excuteCmd/sys/bus/spi/devices/spi2.0/irisstate
E/InputDispatcher( 1491): channel '40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
E/InputDispatcher( 1491): channel '40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera (server)' ~ Channel is unrecoverably broken and will be disposed!
D/AndroidRuntime( 1726): Shutting down VM
W/dalvikvm( 1726): threadid=1: thread exiting with uncaught exception (group=0x40015560)
I/WindowManager( 1491): WINDOW DIED Window{40643898 com.ianc.apd/com.ianc.apd.testcase.cameraex.ImageCamera paused=false}
E/AndroidRuntime( 1726): FATAL EXCEPTION: main
E/AndroidRuntime( 1726): java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
E/AndroidRuntime( 1726):    at android.view.InputChannel.nativeReadFromParcel(Native Method)
E/AndroidRuntime( 1726):    at android.view.InputChannel.readFromParcel(InputChannel.java:138)
E/AndroidRuntime( 1726):    at android.view.IWindowSession$Stub$Proxy.add(IWindowSession.java:409)
E/AndroidRuntime( 1726):    at android.view.ViewRoot.setView(ViewRoot.java:498)
E/AndroidRuntime( 1726):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
E/AndroidRuntime( 1726):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
E/AndroidRuntime( 1726):    at android.view.Window$LocalWindowManager.addView(Window.java:424)
E/AndroidRuntime( 1726):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2170)
E/AndroidRuntime( 1726):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
E/AndroidRuntime( 1726):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 1726):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime( 1726):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1726):    at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1726):    at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 1726):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1726):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1726):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 1726):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 1726):    at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 1491):   Force finishing activity com.ianc.apd/.testcase.cameraex.ImageCamera
W/ActivityManager( 1491): Activity pause timeout for HistoryRecord{4069a248 com.ianc.apd/.testcase.cameraex.ImageCamera}

Why do Consumer closed input channel or an error occurred. events=0x8 happen after many times running? That is too say, my program can run at first, but after many times, the exception happen.

I read this: Input transport and input dispatcher error on 2.3, but I have no idea how to solve it!! Who can help me?

I run my program in real device. The android version is 2.3

Update 1:

I found the root cause of Could not read input channel file descriptors from parcel.

It is E/jdwp (11752): pipe failed.

Why do create pipe failed? Because the pipe is out of the max in the system. that is to say, we create a lot of pipe or file descriptors in the system. And then we found the reason and try to modify it: My friend change the code like that in his Activity: `Original source code:

private class MyHandler extends Handler {
    MyHandler(Looper looper) {
        super(looper);
    }

    @Override
    public void handleMessage(Message msg) {
        switch(msg.what) {
            case RELEASE_CAMERA:
                synchronized (CameraHolder.this) {
                    // In 'CameraHolder.open', the 'RELEASE_CAMERA' message
                    // will be removed if it is found in the queue. However,
                    // there is a chance that this message has been handled
                    // before being removed. So, we need to add a check
                    // here:
                    if (CameraHolder.this.mUsers == 0) releaseCamera();
                }
                break;
        }
    }
}
...
HandlerThread ht = new HandlerThread("CameraHolder");
ht.start();
mHandler = new MyHandler(ht.getLooper());

change to

private class MyHandler extends Handler {
    MyHandler(Looper looper) {
        super(looper);
    }

    @Override
    public void handleMessage(Message msg) {
        switch(msg.what) {
            case RELEASE_CAMERA:
                synchronized (CameraHolder.this) {
                    // In 'CameraHolder.open', the 'RELEASE_CAMERA' message
                    // will be removed if it is found in the queue. However,
                    // there is a chance that this message has been handled
                    // before being removed. So, we need to add a check
                    // here:
                    if (CameraHolder.this.mUsers == 0) releaseCamera();
                }
                break;
        }
    }
}
    mHandler = new MyHandler();

Those file descriptors will reduce obviously. Why? how to explain this case? And I add mHandler.removemessage this function to onPause in my Activity. And Those file descriptors also reduce obviously. why? who can explain this case for me? I am trying to understand this.

like image 649
Judy Avatar asked Dec 30 '11 02:12

Judy


2 Answers

Benni05 found a solution here, by setting android:configChanges="orientation" property for activity @AndroidManifest. It work for me(where i get an error with api lvl.11 installed devices). Good luck!

like image 190
Gökhan Barış Aker Avatar answered Nov 17 '22 18:11

Gökhan Barış Aker


it is most probably because of having a wrong xml resource file. for me i put colors in strings.xml and got this errors. then i created colors.xml and now it works.

like image 37
Kemalettin Erbakırcı Avatar answered Nov 17 '22 17:11

Kemalettin Erbakırcı