Using libmtp, mtp-tools in Fedora 10

Working on MTP-stuff while watching the first day’s time trials in the Tour de Lance. I removed rhythmbox several days ago along with the big load of Gnome bloatware I ditched. No big deal.

aa1-s3-600x445

Just for background, my MTP device is a Samsung S3 (YP-S3). The S3 was on my wishlist because it’s capable of playing OGG and video; it also has a cool touchpad interface instead of a stupid wheel thing. Unfortunately, just because it plays ogg files doesn’t mean it plays fairly with non-Windows operating systems. It was purchased from a big box electronics store which runs its own music download site; this retailer sells custom-flashed models to work with their store and this custom firmware removes OGG-capability (even though the retailer’s site provides specs suggesting it does play ogg files). I installed the default firmware for the device to get OGG support on it; Windows, though, will wrongly suggest these files won’t play on the device when copying. And despite being capable of playing back video, the videos must first be converted for the device using Samsung’s software that comes with it. I chose to not install it so I don’t watch videos. Finally, the other fly in the ointment with the device is that it’s MTP rather than UMS. UMS is standard USB storage and MTP is Microsoft Transfer Protocol. Of course, the packaging and specs don’t tell the consumer that it’s MTP and not plug-and-use like any standard USB device.

Fortunately, there is some MTP support for non-Windows operating systems via libmtp. The project has had some support from Microsoft. Contrary to the naysayers and haters, Microsoft wants wider adoption of their protocols. After all, a Zune sale makes them money whether the user wants to use it in Windows or Linux. Unfortunately, the ease/difficulty of getting devices to work depends on how they’re set up by manufacturers and how many developers or owners have provided information to the developers. Some applications which use libmtp work better than others, which also is affected by which version of libmtp is being used.

There are several applications which use libmtp to support MTP devices. These include amarok and rhythmbox, but also include lesser-known applications and utilities.

I installed mtpfs, a fuse filesystem allowing the device to be mounted, in Debian but was unimpressed with it. I didn’t see mtpfs in Fedora. I don’t know if I’ll bother with compiling it. In Debian, I was able to mount the device and navigate directories to read files but had zero control over files. Like other MTP utilities, there was scant information to help me resolve the problems. I wish it had worked because I love the fuse approach for things like this.

I also looked briefly at gnomad2 (in Fedora) but was put off by a few things. The worst part was the non-recognition of my device (not too surprising since the application isn’t a general MTP manager but targeted to a couple specific devices). The other thing — and this is the kind of aggravating thing some programmers do that pisses me off — is that it uses graphical interface boxes for the main part of the application or its preferences designed for high resolution screens so that on a smaller screem (such as my AA1) a user has to press alt to scroll the thing up off the screen to get to the options on bottom. Maybe the developer isn’t aware that scrollbars allow users to navigate below a certain point if their screens aren’t the same size as his. I removed it after having to push it up the screen repeatedly to find more options to see if it might be tweakable to find and work with my device. I just said, “Fuck it.”

While most users would feel more comfortable using an application like amarok or rhythmbox which uses libmtp, libmtp comes with its own set of tools (usually called mtp-tools for some strange reason). These tools are command-line and not very well documented. Maybe they’d be easier to use if they were, eh.

The first thing I had to do was figure out which Fedora package has mtp-tools. After looking through the mtp-related files (via yum search and yum info) I realized “libmtp-examples” is mtp-tools. Whatever. I installed it and started seeing what I could do with it.

One important command to see if the device is recognized is mtp-detect. This command will provide details about the device — name, ID numbers, directories, and capabilities. Once you know the device is recognizable by libmtp, you can look at managing it (the list of mtp commands is posted below).

I wanted to copy a couple test podcasts to one particular directory. I didn’t know off the top of my head if using mtp-sendfile would result in my podcasts going to the Music directory or to the root directory. After transferring them — one of which resulted in an error — I disconnected the S3, turned it on, and started looking for it. Music? No. But it did land in the file manager’s Music folder, and it played when I selected it.

So I had to figure out  how to manage the directory structure on the device. It’s offputting to have everything go in one directory when there’s a full tree of directories to manage things better. The mtp-folders command produces a list of folders, each with a number in front of it.

After doing a few searches, I learned that I can’t name destination directories when transferring files but rather need to use their number codes (available via mtp-folders). Once I knew that it was easy to send my podcasts to “Datacasts” on my Samsung S3.

screenshot-20090704113939

I still get the “unknown options” error message but the files are going to my “Datacasts” directory; when sending to “Datacasts” by name, they were going to the root of the Music directory and accessible only in the File Manager rather than under Music (stupid, huh). Also note that the permissions require root access to the device. Go figure. I’ll add a new group for it or something but it’s not a big deal since Windows will ignore the permissions anyway.

There are a variety of mtp-tool commands. As you can see, though, I used mtp-connect –sendfile instead of mtp-sendfile. No matter because mtp-sendfile, mtp-delfile, mtp-getfile, mtp-newfolder, and mtp-sendtr are all links to mtp-connect.

mtp-albumart        mtp-emptyfolders    mtp-getplaylist     mtp-reset           mtp-trexist
mtp-albums          mtp-files           mtp-hotplug         mtp-sendfile
mtp-connect         mtp-folders         mtp-newfolder       mtp-sendtr
mtp-delfile         mtp-format          mtp-newplaylist     mtp-thumb
mtp-detect          mtp-getfile         mtp-playlists       mtp-tracks

I’ll see if I can put together a better, more comprehensive tutorial on using these devices without installing bloated apps like those mentioned above.

Advertisements

One Response to “Using libmtp, mtp-tools in Fedora 10”

  1. MTP MP3 Player Creative Zen kein Zugriff Says:

    […] […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: