[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main


  The Road to KDE 4: Phonon Makes Multimedia Easier
KDE Public Relations and Marketing Posted by Troy Unrau on Tuesday 06/Feb/2007, @06:47
from the can-you-hear-me-now dept.
Like the previously featured articles on new KDE 4 technologies for Job Processes or SVG Widgets, today we feature the shiny new multimedia technology Phonon. Phonon is designed to take some of the complications out of writing multimedia applications in KDE 4, and ensure that these applications will work on a multitude of platforms and sound architectures. Unfortunately, writing about a sound technology produces very few snazzy screenshots, so instead this week has a few more technical details. Read on for the details.

Phonon is a new KDE technology that offers a consistent API to use audio or video within multimedia applications. The API is designed to be Qt-like, and as such, it offers KDE developers a familiar style of functionality (If you are interested in the Phonon API, have a look at the online docs, which may or may not be up to date at any given moment).

Firstly, it is important to state what Phonon is not: it is not a new sound server, and will not compete with xine, GStreamer, ESD, aRts, etc. Rather, due to the ever-shifting nature of multimedia programming, it offers a consistent API that wraps around these other multimedia technologies. Then, for example, if GStreamer decided to alter its API, only Phonon needs to be adjusted, instead of each KDE application individually.

Phonon is powered by what the developers call "engines" and there is one engine for each supported backend. Currently there are four engines in development: xine, NMM, GStreamer and avKode (the successor to aKode). You may rest comfortably in the knowledge that aRts is now pretty much dead as a future sound server, and no aRts engine is likely to be developed. However, aRts itself may live on in another form outside of KDE. The goal for KDE 4.0 is to have one 'certified to work' engine, and a few additional optional engines.

Other engines that have been suggested include MPlayer, DirectShow (for the Windows platform), and QuickTime (for the Mac OS X platform). Development on these additional engines has not yet started, as the Phonon core developers are more concerned with making sure that the API is feature-complete before worrying about additional engines. If the Phonon developers attempt to maintain too many engines at once while the API is still in flux, the situation could become quite messy (If you would like to contribute by writing an engine, jump into the #phonon channel at irc.freenode.org).

When an engine is selected by the user or application, Phonon will use the selected engine to determine what file formats and codecs each backend supports, and will then dynamically allow the KDE application to play your media. As it currently exists in the KDE 3 series, the user would have to manually change engines in each application (Kaffeine, Amarok, JuK, etc.) rather than being able to select engines for use across KDE.

Once an engine is selected for Phonon, it allows the programs to do the standard multimedia operations for that engine. This includes the usual actions performed in a media player, like Play, Stop, Pause, Seek, etc. Support also exists in Phonon for higher-level functions, like defining how tracks fade into one another, so that applications can share this functionality instead of re-implementing it each time. Of course, some applications will want more control over their cross-fading, and so are still free to design their own implementation.

The engine with the greatest progress so far is xine, which I was able to set up and run on my system. I was unable to get the NMM (notoriously hard to compile/setup) or GStreamer engines to compile on my system, whilst avKode is currently disabled by default. I would show you a screenshot of Juk or Noatun playing audio with Phonon, but right now these applications look just like their KDE 3.x versions (only with a somewhat ugly/broken interface!). When they are getting polished for release, I will show them off in a later article.

Matthias Kretz offers a short video which, if you turn your speakers on while watching, demonstrates device switching. Phonon lets you switch audio devices on the fly, and you can hear the specific moment when the music switches from his various outputs (headphones, speakers, etc.).

Matthias also submits the following screenshot of output device selection using Phonon's configuration module. This is also a work-in-progress, and so take it with a grain of usability salt.

Phonon config from 4x devel

There are not many things that I can take a screenshot of which show Phonon in use (screenshots of an audio framework are notoriously difficult to compose!), but I can describe one of the neat side effects of using Phonon: network transparency. KDE has long used KIOSlaves to access files over the network as easily as if they were stored on your local computer. Multimedia apps like JuK or Amarok should be able to add files transparently over the network to their collections without having to be concerned about whether or not the back-end engine is aware of how to deal with ioslaves. This support is already partially implemented in KDE 4, and is most visible through audio thumbnails, which are working for many people over any KIO protocol, including sftp:// and fish:// - two popular protocols among KDE power users. They do not yet work for me due to some instability in the fish:// KIOSlave of my current compilation, but the developers in the #phonon IRC channel claim that it this functionality will be ready and working when fish:// is more stable.

So, Phonon, while still in development, is going to be a great pillar technology for KDE application programmers, making their job easier and removing the redundancy and instability caused by constantly-shifting back-end technologies, and (eventually) making support for other platforms a piece of cake. This means that those developers can spend more time working on other parts of their applications to ensure KDE Multimedia applications shine even more brightly than they currently do.

A couple of quickies here to note: Mark Kretschmann, lead developer for Amarok has officially opened up Amarok 2.0 development this week, and seems to be quite interested in what Phonon can do for Amarok 2.0. He doesn't rule out keeping their own engine implementations, like they currently do in the Amarok 1.4 series. However, given its early stage of development, Phonon can likely be adjusted to ensure that it will do everything Amarok asks of it.

If you're looking for a way to help out with KDE and are not a programmer, Matthias Kretz, lead developer of Phonon (Vir on IRC) has requested some help in keeping the Phonon website up-to-date.

And lastly, a few translations of these articles have been popping up around the world in various languages. Sometimes more than one translation is happening for a specific language. If you are translating or plan to translate these articles, send me a message so that we can save everyone some work and avoid redundancy (lets keep the redundancy-reduction spirit of Phonon alive!).

Until next week...



<  |  >

 

  Related Links
 ·   Articles on KDE Public Relations and Marketing
 ·   Also by Troy Unrau
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

Over 40 comments listed. Printing out index only.
Digg this
by JLP on Tuesday 06/Feb/2007, @08:14
The story is available for digging here:
http://digg.com/linux_unix/The_Road_to_KDE_4_Phonon_Makes_Multimedia_Easier
[ Reply To This | View ]
jackd integration
by eeos communications - support on Tuesday 06/Feb/2007, @08:21
It sounds interesting.

One question:

Would jackd be one of the supported engines? Or would applications like rosegarden plug in phonon and phonon then manage the server choice?

Best
-.-
eeos communications support
http://www.eeos.biz
Company No. 05765416
[ Reply To This | View ]
NMM
by Andreas on Tuesday 06/Feb/2007, @08:29
actually nmm is quite cool. if you could not compile it, there are packages and even a knoppix based live-cd at http://www.networkmultimedia.org/Download/index.html

some backgrounds to nmm can be viewed at http://graphics.cs.uni-sb.de/~slusallek/publications.html (Multimedia) or
http://www.infosys.uni-sb.de/teaching/perspektiven0607/slides/slusallek.pdf
[ Reply To This | View ]
independent application volume control?
by tendays on Tuesday 06/Feb/2007, @08:31
Hello, that was nice to read.

I have one question: will there be a way to control the volume for a single (kde) application at a time? Say for instance that I am watching a dvd whose audio is quite low, so I want to push up the volume for the dvd player, but don't want to jump out of my seat or get deaf if I get a mail or some other event occurs, whose notification sound is comparatively louder..
[ Reply To This | View ]
Per-App Settings?
by Anon on Tuesday 06/Feb/2007, @08:34
Firstly, thanks as always to Troy for preparing this for the Hordes hungering for KDE4 news :)

To save everyone the trouble of rooting through the API, I have a couple of questions:

1) I heard rumblings of the existence of per-application volume settings so that (e.g.) you don't have your eardrums blown out when a buddy signs in to MSN just as you're watching the quiet part of your film ;) How will this work, exactly? Any mockups of e.g. kmix?

2) Would it be possible to, for an arbitrary piece of video supported by the currently used engine, extract frames (plus accompanying sound for that frame) one-by-one in some format (YUV+PCM, maybe), process them (maybe adding a watermark, or doing your own custom effects) and then send this altered audio and video frame into another Phonon-based encoder for encoding to, say, XVid?
[ Reply To This | View ]
Video: Only sound on the right speaker
by Carsten Niehaus on Tuesday 06/Feb/2007, @08:51
Same for you as well? Or is that a feature I just didn't notice in the video ;-)
[ Reply To This | View ]
gstremer builds now
by Troy Unrau on Tuesday 06/Feb/2007, @09:44
Just a small update since I wrote this article - I discovered I was missing a package on my system to get the phonon-gstreamer engine to build. After installing libgstreamer-plugins-base0.10-dev, it now builds... I had previously only the libgsreamer0.10-dev package and had assumed that it would be enough to build the engine, but tbscope and christoph4 in #phonon helped me to realize what I was missing.

Cheers
[ Reply To This | View ]
Thank you Troy!
by Michael Thaler on Tuesday 06/Feb/2007, @10:12
I really enjoy reading your "The Road to KDE 4" articles. Thank you very much for writing them!
[ Reply To This | View ]
The best part of KDE4
by mactalla on Tuesday 06/Feb/2007, @12:25
Phonon is (for me) the best part of KDE4. Ever since I heard the proposal, I've been looking forward to KDE4. I have a USB sound card for my laptop which I use with my speakers in one room, but if I take my laptop elsewhere there's no point having that sound card. It's a nuisance to have to manually change the audio output each time (doubly so when said change needs to be done in a config file since xine_part doesn't like to load when it can't access the output).

As much as I'm looking forward to all the other cool stuff coming for KDE4, Phonon has to be the best one for me.

Hats off to the devs!
[ Reply To This | View ]
Huge
by Rafael Fernández López on Tuesday 06/Feb/2007, @12:52
Really impressive and interesting architecture. This rocks.

Thank you phonon developers.

Troy, as always: huge.
[ Reply To This | View ]
KDE4
by Steven on Tuesday 06/Feb/2007, @16:03
When is KDE4 going to be released? Its appearing that the release is getting pushed back as much as Vista has been.
[ Reply To This | View ]
KDE3 compatibility
by D Kite on Tuesday 06/Feb/2007, @17:30
Is there any thought to supporting kde3 apps? Many depend on arts, so any kde3 apps will require an old unmaintained arts installed. Kde3 apps will be around for a long time yet.

How about a library in kde4 that looks like arts but calls phonon?

Could be called pharts?

Derek
[ Reply To This | View ]
ooohh man!
by Jonathan Dehan on Tuesday 06/Feb/2007, @18:41
i'm just thinking aloud but xmms2 backend + amarok = dream media player/server.


i love having my music go no matter what my computer is doing (in and out of x, gui crashes mainly) and allowing all qt multimedia apps to take advantage of the convenience features of xmms2 is well, just ... *drool*
[ Reply To This | View ]
Nice, a couple of feature suggestions
by Ben on Wednesday 07/Feb/2007, @01:13
I love the idea of having different categories for sound, communications, music, etc. I'd like to suggest you add and extra category for music creation software.

Secondly I'd like to suggest that maybe you can set it that if something in one category is playing it can mute or turn down the sound on another category. So if something in Communication turns on music will turn off.
[ Reply To This | View ]
MIDI
by Ben on Wednesday 07/Feb/2007, @01:22
just wondering how Phonon will work with MIDI, anyone have any idea?
[ Reply To This | View ]
Latency
by Fabio A. on Wednesday 07/Feb/2007, @01:29
I don't know whether it's a problem with video/audio synchronization, but the response latency of the system to the issued commands (via the GUI) looks awful to me, it looks to be close to one second!
[ Reply To This | View ]
OpenAL?
by Darkelve on Wednesday 07/Feb/2007, @05:25
Is the Phonon framework relevant for the technology known as OpenAL?

http://www.openal.com/

"OpenAL is a cross-platform 3D audio API appropriate for use with gaming applications and many other types of audio"

Or am I way off base here?
[ Reply To This | View ]
Phonon is just an enourmous fallacy
by Bjarne Alderhaug on Wednesday 07/Feb/2007, @09:17
I think this is an enormous mistake because it puts KDE on the sideline rather than getting actively involved with Gstreamer and helping to make Gstreamer into a totally kick-ass framework and instead taking the cowardly "let us see" attitude that serves noone.

Phonon is also built on a number of fallacies:
1. It assumes that if Gstreamer changes it's API, only Phonon (not the apps) needs to be changed, without considering that Gstreamer may introduce new APIs that can't be handled by the current Phonon API, thus requiring an API change that requires change in applications as well.
2. It assumes that Phonon is going to be more API stable than Gstreamer. Given that Gstreamer is approaching maturity, this is not at all proven.
3. Phonon will never be able to support everything that the lower level systems can. For every new feature that the lower level systems get, Phonon will get there slower.
4. Phonon is setting itself up for a Q & A nightmare, where apps will have different capabilities depending on what capabilities the subsystem has.
5. Phonon will be no more capable and stable than the subsystem. If all the subsystems are half-baked, then Phonon will be as well. Instead KDE could have focused on getting in on helping out with one subsystem to make sure it will stay alive and well.
[ Reply To This | View ]
prefer to see in phonon direct support for ffmpeg
by serge on Wednesday 07/Feb/2007, @09:27
Why not to use ffmpeg (integrated in xine, mplayer, videolan, openwengo, gizmo, vivia, ..) - fastest multimedia engine used for decoding/encoding and grabbing media from DVB, Video4Linux, Fireware devices and CD/VCD/DVD or Internet resources and also used for streaming.

IMO gstreamer is ugliest (stability, performance, documentation) engine build on top of ffmpeg. Does anybody try to use gstreamer-edtor, pitivi and other related projects higly tied to gstreamer?
[ Reply To This | View ]
KMplayer needs both xine and mplayer engine
by vatbier on Wednesday 07/Feb/2007, @10:07
My KMplayer needs xine engine for listening to mp3 radio streams and it needs mplayer engine (embedded in konqueror) to show HD quicktime trailers.
The xine engine can't show those HD quicktime trailers from http://www.apple.com/trailers/ as it can't buffer enough cache of a big HD trailer (e.g. 150 MB).
Mplayer engine is not used for mp3 radio streams as it takes too long to fill the cache (I've set it to 12 MB), therefore the use of xine for mp3 radio streams.

How will Phonon deal with a problem like this?
I want KMplayer to be able to play mp3 radio streams immediately and to buffer big HD trailers enough so the video doesn't stutter.
For me now both xine and mplayer engine need to be supported.
(I know nothing about Phonon KDE multimedia technology, my apologies if my question is not relevant)
[ Reply To This | View ]
The road to KDE 4
by Pim on Wednesday 07/Feb/2007, @11:00
The road to KDE 4?

Release early, release often.

KDE 4 will take up when development releases are available. The question is how user will react when they need to wait more than 1.5 years for a new version of KDE.

I don't understand why KDE does not branch: Stable version (3.5.x) and developmen version with weekly snapshots.
[ Reply To This | View ]
Current state?
by reldruh on Thursday 08/Feb/2007, @01:44
Does anybody know how far along phonon actually is? This is a great overview of what it is but it would also be nice to know the current state of the project. The roadmap on the website seems somewhat outdated (it currently says things that were supposed to be completed in Q2 2006 are in progress). Is there any news on how far along the developers are?
[ Reply To This | View ]
Thanks / Question
by Lans on Thursday 08/Feb/2007, @03:47
Thank you very much Troy, it's always interesting to read "The Road to KDE4"-articles. You've done, as always, a great job.

As a user, it could be hard to follow the development. Lucky me that this kind o series exist. I want to know about so much about KDE4; Plasma, Konqueror, Krunner etc.

However, I think there is an application which is mentioned very rarely when talking about KDE4: Get Hot New Stuff (don't know if this is the actual name). I think it is an application that is very good, but that would need some love from developers and artists.

Does anybody know the current state of Get Hot New Stuff, and how it is going to work in KDE4?
[ Reply To This | View ]
Is it Coincidence !!!
by RF on Thursday 08/Feb/2007, @12:15
Just to mention

The Pronunciation of phonon in Arabic means Arts
[ Reply To This | View ]
Is current kmix going to die ?
by Morreale Jean Roc on Friday 09/Feb/2007, @08:33
As we're talking about sound, any news on kmix ? I hope KDE4 will not ship with a similar sound manager as I would like to install it without the users being lost with all the undocumented and obscure parameters
[ Reply To This | View ]
Will this make my audio jump & my videos stutter?
by kris on Saturday 10/Feb/2007, @12:11
layer upon layer upon layer upon layer upon layer = slow machine.

and me who thought the point with audio was to be able to listen to it, and the point with video was to be able to view it.

NOW.
[ Reply To This | View ]
am I understanding correctly?
by somekool on Saturday 10/Feb/2007, @21:48
Did you say that once you switch backend in Phonon's config, it will use that backend and only that one?

I thought it could be a preference list, like the KDE language settings. so that one is preferered and if it fails, it fallback onto the next one. wouldn't that be sweet? and non-working backend on a system should be automatically disable. for example on a fresh install gstreamer backend would be the default (for example), phonon finds out it fails, phonon suppose gstreamer is not installed and disable the backend. so it won't try and fail again.

another solution would be to mimic the file association config panel. mimi-type type of thing. where, I want mplayer or xine to handle video, and gstreamer for music. again, for example.


keep up the good work

thanks
[ Reply To This | View ]
Phonon and VLC
by Ben on Sunday 11/Feb/2007, @02:08
I was wondering what happens to programs like VLC that have the codecs built in rather than useing an engine like xine. Will there some way of controlling VLC via Phonon? say by useing a special phonon-engine that just takes sound from VLC and sends it to ALSA or the Sound Server?
[ Reply To This | View ]
PulseAudio?
by Josep on Sunday 11/Feb/2007, @04:18
Hi, I like very much what I have read about Phonon, and I would like to ask if there will be support for PulseAudio (http://pulseadio.org) as it seems it's evolving and becoming more popular now.

Thanks.
[ Reply To This | View ]
Authoring APIs?
by phony on Thursday 22/Mar/2007, @04:01
I'm just curios about authoring APIs. Something on par with QuickTime - check the example: http://developer.apple.com/documentation/QuickTime/RM/CreatingMovies/MTCreateMovies/B-Chapter/chapter_1000_section_5.html

The goal of Phone is all nice and evolutionary. But IMHO problem now is not a playback - but creativity support. KDE (and Linux desktop) need decent multimedia creativity support to go forward. After all to play some multimedia content - it (the content) has to be first created.

There are only few applications - e.g. Cinelera, Kino, mencoder, transcode. As my friend said if you want to buy camcoder and use it under Linux - do NOT buy camcoder: video encoding at best flaky, video editing is non-existent.
[ Reply To This | View ]
The Fine Print: The previous comments are owned by whomever posted them.
( Reply )

  "Default settings are easy to manage." -- Aaron Seigo
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]