Android的LogCat中显示BufferQueueProcedure [英] Android LogCat shows BufferQueueProcedure

查看:1864
本文介绍了Android的LogCat中显示BufferQueueProcedure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,请原谅我的英语不好。我有我的应用程序(学业)的最终版本 - 它拍照和照片被用c ++ code缝合后。我测试了我的手机的Xperia迷你API 15上的应用程序,一切是这样的设备就OK了。但是,我借了学校的Nexus 5的API 21,有两个问题。

第一个问题是令人沮丧的。今天,我在调试无解一整天。我不知道,这code的一部分,可以让这个错误。每当应用程序正在运行 - 如果它拍照或拼接不打紧,LogCat中显示了千元以下错误:

 标签:BufferQueueProceducer文字:【无名-3046-0] dequeueBuffer:Bufferqueue已被放弃

在code是该错误后停止。不幸的是我可以更具体,因为我不知道。其中的原因就可以了。

第二个问题是只有在拼接照片过程中,当突然应用程序无响应(ANR)所示。但是,当我点击等待,应用程序继续拼接照片。结果是好的,但对话是烦人。
我发现这个页面上的解决方案 - 问题出在运行环境艺术。我想从ART更改运行时环境的Dalvik,但Nexus 5的没有改变的选项。是否有另一种最佳的选择?
错误LogCat中:

 标签:艺术主题[5,TID = 6270,`WaitingInMainSignalCatcherLoop,螺纹* = 0xf60e40,同行= 0x12c00080,信号守望者]:反应信号3`

感谢每一个建议,LS

我被简化了code(它的主要部分),这样你就可以轻松地分析,但如果你愿意,我可以在这里写的所有codeS。

  //按钮,在文件夹IMG拼接照片
公共无效onlyStitchButtonClicked(查看按钮)
{
    文件根=新的文件(urlStorage +IMG);
    如果(!root.exists()){
        烤面包机(文件夹+ urlStorage +IMG'犯规存在);
    }其他{
        //展示在TextView的消息
        tOutput.append(拼接\\ n);
        choosenResultSize = getUsersSize();        //无延迟的文字不显示的TextView
        新的处理程序()。postDelayed(新的Runnable(){
            公共无效的run(){
                拼接(urlStorage,IMG,choosenResultSize);
                tOutput.append(最终拼接\\ n);
            }
        },500);
    }
    返回;
}//按钮用于拍照和它们拼接
公共无效startButtonClicked(查看按钮){
    //获取用户设置    tOutput.setText(应用程序正在运行启动拍照\\ n。);    //拍摄第一张照片前,等待延迟
    新的处理程序()。postDelayed(新的Runnable(){
        公共无效的run(){
            StartShot();
        }
    },DelayBeforeStart * 1000);
}//照片集取
私人无效StartShot(){
    新CountDownTimer(((1 + NumOfPhoto)* DelayBetweenShot)* 1000,DelayBetweenShot * 1000){
        私人INT照片= 0;        @覆盖
        公共无效onTick(长millisUntilFinished){
            tOutput.append(照片NUM。+ + +照片);            尝试{
                camera.takePicture(NULL,NULL,mPicture);
            }
            赶上(例外五){}
        }        @覆盖
        公共无效onFinish(){
            tOutput.append(停止拍照开始拼接。);
            //拍摄第一张照片前,等待延迟
            新的处理程序()。postDelayed(新的Runnable(){
                公共无效的run(){
                    拼接(urlStorage,文件夹名称,choosenResultSize);                    tOutput.append(拼接完成。);
                    scrollview.fullScroll(ScrollView.FOCUS_DOWN);
                }
            },500);
        }    }。开始();
}


解决方案

问题1:

BufferQueues,这是下垫面的机制,有一个生产者 - 消费者的安排。对于SurfaceView,您的应用程序是制片人,SurfaceFlinger的(系统图形合成器)是消费者。对于表面纹理,双方都在你的应用程序。该BufferQueue已被放弃消息意味着消费者方面已经走远,例如你要发送的帧,SurfaceView的表面,但SurfaceView不再存在。

我的猜测是,无论表面您使用的是相机的输出已经被丢弃,每次摄像机试图发送您得到一个错误消息的preVIEW形象。

问题2:

这听起来像你正在做一堆工作的主UI线程上。这会导致系统认为该应用程序没有响应,你会得到的ANR对话框。的ANR处理的一部分涉及从该响应的进程的堆栈跟踪;因为它不能由通常的方法要求,它发送一个信号3从VM该消息只表示信号3被接收。这是不太可能切换到的Dalvik会改变的问题。

这是一个非UI线程执行的照片拼接,并确保在UI线程不等待另一个线程来完成。 的AsyncTask 可以在这里很有用。

At first please excuse my bad English. I have a final version of my App (school work) - it is taking photos and after that photos are being stitched using c++ code. I tested the app on my phone Xperia mini API 15 where everything is OK on this device. But I borrowed school Nexus 5 API 21 and there are two problems.

First problem is frustrating. Today, I was debugging all day without solution. I have no idea, which part of code can make this error. Whenever the app is running - don't matter if it's taking photo or stitching, LogCat shows thousands of these error:

Tag: BufferQueueProceducer Text: [unnamed-3046-0] dequeueBuffer: Bufferqueue has been abandoned

The code is stopped after this error. Unfortunately I can be more specific, because I don't know. where the cause can be.

Second problem is only in process of stitching photos, when suddenly Application not responding (ANR) shows. But when I click on Wait, app continues with stitching photos. Result is good, but the dialog is annoying. I found solution on this page - problem is in runtime environment ART. I wanted to change runtime environment from ART to Dalvik, but Nexus 5 don't have option for change. Is there another choise? Error in LogCat:

Tag: art  Thread[5,tid=6270, `WaitingInMainSignalCatcherLoop,Thread*=0xf60e40,peer=0x12c00080,"Signal Catcher"]: reacting to signal 3`

Thanks for every advice, LS

I'm being simplified the code (it's the main part), so you can analyze easily, but if you want, I can write all codes here.

// button for stitching photo in folder 'img'
public void onlyStitchButtonClicked(View button)
{
    File root = new File(urlStorage + "img");
    if (!root.exists()){
        toaster("Folder '" + urlStorage + "img' doesnt exist");
    }else{
        // show message on TextView
        tOutput.append("Stitching.\n");
        choosenResultSize = getUsersSize();

        // without delay text dont show in TextView
        new Handler().postDelayed(new Runnable() {
            public void run() {
                Stitching(urlStorage, "img", choosenResultSize);
                tOutput.append("End stitching.\n");
            }
        }, 500);        
    }
    return;
}

// Button for taking photo and stitching them
public void startButtonClicked(View button){
    // Get users settings

    tOutput.setText("App is running. Start taking photo.\n");

    // Wait delay before taking first photo
    new Handler().postDelayed(new Runnable() {
        public void run() {
            StartShot();
        }
    }, DelayBeforeStart*1000);
}

// Take collection of photos
private void StartShot(){
    new CountDownTimer(((1+NumOfPhoto)*DelayBetweenShot)*1000, DelayBetweenShot*1000) {
        private int Photo = 0;

        @Override
        public void onTick(long millisUntilFinished) {
            tOutput.append("Photo num. " + ++Photo );

            try{
                camera.takePicture(null, null, mPicture);
            }
            catch(Exception e){}
        }

        @Override
        public void onFinish() {
            tOutput.append("Stop taking photo. Start stitching");
            // Wait delay before taking first photo
            new Handler().postDelayed(new Runnable() {
                public void run() {
                    Stitching(urlStorage, FolderName, choosenResultSize);

                    tOutput.append("Stitching done.");
                    scrollview.fullScroll(ScrollView.FOCUS_DOWN);
                }
            }, 500);
        }

    }.start();
}

解决方案

Problem #1:

BufferQueues, which are the mechanism underlying Surfaces, have a producer-consumer arrangement. For a SurfaceView, your app is the producer, and SurfaceFlinger (the system graphics compositor) is the consumer. For a SurfaceTexture, both sides are in your app. The "BufferQueue has been abandoned" message means the consumer side has gone away, e.g. you're trying to send frames to a SurfaceView's Surface, but the SurfaceView no longer exists.

My guess is that whatever Surface you're using for the Camera output has been discarded, and every time the Camera tries to send a preview image you get an error message.

Problem #2:

It sounds like you're doing a bunch of work on the main UI thread. This causes the system to believe the application is unresponsive, and you get the ANR dialog. Part of the ANR handling involves getting a stack trace from the unresponsive process; since it can't ask by the usual means, it sends a signal 3. The message from the VM just indicates that signal 3 was received. It's unlikely that switching to Dalvik would change matters.

Perform the photo stitching on a non-UI thread, and make sure the UI thread isn't waiting for the other thread to finish. AsyncTask can be useful here.

这篇关于Android的LogCat中显示BufferQueueProcedure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆