Phonon problem

Thomas Eschenbacher Thomas.Eschenbacher at gmx.de
Sat Sep 5 13:59:14 BST 2009


Volker Härtel wrote:
> Hi,
> 
> I want to use phonon as backend for an audio-editor. It is 
> important for me to stream the source (not only from files).

Hi Volker,

I am also author of a sound editor (Kwave) and tried to get the same
running. The result of my evaluation was that Phonon currently does not
provide any suitable PCM API for sound editors at all.

AFAIR I also read some note about this topic in the Phonon documentation
or on the project homepage.


My major problems were:

1. The latency is extremely high, in my experiments the latency was
above ~1 sec, which is far away from "realtime" feeling.

2. There is no information information interface for getting the
capabilites of the backend - how many channels does it support? which
sample rates? how many bits per sample? which sample encoding? This
makes it impossible to reliably offer a playback function for example if
you have a file in memory with 96kHz/24bit/8 channels - on some systems
something comes out of the speaker, on some not... This also makes it
impossible for the application to "convert" the data into a format that
Phonon is capable to play.

3. There is no API for opening a PCM playback stream with a specific set
of paramters (channels + sample rate + bits per sample + sample
encoding). This makes it necessary to "guess" what Phonon might perhaps
like to play.


The code I currently have implemented for Phonon playback should be
understood as some kind of first "proof of concept" and only as a last
resort if any other playback methods fail.

If you are interested, you can take a look on my experiments on
http://kwave.svn.sourceforge.net/viewvc/kwave/trunk/plugins/playback/
in "PlayBack-Phonon.cpp".

There I implemented some simple output by "faking" a RIFF wave header
(with some fields like length info left unset / set to 0xFF) and
streaming the rest of my audio data through a chain with a bunch of
objects (Phonon::AudioOutput, Phonon::AudioOutputDevice,
Phonon::MediaObject, Phonon::MediaSource, Phonon::Path)

Sorry, but I found no other way...

Thomas



More information about the kde-multimedia mailing list