'Camera.release' causes HUGE lag after update to ICS.

Mickster

Active Member
Licensed User
Longtime User
I added camera functionality to my app using Advanced Camera Library back when my tablet was running HoneyComb. When I updated to ICS I started seeing some weird stuff.

B4X:
Sub btnCameraClose_Click

   pnlCamera.Visible = True
   pnlCameraImage.Visible = False
   Camera1.Release
   
   If btnCameraClose.Visible = False Then
      Dim CloseCamera As Animation
      CloseCamera.InitializeAlpha("CloseCamera", 1, 0)
      CloseCamera.Duration = 500
      CloseCamera.Start(pnlCameraControls)
   Else
      pnlCameraControls.Visible = False
   End If

End Sub

When this button is pressed, the system freezes for roughly 30 - 40 seconds. Eventually the program will just resume, but this is something I can't have in my app.
This button is used if the user wants to back out of my Camera view instead of taking a photo. If they instead take a photo, and my press my 'Save' button, everything is fine. Weirdest part is that the first thing the Save button does is call this close button routine, and there is no lag whatsoever. The lag only exists when THIS button is physically pressed and when 'camera.release' is present in the routine.

Any ideas?
 

Mickster

Active Member
Licensed User
Longtime User
B4X:
AStreams Initialized


Sending: Trans=4



[SurfaceView] queueBuffer: SurfaceTexture has been abandoned!


queueBuffer: error queuing buffer to SurfaceTexture, -19
Queue Buffer Failed


[SurfaceView] queueBuffer: SurfaceTexture has been abandoned!


queueBuffer: error queuing buffer to SurfaceTexture, -19
Queue Buffer Failed


GC_CONCURRENT freed 929K, 10% free 10942K/12103K, paused 6ms+5ms


Waiting on End of Stream event times out, 


NvxDoCameraControl(PreviewStop) failed  [0x80001011]


Waiting on End of Stream event times out, 


NvxDoCameraControl(PreviewStop) failed  [0x80001011]


unable to find stats for iface rmnet0


ERROR --NvxGraphTransitionAllToState[945] comp OMX.Nvidia.camera


NvxGraph state change from IDLE to LOADED Failed! NvError = 0x80001011


Already called release()
Destroying camera 0
Already called release()
session id 7 not found for pid 96
session id 8 not found for pid 96


Could not get config for CONFIG_LENS_PHYSICAL_ATTR (80001001)


onCreateDeviceResult: D-Bus error: org.bluez.Error.AlreadyExists (Already Exists)


Device property changed: 00:18:DB:00:C6:F5 property: UUIDs value: 0


updateDeviceServiceChannelCache(00:18:DB:00:C6:F5)


updateDeviceServiceChannelCache(00:18:DB:00:C6:F5)
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Yeah I tried the regular cam library and had the same issue. Unfortunately I don't have any other devices to run a test with, but I found a similar issue somewhere on the forum that was left unsolved. The OP was having the issue with a particular device, but not others. His issue was on a different device to my own, though.
 
Upvote 0

COBRASoft

Active Member
Licensed User
Longtime User
I still have this problem with Samsung Galaxy S2. The release function works normal in debug mode, but not in release mode (very slow). I've posted this before but never got a decent answer or solution. It's not Erels fault, it's not his library...
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
can you test release with FrontCam library

http://www.b4x.com/forum/addit...tml#post107691
Thanks, but it looks like your link is dead. I'm a bit busy at the moment but if I get a second I'll look into the library and let you know if it works.

I still have this problem with Samsung Galaxy S2. The release function works normal in debug mode, but not in release mode (very slow). I've posted this before but never got a decent answer or solution. It's not Erels fault, it's not his library...

Yeah, I actually replied to your post. I was hoping that by now you'd found a solution you could let me in on :(
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Ah, I forgot to mention that. No I don't, the release is slow regardless of whether I compile debug or release.
 
Upvote 0

COBRASoft

Active Member
Licensed User
Longtime User
Ah, I forgot to mention that. No I don't, the release is slow regardless of whether I compile debug or release.

Go in debug mode an set a breakpoint on the release line. Use F8 key to execute that line. Is it as slow as running without debugger or is it faster? Here the debug is much faster (instantly).
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
here is the correct link for the front cam to test the release

http://www.b4x.com/forum/addit...tml#post107691

Thanks, I'll let you know if it works when I get the chance :)

Go in debug mode an set a breakpoint on the release line. Use F8 key to execute that line. Is it as slow as running without debugger or is it faster? Here the debug is much faster (instantly).

When the debugger reaches the camera.release line, the spinning progress wheel on my tablet freezes, just like the program. It eventually resumes, just like when running in release mode.
 
Upvote 0

Mickster

Active Member
Licensed User
Longtime User
Sorry I took so long to reply, I've been quite busy.

here is the correct link for the front cam to test the release

http://www.b4x.com/forum/addit...tml#post107691

I'm not seeing any issue whatsoever with the front facing camera. Release works immediately.

That's different than my problem then .

I haven't found a fix, but I found a workaround. It may be worth trying yourself. Basically, when I want to release the camera, I call camera.takepicture first. In the camera.takepicture routine I recognise which button I press and tell the program to ignore the picture since I don't actually want it. THEN I call camera.release. Works fine. No idea why this happens, but let me know if you see anything similar.
 
Upvote 0
Top