Log in or register to post comments

App crash after integrate User Defined Targets in ImageTargets

March 9, 2013 - 9:57pm #1

Hi there,

  I follow this article step by step to integrate User Defined Targets in ImageTargets, it work well at the beginning, but after a while it will crash without any message. I search the log and find some logs may tell me why. These logs appear everytime the app crash.

 

03-10 13:48:48.770: W/mm-camera(1242): VFE_RESET_ACK illegal ctrl->state 25
03-10 13:48:48.770: E/InputDispatcher(1339): channel '40877618 com.qualcomm.QCARSamples.ImageTargetsUDT/com.qualcomm.QCARSamples.ImageTargetsUDT.ImageTargets (server)' ~ Consumer closed input channel or an error occurred.  events=0x8
03-10 13:48:48.770: E/InputDispatcher(1339): channel '40877618 com.qualcomm.QCARSamples.ImageTargetsUDT/com.qualcomm.QCARSamples.ImageTargetsUDT.ImageTargets (server)' ~ Channel is unrecoverably broken and will be disposed!
03-10 13:48:48.770: D/Zygote(1241): Process 12645 terminated by signal (11)
03-10 13:48:48.800: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:48.820: I/QualcommCameraHardware(1242): deinitPreview E
03-10 13:48:48.820: I/QualcommCameraHardware(1242): deinitPreview X
03-10 13:48:48.820: D/GPUPostEffect(1242): SIMON: virtual int mlabs::GPUPostEffect::stopPreview() E.
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 50, reg = 1 buffer = 0x416e4000
03-10 13:48:48.820: D/GPUPostEffect(1242): SIMON: int mlabs::GPUPostEffect::stopPreview(mlabs::GPUPostEffect::GPUTask*) E.
03-10 13:48:48.820: D/GPUPostEffect(1242): SIMON: int mlabs::GPUPostEffect::stopPreview(mlabs::GPUPostEffect::GPUTask*) X.
03-10 13:48:48.820: D/GPUPostEffect(1242): SIMON: virtual int mlabs::GPUPostEffect::stopPreview() X.
03-10 13:48:48.820: D/QualcommCameraHardware(1242): void android::QualcommCameraHardware::stopPreviewInternal(): stopPreview done.
03-10 13:48:48.820: D/QualcommCameraHardware(1242): stopPreviewInternal X: 0
03-10 13:48:48.820: D/QualcommCameraHardware(1242): stopPreview: X
03-10 13:48:48.820: W/mm-camera(1242): config_proc_CAMERA_STOP_SNAPSHOT: state is not correct ctrl->state = 25
03-10 13:48:48.820: W/mm-camera(1242): VFE_RESET_ACK illegal ctrl->state 24
03-10 13:48:48.820: D/QualcommCameraHardware(1242): release E
03-10 13:48:48.820: D/(1242): SIMON:GM: mlabs::GPUPostEffect::GPUTask* mlabs::GPUPostEffect::get(): cancel 0 tasks.
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] enter
03-10 13:48:48.820: I/GEManager(1242): [Deinit] enter
03-10 13:48:48.820: I/GEManager(1242): [Deinit] delete m_pCurrShader
03-10 13:48:48.820: I/GEManager(1242): [Deinit] delete m_pShaderBypass
03-10 13:48:48.820: I/GEManager(1242): [Deinit] delete m_pSrcTexture
03-10 13:48:48.820: I/GEManager(1242): [Deinit] delete m_pDstFbo
03-10 13:48:48.820: I/GEManager(1242): [Deinit] leave
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] eglMakeCurrent
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] eglDestroySurface
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] eglDestroyContext
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] eglTerminate
03-10 13:48:48.820: I/GEManager(1242): [~GEManager] leave
03-10 13:48:48.820: D/GPUPostEffect(1242): SIMON: void* mlabs::GPUPostEffect::threadMain() X.
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 50, reg = 1 buffer = 0x4171d000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 50, reg = 1 buffer = 0x41756000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 50, reg = 1 buffer = 0x4178f000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x417c8000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x41801000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x4183a000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x41873000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x418ac000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x418e5000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x4191e000
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x41957000
03-10 13:48:48.820: D/QualcommCameraHardware(1242): Unregister lastest buffer for MSM_PMEM_VIDEO
03-10 13:48:48.820: I/QualcommCameraHardware(1242): register_buf: camfd = 53, reg = 1 buffer = 0x41990000
03-10 13:48:48.820: D/QualcommCameraHardware(1242): frame_thread X
03-10 13:48:48.840: D/QualcommCameraHardware(1242): libposteffect at 0xb000ecf4 unloaded.
03-10 13:48:48.840: D/QualcommCameraHardware(1242): virtual void android::QualcommCameraHardware::release(): GPU manager stopped.
03-10 13:48:48.840: D/QualcommCameraHardware(1242): deinitRaw E
03-10 13:48:48.840: D/QualcommCameraHardware(1242): deinitRaw X
03-10 13:48:48.840: D/mm-camera(1242): set_led_mode = 0, led_ctrl_p->led_mode = 0
03-10 13:48:48.840: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:48.870: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:48.910: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:48.940: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:48.970: E/SensorService(1339): dropping 1 events on the floor (Broken pipe)
03-10 13:48:49.000: D/SensorGUI(1339): ~SensorChannel: mSendFd = 222, mReceiveFd = -1
03-10 13:48:49.000: D/dalvikvm(1339): GC_FOR_MALLOC freed 482K, 34% free 10353K/15559K, external 2129K/2657K, paused 282ms
03-10 13:48:49.000: I/ActivityManager(1339): Process com.qualcomm.QCARSamples.ImageTargetsUDT (pid 12645) has died.
03-10 13:48:49.000: I/WindowManager(1339): WIN DEATH: Window{40a507c8 SurfaceView paused=false}
03-10 13:48:49.020: I/WindowManager(1339): WIN DEATH: Window{40877618 com.qualcomm.QCARSamples.ImageTargetsUDT/com.qualcomm.QCARSamples.ImageTargetsUDT.ImageTargets paused=false}
03-10 13:48:49.020: D/StatusBarPolicy(1423): onSignalStrengthsChanged
03-10 13:48:49.040: D/SurfaceFlinger(1339): layer=0x768cd0 is not in the purgatory list
03-10 13:48:49.231: D/dalvikvm(1339): GC_FOR_MALLOC freed 372K, 35% free 10116K/15559K, external 2129K/2657K, paused 201ms
03-10 13:48:49.231: E/ActivityManager(1339): fail to set top app changed!
03-10 13:48:49.261: D/Sensors(1339): Enable akm: en = 0
03-10 13:48:49.271: D/SensorService(1339): noteStopSensor: uid = 0x3e8, handle = 0x0
03-10 13:48:49.271: I/SurfaceFlinger(1339): SurfaceFlinger::setOrientation
03-10 13:48:49.271: I/WindowManager(1339): Setting rotation to 0, animFlags=1
03-10 13:48:49.271: D/PowerManagerService(1339): button light setOrientation:0
03-10 13:48:49.301: I/ActivityManager(1339): Config changed: { scale=1.0 imsi=460/0 loc=zh_CN touch=3 keys=2/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=537 skin=default}
03-10 13:48:49.391: D/mm-camera stacktrace(1242): +++ DELETING LEAKED MEMORY AT 0xc8dd8 (5 REMAINING)
03-10 13:48:49.391: D/mm-camera stacktrace(1242): +++ DELETING LEAKED MEMORY AT 0xc76d8 (4 REMAINING)
03-10 13:48:49.391: D/mm-camera stacktrace(1242): +++ DELETING LEAKED MEMORY AT 0xc7680 (3 REMAINING)
03-10 13:48:49.391: D/mm-camera stacktrace(1242): +++ DELETING LEAKED MEMORY AT 0xc7628 (2 REMAINING)
03-10 13:48:49.391: D/mm-camera stacktrace(1242): +++ DELETING LEAKED MEMORY AT 0xc75d0 (1 REMAINING)
03-10 13:48:49.391: D/QualcommCameraHardware(1242): dlclose(libqcamera)
03-10 13:48:49.391: D/QualcommCameraHardware(1242): release X
03-10 13:48:49.391: D/QualcommCameraHardware(1242): ~QualcommCameraHardware E
03-10 13:48:49.391: D/QualcommCameraHardware(1242): ~QualcommCameraHardware X
03-10 13:48:49.391: D/QualcommCameraHardware(1242): [ATS][close_camera][complete]
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1801) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1801) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1801) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1802) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1802) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1802) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1798) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1798) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1798) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1797) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1797) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1797) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1800) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1800) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1800) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1799) from pid 1242
03-10 13:48:49.391: V/MediaPlayerService(1242): Client(1799) destructor pid = 1242
03-10 13:48:49.391: V/AudioSink(1242): close
03-10 13:48:49.391: V/MediaPlayerService(1242): disconnect(1799) from pid 1242
03-10 13:48:49.511: D/dalvikvm(1464): GC_EXTERNAL_ALLOC freed 254K, 59% free 3435K/8263K, external 1666K/1755K, paused 37ms
03-10 13:48:49.521: D/AK8975(1248): Compass CLOSE 

 

Could anyone tell me what does it mean?How can I solve this problem?

Thank you very much.

App crash after integrate User Defined Targets in ImageTargets

March 13, 2013 - 5:54am #12

I see.  Now, it's clearer....

but that's also very weird; I have tested several times on a few devices here and never got into that situation.

I would suggest to put some Logs and verify the value of these two variables at startup and during the various phases:

  • scanning
  • creatingTarget

For instance, they should both be false at startup (then scanning should become true after pressing the start scan button, etc.);

you might find that those values get to an inconsistent state... which could explain the issue.

 

 

App crash after integrate User Defined Targets in ImageTargets

March 13, 2013 - 5:49am #11

yes, that is what I mean

App crash after integrate User Defined Targets in ImageTargets

March 12, 2013 - 6:08am #10

What do you mean by "target to images" ?

do you mean just "moving your device around and aiming it at some image in your environment" ?

 

App crash after integrate User Defined Targets in ImageTargets

March 12, 2013 - 5:24am #9

If I do by these steps: “start app” -> “click start scan button” -> “click build target button” -> “target to images or UDT image”, everything works fine.

If I do by these steps: “start app” -> “target to images”, then the app crashed.

THX.

App crash after integrate User Defined Targets in ImageTargets

March 11, 2013 - 10:13am #8

Hi,

I also observe that if I click "start scan"&"build target" one time before I track those images, then the app will work well and won't crash when I target to those images.

Not sure to follow you here:

clicking "start scan" and then "build target" is the normal procedure; did you try different ways ? 

 

App crash after integrate User Defined Targets in ImageTargets

March 11, 2013 - 8:36am #7

The image has complex details such as the paint - Pink peach trees(and it is the default image target),  Ophelia floating,  The Hay Wain and so on.

I also observe that if I click "start scan"&"build target" one time before I track those images, then the app will work well and won't crash when I target to those images.

 

So I try to give "dataSetUserDef" a inital data with "imagetarget.xml" in loadTrackerData() function, just like:

     if (!dataSetUserDef->load("StonesAndChips.xml", QCAR::DataSet::STORAGE_APPRESOURCE))

then the app doesn't crash but also doesn't show any 3D model on scanning target (on the default image target it works well). The log says "Failed to destroy a Trackable because this dataset contains trackables loaded from a dataset file."

 

My English is not very well, I don't know whether I explain it clear.

Thank you for your time.

App crash after integrate User Defined Targets in ImageTargets

March 11, 2013 - 7:03am #6

Ok, so, just to confirm:

  • you observe the crash only when you are Tracking the image target and you are not in scanning mode (i.e. scanning = false in the sample)
  • you observe the crash if the image has complex details or you move the device fast

Can you provide a little bit more explanations on "complex details" ? maybe do you have a screenshot that you can provide ?

 

 

App crash after integrate User Defined Targets in ImageTargets

March 11, 2013 - 6:04am #5

I removed it and the app crashed again. I try to remove the code incrementally, finally there are only starScan() function & buildTarget() function and the app stop crashing, but it doesn't make any sense. 

The crash often happens when I target to something have complex details or move fast, is that because of my android system has something wrong?(PS. on the image target mode not the scaning mode)

THX.

App crash after integrate User Defined Targets in ImageTargets

March 10, 2013 - 3:12pm #4

Ok, let's try to get to the problem incrementally;

in your  renderFrame() function, you have added this code:

 

if (scanning)
{
    // UDT: Get the frame quality from the target builder
    QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
    QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
                   trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
 
    QCAR::ImageTargetBuilder* targetBuilder = imageTracker->getImageTargetBuilder();
    QCAR::ImageTargetBuilder::FRAME_QUALITY frameQuality =
                            targetBuilder->getFrameQuality();
 
    jclass javaClass = env->GetObjectClass(obj);
    jmethodID method = env->GetMethodID(javaClass, "setCurrentFrameQuality", "(I)V");
    env->CallVoidMethod(obj, method, (jint)frameQuality);
}
 
 
Could you remove it and test again ?

 

App crash after integrate User Defined Targets in ImageTargets

March 10, 2013 - 3:03am #3

thank you for your reply

I remove the code in setCurrentFrameQuality, it still crash...

App crash after integrate User Defined Targets in ImageTargets

March 10, 2013 - 1:09am #2

Hi,

hard to tell what is causing the crash, but could you try by removing the code in setCurrentFrameQuality() ?

i.e. instead of setting the color of the mBuildButton, just write an empty setCurrentFrameQuality like this:

public void setCurrentFrameQuality(final int quality)
{
   // DO NOTHING 
}

And then you can see if the crash still occurs..

Log in or register to post comments