This Time Self-Hosted
dark mode light mode Search

Synergy of frontend and backend

Sometimes, it’s easy to forget how helpful is for frontends and backends (or in case of xine-lib we should more properly speak of middleend) developers to work together, back to back to provide users new features.

I wrote before that I wanted to see what would it take to implement Last.FM support directly in xine itself; thanks to eean (Ian Monroe) and Alex, I’ve been able to actually understand why it’s not a good idea to actually implement the whole last.fm protocol in xine-lib.

But, what I can do is making it easier to xine frontends to implement last.FM playback. The SYNC string is sent on the HTTP stream every time the track changes, it’s usually skipped over, as it doesn’t disrupt the mp3 stream; what I can do instead is looking for that string, and then inform the frontend that the metadata has to be re-read. Other input plugins do similar things to inform the frontend that the channel, the chapter, or other stuff, in this case, the metadata, so the event was already present and required me no interface addition.

Implementing this xine side was quite easy, it was an about five lines change, the result was quite good. I just needed to add a memmem() replacement for systems where it’s not present (I know there are a few).

Ian then started working on making Amarok use the new feature (that will be available in 1.1.8 version and in 1.2 series); by using this, it’s possible to skip over the whole Ruby proxy script, first connection is faster, and the metadata is updated when the track changes, rather than some time before the track changes.

This is a perfect example of synergy in development. Through this changed, applied to a real world need of one frontend (Amarok) who wants to play Last.FM, is now possible to implement Last.FM playback much easily in any xine-lib frontend.

On a different note, thanks to Kostya (and then to Peter Lemenkov), I now know there is a really Free implementation of Monkey’s Audio decoding (for the last revision of the format) at http://www.rockbox.org/tracker/task/7256. Unfortunately it’s designed for embedded usage so it’s not much use of xine out of the box, I’ll need to fix it to be at least reentrant (right now it’s using static buffers for everything). Maybe there is some hope to get Monkey’s Audio support in xine (and thus Amarok) 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.