Re: [Libmtp-discuss] udev and libmtp: detect a new mtp device based on its USB interface descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/10/26  <lan.liu@xxxxxxxxx>:

> This is Lan from PC Connectivity team, Nokia (China) Investment Co. Ltd.

Great to hear from you! All of us working with libmtp really
like vendor participation.

> Nokia has launched N8 which integrate the MTP feature developed by our team.
> I just submited a feature request on sourceforge.
> https://sourceforge.net/tracker/?func=detail&aid=3094599&group_id=158745&atid=809064
>
> so that libmtp could include N8 device info in its coming new release.

OK I have added it to our device database. I will try to push a new
libmtp release soon so it will get into distributions.

> While, Nokia will ship more devices with MTP support in the near future,
> each with different product id, we are wondering whether this is a ‘ONCE for
> All’ solution for the new device issue: instead of adding each new device’s
> vendor id, product id , could libmtp help udev daemon detect the device as a
> MTP device based on USB interface descriptor

I've wanted to do this for a long time, sadly my time has been a bit
limited. If Nokia can help out, I'd be delighted.

I'm looping in linux-usb on this so we can get some broader discussion.

> including:
>
> Class/sub/proto(06/01/01) + MS OS descriptor

This is the real trick. Either the kernel has to do this MS OS descriptor
probing and provide information to udev, or udev has to call some small
binary program (could be part of the libmtp-examples tools) that tell
whether the device has an MS OS descriptor or not. Probably the
latter is a better approach. (Anyone for kernel mods?)

I think it is possible to add some config file to udev from the libmtp
install that does this probing before it passes any information on
to the rest of userspace. However that's a lot of work for me.

But:
- Create examples/mtp-probe.c calling into a new libmtp interface
  to just probe devices
- Provide this into udev scripts so these devices are flagged as
  music players.

And actually just probing 06/01/01 is not enough, there are plenty of devices
out there not using this class but still MTP. I think the Microsoft OS:es
will probe also everything that has a custom interface.

Anyone that wants to help out with this?

> or
>
> Class/sub/proto(06/01/01) + string descriptor of 6/1/1 interface contains a
> string text “MTP”

This could probably be done the same way, with some udev script
from libmtp,  maybe something real simple now, just parsing the interface
string. This can be done by anyone who has some time.

> Based on this, I just wonder could libmtp generate a more general udev rules
> for udev daemon to match against mtp device, based on the usb interface
> desciptor, see above labeled as green. Or any other means that could solve
> this issue? Thanks.

I think the outline above should work just fine. However I don't have
the time to do it. If you can help out, patches are welcome!

Else we'll be just updating the device database perpetually...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux