Discussion:
[Interest] QAudioDecoder: defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.audiodecode"
Till Oliver Knoll
2013-03-22 19:01:47 UTC
Permalink
Hi,

I am trying to learn OpenAL. For that I need to read simple *.wav files
and thought the QAudioDecoder (Qt 5.0.1 - OS X 10.8.2) would be a
perfect fit.

I have:

m_audioDecoder = new QAudioDecoder;
qDebug("Error: %s", qPrintable(m_audioDecoder->errorString()));
connect(m_audioDecoder, SIGNAL(bufferReady()),
this, SLOT(handleBufferReady()));
...
// select WAV file
...
m_audioDecoder->setSourceFilename(filePath);
m_audioDecoder->start();
...

When I run my application from within Qt Creator (in debug mode) I
immediatelly get on the console ("Application Output"):

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

Also the qDebug statement prints out:

Error: The QAudioDecoder object does not have a valid service

and when I execute start() my slot handleBufferReady() is hence never
called.


I also get lots of error messages upon application startup, such as

objc[747]: Class TransparentQTMovieView is implemented in both
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine.dylib
and
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine_debug.dylib.
One of the two will be used. Which one is undefined.
objc[747]: Class HiddenQTMovieView is implemented in both
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine.dylib
and
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine_debug.dylib.
One of the two will be used. Which one is undefined.
objc[747]: Class QTMovieObserver is implemented in both
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine.dylib
and
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine_debug.dylib.
One of the two will be used. Which one is undefined.

(and more)


AFAIK I never had problems with previous Qt Creator / Qt 4.8 versions
and debug/release plugins being mixed up - is that a known problem with
the stock binary Qt 5.0.1 distribution for Mac? Do I have to manually
move e.g. the _debug plugins into a dedicated folder, setup/modify the
plugin search path within my app and make sure that only those are
picked up when running my application in debug mode? Or is there a flag
in Qt Creator or some DEFINE I have to set?

At this point I did not any deployment (App Bundle), I simply start my
application from a fresh Qt 5.0.1 / Qt Creator installation.

By the way this is a simple QWidget based application as created from
the Qt Creator "MainWindow" template. I link with the OpenAL framework,
in case that matters (but I don't get any OpenAL related errors up to
that point, AFAICT).

The generated and modified *.pro file:

QT += core gui multimedia

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MyOpenAl
TEMPLATE = app


SOURCES += main.cpp\
MainWindow.cpp

HEADERS += MainWindow.h

FORMS += MainWindow.ui

LIBS += -framework OpenAL


Also I get lots of entries such as:

Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtmultimedia/src/plugins/audiocapture/.obj/debug-shared/audioencodercontrol.o"
- no debug information available for "audioencodercontrol.cpp".

I mean several dozens such entries (for several source files - they
probably don't harm, but are a bit annoying (I never had such console
output with Qt 4.x when debugging my applications, AFAICR).



Unrelated: it seems that (since Qt 4.7 or Qt 4.8 - but it was fixed in
between and is an ever re-occuring regression) in each binary Qt
distribution there seems to be another folder "missing" when linking my
own application:

ld: warning: directory not found for option
'-F/Users/tknoll/Qt5.0.1/5.0.1/clang_64/qtbase/lib'

Yes, that directory really does not exists (and my application links
just fine) - but still qmake seems to insist to add it to the linker
include paths. Harmless, but a little bit annoying ;)
Till Oliver Knoll
2013-03-22 19:04:14 UTC
Permalink
Post by Till Oliver Knoll
Hi,
...
defaultServiceProvider::requestService(): no service found for -
"org.qt-project.qt.audiodecode"
Error: The QAudioDecoder object does not have a valid service
By the way: the only related google entry I found so far (from February
21, 2013):

http://qt-project.org/forums/viewthread/25059

Exactly the same error. But no reply so far ;)

Cheers, Oliver
Till Oliver Knoll
2013-03-22 19:14:05 UTC
Permalink
Post by Till Oliver Knoll
...
I also get lots of error messages upon application startup, such as
objc[747]: Class TransparentQTMovieView is implemented in both
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine.dylib
and
/Users/tknoll/Qt5.0.1/5.0.1/clang_64/plugins/mediaservice/libqqt7engine_debug.dylib.
One of the two will be used. Which one is undefined.
...
(and more)
AFAIK I never had problems with previous Qt Creator / Qt 4.8 versions
and debug/release plugins being mixed up
In the meantime I have temporarily moved the debug versions of the plugins:

libqavfcamera_debug.dylib
libqavfmediaplayer_debug.dylib
libqqt7engine_debug.dylib
libqtmedia_audioengine_debug.dylib

into a directory where they are not "visible" to Qt applications
(launched from within Qt Creator).

It is notable that only the "mediaservice plugins" seem to have this
issue. Other plugins - e.g. the image plugins - do not show those "Class
foo is implemented in both... One of the two will be used." messages.

However I still get the

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

message. Do I need to install more "audiodecode" plugins?



Also I still get all the other messages, for the record:

Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/platforms/minimal/.obj/debug-shared/main.o"
- no debug information available for "main.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/platforms/minimal/.obj/debug-shared/qminimalintegration.o"
- no debug information available for "qminimalintegration.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/platforms/minimal/.obj/debug-shared/qminimalbackingstore.o"
- no debug information available for "qminimalbackingstore.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/lib/libQt5PlatformSupport_debug.a(qunixeventdispatcher.o)"
- no debug information available for
"eventdispatchers/qunixeventdispatcher.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/lib/libQt5PlatformSupport_debug.a(qgenericunixeventdispatcher.o)"
- no debug information available for
"eventdispatchers/qgenericunixeventdispatcher.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/lib/libQt5PlatformSupport_debug.a(moc_qunixeventdispatcher_qpa_p.o)"
- no debug information available for
".moc/debug-shared/moc_qunixeventdispatcher_qpa_p.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtdeclarative/src/plugins/accessible/quick/.obj/debug-shared/qqmlaccessible.o"
- no debug information available for "../shared/qqmlaccessible.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtdeclarative/src/plugins/accessible/quick/.obj/debug-shared/main.o"
- no debug information available for "main.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtdeclarative/src/plugins/accessible/quick/.obj/debug-shared/qaccessiblequickview.o"
- no debug information available for "qaccessiblequickview.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtdeclarative/src/plugins/accessible/quick/.obj/debug-shared/qaccessiblequickitem.o"
- no debug information available for "qaccessiblequickitem.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/main.o"
- no debug information available for "main.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/simplewidgets.o"
- no debug information available for "simplewidgets.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/rangecontrols.o"
- no debug information available for "rangecontrols.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/complexwidgets.o"
- no debug information available for "complexwidgets.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/qaccessiblewidgets.o"
- no debug information available for "qaccessiblewidgets.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/qaccessiblemenu.o"
- no debug information available for "qaccessiblemenu.cpp".
Could not find object file
"/Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/qt5_workdir/w/s/qtbase/src/plugins/accessible/widgets/.obj/debug-shared/itemviews.o"
- no debug information available for "itemviews.cpp".



Thanks,
Oliver
Till Oliver Knoll
2013-03-25 13:25:22 UTC
Permalink
Post by Till Oliver Knoll
Hi,
I am trying to learn OpenAL. For that I need to read simple *.wav files
and thought the QAudioDecoder (Qt 5.0.1 - OS X 10.8.2) would be a
perfect fit.
m_audioDecoder = new QAudioDecoder;
qDebug("Error: %s", qPrintable(m_audioDecoder->errorString()));
connect(m_audioDecoder, SIGNAL(bufferReady()),
this, SLOT(handleBufferReady()));
...
// select WAV file
...
m_audioDecoder->setSourceFilename(filePath);
m_audioDecoder->start();
...
When I run my application from within Qt Creator (in debug mode) I
defaultServiceProvider::requestService(): no service found for -
"org.qt-project.qt.audiodecode"
Okay, so I have done some google research: it seems that the
Q_MEDIASERVICE_AUDIODECODER ("org.qt-project.qt.audiodecode")
interface is simply not implemented on Mac (OS X), e.g.in the
QuickTime 7 based plugin:

http://qt.gitorious.org/qt/qtmultimedia/blobs/stable/src/plugins/qt7/qt7serviceplugin.mm

or in the AV Foundation based plugin:

http://qt.gitorious.org/qt/qtmultimedia/blobs/stable/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm

Note that in the create() method the only supported key seems to be
Q_MEDIASERVICE_MEDIAPLAYER.

As opposed to e.g. the GStreamer based plugin implementation:

http://qt.gitorious.org/qt/qtmultimedia/blobs/stable/src/plugins/gstreamer/audiodecoder/qgstreameraudiodecoderserviceplugin.cpp

which seems to have a dedicated QAudioDecoder plugin (the create()
method reacts upon the Q_MEDIASERVICE_AUDIODECODER key.

The supported key(s) for the GStreamer based AudioDecorder plugin are
also listed here, as I just figured out:

http://qt.gitorious.org/qt/qtmultimedia/blobs/stable/src/plugins/gstreamer/audiodecoder/audiodecoder.json


However I don't find any such key in the AV Foundation based Mac plugins:

http://qt.gitorious.org/qt/qtmultimedia/trees/stable/src/plugins/avfoundation

(Nor in the QuickTime 7 based plugin:
http://qt.gitorious.org/qt/qtmultimedia/trees/stable/src/plugins/qt7
which is probably outdated anyway: AV Foundation seems to be the way
to go now).

(I assume the above links point to the latest Master branch ;)).


That seems to strongly imply that there is no QAudioDecoder support on
Mac for now :( And as QMultimedia was last maintained in Australia
(http://qt-project.org/wiki/Maintainers) I am not sure if anyone is
still working on that one (Michael Goddard)? Well, at least there are
still commits to QMultimedia:

https://qt.gitorious.org/qt/qtmultimedia

(Hint hint: we want audio decoding support on Mac ;))


In the meantime I will probably totally *mis-use* the private
https://qt.gitorious.org/qt/qtmultimedia/blobs/stable/src/multimedia/audio/qwavedecoder_p.h,
as decoding simple (Mono, 16bit 44 KHz PCM data) WAVE files is all I
really need for now >:)


For anyone who wants to jump in: in the "OpenAL Example"

http://developer.apple.com/library/mac/#samplecode/OpenALExample/Listings/MyOpenALSupport_c.html#//apple_ref/doc/uid/DTS10003587-MyOpenALSupport_c-DontLinkElementID_5

I stumbled over the function "ExtAduioFileOpen" that they use in that example:

https://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html

"Extended Audio File Services provides simplified audio file access,
combining features of Audio File Services and Audio Converter
Services. It provides a unified interface for reading and writing
compressed as well as linear PCM audio files."

That API looks pretty straight-forward to me. Maybe I'll try to come
up with a "proof-of-concept" Qt Mac AudioDecoder plugin using that
API...

I am not sure whether that is the proper way nowadays to decode audio
files on Mac (I am not a Cocoa expert by no means ;)) or whether the
AV Foundation classes provide a better way.


Cheers, Oliver

Loading...