Replace Phonon with QtMultimedia?

Hi,

since a long time Phonon is the central Multimedia Framework for many KDE projects till today. But my impression is that the development stagnated in the last years, leading to more and more issues that comes with it.
Back in time there were 4 of them as I am aware of (VLC, GStreamer, Xine, MPlayer), now only VLC remains officially supported.
This wouldn’t be a problem but since the Plasma 6 release the activity in one of my projects (phonon-mpv) increased by people that still have their issues with VLC and looking for alternatives.

The phonon-vlc backend is also not in its best state, many features got disabled with newer VLC releases, leaving apps like dragon player with its audio vizualizer or Amarok with its volume fading effect broken.
The Phonon documentation is also poor on some places or not up-to-date.
Some KDE projects like KAlarm even port away from Phonon to use VLC directly.

Since the usage of Phonon in all KDE projects is today reduced to simple playback only, wouldn’t it be better to abaddon Phonon and move to QtMultimedia instead?
Some points could be:

  • Excellect compatibility
  • Since its part of Qt, it shares its active development and release cycles
  • The API is similar to Phonon, so porting should not require a major rewrite of everything
  • It does not introduce more additional dependencies compared to other external players
  • Its ffmpeg-backend even provides hardware-accelerated playback

Are they any drawbacks that speaks agains this possible migration path?
Except of development work of course, but maybe there are points that I am not aware of that could abaddon this idea.
I’m really intrerested in your thoughts, especially from KDE Developers of affected projects.

Greetings

This is an interesting topic. I know I will do something with audio playback after Qt6/KF6 support (+ maybe some other topics) starts to be in good shape for Amarok. Not sure yet what. One option would be working on Phonon backend(s), but I don’t think I’ll be doing that. For replacement there are of course many options. I have to study a bit deeper later, but I had a look some time ago and I was left with a feeling that e.g. directly using GStreamer might be better suited for Amarok than the functionalities QtMultimedia provides. But I’ll ponder this more later.

Of course it makes sense for a project to choose a third-party solution if there are extended requirements for audio/video playback (and I remember Amarok was one of them).
But for the usecase of simple notifications or short previews like in dolphin, gwenview, plasma-workspace, knotifications, kalarm etc. it feels a bit over-engineered to rely on big packages like libVLC just for this purpose.
If I get the time I will try to provide MRs to projects which will replace phonon or at least offer QtMultimedia as an additional option beside phonon.

I’ll note here that after switching to Qt6/KF6 based Amarok, I realized that phonon-gstreamer doesn’t build on Qt6 and there are various small issues with phonon-vlc that have either been introduced with Qt6, or that were there but I haven’t been aware of on Qt5. (In addition to the lack of various features.)

So I decided to have a try with pure GStreamer. I started salvaging things from the abandoned phonon-gstreamer yesterday and currently am able to listen to local music with it. Probably the way forward.

1 Like