[IMX6] QtMultimedia : defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[IMX6] QtMultimedia : defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer

12,602 Views
vincentbodin
Contributor II

Hi,

Context : Yocto, imx6q

After some reading on Internet, I've decided to build a linux image usin yocto (with fsl comunity bsp. Today, I've succeed to create a minimal image with differents gstreamer1.0 plugins and it works fine. I then added Qt5 in my core image minimal and same, the Qt5cinematics example works like a charm accross eglfs.

To continue this experience, I've decided to test QtMultimedia that, if I correctly understand Qt documentation, needs gstreamer to work (gstreamer works as backend on linux for Qtmultimedia). So I retrieved the player example from Qt website and compile it in Qtcreator. All it's ok but when I run this application, I've got this error :

Console qtcreator : defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer

On my target got a popup that indicates : The QMediaPlayer object does not have a valide service. Please check the media service plugins are installed.

This my local.conf :

MACHINE ?= 'apalis-imx6'

DISTRO ?= 'poky'

PACKAGE_CLASSES ?= "package_rpm"

EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh"

USER_CLASSES ?= "buildstats image-mklibs"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS = "\

    STOPTASKS,${TMPDIR},1G,100K \

    STOPTASKS,${DL_DIR},1G,100K \

    STOPTASKS,${SSTATE_DIR},1G,100K \

    STOPTASKS,/tmp,100M,100K \

    ABORT,${TMPDIR},100M,1K \

    ABORT,${DL_DIR},100M,1K \

    ABORT,${SSTATE_DIR},100M,1K \

    ABORT,/tmp,10M,1K"

#PACKAGECONFIG_append_pn-qemu-native = " sdl"

#PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"

#ASSUME_PROVIDED += "libsdl-native"

CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"

IMAGE_INSTALL_append = " gcc g++ binutils libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev \

autoconf automake ccache chkconfig glib-networking glibmm \

packagegroup-core-buildessential pkgconfig  \

boost cmake zlib glib-2.0 packagegroup-fsl-tools-testapps  \

    cpufrequtils \

    nano \

    gdb \

    openssh-sftp-server \

    imx-vpu \

    imx-test \   

    qtbase-fonts \

    qtbase-plugins \

    qtbase-tools \

    qtdeclarative \

    qtdeclarative-plugins \

    qtdeclarative-tools \

    qtdeclarative-qmlplugins \

    qtmultimedia \

    qtmultimedia-plugins \

    qtmultimedia-qmlplugins \

    qtsvg \

    qtsvg-plugins \

    qtsensors \

    qtimageformats-plugins \

    qtsystems \

    qtsystems-tools \

    qtsystems-qmlplugins \

    qtscript \

    qtwebkit \

    qtwebkit-qmlplugins \

    qtgraphicaleffects-qmlplugins \

    qtconnectivity-qmlplugins \

    qtlocation-plugins \

    qtlocation-qmlplugins \

    cinematicexperience \

    cairo pango fontconfig freetype pulseaudio dbus \

    i2c-tools \

    gstreamer1.0-plugins-imx \

    gst1.0-fsl-plugin \

    gstreamer1.0-plugins-base \

    psplash \

"

DISTRO_FEATURES_remove = "x11 wayland"

IMAGE_INSTALL_remove = "eglinfo-x11"

KERNEL_IMAGETYPE = "uImage"

ACCEPT_FSL_EULA = "1"

IMAGE_FSTYPES += "ext3"

PREFERRED_PROVIDER_psplash = "meta-yocto"

What I miss ?

Thanks, Vincent

Labels (4)
13 Replies

3,879 Views
shawnbee
Contributor II

I met the same problem and I tried several methods above, but it didn't work.

My evb is IMX6Q-SABRESD;

I downloaded the latest linux source code:

fsl-yocto-L4.1.15_2.0.0-ga

repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1-krogoth -m
imx-4.1.15-2.0.0.xml

compile option:

1. DISTRO=fsl-imx-fb MACHINE=imx6qsabresd source fsl-setup-release.sh –b build-fb

2. modified my local.conf reference the answers in this website.

3. bitbake fsl-image-qt5 and bitbake fsl-image-qt5 -c populate_sdk

4. app is below

   import QtMultimedia 5.0
   Audio{
    id: audioMp3
    source: "file:///unit_tests/Qt5.6.2/sun.mp3"
    volume: 0.5
    autoPlay: true
    loops: Audio.Infinite
   }

Finally, it hinted

QtMultimedia : defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer

What can I do for this ?

0 Kudos

3,879 Views
shawnbee
Contributor II

3,879 Views
hanmo
Contributor II

Hi Shawn

I use qml to play media success, but failed with QMediaPlayer, Have you ever tried this?

1.qml src:

Rectangle {
color: "black"
anchors.fill: parent

MediaPlayer {

id: mediaPlayer
source: "file:///forlinux/video/test.mp4"
autoPlay: true

}

VideoOutput {

id: video
anchors.fill: parent
source: mediaPlayer

}

}

2.QMediaPlayer src:

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{

ui->setupUi(this);

videowidget = new QVideoWidget;

mediaplayer = new QMediaPlayer;
mediaplayer->setVideoOutput(videowidget);
mediaplayer->setMedia(QUrl::fromLocalFile("/home/root/test.mp4"));

videowidget->show();
mediaplayer->play();

}

Errors:

====== AIUR: 4.1.4 build on Mar 17 2018 00:02:44. ======
Core: MPEG4PARSER_06.09.36 build on Aug 23 2016 05:18:47
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm11_elinux.so.3.2
------------------------
Track 00 [video_0] Enabled
Duration: 0:00:09.360000000
Language: und
Mime:
video/x-h264, parsed=(boolean)true, alignment=(string)au, stream-format=(string)avc, width=(int)1920, height=(int)1080, framerate=(fraction)25/1, codec_data=(buffer)01640029ffe1001b67640029acd940780227e5c044000003000400000300c83c60c65801000468efbcb0
------------------------
------------------------
Track 01 [audio_0] Enabled
Duration: 0:00:09.334000000
Language: und
Mime:
audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)44100, bitrate=(int)3115, stream-format=(string)raw, codec_data=(buffer)1210
------------------------

====== BEEP: 4.1.4 build on Mar 17 2018 00:02:48. ======
Core: AAC decoder Wrapper build on May 30 2016 12:33:44
file: /usr/lib/imx-mm/audio-codec/wrap/lib_aacd_wrap_arm12_elinux.so.3
CODEC: BLN_MAD-MMCODECS_AACD_ARM_03.09.00_CORTEX-A8 build on Jul 13 2016 18:15:25.
[INFO] bitstreamMode 1, chromaInterleave 0, mapType 0, tiled2LinearEnable 0
Segmentation fault

Has anyone ever seen this error log? How to fix it?

0 Kudos

3,880 Views
charles-chau
Contributor II

This will enable GStreamer in Qt5 qtmultimedia_git.bb,

Add this line to your /build/conf/local.conf

PACKAGECONFIG_append_pn-qtmultimedia = " gstreamer"

Please take a look at the recipe and add your prefer PACKAGECONFIG[]

meta-qt5/qtmultimedia_git.bb at master · meta-qt5/meta-qt5 · GitHub

3,880 Views
vincentbodin
Contributor II

Please take a look at the recipe and add your prefer PACKAGECONFIG[]meta-qt5/qtmultimedia_git.bb at master · meta-qt5/meta-qt5 · GitHub

where I have to add my prefer package config ?It works with gstreamer 1.x ?

0 Kudos

3,880 Views
charles-chau
Contributor II

The PACKAGECONFIG variable helps in the configuration of packages by defining a number of features.

In the Qt Multimedia recipe, we see

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \

  ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"

PACKAGECONFIG[alsa] = ",,alsa-lib"

PACKAGECONFIG[pulseaudio] = ",,pulseaudio"

PACKAGECONFIG[openal] = ",,openal-soft"

PACKAGECONFIG[gstreamer] = ",,gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"

PACKAGECONFIG[gstreamer010] = ",,gstreamer gst-plugins-base gst-plugins-bad"

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \

  ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"

This means that it will check for alsa and pulseaudio in our DISTRO_FEATURES at the end of parsing process.  Then,  if it exist, it will add alsa, pulseaudio to the configuration.

However, you would not see that to openal, gstreamer, and gstreamer010.  Therefore, to have qt uses gstreamer, we need to add PACKAGECONFIG_append_pn-qtmultimedia = " gstreamer" to our local.conf

The syntax of PACKAGECONFIG is as follow:

PACKAGECONFIG[feature] = " --with-feature, --without-feature,build-dependencies-feature, runtime-dependencies-feature"

0 Kudos

3,880 Views
igorpadykov
NXP Employee
NXP Employee

Hi Vincent

latest 3.14.52 BSP release supports Qt 5.5 with hardware accelerated QML video,

attached release notes describes that in Table 6 Multimedia standard packages

sect.6.4 Freescale Qt Applications. Link below may be useful

https://community.freescale.com/thread/356797

Board Support Packages (29)

L3.14.52_1.1.0_MX6QDLSOLO (REV L3.14.52_1.1.0)

http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/i.mx-applications-process...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

3,880 Views
vincentbodin
Contributor II

Hi igorpadykov​,

Thanks for this answer. However, I don't understand the link between QtMultimedia anq QML ?

0 Kudos

3,880 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos

3,880 Views
vincentbodin
Contributor II

Ok but what I mean is that in the Qt player example there is no use of QMLso it's why I don't understand the link between QtMultimedia anq QML ?

0 Kudos

3,880 Views
igorpadykov
NXP Employee
NXP Employee

Enable Qt Multimedia

source/meta-qt5/recipes-qt/qt5/qtmultimedia_git.bb:

add “gstreamer” at the end of “PACKAGECONFIG ??=”

bitbake qtmultimedia

cp ./build-x11/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/qtmultimedia

/5.5.1+gitAUTOINC+0cf41ef53f-r0/image/usr/ / -a

export DISPLAY=:0

Video example application located at /usr/share/qt5/examples/multimedia/qmlvideo

0 Kudos

3,880 Views
vincentbodin
Contributor II

Hi igorpadykov​,

I'll test as soon as possible. Thanks for your support.

0 Kudos

3,880 Views
xinyu_chen
NXP Employee
NXP Employee

Hi Vincent

Please add the gstreamer build time dependency for qtbase, and some fix for qtmultimedia .bb file. Please refer to:

meta-qt-bsp/recipes-qt/qt5 at imx-4.1-krogoth · muddog/meta-qt-bsp · GitHub 

For qtbase bb file, add:

DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base"

For qtmultimedia .bb file, add:

EXTRA_QMAKEVARS_PRE_remove = "CONFIG+=done_config_gstreamer"

Thanks

0 Kudos