diff --git a/mtp/mtp_MtpServer.cpp b/mtp/mtp_MtpServer.cpp index 96a1e945..b53d07a8 100755 --- a/mtp/mtp_MtpServer.cpp +++ b/mtp/mtp_MtpServer.cpp @@ -56,6 +56,11 @@ int twmtp_MtpServer::setup() { usePtp = false; MyMtpDatabase* mtpdb = new MyMtpDatabase(); + /* Sleep for a bit before we open the MTP USB device because some + * devices are not ready due to the kernel not responding to our + * sysfs requests right away. + */ + usleep(800000); #ifdef USB_MTP_DEVICE #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) diff --git a/partitionmanager.cpp b/partitionmanager.cpp index be6674b8..ea61d57d 100644 --- a/partitionmanager.cpp +++ b/partitionmanager.cpp @@ -1922,7 +1922,6 @@ bool TWPartitionManager::Enable_MTP(void) { TWFunc::write_file("/sys/class/android_usb/android0/idVendor", vendorstr); TWFunc::write_file("/sys/class/android_usb/android0/idProduct", productstr); property_set("sys.usb.config", "mtp,adb"); - usleep(2000); // Short sleep to prevent an occasional kernel panic on some devices std::vector::iterator iter; /* To enable MTP debug, use the twrp command line feature to * twrp set tw_mtp_debug 1