I just need to play simple audio wav or mp3 file from QT 5.1 application running on Raspberry Pi.
My console application is successfully building and deploying to pi.
However I'm getting a message when I try to play the file:
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
I try to play the file like this:
QMediaPlaylist * playlist = new QMediaPlaylist;
playlist->addMedia(QUrl::fromLocalFile(hall1_5min));
playlist->addMedia(QUrl::fromLocalFile(hall1_start));
playlist->setCurrentIndex(1);
QMediaPlayer * player = new QMediaPlayer;
player->setPlaylist(playlist);
player->play();
As I understand there is something wrong with my QTMultimedia compilation.. I need help with that.
I've compiled with these instructions.
I've installed some gstreamer packages as mentioned above,
However, when I compile QTMultimedia module
when running qmake - it doesn't detect gstreamer..
How can I compile QTMultimedia with explicitly specified gstreamer or other media service driver?
If QtMultimedia is not being built, how can you expect it to work running the application?
That probably means you're still missing some dependencies or something else is wrong with your env. Maybe you didn't set pkgconfig paths correctly. You can also try with this guide I wrote: http://thebugfreeblog.blogspot.it/2013/03/bring-up-qt-501-on-raspberry-pi-with.html. I had issues with audio and gstreamer, but some time has passed and something might have changed since then.
If after building and deploying the QtMultimedia module and the gstreamer plugin you still get that, use the QT_DEBUG_PLUGIN env variable to get some logs.
Related
I'm working with a DEBIAN OS that it have an enviroment configured to work with a cross platform arm device with yocto.
After following the provider instructions:
Set up OS env with a script
open qtcreator from a terminal with the custom enviroment
add a kit with custom qmake, gcc and gdb (there is no warning)
add the device sysroot & ip (all tests ok)
Seems like all is ok but when i try to apply this changes i receive the following message:
Failed to set up kit for Qbs: Could no determine whether Qt is a
static build.
and the kit is not appearing when i try to create a new project.
i already check this pages and all explained there is done:
http://doc.qt.io/qtcreator/creator-targets.html
https://support.emtrion.de/en/details_operating-systems/linux-37.html?file=files/content/emtrion/downloads/emLinux-documentation-v008en.pdf
any clue about what is going wrong here?
Thanks by your time.
EDIT
i'm using qt-creator 4.7 and the current configuration works properly at 4.2 version.
the Qt version used fot the kit give the follow message at both versions:
ABI detection failed: Make sure to use a matching compiler when building
here is an open post with a similar unsolved issue:
https://forum.qt.io/topic/88857/my-kit-isn-t-showing-up/15
Yesterday I installed Qt 5.4 on my windows 7 PC. But I can not build and run any Qt project including those given in Examples section on the Welcome page of Qt Creator 3.3 except for a few. Also, I can’t run any qml file either using this command from cmd: “qmlscene myqmlfile.qml”
Please note that I have added this path to my environment variables:
C:\Qt\Qt5.4.0\5.4\mingw491_32\bin
and Qt installation directory is
C:\Qt
The error message I get in the output window in Qt creator, and in console when running a qml file from cmd, is as follows:
QOpenGLShaderProgram::uniformLocation( qt_Matrix ): shader program is not linked
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShader: could not create shader
shader compilation failed:
""
Previously, I used PyQt5, and ran qml files using the command
qmlscene myqmlfile.qml
without any problem. Then installed Qt Creator 3.3 to run Qt projects, but failed (got some error saying problem in qmake). Finally I uninstalled PyQt5 and Qt Creator 3.3, downloaded Qt 5.4 and installed it, but still could not run Qt projects.
I found in some website, that I need open GL 2.0 to run Qt projects in Qt 5.4. How do I make sure that I have openGL 2.0? (I checked with GPU-Z and it shows my shader model 2.0 and I don’t know if it has anything to do with OpenGL :( )
Please help me correct whatever is wrong with my Qt installation. This is freaking annoying.
Make sure you have Intel Graphics Driver installed from Intel. Microsoft's default drivers do not include OpenGL support.
I've to say... why is so hard to deploy Qt5 in OS X?
After a lot of pain... and discovering this script: https://gist.github.com/lasconic/5965542 and this custom macdeployqt: https://github.com/MaximAlien/macdeployqt I was able to deploy in OSX... but audio is not working.
I've a simple SoundEffect element:
SoundEffect {
id: ring
loops: 1
source: "alarm03.wav"
}
it works fine running in debug/release mode from Qt Creator... but as soon as I run macdeployqt I start to get this error: using null output device, none available
and no sound is played.
Then I found that it could be the audio plugin missing... so I copied the plugins/audio folder to my app package.
Then I start to get an error in startup and the sound starts to play but it runs for about half second... and stops with another error.
The error in startup: http://pastebin.com/TFBgswfb
The error when try to play the sound: http://pastebin.com/KjQ3JCXJ
The error in startup I found that was because it was loading libraries from the app package and from my Qt installation (why??) so I renamed my installation folder to test... the error in startup disappeared... but the first error playing the sound returned.
So I'm out of ideas about what's happening... the only thing I know is that Qt needs a easier deployment system.
Versions: Qt 5.2 - Clang64 - Qt Creator 3.1
PS: My .pro file contains:
QT += sql multimedia
I cross compiled Qt 5.2.1 for TI AM335x board using the toolchain provided by TI together with their SDK 6.00.00.
Unluckily I am not able to reproduce any video in QML...
The debug console tells:
defaultServiceProvider::requestService(): no service found for – “org.qt-project.qt.mediaplayer”
Is there something that I am missing in cross-compilation? maybe some dependencies?
Can somebody help me in determining what I am missing?
You can find here my cross-compilation configuration and here the full trace of messages produced by the application when setting the environment variable QT_DEBUG_PLUGIN
You are missing a QtMultimedia backend that can actually play audio. Either it is not installed into the correct directory, or it was not built. Since your log output says that one backend (an audio capture one) was found, I'd rule out an installation problem.
You need to rebuild your QtMultimedia with the proper dependencies in place. For example, when gstreamer is found when building QtMultimedia, a GStreamer backend plugin will be built. The Qt documentation has a list of available backends.
When you build QtMultimedia, it will actually tell you what libraries it found, which is an indication of which backends will be built. Here is an example output when running qmake on QtMultimedia for desktop Linux - which built a gstreamer backend for me:
Running qmake /home/thomas/src/qt/qtmultimedia-stable ...
Info: creating cache file /home/thomas/build/qt/qtmultimedia-stable/.qmake.cache
Checking for openal... no
Checking for alsa... yes
Checking for pulseaudio... no
Checking for gstreamer... yes
Checking for gstreamer_photography... no
Checking for gstreamer_encodingprofiles... yes
Checking for gstreamer_appsrc... yes
Checking for resourcepolicy... no
I have installed Qt 5.0.1 - 32-bit Version on Ubuntu 12.04. All the programs crash at startup with the following messages :
The program has unexpectedly finished.
/home/manager/Qt5.0.1/5.0.1/gcc/examples/opengl/2dpainting-build-Desktop_Qt_5_0_1_GCC_32bit-Debug/2dpainting
exited with code 0
I tried:
Making the default Qml Application
Running a few example applications.
I switched between the debug and release modes as well, but all crashed with similar message. Surprisingly 'Animated Tiles example' works fine. Any suggestions ?
Edit:
In debug mode this is what i get:
Debugging starts
&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'
RTTI symbol not found for class 'QGLWidget'
I have same problem on Windows with Qt5. As i understood, in qt5 window subsystem moved into plugins and when application start, QApplication object can't find this libraries.
On windows I step-trace my app into Qt code, and find that plugins try to load from folder ./plugins/system where . is folder with our app binary. Also it was a problem with
dependence. Windows specific plugin dependence from libGLES.dll or libGLES2.dll. But GL libs must place in the same folder as app binary, not with plugins.
Correct file tree on Windows look like this
plugins
system
platform.dll
windows.dll
libGLES.dll
MyApp.exe
Try to look in this way.
Firstly check your graphics driver is installed.
Qt5 or higher version supports OpenGL 3.0 or higher, if your system is old one, i think you need to check the graphics card can support OPENGL verion as i mentioned above.
If above things are fine, then i think you need to install some opengl libraries that can be easily downloadable from Ubuntu.
Regards
Ansif