Sunday, July 27, 2008

MTP File Management and iPod Covers

So MTP file management (copying/deleting) has gotten implemented, and works well on all 3 devices I tested on. Still a lot of polishing left to do as far as interface goes, and some threading to not stall Amarok at key points, and it should be good to go. One thing I'm having issues with is copying files directly from an MTP to an iPod and vice versa, but will investigate this later as this is a bit more advanced.

So, I had a bit of an epic struggle with a few things over the last day or so. See, libgpod can only retrieve covers in the form of GdkPixbuf structs, but so as to not force the GdkPixbuf dependency on people, they return it as a gpointer which you can then choose to cast if you want to use GdkPixbuf. Sounds great, right? No problem...

... except for having CMake pull in the dependency. So as it turns out, there's no built-in module for gdk-pixbuf library. So, I decided to create my own as I did with libgpod, except when I pulled it in, a certain function wasn't present. Odd... hm. Well as it turns out, this function is only present in the gdk-pixbuf library that resides in gtk. Great! There's a CMake module for GTK, all should be fine this time, yes? No. The GTK module in CMake pulls in GTK1, and gdk-pixbuf is in GTK2. So I end up modifying the gdk-pixbuf module I made before, learning lots about CMake along the way, and finally get it compiling.

Long story short for the next part, the README in libgpod didn't really work for me for setting up SysInfo for my iPod, and I accidentally tripped on a feature from the old Amarok which set it up right, after I modified some permissions. Wonderful, yeah?

Wrong! Turns out that iTunes and libgpod handle covers in two different ways, and so I have to cater to both of them. This turned out to be a bit of a pain, but at last, I finally got a size-distorted but correct solution:

The m-flo cover was set by me using libgpod via Amarok, and the ManĂ¡ cover was set by iTunes. I'm going to fine-tune the sizes later, and all should be peaches and cream.

That's all for now. One note though about the interface, which right now is either non-existent or bad: likely going to be making an applet which does all the fun stuff that A1 did for media devices, including: connect/disconnect, % free space, possibly a queue, and if supported, even % battery level! That however, is a ways away from coming true, but do stay tuned.

Thursday, July 24, 2008

MTP Support Arrives

Caption: 2 MTP devices connected, and songs playing from iPod

This is a bit overdue, but initial support for MTP devices has arrived. To use it, you require limbtp >= 0.3.0 installed on the system, and a device supported by libmtp of course.

Part of the reason this took so long is that I'm starting to notice a lot of potentially reusable code, and will probably soon refactor to reflect this. MTP devices are strange beasts, because their filesystem can't be directly accessed. As a result, Amarok 1 and Windows Media Player et al can only do file management of tracks on these devices, not actually play directly off of them. I'm going to be working on an idea that allows playing off of them to be possible, because let's face it, A2 is an audio player, not just a file manager.

Thanks again to everyone who donated MTP devices to the Amarok group. You're the ones who make this possible. Support is still pretty basic, so please don't file bugs on this yet, but be ready to at some point in the semi-near future.

Edit: Snapshot of 3 Mentioned Devices

Sunday, July 13, 2008

MTP Incoming and Ipod File Deletion Support

First off, thanks to everyone who has responded to the request for devices so far, and those to come! Sorry if the replies to the e-mails take a bit, but I'm probably working on Amarok ironically enough. Some of the devices offered have already been sent, and soon we'll see the first signs of MTP support on Amarok 2 =D . To get this question out of the way, _yes_, of course we're going with libmtp 0.3, it just makes sense to. Look forward to this MTP users, and thanks again to all donors of devices!

Summary of Ipod News:

- You can now delete files one at a time from the iPod
- You can now "edit" tags, although changes won't save yet (implementing next)

After fighting for a while with how to create a custom "remove" button, users now have access to deleting files on the ipod! ... one at a time, hah, looks like I have to do some more magic before you can do it with multiple files at once. Also, the icon for "remove" doesn't seem to make sense, and I'm fixing this soon too. Why there isn't a built-in capability to remove from a collection when there's built-in support for it in CollectionLocation? Probably nobody got around to it yet. If nobody does it after this summer, I'll implement it so that people don't have to go through this again, haha.

Turns out that because pre-made actions are in the CollectionTreeView, they can do all sorts of magic like... know which items are selected, so that they can work with multiple things at once. I'll have to look into this next.

Anyway, editing ipod tags will no longer crash your Amarok, and they'll even update in the view!... but not in the ipod's database, so a restart of Amarok will clear those changes, don't be fooled! It won't be too hard to port over tags support I'm sure. Er.. wait, I've said "it shouldn't be too hard to..." way too many times already, and I'm always surprised when it turns out to be a pita, haha.

The rest of the stuff I mentioned in previous posts has not yet been dealt with. No need to ask about the progress, it'll get here fairly soon. I've tried to concentrate on core features (tag editing, file management) for now. Yes, album covers and podcasts are wonderful, and they're soon to be here.

Wednesday, July 9, 2008

Ipod File Transfer Support Arrives

After an all-nighter porting over file-related code and some hours trying to make it work with CollectionLocation, we have the first signs of file transfer to ipod support available.

- AA format not yet supported due to some Audible strangeness
- Copying might seem slow right now (as in, takes 3-5 seconds to copy about 12 tracks), but I will fix this pretty soon as I know the cause

How to copy to iPod?
1.) Have iPod plugged in and mounted
2.) In Amarok, an iPod collection should show
3.) Either right-click an artist/album/track from another collection (e.g. local collection), or drag into the middle area to bring up the PUD. Hover over Copy to Collection, and select your Ipod.
4.) The tracks should then be being added. Expand your ipod collection to confirm that the tracks have been added and are able to be added to the playlist and played.
5.) Confirm that the songs can be played from the iPod itself

Forthcoming but not yet here:
- Album Cover support
- Podcast support
- Tag editing support
- Playlist support
- Pretty interface for file transfers &c.

Also, there's a "hang on exit" bug right now, but don't be afraid to "killall -9 amarok," as it won't affect your iPod. Sorry for the inconvenience, I'm tracking that one down fairly soon too.

Monday, July 7, 2008

Wanted: Portable Media Devices

So iPod support should be pretty well set by this next weekend, and the next thing on my list is support for MTP devices.

So, what's an MTP device? MTP = Media Transfer Protocol, a protocol Microsoft came up with for media devices. Examples of devices that use it? Pretty much every Creative Zen, iRiver, Samsung and Sandisk media device you can think of, which is why the support for these devices is so important.

But I'm at an impasse, since I don't actually _have_ any of these devices. The lack of devices is actually a pretty common issue for the Amarok project, which is where we come to you =). If you have access to a media device which you can donate for development , please let the Amarok team know at: A list of devices that the project is looking for is available here. This will ensure that the people with these devices are happy people when Amarok 2 rolls around. Of particular urgency to the 2.0 release is the need for an MTP device (see list of MTP devices: here) Any of those devices will be a great help.

And, once I have one of those devices in hand and support starts rolling out, I ask anyone who has an MTP device to check out a copy of Amarok 2 from your friendly neighborhood svn server to help me test things out and make support be _good_ (see: here)

Lastly, thanks in advance to all of you!