×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    N950 & QML Camera = segmentation fault?

    Hi all,

    I wrote a simple QML app that use QML Camera element and faced the following problem. I call Camera.start(), make photo, then call Camera.stop() and perform some processing on resulting photo. However, if I swipe my app to background while Camera is inactive (i.e. Camera.stop() was called), and after bringing my app to foreground I call Camera.start() once again, application crashes with segmentation fault. It seems that Camera does not survive after destroy of Meego graphics system even in stopped state (there is a message "Meego graphics system destroyed" when application goes to background and "Using the meego graphics system" when application goes to foreground). Is there any reasonable way to make it work without using different tricks like watchdog application and so on?

    Thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: N950 & QML Camera = segmentation fault?

    Hi,
    You should not be worried by "Meego graphics system destroyed" and "Using the meego graphics system" messages. They are just debug messages printed out by the Harmattan graphics system.
    I tried myself Mobility QML Camera on my device and it worked as expected. No crashes at all.

    Could you please check if the official Mobility Camera example works for you?
    You can find it in the qt-mobility-qt-mobility/examples/declarative-camera directory of this archive: https://qt.gitorious.org/qt-mobility...ve-tarball/1.1

    If it doesn't work, you have found a bug; If it works fine, then the issue is in your application.
    Of course you could debug your app and then check what's wrong looking at the backtrace.

    Let us know how it goes.

  3. #3
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    Re: N950 & QML Camera = segmentation fault?

    Quote Originally Posted by gnuton View Post
    Hi,
    You should not be worried by "Meego graphics system destroyed" and "Using the meego graphics system" messages. They are just debug messages printed out by the Harmattan graphics system.
    I tried myself Mobility QML Camera on my device and it worked as expected. No crashes at all.

    Could you please check if the official Mobility Camera example works for you?
    You can find it in the qt-mobility-qt-mobility/examples/declarative-camera directory of this archive: https://qt.gitorious.org/qt-mobility...ve-tarball/1.1

    If it doesn't work, you have found a bug; If it works fine, then the issue is in your application.
    Of course you could debug your app and then check what's wrong looking at the backtrace.

    Let us know how it goes.
    Do you mean declarative-camera example from Qt Mobility? As I can see, it does not call stop() method for Camera at all. I will try to make simple test case for QML Camera in the evening and I'll report here the results. Thank you!

  4. #4
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    Re: N950 & QML Camera = segmentation fault?

    Quote Originally Posted by gnuton View Post
    Hi,
    Let us know how it goes.
    OK, so I made a simple test case - this one:

    Code:
    import QtQuick 1.0
    import QtMultimediaKit 1.1
    import com.nokia.meego 1.0
    
    Window {
        id: mainWindow
    
        Rectangle {
            id:           backgroundRectangle
            anchors.fill: parent
            color:        "black"
    
            Camera {
                id:                camera
                anchors.centerIn:  parent
                width:             480
                height:            360
                captureResolution: "480x360"
            }
    
            Button {
                id:             startButton
                anchors.bottom: parent.bottom
                anchors.left:   parent.left
                width:          128
                text:           "Start"
    
                onClicked: {
                    camera.start();
                }
            }
    
            Button {
                id:             stopButton
                anchors.bottom: parent.bottom
                anchors.right:  parent.right
                width:          128
                text:           "Stop"
    
                onClicked: {
                    camera.stop();
                }
            }
        }
    }
    and here are the test results:

    1. When I start this app, camera preview video appears on the screen. If I swipe application to background without pressing "Stop" button, I have application crash with the following lines in application output:

    Code:
    Using the meego graphics system
    Successfully resolved MeeGo graphics system: /usr/lib/qt4/plugins/graphicssystems/libqmeegographicssystem.so 
    
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    MeegoGraphics: found EGL_NOK_image_shared
    MeegoGraphics: found EGL_KHR_lock_surface2
    MeegoGraphics: found EGL_KHR_fence_sync
    hijackWindow() context created for QmlApplicationViewer(0xaebe7ad4) 1 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x299948) 
    hijackWindow() context created for QWidget(0x4d100) 2 
    QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss 
    libomap3camd 1.114
    libomap3camd 1.114
    libomap3camd 1.114
    Meego graphics system destroyed
    Illegal instruction
    2. If I press "Stop" button first and then swipe application to background, it doesn't crash. However, if I then push it to foreground and press "Start" button, it crashes immediately like this:

    Code:
    Using the meego graphics system
    Successfully resolved MeeGo graphics system: /usr/lib/qt4/plugins/graphicssystems/libqmeegographicssystem.so 
    
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    MeegoGraphics: found EGL_NOK_image_shared
    MeegoGraphics: found EGL_KHR_lock_surface2
    MeegoGraphics: found EGL_KHR_fence_sync
    hijackWindow() context created for QmlApplicationViewer(0xaed90ad4) 1 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x299768) 
    hijackWindow() context created for QWidget(0x4d100) 2 
    QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss 
    libomap3camd 1.114
    libomap3camd 1.114
    libomap3camd 1.114
    Meego graphics system destroyed
    Using the meego graphics system
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    hijackWindow() context created for QmlApplicationViewer(0xaed90ad4) 1 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    QGLWindowSurface: Using plain widget as window surface QGLWindowSurface(0x5e4408) 
    hijackWindow() context created for QWidget(0x4d100) 2 
    QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss 
    Found SGX/MBX driver, enabling FullClearOnEveryFrame 
    Found v1.4 driver, enabling brokenTexSubImage 
    Segmentation fault
    This was tested on the latest available N950 firmware (1.2011.34-2_PR_RM680).

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: N950 & QML Camera = segmentation fault?

    Hi,
    The code looks okay to me. I tested this on my N9 and it crashed, so I think it's a bug.
    Please report it to https://bugreports.qt.nokia.com

  6. #6
    Regular Contributor
    Join Date
    Mar 2011
    Posts
    111

    Re: N950 & QML Camera = segmentation fault?

    Quote Originally Posted by gnuton View Post
    Hi,
    The code looks okay to me. I tested this on my N9 and it crashed, so I think it's a bug.
    Please report it to https://bugreports.qt.nokia.com
    Thank you, I have reported it:

    http://bugreports.qt.nokia.com/browse/QTMOBILITY-1881

    I hope that Qt Mobility team will take a look.

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: N950 & QML Camera = segmentation fault?

    Watching it.
    Thanks for filing the bug.

    Micheal will answer as soon as possible, don't worry! ;D

  8. #8
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    445

    Re: N950 & QML Camera = segmentation fault?

    lostdev, have you found a workaround for this bug?

  9. #9
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: N950 & QML Camera = segmentation fault?

    pixsta,

    Doing the below should be the workaround if you are using QML components -

    "
    - If you use the QML Camera or Video elements of the Qt Mobility

    Multimedia API, use QGLWidget as a viewport or the

    application crashes when swiped. In other words, the main.cpp should

    look something like this:



    #include <QtGui/QApplication>

    #include <QtOpenGL/QGLWidget>

    #include <QtDeclarative>



    int main(int argc, char *argv[])

    {

    QApplication app(argc, argv);

    QDeclarativeView view;

    view.setViewport(new QGLWidget());

    view.setSource(QUrl("qrc:/qml/main.qml"));

    view.showFullScreen();

    return app.exec();

    }



    Correspondingly, include the following line in the .pro file:



    QT += opengl

    "

  10. #10
    Regular Contributor
    Join Date
    Apr 2008
    Posts
    445

    Re: N950 & QML Camera = segmentation fault?

    Thanks! Works like a charm.

  11. #11
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    145

    Re: N950 & QML Camera = segmentation fault?

    didn't work for me. i still get a segmentation error. When i don't use the QGLWidget i don't get the segmentation error.
    however i am using QAbstractVideoSurface and not sure whether it is due to that

  12. #12
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: N950 & QML Camera = segmentation fault?

    Ah, If you are using QAbstractVideoSurface by subclassing it in N9 as in the qcamera example in the demo folder of qtmobility, it does not work on N9.
    There is a bug filed for the issue, but none has touched it so far.
    Yes, as you mentioned it is not segmentation fault in this case but just taht a black screen appears with errors as -
    virtual GstElement* QGstreamerGLTextureRenderer::videoSink() : Fallback to
    QVideoSurfaceGstSink since EGLImageTextureHandle is not supported
    Failed to start video surface
    CameraBin error: "Internal data flow error."

    https://bugreports.qt.nokia.com/browse/QTMOBILITY-1963

  13. #13
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: N950 & QML Camera = segmentation fault?

    Oh this is a very popular bug! I invite people to vote for this bug in order to have it fixed as soon as possible.
    Thanks

Similar Threads

  1. a segmentation fault
    By yaohao@nokia in forum Qt
    Replies: 13
    Last Post: 2011-03-18, 05:25
  2. Segmentation Fault?
    By LarryP in forum [Archived] Qt SDKs and Tools
    Replies: 6
    Last Post: 2010-11-17, 18:30
  3. Segmentation fault problem
    By NMMA in forum Qt
    Replies: 8
    Last Post: 2010-06-17, 11:53

Posting Permissions

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