From: Linus W. <lin...@gm...> - 2008-02-11 21:56:35
|
2008/2/11, Sciamano <sci...@gm...>: > Anyway, my intentions with the first post was to point out "this" > connection problem, in case it was useful for improving libmtp. Yeah, well not perhaps libmtp as it is but maybe something generic can be done to ease the situation if it is as I suspect. The problem is we don't know for sure why the device behaves like this, I only have an educated guess. If I am right the MTP protocol itself is not the problem, the problem is how the devices are made. They are all built to be used by one GUI thing, the Windows Media Player. Anything that behaves differently will be untested. So to behave like the device want you to, you have to be a GUI sufficiently like WMP. And I think gnomad2, Amarok 2 (KDE4 choice!) and Rhythmbox (GNOME choice!) are getting close to that. The achieve it using HAL and D-Bus to "hook" the device the instant it appears. (It's too bad for those who like command-line utilities though, then again, not all devices have this problem.) The problem is that on Windows, there is a daemon that "hook" the device when you plug it in (or boot with it plugged) and keep it hooked until you plug it out or shut down the host. The device expects to be "hooked" and thus will revert to something like USB mass storage mode or plain reset unless it gets hooked quick enough. This problem is very common I think. Some devices do not even allow for closing the PTP/MTP session without causing USB errors, this is a protocol violation but the manufacturers doesn't seem to care. It has been suggested to create a generic daemon that "hook" devices when they are plugged-in, and maintain a session with them until they are unplugged. (This is what Windows does, I think). This can be written around libmtp if we make a few changes to it. It's a lot of work and require all software using libmtp (including any command-line utilities) to be modified to use that as session manager. And it is not likely to happen, IMHO. BTW: Richard, do you have anything for the Mac sortalike HAL+D-Bus that can notify XNJB when new devices are plugged in so you can hook them? Linus |