Sunday, 7 July 2013

Amarok MTP (Android) GSoC: week 3; Amarok 2.8 Released

Hola, this is a third weekly report describing my work on my Google Summer of Code project to rewrite MTP (Android) support in Amarok from scratch. This week I've finished implementing reading the track list from MTP devices.
What I've done this week:
  • Finished the background job to read MTP tracks and their metadata. Includes a nice progress bar (everyone loves progress bars) and is abort-able too.
  • Implemented central MtpTrack class and associated MtpAlbum, MtpArtist, MtpComposer, MtpGenre and MtpYear classes that are used to represent the collection entities in the Collection Browser.
  • Thanks to the above, Collection Browser now shows the entity tree of your MTP device (first screen-shot), which is nice.
Problems I've faced:
  • First little bugs/API omissions with libmtp are showing up (inability to flush libmtp's object cache). Fortunately the upstream is very helpful, so I'm looking forward to discuss it with them.
What's next:
  • Given that I've basically done work of both week 3 & week 4 from my timeline, I'll do a bit of polishing and testing. I'll also look at week 5 schedule which contains playability of MTP tracks directly in Amarok.
You can view and test my code by checking out gsoc branch of my personal Amarok clone repository.

On a related note, we've released Amarok 2.8 Beta! Yay! It contains a galore of improvements and corrections that are slated to end up in Amarok 2.8 (final). I definitely think you can give it some testing, can you? :-)

2 comments:

  1. Hi.

    I have not tested your work but this seems nice :)

    I found out that amarok is the only MTP application that can send data to my creative ZEN Mozaic. Every other software or fuse driver fail (I see directory structure but this completely misbehaves), this must be specific to my device. So I guess amarok has some workarounds or some builtin library for MTP.

    Anyways, as this is the only thing that works for me and keeping in mind the device only reads .mp3 and 75% of my files are .flac, I'm trying to find a solution for on-the-fly encoding before sending to the creative. Is this feature implemented/thought of for Amarok?

    If not, do you think there is enough internal helpers to start looking at it even if I have never opened amarok's source code ? WIthout spending 3 weeks of source comprehension beforehand ?


    Thank you.

    ReplyDelete
  2. > I found out that amarok is the only MTP application that can send data
    to my creative ZEN Mozaic. Every other software or fuse driver fail (I
    see directory structure but this completely misbehaves), this must be
    specific to my device. So I guess amarok has some workarounds or some
    builtin library for MTP.

    Not really, Amarok uses libmtp library shipped with your distro and I don't recall seeing any MTP work-arounds in Amarok code. However, MTP spec is rather flexible (it is technically possible to have 2 different files with the same in on directory for example, or for device not to implement directory structure at all) and all vendors deviate from it, some more, some less. It is therefore a question of which assumptions about the devices an application has, the less assumptions the more devices work. Amarok hopefully has a small amount of them, which I'd like to keep.

    > Anyways, as this is the only thing that works for me and keeping in mind
    the device only reads .mp3 and 75% of my files are .flac, I'm trying to
    find a solution for on-the-fly encoding before sending to the creative.
    Is this feature implemented/thought of for Amarok?

    Good news, it will be implemented as part of my project (somewhere in August). :-)

    Given that MTP devices vary very much and I can test only with a limited amount of them, I'd welcome testing, especially from people with "funny" players like you. Perhaps you can test my code on with your device? This shouldn't be hard to do without risk of messing with your system, you would follow http://blogs.fsfe.org/myriam/2009/09/26/compiling-amarok-from-git-locally-full-summary/ but in step 7 you would do
    $ git clone git://anongit.kde.org/clones/amarok/laitl/amarok.git
    $ cd amarok
    $ git checkout gsoc
    instead of
    $ git clone git://anongit.kde.org/amarok.git

    Every time I publish a weekly report, you would update & build according to step 9 and check that functionality I speak about in the report works for you, too.

    ReplyDelete