From: Philip L. <ph...@ov...> - 2018-05-14 17:57:18
|
On 2018-05-13 23:29, Andrea Vai wrote: > >> You can override the device timeout value, and libmtp actually does >> this in a different call that retrieves the list of all files on the >> device. The gvfs code that is relevant in your example is only >> getting >> the file list for a single directory but if the device has a silly >> default timeout (likely - thank's samsung), it might still hit it. >> So >> I'd try setting a larger timeout and see if it helps. If that does >> help, you can then look at implementing it as a device quirk. >> >> See get_all_metadata_fast for the current usage and then look at >> LIBMTP_Get_Files_And_Folders for where you'd want to adjust the >> timeout >> (around the call to ptp_getobjecthandles). > > Thank you for your kind reply, Phil. I downloaded the current source > code and found the strings you mention in libmtp.c. I guess I should > increase the "60000" value at line 2620. Though, I am not skilled in > linux development, so some further hints would be greatly appreciated > (should I change the value, remove my libmtp installed package, build > and install the hacked source code, and try if it works?). In the > meantime, I will try to figure it out. Hi Andrea, No - you want to apply the same technique used in get_all_metadata_fast in LIBMTP_Get_Files_and_Folders, so set the timeout to 60000 before the call to ptp_getobjecthandles and then restore it to the previous value afterwards. As for testing it out, the most robust way would be to build it and then add a file in /etc/ld.so.config.d/ which lists the location of your built libmtp.so. Then after you run `ldconfig`, it should have higher priority than the installed library. You can verify this by running ldd on the gvfsd-mtp binary. --phil |