Hi.
I've managed to get Alcatel One Touch Pop 2 working with libmtp. It is an android 4.4 phone that doesn't support usb storage. After connecting, the phone provides a cdrom drive with windows drivers. Manually ejecting the cdrom device (/dev/sr0) makes the device working. When looking for some automatic solution, I've created the following udev rule:
KERNEL=="sr?", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="f017", RUN+="/usr/bin/eject '/dev/%k'"
This works, but there is also a software usb-modeswitch, that performs a similar action, and already knows this device. However, usb-modeswitch causes that the device is grabbed by kernel modules 'option', 'usb_wwan', and 'usbserial', and therefore it is unusable by the mtp library.
I'd be nice if this device works out of the box, but I'm not sure what is the correct solution that suits everybody needs. Unfortunately, it seems that the same vendor-product id is used by some usb modems. I guess that the correct way to handle this device is to install usb-modeswitch (that performs the switch of device mode) and mtp-library then detaches usbserial driver from this device.
mtp-detect output is attached to this report.
Here is dmesg output when no switching is enabled:
[16258.544179] usb 4-2: new high-speed USB device number 4 using ehci-pci
[16258.679349] usb 4-2: New USB device found, idVendor=1bbb, idProduct=f017
[16258.679363] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16258.679371] usb 4-2: Product: Android
[16258.679377] usb 4-2: Manufacturer: Android
[16258.679384] usb 4-2: SerialNumber: a3c9e7a3
[16258.680641] usb-storage 4-2:1.0: USB Mass Storage device detected
[16258.684357] scsi4 : usb-storage 4-2:1.0
[16259.685077] scsi 4:0:0:0: Direct-Access Linux File-CD Gadget 0310 PQ: 0 ANSI: 2
[16259.685621] scsi 4:0:0:1: CD-ROM Linux File-CD Gadget 0310 PQ: 0 ANSI: 2
[16259.686326] sd 4:0:0:0: Attached scsi generic sg1 type 0
[16259.693867] sr0: scsi-1 drive
[16259.694742] sr 4:0:0:1: Attached scsi CD-ROM sr0
[16259.695103] sr 4:0:0:1: Attached scsi generic sg2 type 5
[16259.695323] sd 4:0:0:0: [sdb] Attached SCSI removable disk
Here is dmesg output of ejecting the device:
[16640.407301] usb 4-2: USB disconnect, device number 6
[16640.652198] usb 4-2: new high-speed USB device number 7 using ehci-pci
[16640.787866] usb 4-2: New USB device found, idVendor=1bbb, idProduct=a00e
[16640.787880] usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16640.787888] usb 4-2: Product: Android
[16640.787894] usb 4-2: Manufacturer: Android
[16640.787900] usb 4-2: SerialNumber: a3c9e7a3
Anonymous
Ok, I've tried to create a fix myself, and it was quite simple (patch attached). With this patch and usb-modeswitch installed, the phone works. I also tried to put original product id (f017) and disable usb-modeswitch, but that didn't work.
the android flag has DEVICE_FLAG_UNLOAD_DRIVER, where we unload the kernel driver.
i applied your patch for the next release ,thanks!