Raspberry && Qt5 && play mp3 problem
-
Hi all,
I built Qt 5.1.0 for my Raspberry and I can build my qt applications for the board.Now I have some problem when trying to play mp3 with QMediaPlayer:
@
QMediaPlayer *player = new QMediaPlayer;
player->setMedia(QUrl::fromLocalFile("/tmp/alarm.mp3"));
player->setVolume(50);
player->play();
@When I execute the code I get the following message and I can't hear the sound:
@
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
@When configuring Qt 5 I get the following report:
@
Configure summaryBuilding on: linux-g++ (i386, CPU features:)
Building for: devices/linux-rasp-pi-g++ (arm, CPU features:)
Platform notes:- Also available for Linux: linux-kcc linux-icc linux-cxx
Build options:
Configuration .......... accessibility alsa audio-backend c++11 clock-gettime clock-monotonic concurrent cross_compile egl eglfs evdev eventfd force_debug_info freetype full-config getaddrinfo getifaddrs iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis opengl opengles2 openssl pcre png qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-zlib v8 v8snapshot
Build parts ............ libs
Mode ................... release (with debug info)
Using C++11 ............ yes
Using PCH .............. no
Target compiler supports:
iWMMXt/Neon .......... no/yesQt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
JavaScriptCore JIT ..... yes (To be decided by JavaScriptCore)
QML debugging .......... yes
Use system proxies ..... noSupport enabled for:
Accessibility .......... yes
ALSA ................... yes
CUPS ................... no
FontConfig ............. no
Iconv .................. yes
ICU .................... yes
Image formats:
GIF .................. yes (plugin, using system library)
JPEG ................. yes (plugin, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
Glib ................... no
GStreamer .............. no
GTK theme .............. no
Large File ............. yes
libudev ................ yes
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
OpenSSL .............. yes (loading libraries at run-time)
NIS .................... yes
OpenGL ................. yes (OpenGL ES 2.x)
OpenVG ................. no
PCRE ................... yes (bundled copy)
pkg-config ............. yes
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ yes
KMS .................. no
LinuxFB .............. yes
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
udev ................... yes
xkbcommon .............. no
zlib ................... yes (system library)
@As you can see, there is:
@
GStreamer .............. no
@and I think this is the problem but I don't know how to enable GStreamer.
I installed all the required libraries in the Raspberry:
@
apt-get install libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad@
Can you help me?
-
Hi,
I had same issue on my pi, but my Qt was in 5.0.2 version, and didn't find solutions to solve this problem ;/, somewhere i've read that there is a problem with gstreamer for Pi maybe it has solved. But i've lost my cross-compiled Qt for Pi, and now i have problems to cross-compile Qt for Pi. Can you provide a good tutorial for it? -
Hi,
I have followed the guidelines from the following sites:
http://creeder.com/?page=RaspberryPi
http://qt-project.org/wiki/RaspberryPi_Beginners_guide
http://www.ics.com/blog/building-qt-5-raspberry-pi#.Up2JksTmOaoIf you want to compile 5.1.1, remember to do a
@git checkout v5.1.1@I used the patches from "bakeqtpi":git://gitorious.org/bakeqtpi/bakeqtpi.git
and also I had to add "patch to qeglfshooks_pi.cpp":https://codereview.qt-project.org/#patch,sidebyside,65404,2,mkspecs/devices/linux-rasp-pi-g%2B%2B/qeglfshooks_pi.cpp to avoid compilation error. -
... I also tried to compile gst-omx as described @ http://creeder.com/?page=RaspberryPi but without luck - have read that the branch has been renamed from raspberrypi to 0.10. If you know how to preceed from here please share :)
-
[quote author="helthans" date="1398836868"]Unfortunately I havent had time to look more into this issue, so I haven't had any progress.[/quote]
So is there any other way to replace gstreamer?
I used a different ARM board, but I think it's the same situation.
To get the board run with audio program, I tried QSound, but there's no device in /dev/dsp, and I tried to add it back, but no way seemed to work.
And I also tried QMediaPlayer, and installed gstreamer on the board, didn't work either. -
I'm really not sure. Lately I have been working with Odroid U3 board, which is also ARM based, and for this board the situation is completely different, but not sure why. I have compiled Qt5 using the same approach as for raspberry pi but things just works here :) The gstreamer is recognized the required libs for playing video and audio are created such that QMediaPlayer can handle audio and video. So far I have been able to play mpeg, m4a and aac without problems. The only issue I have right now, is that video is not hardware decoded and hence 1080p video is not played smoothly.
-
Problem solved !
install the whole gstreamer 0.10 package by using,
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev
sudo apt-get install gstreamer0.10*this works for me..