Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Gstreamer error only when running app with sudo
Forum Updated to NodeBB v4.3 + New Features

Gstreamer error only when running app with sudo

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 491 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    respect88
    wrote on last edited by respect88
    #1

    When I run my Python/QML app with sudo, it doesn't play the WAV file, and shows the error below. But if I run the app without sudo it works fine and I hear the sound. I am pretty sure I just need to configure something for maybe gstreamer and the root user but I am not sure what to do? Any ideas? I installed X and the i3 window manager on my own.

    I am using Ubuntu 20.04 with Python 3.7 and PySide2 5.15 and QML.

    ubuntu@ubuntu:~$ sudo ./main 
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    
    qrc:/resources/qml/main.qml:42:13: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column. Column will not function.
    Error: "" : "no element \"identity\""
    
    (main-gui:1975): GLib-GObject-CRITICAL **: 15:46:39.121: g_object_set: assertion 'G_IS_OBJECT (object)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_object_ref: assertion 'object != NULL' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_bin_add_many: assertion 'GST_IS_ELEMENT (element_1)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.121: gst_object_unref: assertion 'object != NULL' failed
    Error: "" : "no element \"identity\""
    
    (main-gui:1975): GLib-GObject-CRITICAL **: 15:46:39.122: g_object_set: assertion 'G_IS_OBJECT (object)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_object_ref: assertion 'object != NULL' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_bin_add_many: assertion 'GST_IS_ELEMENT (element_1)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed
    
    (main-gui:1975): GStreamer-CRITICAL **: 15:46:39.122: gst_object_unref: assertion 'object != NULL' failed
    
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, every recent Linux distribution has disabled root access to X by default. You have to explicitly enable that before calling sudo.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • R Offline
        R Offline
        respect88
        wrote on last edited by
        #3

        On my system, the root user seems to be able to run X apps fine.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Calling them with sudo from your standard user ?
          Can you give an example ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved