×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    QCamera - camera error after starting camera then capturing image after standby

    Hi dudes,

    Been running round in circles trying to perform the following:

    1) Start camera and wait for active state
    2) Lock focus
    3) Get locked focus
    4) Capture image
    5) Stop camera
    6) Wait a while, camera goes into status standby (power saving mode)
    7) Start camera
    8) Lock focus
    9) Get locked focus
    10) Capture image
    11) Get camera error


    Here is some logging to show exactly what the status of the elements are:

    [Qt Message] Starting camera
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: ActiveStatus
    [Qt Message] Locking focus
    [Qt Message] Camera LOCK changed: status: Searching, reason UserRequest
    [Qt Message] Camera LOCK changed: status: Locked, reason LockAcquired
    [Qt Message] Taking picture
    [Qt Message] Camera LOCK changed: status: Unlocked, reason UserRequest
    [Qt Message] Image Saved:
    [Qt Message] "c:\Data\Images\test.jpg"
    [Qt Message] Shutting down camera
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: StandbyStatus
    [Qt Message] Starting camera
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: ActiveStatus
    [Qt Message] Locking focus
    [Qt Message] Camera LOCK changed: status: Searching, reason UserRequest
    [Qt Message] Camera LOCK changed: status: Locked, reason LockAcquired
    [Qt Message] Taking picture
    [Qt Message] Camera LOCK changed: status: Unlocked, reason UserRequest
    [Qt Message] Camera error: "General camera error."
    [Qt Message] Camera error: CameraError

    This is from a very simple app I put together, but I get the same thing if I modify the qCamera example app to perform the same steps.

    Can anyone help?? Or is this a problem in the API maybe?

    Cheers!!
    Ste

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QCamera - camera error after starting camera then capturing image after standby

    Could you please send us the code you are using and tell use what device you used to test it?

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    Re: QCamera - camera error after starting camera then capturing image after standby

    Hi gnuton,

    Sure thing. I posted it up as a bug here: https://bugreports.qt-project.org/br...TMOBILITY-2021

    Hope that was not the wrong thing to do!

    It's on an Nokia N8 phone. Code is posted to the bug page.

    Cheers!
    Ste

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: QCamera - camera error after starting camera then capturing image after standby

    I tried with the following SW with N8, looks to me works like this way (Need to analysis the code), I updated the same with bug report also
    Symbian Anna, 022.010
    Qt + Mobility 4.7.4 + 1.2.1

    [Qt Message] Starting camera
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: ActiveStatus
    [Qt Message] Locking focus
    [Qt Message] Camera LOCK changed: status: Searching, reason UserRequest
    [Qt Message] Camera LOCK changed: status: Unlocked, reason LockFailed
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: UnloadedStatus
    [Qt Message] Camera state changed: QCamera::UnloadedState
    [Qt Message] Camera state changed: QCamera::ActiveState
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Taking picture - NOT READY FOR CAPTURE
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: ActiveStatus
    [Qt Message] Camera status changed: StartingStatus
    [Qt Message] Camera status changed: LoadedStatus
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: UnloadedStatus
    [Qt Message] Camera state changed: QCamera::UnloadedState
    [Qt Message] Camera state changed: QCamera::ActiveState
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: UnloadedStatus
    [Qt Message] Camera state changed: QCamera::UnloadedState
    [Qt Message] Camera state changed: QCamera::ActiveState
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera status changed: UnloadedStatus
    [Qt Message] Camera state changed: QCamera::UnloadedState
    [Qt Message] Camera state changed: QCamera::ActiveState
    [Qt Message] Camera status changed: LoadingStatus
    [Qt Message] Camera error: "Access to camera device was rejected."
    [Qt Message] Camera error: CameraError
    [Qt Message] Camera status changed: UnloadedStatus
    [Qt Message] Camera state changed: QCamera::UnloadedState

  5. #5
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    Re: QCamera - camera error after starting camera then capturing image after standby

    From that log, looks to me like it is not taking a picture at all, not even the first time. For speed of building the test app I used delays rather than checking for signals...they are mostly 4 seconds, sop should be plenty of time for things to get set-up.

  6. #6
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: QCamera - camera error after starting camera then capturing image after standby

    Hi,

    It looks to me there is no error in Camera API, it works as it should be.
    Probably we are not using the focus locking feature properly.

    I modified the Qt mobility example as you have done and looks work OK.
    I tested with N8. Find the updated project as attached file. You can modify your code as necessary or use this one by modifying UI

    regards
    Mahbub
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    Re: QCamera - camera error after starting camera then capturing image after standby

    Hi mahbub,

    Had a quick look through the code you posted. Think you are missing the point of what I am trying to achieve.

    Not been able to run what you have posted, don't have the phone here with me :S but...and correct me if I am wrong...

    An image is taken, and imageSaved signal fired...at this point you stop the camera, then 4 seconds later start the camera in function StartCameraSlot.

    What I am trying to achieve is stop the camera, wait for at least a minute (the camera is automatically put into power saving mode by the hardware/SDK after approx 40 seconds), start the camera again and take a picture.

    Maybe this just cannot be done...maybe you have to completely shutdown, destroy and re-create/re-setup a camera once it goes into powersaving mode...

    Cheers!
    Ste

  8. #8
    Registered User
    Join Date
    Jan 2012
    Posts
    9

    Re: QCamera - camera error after starting camera then capturing image after standby

    In fact, With a very small change to your code, I can make it do what I am suggesting is the bug...and break it.

    Change the single shot timer call in Camera::imageSaved from 4000ms to 45000ms and watch a camera error occur when attempting to grab the second picture.

    I went one stage further and added the signal to statusChanged(QCamera::Status). You will see that when the above mentioned timer is large enough to make '[Qt Message] Camera::updateCameraStatus StandbyStatus ' happen, you will get a camera error on the second shot. Setting it to 25000ms is short enough to not let the camera fall into the standby state.

    I want greater gaps than 25 seconds, and I want toe camera to fall into standby (power-saving) mode!

  9. #9
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: QCamera - camera error after starting camera then capturing image after standby

    Hi,
    Sorry for later reply,
    I think it would be best way you can submit a case via this link
    https://www.developer.nokia.com/Resources/Support/
    For more information you could contact via private message.

Similar Threads

  1. QML Camera (QCamera). Image saving.
    By Habolog in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-10-18, 09:33
  2. Camera Wrapper library Face camera capture image reversed
    By waelfarouk in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2011-05-13, 18:10
  3. Capturing image from secondary camera problem
    By michaelnewyork in forum Symbian C++
    Replies: 7
    Last Post: 2008-09-08, 08:09
  4. Replies: 2
    Last Post: 2006-03-08, 11:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •