Mobileread
MTP support: Testers needed
#1  kovidgoyal 09-14-2012, 02:44 AM
Hi all,

This weeks' calibre release (0.8.69) contains beta MTP drivers. MTP drivers allow calibre to connect via USB cable to devices that dont show up as a disk drive. Examples of such devices are newer Android phones/tablets, like the Nexus 7 and the Kindle Fire HD.

calibre has drivers that work (I hope) on Windows Vista and newer and Linux. On Windows XP you may be able to get it to work by installing Windows Media Player 11 or newer and rebooting your computer. There is no support for OS X.

To enable the beta drivers, go to Preferences->Pugins and click the Plugin Tweaks button in the bottom right. Type the following text into the box:

Code
test_mtp_driver = True
Click the OK button and then click the Apply button in the top left corner, and restart calibre. Your MTP device should now be detected.

These drivers are beta quality, use them only if you are willing to help test and debug problems.

You should be able to browse the files on the device, send files to the device, delete files from the device and add files from the device to your calibre library. You can check where on the device a particular book is by clicking on the books' entry in the calibre device view, the path to the file will show up in the book details panel on the right.

The device driver is highly customizable. To customize it, simply right click on the device icon in the calibre toolbar (with your device connected) and select configure this device. You can change:

These drivers are very new and I have only done a limited amount of testing, on Linux and Windows 7, with one Android 2.3 and one 4.1 device, so there will likely be problems.

*The reason there is no support for OS X is that Apple does not support MTP and the open source MTP libraries that are used in linux have problems on OS X (they cause memory leaks and hang on computers with certain USB devices)

#2  PeterT 09-14-2012, 08:39 AM
I don't see a Plugins Tweak button....

#3  mbovenka 09-14-2012, 08:47 AM
Kovid,

I just tried it with my Samsung Galaxy SPlus ('GT-I9001'), running Android 2.3.5 in 'MediaPlayer' USB mode.

It's recognized, but as soon as I actually try to do something with it (as in clicking the Device icon to list books on it), I get 'Error communicating with device' with the following details:

calibre, version 0.8.69
ERROR: Error: Error communicating with device

local variable 'p' referenced before assignment

Traceback (most recent call last):
File "site-packages\calibre\gui2\device.py", line 85, in run
File "site-packages\calibre\gui2\device.py", line 450, in _books
File "site-packages\calibre\devices\mtp\driver.py", line 144, in books
File "site-packages\calibre\devices\mtp\driver.py", line 120, in get_driveinfo
File "site-packages\calibre\devices\mtp\windows\driver.py", line 222, in filesystem_cache
File "site-packages\calibre\devices\mtp\filesystem_cache.py", line 207, in __init__
UnboundLocalError: local variable 'p' referenced before assignment

And the screen remains blank. Afterwards I can click on the Device or Card A buttons, but nothing happens; the screen remains blank.

Trying to configure it gets me a ThreadingViolation error with the following details:

calibre, version 0.8.69
ERROR: Unhandled exception: <b>ThreadingViolation</b>:You cannot use the MTP driver from a thread other than the thread in which startup() was called

Traceback (most recent call last):
File "site-packages\calibre\gui2\device_drivers\mtp_config.py ", line 249, in browse
File "site-packages\calibre\devices\mtp\windows\driver.py", line 205, in filesystem_cache
File "site-packages\calibre\devices\mtp\windows\driver.py", line 32, in check_thread
ThreadingViolation: You cannot use the MTP driver from a thread other than the thread in which startup() was called

Let me know if you need any more info or if you want me to try anything.

Edit: by 'configuring it' I meant trying to add a format-specific send directory rule.

#4  mbovenka 09-14-2012, 08:55 AM
Quote PeterT
I don't see a Plugins Tweak button....
Preferences -> Tweaks -> Plugin Tweaks (at the bottom of the screen).

#5  PeterT 09-14-2012, 09:00 AM
Duh... I missed that!

#6  PeterT 09-14-2012, 09:06 AM
For what it's worth my Nokia dumb phone is correctly seen

#7  kovidgoyal 09-14-2012, 09:37 AM
@mbovenka: looks like your device has some files whose parent folders dont exist. I've add code to handle that, if you can run from source, the fix is already committed, otherwise I'll upload a build with the fix in a bit.

#8  kovidgoyal 09-14-2012, 09:39 AM
Quote PeterT
For what it's worth my Nokia dumb phone is correctly seen
Yeah I am going to have to implement some kind of popup the first time a device is detected that asks the user to confirm they want the mtp device handled by calibre, otherwise all the phones/cameras/music players will get detected.

#9  kovidgoyal 09-14-2012, 11:00 AM
@mbovenka: I re-uploaded the 0.8.69 build with the fix, so if you re-download and re-install that error will hopefully go away.

#10  Hopskinny 09-14-2012, 10:56 PM
Wow, that works! Using WinXP (with WMP11 installed), I:
1) Installed Calibre v0.8.69.
2) Edited the plug in tweak as instructed, forgetting to hit apply.
3) Tried again and did it properly this time.
4) Calibre told me to restart Calibre, and I always do what I am told.
5) Calibre recognised my Nexus 7 running Android 4.1.1. It wouldn't before this.
6) I instructed Calibre to show books in the main memory of the device, and it listed absolutely everything on the Nexus 7.
7) I went back to the Calibre library on my PC, and instructed Calibre to send a book to the device that wasn't already on there, and it did as it was told. Good Calibre!

Well, it is working in WinXP for me! Thank you for your amazing work! Do you want me to test any other function of this latest version, Kovid?

  Next »  Last »  (1/7)
Today's Posts | Search this Thread | Login | Register