I have some sad news to report. Here, have a Unicorn to soothe your soul:
Not too long ago, we released Phonon-GStreamer 4.6, which contained fancy new gapless playback support.
For Amarok and most media players, it works flawlessly. For quick soundbytes (such as ktuberling), it breaks everything. We, the phonominals, detest regressions, and it seems the only way to resolve this issue is to remove gapless support in phonon-gstreamer 4.6.1.
Here’s a technical description of the issue:
- Once the last buffer in the GStreamer pipeline is decoded and sent to the audio sink element, playbin2 emits the ‘about-to-finish’ signal. This signal must be handled synchronously, or playbin2 will not have gapless audio playback.
- In the signal handler, we lock a mutex, emit the aboutToFinish signal in the MediaObject, and wait 3 seconds to be assigned the next MediaSource.
- Trying to change states to stopped/paused or even seeking during this lock invokes a 3 second delay while the signal handler waits for the next MediaSource. Unlocking the mutex when we try to change states causes strange race conditions when the application ends up recieving endOfStream signals before/after it handles the aboutToFinish signal and all kinds of other weirdness that gives us headaches.
The real solution to a lot of this is that we’re starting to design Phonon Five to handle a lot of WTFs in the API. It will certainly be worked on at this year’s Randa sprint.
Having said that, Phonon-GStreamer 4.6.1 will be coming out tomorrow.
Additionally, I’ll be at Akademy next week!
Feel free to vent about this in the comments.