This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Camera streaming issue

Part Number: AM5728

Tool/software: Linux

Hello there,

We're having AM5728 based custom board, on VIN1 Port A we have connected our camera module. Camera creates a video node /dev/video1.

We are running a QT5.5 based application upon EGLFS platform. Previously we were using Wayland based platform, on which camera was working fine.

After switching to EGLFS, when we try to run the Qt's example camera app from, /usr/share/qt5/examples/multimediawidgets/camera/camera, camera doesn't display live stream. The behavior is random, once in 5-6 times, we can see the camera app working fine and we can see the stream on the LCD, rest of the time, the stream doesn't come on LCD and below errors print on the console.

root@raymond-gdm:/opt/GDM# sh run_camera.sh
[ 3621.998258] PVR_K: UM DDK-(3699939) and KM DDK-(3699939) match. [ OK ]
PVR:(Error): SrvInit: PVRSRVInitSrvConnect failed (129) [0, ]
/usr/bin/pvrsrvctl: SrvInit failed (already initialized?) (err=PVRSRV_ERROR_SRV_CONNECT_FAILED)
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms")
qt.qpa.egldeviceintegration: Using base device integration
qt.qpa.input: evdevkeyboard: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x8)
qt.qpa.input: Found matching devices ("/dev/input/event1")
qt.qpa.input: Adding keyboard at "/dev/input/event1"
qt.qpa.input: Try to create keyboard handler for "/dev/input/event1" ""
qt.qpa.input: Opening keyboard at "/dev/input/event1"
qt.qpa.input: Create keyboard handler with for device "/dev/input/event1"
qt.qpa.input: Unload current keymap and restore built-in
qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
qt.qpa.input: evdevmouse: Using device discovery
qt.qpa.input: udev device discovery for type QFlags(0x1|0x2)
qt.qpa.input: Found matching devices ()
qt.qpa.input: Initializing tslib plugin "TsLib" ""
qt.qpa.input: tslib device is "/dev/input/event0"
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
qt.qpa.input: Initializing tslib plugin "tslib" "/dev/input/event0"
qt.qpa.input: tslib device is "/dev/input/event0"
[ 3622.578363] vip1-s0: VIP_PORTA_OUTPUT_FIFO_YUV
[ 3622.584290] vip1-s0: vip_overflow_recovery_work: Port A
[ 3622.611693] vip1-s0: VIP_PORTA_OUTPUT_FIFO_YUV
[ 3622.616421] vip1-s0: vip_overflow_recovery_work: Port A
[ 3622.645026] vip1-s0: VIP_PORTA_OUTPUT_FIFO_YUV
[ 3622.649739] vip1-s0: vip_overflow_recovery_work: Port A
[ 3622.678360] vip1-s0: VIP_PORTA_OUTPUT_FIFO_YUV
[ 3622.683826] vip1-s0: vip_overflow_recovery_work: Port A
[ 3622.711693] vip1-s0: VIP_PORTA_OUTPUT_FIFO_YUV
[ 3622.717199] vip1-s0: vip_overflow_recovery_work: Port A
[ 3622.724115] vip1-s0: vip_overflow_recovery_work: num_recovery limit exceeded leaving disabled

Text in bold fonts are my concern. I have checked the driver code, it seems like driver is giving up on not having interrupts from camera port and it's trying 5 times.

I have also checked the vip interrupts while the app is running and found out that, when camera doesn't show stream on LCD, vip interrupt doesn't increase. On the other hand, when we see camera's stream on the LCD, the interrupts on vip increases. Below is the way I check the interrupts for vip.

root@raymond-gdm:/opt/GDM# cat /proc/interrupts | grep vip
354: 65946 0 CBAR 351 Level vip1-s0
355: 0 0 CBAR 392 Level vip1-s1

Any help would be highly appreciated. I can also provide camera invoke script if needed.

Thanks,

Divyeshkumar M

  • The software team have been notified. They will respond here.
  • QT camera app may have some issues with the multimedia widgets. You can run the camera using V4L2 APIs with eglfs plugin. Check the video-graphics-test application under example-applications in PLSDK 3.3 release for capturing through V4L2 APIs and hardware accelerated rendering through eglfs. It uses eglfs_kms plugin.
  • I have already created an App based on QML using V4L2, and we're having stream from that app. I can port the same logic for a QWidget based app, just that I don't know how to display the stream on the QWidget based app. Can you help with that?

    I can try the example application you mentioned.

    Thanks.
  • Hi, I have tried to compile that App through Qt Creator but it gave me below errors:

    error: No rule to make target '/media/mreigada/Storage/mgc/2015.12.150/codebench/mel/ade/ade-core-image-base-raymond-gdm-2015.12.1496688830/sysroots/cortexa15hf-vfp-neon-mel-linux-gnueabi/usr/lib/libQt5PlatformSupport.a', needed by 'graphicsTest'. Stop.

    Than, I added
    QT += gui-private
    in the .pro file and it compiled it fine.

    I tried to run that binary and it crashed with following log:

    PVR:(Error): SrvInit: PVRSRVInitSrvConnect failed (129) [0, ]
    /usr/bin/pvrsrvctl: SrvInit failed (already initialized?) (err=PVRSRV_ERROR_SRV_CONNECT_FAILED)
    qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms")
    qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms")
    qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
    qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
    qt.qpa.eglfs.kms: Creating GBM device for file descriptor 4 obtained from "/dev/dri/card0"
    failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
    failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or diy
    loaded module : gbm_pvr.so
    found valid GBM backend : gbm_pvr.so
    qt.qpa.input: evdevkeyboard: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags(0x8)
    qt.qpa.input: Found matching devices ("/dev/input/event1")
    qt.qpa.input: Adding keyboard at "/dev/input/event1"
    qt.qpa.input: Try to create keyboard handler for "/dev/input/event1" ""
    qt.qpa.input: Opening keyboard at "/dev/input/event1"
    qt.qpa.input: Create keyboard handler with for device "/dev/input/event1"
    qt.qpa.input: Unload current keymap and restore built-in
    qt.qpa.input: numlock=0 , capslock=0, scrolllock=0
    qt.qpa.input: evdevmouse: Using device discovery
    qt.qpa.input: udev device discovery for type QFlags(0x1|0x2)
    qt.qpa.input: Found matching devices ()
    qt.qpa.input: Initializing tslib plugin "TsLib" ""
    qt.qpa.input: tslib device is "/dev/input/event0"
    qt.qpa.eglfs.kms: QEglFSKmsDevice::createScreens
    qt.qpa.eglfs.kms: "None1" mode count: 1
    qt.qpa.eglfs.kms: mode 0 800 x 480 @ 60 hz
    qt.qpa.eglfs.kms: Selected mode 0 : 800 x 480 @ 60 hz for output "None1"
    qt.qpa.eglfs.kms: "HDMI1" mode count: 0
    No modes available for output "HDMI1"
    qt.qpa.input: Initializing tslib plugin "tslib" "/dev/input/event0"
    qt.qpa.input: tslib device is "/dev/input/event0"
    ERROR:drm_crtc_resolution:636: drmModeGetResources failed: Inappropriate ioctl for device




    Could you suggest me what I am doing wrong?

    thanks,
    Divyeshkumar
  • Are you getting this error running video-graphics-test app or your custom app?? Is weston disabled?
  • Hi M. Divyeshkumar, TI,


    Sorry to add a message here but I'm working also on the video input port. I start to create an I2C driver to handle my imager on the DTS file.

    I would like to know if you also create a specific driver for your camera. If no how did you succeed to bind the camera on the DTS file ?


    At this point my driver is still failing due to v4l2_ctrl_handler_setup fct answering -22. So I'm not able to get data from the imager. I will create another post on the TI forum to not disturb here.

    Thanks and Best regards,
    François
  • Hey Manisha,

    I am getting this error while running the video-graphics-test app and weston is disabled on my platform.

    I would also like to know the source of

    "status.drm_fd = (int) platInf->nativeResourceForIntegration("drm_fd");" and "status.drm_plane_sreq_handler = (drm_plane_sreq)platInf->nativeResourceForIntegration("drm_plane_set_req");"

    in mainwindow.cpp of the video-graphics-test app.

    In RDK 3.03, I couldn't find the file "video_graphics_test.sh", which as per Makefile.build should be there.

    I doubt I am not running the app with proper environment variables set. Please suggest how to run the app too.

    Edit: For "eglfs_kms" plugins, I am not able to see labels (Any text) on my GUI. I have tried this on other App and also on video_graphics_test app without camera stream (I have tricked with the code to atleast get the UI). I am attaching the script I use to invoke the video_graphics_test App.

    root@raymond-gdm:/opt/GDM# cat run_camera.sh
    #!/bin/bash

    # Load powevr gpu driver

    /etc/init.d/rc.pvr start

    export LIBDRM_WRITER_DRM_DEVICE_NUMBER=0
    export LIBDRM_WRITER_DEBUG_LEVEL=0

    export QT_LOGGING_RULES=qt.qpa.*=true

    export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
    export QT_QPA_PLATFORM=eglfs

    export QML_DISABLE_DISTANCEFIELD=1

    export QT_QPA_EGLFS_HIDECURSOR=1

    export QT_QPA_FB_DISABLE_INPUT=0
    export QT_QPA_EGLFS_DISABLE_INPUT=0

    export QT_QPA_EGLFS_PHYSICAL_WIDTH=800
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=480

    #export QT_DEBUG_PLUGINS=1

    export TSLIB_TSEVENTTYPE=INPUT
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_CONSOLEDEVICE=none
    export TSLIB_TSDEVICE=/dev/input/event0
    export TSLIB_CALIBFILE=/mnt/overlays/tslib/calibration.conf
    export TSLIB_PLUGINDIR=/usr/lib/ts
    export TSLIB_CONFFILE=/etc/ts.conf
    export QT_QPA_FB_TSLIB=1
    export QT_QPA_EGLFS_TSLIB=1

    if [ ! -e "/mnt/overlays/tslib/calibration.conf" ]; then
    mkdir -p /mnt/overlays/tslib/
    ts_calibrate
    fi;

    /media/sda1/video_graphics_test -platform eglfs -plugin tslib:/dev/input/event0

    Kindly go through it and let me know if you see a breach.

    Regards,

    Divyeshkumar 

  • No need to modify the qt environment variable. Just boot the board, stop the weston and then from command prompt, type following -

    #export QT_QPA_EGLFS_INTEGRATION=eglfs_kms

    #video-graphics-test -platform eglfs

    There is no video-graphics-test.sh available in PLSDK release today. 

    You can find the source code for eglfs_kms when you clone arago repository and build config files (version 3.3 and above)  from Processor SDK. 

  • Hi Manisha, 

    I am able to run the app with additional,

    #export QT_QPA_EGLFS_HIDECURSOR=1

    But, as I mentioned above, main issue is, I am not getting Labels (Any text) on buttons in the running app, I can see the buttons, I can click on them and they function well, But I could not see the labels on the Buttons (I have inserted a Photo for your clarification, the buttons without text/label shown in red mark). I am having same issue with other custom app. Is there anything I am missing?



    Kindly suggest.

    Regards,
    Divyeshkumar

  • Hi Divyesh,

    video-graphics-test application has color of the box drawn in white and the text in black. If you are running video-graphics-test application without any modification, I would have expected same color, but it seems that boxes are being drawn as blue color. If colors are messed, then text might not be showing because color of the text might be same as the color of the box. There shouldn't any other reason for box being shown but no color.
  • Do you have AM57x EVM and did you you try running the demo using PLSDK release?
  • Hi Manisha,

    The button is not of color blue, it is of white, it's just the photo taken with an angel that shows the button as blue. I did not run the demo on PLSDK.

    The progress is, I am able to get the camera feed on my custom app. But, in the custom app too, labels/text is not being rendered.

    All the buttons labels and other text are not being displayed, I can do all the functions through pressing those blank buttons though.

    If I change, QT_QPA_EGLFS_INTEGRATION to "none" from "eglfs_kms", than I can see my custom app being rendering text and labels perfectly, but in this case I can not get the camera feed displayed on the screen.

    Can you suggest a reason for text/label not being rendered while "QT_QPA_EGLFS_INTEGRATION=eglfs_kms"?


    Really appreciate your help.

     

    Regards,

    Divyeshkumar

  • One of the plane being seen (video or graphics) but not both could be due to zorder settings but if you see both the planes but only text is missing, then some QT usage related issue and I do not have any comment there.
  • Right,

    I thought of same. Anyway, I really appreciate your help. I may post back this thread once i'll figure out the solution.

    Thanks & Regards,
    Divyeshkumar
  • Adding a custom style sheet to the buttons solved the problem.

    Thanks for help though.

    Regards,

    Divyeshkumar