MTP plugin: New plugin MTP/PTP for USB-connected devices (Android, cameras, iOS Camera Roll)#3382
MTP plugin: New plugin MTP/PTP for USB-connected devices (Android, cameras, iOS Camera Roll)#3382stpork wants to merge 11 commits into
Conversation
9c16069 to
c3f9c4f
Compare
|
Please mention in README.md that libusb-1.0-0-dev is needed to install and add it to example apt command as its seems its required now unless -MTP=NO specified for cmake. |
Browse, copy, move, rename and delete files on USB-connected phones and cameras (Android, iOS PTP, digital cameras). Built on vendored libmtp.
Instead, I wired libusb statically into the plugin and rebased. |
|
It was a terrible idea, now it just not working previous version worked great. Is it possible to rallback to the third commit, when the plugin worked? It is better to have extra dependency, than non-functional pluggin I'm not using FHS distro, so that could be a reason it dosn't works for me. Here is far:about fixed in patch bellow |
|
I tried add a wayout for Nix to make it buildable There is an easy way to take if there is Nix or not in CMake but then I do not understand what to change. The revision 7488db1 was fully working, but now there is a mess i do not understand how to solve fixed in patch bellow |
|
Finally wrote a working patch now ed3fa3d is working for Nix too |
|
@tempergate Thanks for the patch and the repro log.
For your Nix derivation: keep libusb in buildInputs, no flag needed. If auto-detect fails, add -DMTP_SYSTEM_LIBUSB=ON. When system libusb is picked, cmake prints: Please check on NixOS and confirm the plugin sees your device? Also: if you can build with -DMTP_SYSTEM_LIBUSB=OFF (forces vendored) and run with LIBUSB_DEBUG=4 I can look at why the static libusb fails on NixOS — the log you posted only shows Libusb1 init failed, which isn't enough to see the root cause. |
Thanks, it works |
IMHO static usage of external library is not good unless absolutely necessary. For example for packaging in Debian/Ubuntu repositories we need addition restrictions. @alexmyczko or @mitya57 please explain the preferable way in such case. |
|
@akruphi I've added the flag and set it as ON by default: |
|
For Debian/Ubuntu, I would prefer if it could build with system MTP too ( |
|
@mitya57 , yes that is possible - there is -DMTP_SYSTEM_LIBMTP flag too. However, you will get like 10x slower enumerations on directories with > 100 files due to sub-optimal protocol implementation in standard libMTP. Still manageable for ordinary user though. If that's ok you can use for Debian something like |
|
Is it possible to forward your optimizations to upstream libMTP? |
|
It is possible but there are few things I was trying to avoid:
I would suggest that we keep it "default slow" on Debian. It is like 1-5 seconds of waiting for the user instead of instant browse, which is mitigated by cache on subsequent access of same dirs (once objects are in cache - it is instant). I will try to submit PR to libMTP when have time but have some doubts if they would consider it is as "risky" due to fact that some old Nokia phones cannot do them properly. |

A new plugin to browse USB-connected MTP/PTP devices (Android, cameras, iOS Camera Roll) directly from the file panel.
-DMTP=OFFto disable. Seemtp/README.mdfor full notes.