[SOLVED] Need advice on Audio playback API for Qt4.8.4 on Embedded Linux
-
Hi everyone!
As a beginner in Qt I need some advice in choosing the right Multimedia/Audio playback API for Qt4.8.4 from those of you have experince with this. I'm configuring a embedded linux ARM device for Qt support, have working libraries that runs on target with touch.
What we want to do is to make an audio playback/media player application for a proof of concept demonstration. The QtMultimedia API in Qt5 looks exactly what we need, but due to hardware limitiations (opengl dependent) we have not been able to cross compile Qt5 -> Stuck at 4.8.4.
I have done a lot of research the last months, but I'm still very confused what my posibilites for Multimedia(audio) are on Qt4.8.4 and what API/modules we should use. Reading forum discussions, blogs, example code and documentation is helpfull, but VERY confusing since all of them is refering to different version and use, and the fact that API's and the usage of them have changed along the way.
I understand that ALSA and Gstreamer is needed regardless of API, but I need to know the link between my current Qt version and Gstreamer.
I know about the possibilty to use Gstreamer API directly, QtGstreamer, QtMultimedia, QtMultimedia/QtMobility, in different versions, but I don't know whats recommended for Qt4.8.4 for my use. How Phonon is used and integrated is also very confusing.In a perfect world I would like to end up with an high level abstraction of:
-
Different file support (WAV, FLAC+metadata, mp3)
-
Play/pause/stop/seek
-
Easy access to meta data
-
An easy way to implement a playlist
-
Volume control
I don't need:
-
Advanced pipeline and pipeline control in gstreamer
-
Low level control except volume
-
Video
If easy to implement:
- Be able to use software effects in gstreamer/other for Eq.
First priority would be to get a working configuration of gstreamer og qt for FLAC and a play/pause button. Next Metadata.
Configuration time and setup is also a big concern, but the posibilities at application programming is more important.Any tips or help would be very helpfull!
Please let me know if my goals are unclear or if more information is needed.- Preben
-
-
Hi,
I haven't worked on high-level multimedia programs before, so I can't tell you what's best for your project, but I do know that Qt Multimedia (Qt 4) is for low-level (byte stream) processing. It does not include built-in support for various file formats, play/pause/stop/seek, metadata, or volume control -- I used libsndfile and wrote my own code for those in my audio processing project.
Qt Mobility and Phonon do provide high-level multimedia APIs, but they were designed separately so they probably don't work well together -- it's one or the other. I can't find Qt Mobility documentation anymore (Nokia removed them), but I did find this: http://qt-project.org/doc/qt-4.8/phonon-overview.html
If you go with Phonon, the (reasonably small) list of all classes, types, and functions are at http://qt-project.org/doc/qt-4.8/phonon.html . Have a look; I think it supports everything you want. Also, it's quite an independent module that provides its own widgets for interacting with your media. I'd say that the widgets are the link between Phonon and the rest of Qt -- you can just insert Phonon widgets into your Qt app.
QtGStreamer is not an official Qt module. It looks like a simple Qt-ish wrapper around the GStreamer API.
-
Hi!
Thank you for your answer.
I did a new round of research and re-read some documentation and articles yesterday. You are totaly right. In my earlier reading about Qtmulitimedia Qt5(!) I thought that the module was an high level API. With that In mind I thought also that the earlier Qtmultimedia (Qt4) modules was designed to do the same, but I couldn't find any usage of if for playback applications. Since I also read that Phonon was on the way out/unsported did not try to dig deeper into Phonon. (I may have mixed up in reading Qt4 and Qt5 documentation earlier)
In a Qt4.8 overview and in the phonon overview, it states clearly that Qtmultimedia is for low-level processing, and that Qt uses Phonon for high level media.
No wonder I couldn't find the right information, when I was looking for Qtmultimedia details, and totally ignored the Phonon Module.
Thank you for clearing this out, it makes perfectly sense now.
(As a newbie to both Linux programming, OOP and Qt, I'm looking forward to try Phonon, Some of the Qt-Phonon examples are well documentated, and the API looks intuitive.)Have a nice day!
-
I've marked this post as Solved since I've got enough information to choose directon and and begin experiment with Phonon.
I would still appreciate comments, tips and user experices from those of you who have used Phonon or other media API in Qt4.8 for audio playback applications.
-
You're welcome :)
Qt Multimedia 5.0 absorbed the high-level classes from Qt Mobility, which has been split up and distributed among the various "main" Qt modules. Phonon was excluded from Qt 5.0 because it did not have an active maintainer (http://permalink.gmane.org/gmane.comp.lib.qt.user/1606 ), but there's a small chance it might come back to Qt 5.x in the future.
If you'd like more comments, I suggest starting a new topic, or at least removing the "Solved" flag (as people are less likely to open the post then)