JUL
24
2008

Sound on Maemo

Continuing my efforts to get a decent KDE based system on a maemo based device, this week I've worked on getting sound to work. As maemo uses gstreamer for its media, my first attempt was to use the phonon-gstreamer backend. To get the phonon kcm to build without having xine installed (as I couldn't find any xine packages for maemo) I had to hack around a bit in some cmake files (why are the only options "no multimedia at all" and "multimedia with xine", and is there no "multimedia, but with a different phonon backend" option?), but I got it to compile. However when I tried to play sound I didn't got any errors, but I didn't hear any sound either (when playing music with amarok tracks finished as soon as I started them).

My second attempt was to compile libxine, and use the xine backend after all. Compiling xine and its phonon backend didn't bring any new problems, and after installing it on the n810, I finally got sound out of amarok:

Actually, before I got amarok to start at all, I had some other problems to debug; the first time I tried to start amarok, it did nothing at all, using 100% cpu while making no progress at all. When I started amarok from gdb it turned out that some code in a libkjs global constructor was the culprit, somehow one of the assembly instructions in the initialization code for NaN/NaN_Bytes (not sure which of the two) would never finish. I guess I found the first problem caused by "There could be alignment issues with this, since arrays of characters don't necessarily need the same alignment doubles do, but for now it seems to work." in kjs/fpconst.cpp, although I'm not quite sure yet what the problem is. Fortunately after defining AVOID_STATIC_CONSTRUCTORS=0 to make it compile a different version of the code my problem went away, and I was able to start amarok.

Comments

This is way cool ;-)

Using amarok on such a thing - it's UI will probably need a bit of work to adjust, but from the screenshot it looks like it's already pretty close... Nice work!


By superstoned at Thu, 07/24/2008 - 16:05

AFAIK it's just a matter of using the macro_optional_add_subdirectory macro instead of add_subdirectory and you get a new option called BUILD_. The xine subdir uses this macro so all you need to do to disable the xine backend build is to set BUILD_xine to "no" or "false" or whatever it is - use cmake-gui, it'll do the right thing. :-)

To debug phonon-gstreamer PHONON_GST_DEBUG is useful, set it to 3 for maximum verbosity. Same for GST_DEBUG.


By Matthias Kretz at Thu, 07/24/2008 - 16:10

In case you have to hack around in cmake files, that probably happens because you're the first one who wants to do something special.
So just let us know and we'll find the right way to do it.
Either in kde-buildsystem, or on kde-core-devel, or, if you don't see another way, per direct mail to me.

Alex


By Alexander Neundorf at Thu, 07/24/2008 - 22:01