[Kde-hardware-devel] Identifying iPod and iPhone-like devices using Solid (was: Amarok review request)

Tom Gundersen teg at jklm.no
Fri Oct 28 00:13:26 UTC 2011


Hi guys,

I tried to look into this a few months ago, but eventually gave up due
to bugs in libgpod (see below).

This is what I learned:

On Wed, Oct 26, 2011 at 4:05 PM, Matěj Laitl <matej at laitl.cz> wrote:
> On 25. 10. 2011 Bart Cerneels wrote:
>> Looks like quite a few pretty ugly hacks are needed for proper iP* detection
>> with the current mediadevice codebase. In the near future (post 2.5
>> release) we should together try to find a simpler and easier to maintain
>> solution.
>
> Thanks for your review, Bart.
>
> I've looked around a bit and the situation seems rather sad:
>  * solid knows nothing about media-player-info or usbmuxd and its udev
> PortableMediaPlayer implementation is just a stub [1], furthermore it doesn't
> even currently attach PortableMediaPlayer interface to relevant devices as it
> checks udev env ID_MEDIA_PLAYER against numeric 1 (gphoto remnant) [2,3], but
> media-player-info attaches normalised player name there.
>
> [1]
> http://quickgit.kde.org/?p=kdelibs.git&a=blob&f=solid/solid/backends/udev/udevportablemediaplayer.cpp
> [2]
> http://quickgit.kde.org/?p=kdelibs.git&a=blob&f=solid/solid/backends/udev/udevdevice.cpp
> [3]
> http://quickgit.kde.org/?p=kdelibs.git&a=blob&f=solid/solid/backends/udev/udevmanager.cpp
>
> In an ideal world (in my opinion):
>  * PortableMediaPlayer::supportedProtocols() would return a list containing
> "ipod" for all iPod-like devices (it should just parse /usr/share/media-
> player-info/${ID_MEDIA_PLAYER}.mpi)
>  * PortableMediaPlayer::supportedDrivers() would return a list containing
> "usb" for traditional iPods and something like "usbmuxd" for iPhone-like
> devices. (this would be more tricky, but could use udev env USBMUX_SUPPORTED)

I spoke to the media-player-info guys (mainly to propose patches to
improve the ipod rules they ship), and they told me that m-p-i is
mainly meant for supporting regular mtp devices, and that
imobiledevices are out of scope for it. They pointed me to libgpod
instead.

It looks like libgpod should indeed give us a very nice way to
identify the device. It will export the relevant information (device,
custom name of device, icon, etc) as udev attributes. It turns out
that this does not work correctly with the device I have (iPhone 3)
and it was not obvious to me what the problem was, so I stopped here.

I think the correct solution would be to fix libgpod, and use the
information exported (which should be much more accurate and detailed
than what m-p-i contains) through libudev.

Looking forward to imobiledevice  support in Amarok ;-)

Cheers,

Tom


More information about the Amarok-devel mailing list