PDA

View Full Version : Phonon - audio-output-problem and high latency



nearlyNERD
5th May 2010, 21:40
Hey,

after many problems, I get phonon "working":

When I click on an area, a 1-second-sound should be played.

My problem is, that I get this warnings and a big latency (1 second or something like this), before playing the sound:


WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface
Qt Application(5432) Phonon::KdePlatformPlugin::createBackend: using backend: "Xine"


My Phonon-specific code is this:


#include <phonon/audiooutput.h>
#include <phonon/path.h>
#include <phonon/mediaobject.h>
#include <phonon/backendcapabilities.h>

// .....

Phonon::MediaObject *music =
Phonon::createPlayer(Phonon::MusicCategory,
Phonon::MediaSource("/home/fabi/Desktop/MobileDrumKit/MobileDrumKit/data/Music/15575_lewis_crash_bell.wav"));
music->play();

I also tried to do this :


QList<Phonon::AudioOutputDevice> audioOutputDevices =
Phonon::BackendCapabilities::availableAudioOutputD evices();
Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput;

audioOutput->setOutputDevice(audioOutputDevices[0]);

but no luck...

Thanks in advance.

Also, I want to know, how big the latency between clicking and hear the sound is usually.

nearlyNERD
6th May 2010, 14:43
Isn't there anybody out, who knows, why I have these problems?

Nickolay
17th July 2010, 22:15
I also have this big latency, but only before first click! Seems on first click phonon loads all it's dlls,
and next clicks play immediately.
Who knows maybe is any possibility to "pre-initialize" phonon on start of application?

viniciusjl
27th June 2012, 21:17
Just for documentation, the link http://www.tuxradar.com/content/code-project-create-media-player has a solution for this problem:


The error you describe is because Phonon is expecting the application to have a name defined through the Qt framework. This can be solved by adding:

a.setApplicationName( "Mu" );

to the 'main.cpp' file, just below the 'QApplication a(argc, argv)' line.