Important: Please read the Qt Code of Conduct -

QMediaPlayer set playing device

  • I have multiple audio devices on my computer. How can i select the right one and the audio to be routed to the good one.?

  • Just to explain a bit more.. I have 3 playing devices into my computer 1 is HDMI, the second is the motherboard audio and third, it is a USB audio. now, without doing anything, when I'm calling play() function is playing on the default system board which is the motherboard audio. But both the motherboard and the USB have the speakers connected it to them. And I wish the sound to come out on the USB only not on the how can I do that without making the USB default in Linux (by the way I'm using Ubuntu Linux)...
    any option?? your help will be highly appreciated...

  • ok I've tried this application Media Player example from Qt and this is what I'm getting after uploading it to my pi.... any good help on this??

    Starting /home/pi/player...
    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).
    (player:6588): GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
    (player:6588): GStreamer-CRITICAL **: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed
    User requested stop. Shutting down...
    Application finished with exit code 1.

  • Just for other that have similar problems like me, I've sorted it out! The problem was that the gstreamer was not installed and when I've proceeded with the installation,

    sudo apt-get install gstreamer1*

    I've got this error

    The following packages have unmet dependencies:
     gstreamer1.0-omx-dbg : Depends: gstreamer1.0-omx (= but 1.10.4-1+rpt2 is to be installed
    E: Unable to correct problems, you have held broken packages.

    What I've done was to install the list one by one except for the "gstreamer1.0-omx-dbg"

    and now, on Raspberry Pi QMediaPlayer is working fine on default output device.

  • Lifetime Qt Champion

    Glad you found out and thanks for the feedback !

Log in to reply