Giter Site home page Giter Site logo

simple-mtpfs's Introduction

ABOUT

SIMPLE-MTPFS (Simple Media Transfer Protocol FileSystem) is a file system for Linux (and other operating systems with a FUSE implementation, such as Mac OS X or FreeBSD) capable of operating on files on MTP devices attached via USB to local machine. On the local computer where the SIMPLE-MTPFS is mounted, the implementation makes use of the FUSE (Filesystem in Userspace) kernel module. The practical effect of this is that the end user can seamlessly interact with MTP device files.

LATEST VERSION

Latest sources of the software can be found at: simple-mtpfs

INSTALLATION

Simple-mtpfs depends on fuse (version >= 2.7.3) and libmtp. It also requires the C++ compiler to support C++11 standard.

To install the driver, follow these steps:

$ mkdir build && cd build
$ ../configure
$ make
$ make install (as root)

Due to MTP nature, it is necessary to use a folder, where the temporary files downloaded will be downloaded. The project can be configured to use custom directory for such files. To configure the simple-mtpfs to use desired temporary directory, add --with-tmpdir=TMPDIR option to configure script. Default value for temporary directory is /tmp.

If you got the sources from git repository, first you have to run:

$ ./autogen.sh

MOUNTING

To mount MTP-based device to your local filesystem, simply run:

$ simple-mtpfs mountpoint [options]

If you have more than one MTP device attached to the computer, it is possible to specify which device, you are willing to mount. Either by entering its order number or special file usually placed in /dev:

MOUNTING BY NUMBER

$ simple-mtpfs --device <number> mountpoint [options]

Where the <number> should contain a numeric order of the device, you are about to mount. To get a list of all attached devices, execute following:

$ simple-mtpfs --list-devices
<number>: <device name>
<number>: <device name>
...

MOUNTING BY SPECIAL FILE

Enter special device file as the first argument to simple-mtpfs. The special device file is usually named as /dev/libmtp-*.

$ simple-mtpfs <device> mountpoint [options]

UNMOUNTING

To unmount MTP device, execute following command:

$ fusermount -u <mountpoint>

BUG REPORTS

Report bugs to [email protected] or simple-mtpfs issues.

simple-mtpfs's People

Contributors

barak avatar cyp avatar eugenesan avatar jh-hsd avatar jimmyohn avatar kheyse avatar klavsklavsen avatar phatina avatar risacher avatar wulf7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-mtpfs's Issues

simple-mtpfs mounts android ok but file sizes are wrong

example:

download install simple-mtpfs from head
cd /mnt
mkdir android
simple-mtpfs android
Unable to open ~/.mtpz-data for reading, MTPZ disabled.

du -b /mnt/android/DCIM/Camera/IMG_20131013_081500.jpg
749356
Image viewer error: Application transferred too few scanlines

bittorrentsync file transfer:
du -b /mnt/bittorrentsync/Camera/IMG_20131013_081500.jpg
749387
Image viewed ok

hope this helps,

Ubuntu 13.10 | x86_64
Nexus 4 | Android 4.3

Can't set modification time in mounted MTP device

I am running simple-mtpfs HEAD with osxfuse 2.7.5 on OS X Yosemite 10.10.3. I'm getting the following error in a synchronization application, when the modification time of a mounted file is trying to be set:

Cannot write modification time of "/Users/me/mtp_mounted/file..."
Error Code 13: Permission denied (setattrlist)

Also, all mounted files have a creation time of 1/1/1970.

Any ideas?

"get partial object" doesn't work

Looks like "get partial object" isn't working. Even if simple-mtpfs is detecting that capability.


System: openSUSE 42.2

Tested simple-mtpfs versions (same results):

  • 0.2 - by openSUSE 42.2
  • 0.3 - Compiled by me, including also self compiled libmtp-1.1.13. Both (simple-mtpfs and libmtp) compiled with the following (is that enough/correct!?): CFLAGS=-DHAVE_LIBMTP_CHECK_CAPABILITY=1 CPPLAGS=-DHAVE_LIBMTP_CHECK_CAPABILITY=1 CXXFAGS=-DHAVE_LIBMTP_CHECK_CAPABILITY=1 ./configure

MTP-Device: Samsung galaxy S4 Mini (i9195), running Android 7.1.1 (LineageOS 14.1).

$ simple-mtpfs --list-devices --verbose
1: SamsungGalaxy models (MTP)
  - can get  partial object: yes
  - can send partial object: yes
  - can edit objects       : yes

Reading 1KB at position 100MB (100.000.000 bytes).

# simple-mtpfs mount:
$ time hexdump -s 100000000 -n 1024 bigfile
-> 23 seconds

# gvfs mount:
$ time hexdump -s 100000000 -n 1024 bigfile
-> 0.3 seconds

Help text doesn't mention --verbose

Help text doesn't mention --verbose. I think it'd be nice to make it obvious there is a way to get more details on what is happening in case of errors.

make fails: simple_mtpfs-simple-mtpfs-fuse.o Error 1

Making all in src
  CXX      simple_mtpfs-simple-mtpfs-fuse.o
../../src/simple-mtpfs-fuse.cpp:589:18: error: no member named 'fdatasync' in the global namespace
        return ::fdatasync(fi->fh);

I just cloned from master, ran ./autogen.sh and then followed the rest of the instructions.

Cannot see disk mounted

Debian Jessie swallows th command
simple-mtpfs --device 1 mountpoint -o allow_other
but then if I run fdisk -lI cannot see the disk mounted.
Where am I wrong?

"-lmtp not found" on MacPorts

I've used MacPorts to install libmtp on my mac, by default MacPorts use prefix /opt/local for all installed software, so in order to configure I had to use command:

PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include" ./configure

PKG_CONFIG_PATH is for osxfuse not sure why it's not autodetected, probably because pkg-config is from macports too and expects it to be in /opt/local.

I have no knowledge to send PR but hopefully it could be useful for others.

Making a release for easy use on macOS

Could you make a new release with the latest point, @phatina ?
Sadly only the very old version (0.2.0) is available on Homebrew 😢
Since they won't also accept unversioned things, nobody can update your great product.

Thanks

Zero size arrays

Hi there, trying to make on my Mac, running MacPorts-2.3.5-10.12-Sierra, and FUSE for Mac 3.5.4. If there's any other info I can send you, please let me know!

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in src
  CXX      simple_mtpfs-simple-mtpfs-fuse.o
  CXX      simple_mtpfs-simple-mtpfs-libmtp.o
  CXX      simple_mtpfs-simple-mtpfs-log.o
  CXX      simple_mtpfs-simple-mtpfs-main.o
  CXX      simple_mtpfs-simple-mtpfs-mtp-device.o
../../src/simple-mtpfs-mtp-device.cpp:28:11: warning: '_DARWIN_USE_64_BIT_INODE' macro redefined [-Wmacro-redefined]
#  define _DARWIN_USE_64_BIT_INODE
          ^
<command line>:4:9: note: previous definition is here
#define _DARWIN_USE_64_BIT_INODE 1
        ^
1 warning generated.
  CXX      simple_mtpfs-simple-mtpfs-sha1.o
  CXX      simple_mtpfs-simple-mtpfs-tmp-files-pool.o
  CXX      simple_mtpfs-simple-mtpfs-type-dir.o
  CXX      simple_mtpfs-simple-mtpfs-type-file.o
  CXX      simple_mtpfs-simple-mtpfs-type-tmp-file.o
  CXX      simple_mtpfs-simple-mtpfs-util.o
In file included from ../../src/simple-mtpfs-util.cpp:38:
/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0/libusb.h:736:3: warning: zero size arrays are an extension
      [-Wzero-length-array]
        [0] /* non-standard, but usually working code */
         ^
/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0/libusb.h:767:3: warning: zero size arrays are an extension
      [-Wzero-length-array]
        [0] /* non-standard, but usually working code */
         ^
/usr/local/Cellar/libusb/1.0.21/include/libusb-1.0/libusb.h:1263:3: warning: zero size arrays are an extension
      [-Wzero-length-array]
        [0] /* non-standard, but usually working code */
         ^
3 warnings generated.
  CXXLD    simple-mtpfs
clang: warning: argument unused during compilation: '-pthread'
Making all in man
make[2]: Nothing to be done for `all'.
make[2]: Nothing to be done for `all-am'.

Thanks for your help!

bad connection leave mount directory in bad state

I used simple-mtpfs to mount a Moto X, which failed. But now the mount directory is unavailable/unremoveable.

ls -l /mnt
ls: cannot access /mnt/motox: Transport endpoint is not connected
total 0
d?????????? ? ? ? ? ? motox
rmdir /mnt/motox
rmdir: failed to remove ‘/mnt/motox’: Device or resource busy
lsof | grep motox
lsof: WARNING: can't stat() fuse.simple-mtpfs file system /mnt/motox
fuser -km /mnt/motox
Cannot stat /mnt/motox: Transport endpoint is not connected

Or is this a libmtp issue?

make fails

Make fails for me when trying to build freshly checked-out code (after fixing the ./configure issue I reported previously)

$ make
make all-recursive
make[1]: Entering directory /home/calum/src/simple-mtpfs' Making all in src make[2]: Entering directory/home/calum/src/simple-mtpfs/src'
CXX simple_mtpfs-simple-mtpfs-fuse.o
simple-mtpfs-fuse.cpp: In constructor ‘SMTPFileSystem::SMTPFileSystemOptions::SMTPFileSystemOptions()’:
simple-mtpfs-fuse.cpp:165: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In static member function ‘static int SMTPFileSystem::SMTPFileSystemOptions::opt_proc(void_, const char_, int, fuse_args_)’:
simple-mtpfs-fuse.cpp:190: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In constructor ‘SMTPFileSystem::SMTPFileSystem()’:
simple-mtpfs-fuse.cpp:224: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In member function ‘bool SMTPFileSystem::parseOptions(int, char__)’:
simple-mtpfs-fuse.cpp:270: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_enable_move’ of NULL object
simple-mtpfs-fuse.cpp:270: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:271: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_device_no’ of NULL object
simple-mtpfs-fuse.cpp:271: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:272: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_list_devices’ of NULL object
simple-mtpfs-fuse.cpp:272: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:273: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_list_devices’ of NULL object
simple-mtpfs-fuse.cpp:273: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:274: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_verbose’ of NULL object
simple-mtpfs-fuse.cpp:274: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:275: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_verbose’ of NULL object
simple-mtpfs-fuse.cpp:275: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:276: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_version’ of NULL object
simple-mtpfs-fuse.cpp:276: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:277: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_version’ of NULL object
simple-mtpfs-fuse.cpp:277: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:278: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_help’ of NULL object
simple-mtpfs-fuse.cpp:278: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:279: warning: invalid access to non-static data member ‘SMTPFileSystem::SMTPFileSystemOptions::m_help’ of NULL object
simple-mtpfs-fuse.cpp:279: warning: (perhaps the ‘offsetof’ macro was used incorrectly)
simple-mtpfs-fuse.cpp:280: error: expected primary-expression before ‘.’ token
simple-mtpfs-fuse.cpp: In member function ‘void SMTPFileSystem::printHelp() const’:
simple-mtpfs-fuse.cpp:350: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In member function ‘void SMTPFileSystem::printVersion() const’:
simple-mtpfs-fuse.cpp:363: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In member function ‘bool SMTPFileSystem::exec()’:
simple-mtpfs-fuse.cpp:398: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In member function ‘void_ SMTPFileSystem::init(fuse_conn_info_)’:
simple-mtpfs-fuse.cpp:410: error: ‘nullptr’ was not declared in this scope
simple-mtpfs-fuse.cpp: In member function ‘int SMTPFileSystem::readdir(const char_, void_, int ()(void, const char_, const stat_, off_t), off_t, fuse_file_info_)’:
simple-mtpfs-fuse.cpp:733: error: expected initializer before ‘:’ token
simple-mtpfs-fuse.cpp:741: error: expected primary-expression before ‘for’
simple-mtpfs-fuse.cpp:741: error: expected ‘;’ before ‘for’
simple-mtpfs-fuse.cpp:741: error: expected primary-expression before ‘for’
simple-mtpfs-fuse.cpp:741: error: expected ‘)’ before ‘for’
simple-mtpfs-fuse.cpp:741: error: expected initializer before ‘:’ token
simple-mtpfs-fuse.cpp:749: error: expected primary-expression before ‘return’
simple-mtpfs-fuse.cpp:749: error: expected ‘;’ before ‘return’
simple-mtpfs-fuse.cpp:749: error: expected primary-expression before ‘return’
simple-mtpfs-fuse.cpp:749: error: expected ‘)’ before ‘return’
make[2]: *** [simple_mtpfs-simple-mtpfs-fuse.o] Error 1
make[2]: Leaving directory /home/calum/src/simple-mtpfs/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/calum/src/simple-mtpfs'
make: *** [all] Error 2

CentOS 6.5
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
glibc-2.12-1.132.el6.x86_64

bogus storage size on freebsd

$ df -h
Filesystem               Size    Used   Avail Capacity  Mounted on
...
df: File system /media/android does not have a block size, assuming 512.
/dev/fuse                 20G    8.9G     11G    43%    /media/android
$ adb shell df
Filesystem               Size     Used     Free   Blksize
...
/mnt/shell/emulated     11.7G     6.7G     5.1G   4096
/storage/sdcard1        29.4G    10.9G    18.5G   32768

On POSIX systems f_bsize from statfs == f_frsize from statvfs.

diff --git a/src/simple-mtpfs-fuse.cpp b/src/simple-mtpfs-fuse.cpp
index 58acd1c..9a9a451 100644
--- a/src/simple-mtpfs-fuse.cpp
+++ b/src/simple-mtpfs-fuse.cpp
@@ -568,7 +568,7 @@ int SMTPFileSystem::release(const char *path, struct fuse_file_info *file_info)
 int SMTPFileSystem::statfs(const char *path, struct statvfs *stat_info)
 {
     uint64_t bs = 1024;
-    stat_info->f_bsize = static_cast<unsigned long>(bs);
+    stat_info->f_frsize = static_cast<unsigned long>(bs);
     stat_info->f_blocks = m_device.storageTotalSize() / bs;
     stat_info->f_bavail = m_device.storageFreeSize() / bs;
     stat_info->f_bfree = stat_info->f_bavail;
$ df -h
Filesystem               Size    Used   Avail Capacity  Mounted on
...
/dev/fuse                 41G     17G     23G    43%    /media/android

./configure fails

Running autogen.sh and then ./configure produces the following error.

checking for FUSE... yes
checking for LIBUSB1... yes
./configure: line 4785: syntax error near unexpected token fi' ./configure: line 4785:fi'

Removing the unused "else" at this line fixes the problem.

CentOS 6.5

Can't delete actual files on MTP device.

Hi
Perhaps this is a limitation of this approach.
Please see my long thread and attempt to delete files
http://www.linuxquestions.org/questions/linux-software-2/simple-mtpfs-unable-to-delete-files-%5Bpermissions-issue%5D-4175596482/

I had 90% of a solution
Looking at the various FUSE options I saw that there is allow_root
I also discovered that FUSE options are set when you mount the device

$ simple-mtpfs ~/camera -o allow_root
However, i at first got an error with the above and first had to edit my /etc/fuse.conf and uncomment 'user_allow_other'

So then

$ simple-mtpfs ~/camera -o allow_root
$ ##chmod not necessary, we are already accessing camera as root 
$ sudo rm -rf ~/camera/DCIM/Camera/*

To confirm unmounted, remounted and checked mounted Camera directory. All photos seemed to be gone!

$ fusermount -u ~/camera
$ simple-mtpfs ~/camera -o allow_root

However, the original photos on the actual physical camera are NOT deleted even though they seem to be when I remount the camera.

Remove dependency on fuse-utils

At least Ubuntu 13.10 does not have fuse-utils package anymore. I removed it from debian/control, packaged simple-mtpfs and it worked nicely.

Please check if the dependency is needed for something, and remove or change it as necessary.

Thanks!

support TMPDIR environmental variable.

simple-mtpfs have hardcoded path for /tmp, which is imo a bit wrong, in my very case /tmp is a 128M tmpfs, so I am not able to transfer files bigger than that.

Also, if I setup a -o tmp-dir= it does not treat it like tmpdir but rather than like a prefix, after manualy creating $TMPDIR/simple-mtpfs I saw that it first deleted $TMPDIR/simple-mptfs dir, them, created something like $TMPDIR/simple-mtpfs1245asd (a random chars at the ending, inside $TMPDIR, not under $TMPDIR/simple-mtpfs subdir).

Building on PPC

Hi,

I'm trying to build simple-mtpfs for leopard PPC through tigerbrew.
I tried using homebrew current formula but i'm getting this configure error:

configure: error: *** A compiler with support for C++11 language features is required.

Can you help?
Since both OSXFuse and SSHFS have been built for Leopard PPC
do you think the same can be done for simple-mtpfs?

Best regards,
voidRunner

Can't mount device

So simple-mtpfs now works for me on Mavericks and I can build it successfully, it also detects the attached device:

13:11:04 /V/phone $ simple-mtpfs -l
1: NokiaNokia Lumia WP8

However, no matter what I try I can't mount it and I can't seem to get debug output either:

13:12:17 /V/phone $ simple-mtpfs /Volumes/phone/
13:12:52 /V/phone $ echo $status
1

13:13:04 /V/phone $ simple-mtpfs /Volumes/phone/ -f -d
13:12:52 /V/phone $ echo $status
1

So how do I go about this?

New tag release?

This isn't really much of an issue but I've noticed quite a few fixes have been made since that last tagged release (0.1). Is an upcoming release being considered?

The reason I ask is because I maintain an Arch Linux AUR package for simple-mtpfs and it would be nice to have a new release. I can of course create a package that follows the git master but if you're planning another release there probably isn't a point in me doing this.

Fedora 25 cannot mount mtp-enable Samsung Galaxy

Hello,
I see this:

simple-mtpfs -l

1: SamsungGalaxy models (MTP)

But when I try to mount onto /mnt/samsung, and I do ls /mnt/samsung, the directory is empty. As well, I get this in my system logs:

Dec 26 16:41:16 rodin kernel: usb 3-1: usbfs: process 6145 (simple-mtpfs) did not claim interface 0 before use
Dec 26 16:41:16 rodin kernel: usb 3-1: reset high-speed USB device number 42 using xhci_hcd
Dec 26 16:41:17 rodin kernel: usb 3-1: usbfs: process 6145 (simple-mtpfs) did not claim interface 0 before use

I get this in my logs when I plug in the phone. I don't know what kamera.kio is there for. I tried looking for it, and I removed the package "kamera" thinking there may be a conflict, but I even after removing the package I still get this:

Dec 26 16:42:10 rodin kernel: usb 3-1: new high-speed USB device number 43 using xhci_hcd
Dec 26 16:42:10 rodin kernel: usb 3-1: New USB device found, idVendor=04e8, idProduct=6860
Dec 26 16:42:10 rodin kernel: usb 3-1: New USB device strings: Mfr=3, Product=4, SerialNumber=5
Dec 26 16:42:10 rodin kernel: usb 3-1: Product: SAMSUNG_Android
Dec 26 16:42:10 rodin kernel: usb 3-1: Manufacturer: SAMSUNG
Dec 26 16:42:10 rodin kernel: usb 3-1: SerialNumber: f1a22b89
Dec 26 16:42:10 rodin dolphin[3797]: QObject::connect: invalid null parameter
Dec 26 16:42:10 rodin dolphin[3353]: QObject::connect: invalid null parameter
Dec 26 16:42:10 rodin kdeinit5[1744]: QObject::connect: invalid null parameter
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: stat(" "/" ")
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: stat(" "/Samsung%20Galaxy%20models%20(MTP)@usb:003,009" ")
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: statRegular(" "/Samsung%20Galaxy%20models%20(MTP)@usb:003,009" ")
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: KameraProtocol::setCamera( "Samsung Galaxy models (MTP)" , "usb:003,009" )
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: Initializing camera
Dec 26 16:42:10 rodin /usr/libexec/gdm-x-session[1512]: Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: Opening camera model "Samsung Galaxy models (MTP)" at "usb:003,009"
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: KameraProtocol::openCamera at 3360
Dec 26 16:42:10 rodin kdeinit5[3360]: kamera.kio: Unable to init camera: "Bad parameters"
Dec 26 16:42:10 rodin kdeinit5[3360]: finished() called after error()! Please fix the KIO slave.
Dec 26 16:42:10 rodin kwin_x11[1806]: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 37513, resource id: 0, major code: 14 (GetGeometry), minor code: 0
Dec 26 16:42:11 rodin /usr/libexec/gdm-x-session[1512]: LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:1
Dec 26 16:42:11 rodin /usr/libexec/gdm-x-session[1512]: LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:1

Thanks for any help.

Phone and Card directories empty on Android 4.4.4

I mounted an Android phone but inside the mountpoint, I only find the Phone and Card directories, with nothing inside them.

$ simple-mtpfs phone
$ cd phone/
$ ls -laR
total 0
drwxrwxr-x  2 dcorking  staff  0  1 Jan  1970 Card
drwxrwxr-x  2 dcorking  staff  0  1 Jan  1970 Phone

./Card:

./Phone:

I am on Mac OS X 10.11.6

What have I done wrong?

The phone works with gvfs on Linux and with Android File Transfer on Mac OS X. (However on gvfs my filemanager mounts Phone and Card as separate mount points.)

$ simple-mtpfs --version
simple-mtpfs version 0.3.0
OSXFUSE 3.6.3
FUSE library version: 2.9.7
fuse: no mount point
$ simple-mtpfs --list-devices
1: SamsungGalaxy models (MTP)

Missing newline?

This is incredibly minor but I noticed the output is slightly different between 0.1 and 0.2

0.1

[dan@dan-mainbox ~]$ ~/dev/simple-mtpfs/bin/src/simple-mtpfs -d -f mnt/
Device 0 (VID=18d1 and PID=4ee1) is a Google Inc (for LG Electronics/Samsung) Nexus 4/10 (MTP).
Unable to open ~/.mtpz-data for reading, MTPZ disabled.Android device detected, assigning default bug flags

0.2

[dan@dan-mainbox ~]$ simple-mtpfs -d -f mnt/
Unable to open ~/.mtpz-data for reading, MTPZ disabled.[dan@dan-mainbox ~]$ 

only works in debug mode on OS X Mavericks

simple-mtpfs only works for me in debug mode. If I don't use debug mode, it will appear to succeed, but the mounted directory is empty. When using "simple-mtpfs -d ~/mtp" the mount succeeds and actually accesses files.

FWIW, tested with an Kindle Fire HDX and HTC One, both of which are unrecognized devices by libmtp at this time.

fuse version not matching - configure error on osx

Hi,
I am trying to compile simple-mtpfs on a Mac running 10.8.4 and Xcode 4.6.3.

I have got to a point where I have issues with "fuse" package.
What I have found is osxfuse 2.6.0 which was released really recently and I have set the corrent env variables I guess.

export PKG_CONFIG_PATH="/System/Library/Filesystems/prlufs.fs/Support/10.5/prlufs/lib/pkgconfig"

but when I run the configure file, I get this error:

Requested 'fuse >= 2.8' but version of prlufs is 2.7.3
configure:4135: error: Package requirements (fuse >= 2.8) were not met:

Requested 'fuse >= 2.8' but version of prlufs is 2.7.3

I have no idea on how to solve this, can you please help?
Thanks a lot

HAVE_LIBUSB1 + libmtp-1.1.9: LIBMTP PANIC: Trying to dump the error stack of a NULL device!

libmtp no longer allow calling usb_init() more than once. At least on FreeBSD and libusb autodetected this results in

$ simple-mtpfs /mnt
LIBMTP PANIC: Trying to dump the error stack of a NULL device!

from

  * thread #1: tid = 100151, 0x0000000800cf4804 libmtp.so.9`init_usb + 4 at libusb1-glue.c:144, stop reason = breakpoint 1.1
      frame #0: 0x0000000800cf4804 libmtp.so.9`init_usb + 4 at libusb1-glue.c:144
      frame #1: 0x0000000800cef24c libmtp.so.9`get_mtp_usb_device_list(mtp_device_list=0x00007fffffffe0c8) + 28 at libusb1-glue.c:513
      frame #2: 0x0000000800ceeccf libmtp.so.9`LIBMTP_Detect_Raw_Devices(devices=0x00007fffffffe150, numdevs=0x00007fffffffe158) + 47 at libusb1-glue.c:633
      frame #3: 0x0000000000417d98 simple-mtpfs`MTPDevice::connect(this=0x0000000802419260, dev_no=0) + 88 at simple-mtpfs-mtp-device.cpp:94
      frame #4: 0x000000000040b5a4 simple-mtpfs`SMTPFileSystem::exec(this=0x0000000802419080) + 708 at simple-mtpfs-fuse.cpp:399
      frame #5: 0x0000000000417837 simple-mtpfs`main(argc=4, argv=0x00007fffffffe398) + 471 at simple-mtpfs-main.cpp:46
      frame #6: 0x00000000004047cf simple-mtpfs`_start(ap=<unavailable>, cleanup=<unavailable>) + 367 at crt1.c:78

  * thread #1: tid = 100151, 0x0000000800cf4804 libmtp.so.9`init_usb + 4 at libusb1-glue.c:144, stop reason = breakpoint 1.1
    * frame #0: 0x0000000800cf4804 libmtp.so.9`init_usb + 4 at libusb1-glue.c:144
      frame #1: 0x0000000800cf2c24 libmtp.so.9`configure_usb_device(device=0x00000008024213d0, params=0x0000000802419300, usbinfo=0x000000080242e090) + 52 at libusb1-glue.c:2008
      frame #2: 0x0000000800cc5347 libmtp.so.9`LIBMTP_Open_Raw_Device_Uncached(rawdevice=0x00000008024213d0) + 791 at libmtp.c:1887
      frame #3: 0x0000000000417efe simple-mtpfs`MTPDevice::connect(this=0x0000000802419260, dev_no=0) + 446 at simple-mtpfs-mtp-device.cpp:138
      frame #4: 0x000000000040b5a4 simple-mtpfs`SMTPFileSystem::exec(this=0x0000000802419080) + 708 at simple-mtpfs-fuse.cpp:399
      frame #5: 0x0000000000417837 simple-mtpfs`main(argc=4, argv=0x00007fffffffe398) + 471 at simple-mtpfs-main.cpp:46
      frame #6: 0x00000000004047cf simple-mtpfs`_start(ap=<unavailable>, cleanup=<unavailable>) + 367 at crt1.c:78

My workaround follows

# Reset libusb_context for successive init_usb() calls instead of error.
# Tested to not regress test_raw_devices.c from [patches:#64].

diff --git libmtp-1.1.9/src/libusb1-glue.c libmtp-1.1.9/src/libusb1-glue.c
index 2a6041f..7949115 100644
--- libmtp-1.1.9/src/libusb1-glue.c
+++ libmtp-1.1.9/src/libusb1-glue.c
@@ -142,7 +142,7 @@ static LIBMTP_error_number_t init_usb()
    * We use the same level debug between MTP and USB.
    */
   if (libusb1_initialized)
-     return LIBMTP_ERROR_NONE;
+    libusb_exit(NULL);

   if (libusb_init(NULL) < 0) {
     LIBMTP_ERROR("Libusb1 init failed\n");

Can't upload files to MTP device

simple-mtpfs builded from tag simple-mtpfs-0.2 (80784a0).

Listing/fetching/deleteing works fine (except that deleted files seems to present untill dir is entered again), but I can't upload any file on device, getting error "No such file or directory". According to debug log (https://gist.github.com/evgkrsk/8168801 , created with simple-tmpfs /mnt/phone -d) there may be some problem in libmtp, but I not sure how to check/debug it.

Mounting via fstab

I am able to use simple-mtpfs to mount and unmount my Galaxy S3. I'd like to do it via /etc/fstab and here's what I've tried:

simple-mtpfs#/ /media/phone-mtp fuse user,fsname=simple-mtpfs#/,noauto 0 0

With this setup I get the following error when I try to mount it:
adrianp@frost:~$ mount /media/phone-mtp
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
fuse: invalid argument `/media/phone-mtp'

A different way I tried it is:

simple-mtpfs# /media/phone-mtp fuse user,fsname=simple-mtpfs#,noauto 0 0

... with this result:

adrianp@frost:~$ mount /media/phone-mtp
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note.
fuse: bad mount point `': No such file or directory

The problem seems to be the fact that fstab expects a mount device in addition to a mount point. Using a fake device generates errors though.

Is there a way to mount via fstab?
Thanks

include files prevent compile on OSX

To get simple-mtp to compile on OS X "Mavericks" I had to add a flag in src/makefile to include /usr/local/include/oxsfuse. (I'm using osxfuse and other libraries from http://brew.sh)

The line I modified is this:
FUSE_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/Cellar/osxfuse/2.6.2/include/osxfuse/fuse -I/usr/local/include/osxfuse

(When using homebrew, /usr/local/include/osxfuse is a symlink to /usr/local/Cellar/osxfuse/2.6.2/include/osxfuse)

The compile error is this:
simple-mtpfs-fuse.cpp:22:12: fatal error: 'fuse/fuse_opt.h' file not found

Since the makefile is generated by Autoconf, it's not obvious to me how to fix this upstream.

Alternatively, I can change 2 #include lines in simple-mtpfs-fuse.h and simple-mtpfs.fuse.cpp to drop the "fuse/" prefix, and that also resolves the issue (for me, anyway), but I'm not sure if that will break the build on Linux or other platforms.

Add Moto X Pure to the device list

Device 0 (VID=22b8 and PID=2e82) is UNKNOWN.

Moto X Pure

[ 5136.557475] usb 3-2: new high-speed USB device number 13 using xhci_hcd
[ 5136.724405] usb 3-2: New USB device found, idVendor=22b8, idProduct=2e82
[ 5136.724412] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5136.724416] usb 3-2: Product: XT1575
[ 5136.724419] usb 3-2: Manufacturer: motorola
[ 5136.724421] usb 3-2: SerialNumber: TA3940071B

Is it possible to have consistent directory contents?

After a successful mount of my android device to my Linux host, I can add/remove files to/from it using the Linux host. Such changes are visible to the simple-mtpfs.

But when I am adding or removing a file on the android device itself, simple-mtpfs doesn't see it and displays the old directory contents.

Is it possible to tell to the simple-mtpfs to re-read directory contents on demand?

doesnt build on freebsd

fdatasync(2) is not available on freebsd and dragonfly

simple-mtpfs-fuse.cpp:586:25: error: no member named 'fdatasync' in the global
      namespace
    return datasync ? ::fdatasync(fi->fh) : ::fsync(fi->fh);
                      ~~^
1 error generated.
diff --git a/configure.ac b/configure.ac
index 7d84090..c09d8b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,7 @@ AC_PROG_INSTALL

 m4_include([m4/cxx11.m4])
 AX_CXX_COMPILE_STDCXX_11([noext])
+AC_CHECK_FUNCS([fdatasync])
 AC_CHECK_LIB([mtp], [LIBMTP_Init], [], [AC_MSG_ERROR([libmtp not found])])
 AC_CHECK_HEADERS([libmtp.h])
 PKG_CHECK_MODULES([FUSE], [fuse >= 2.8])
diff --git a/src/simple-mtpfs-fuse.cpp b/src/simple-mtpfs-fuse.cpp
index 1a20dc3..58acd1c 100644
--- a/src/simple-mtpfs-fuse.cpp
+++ b/src/simple-mtpfs-fuse.cpp
@@ -583,7 +583,12 @@ int SMTPFileSystem::flush(const char *path, struct fuse_file_info *file_info)
 int SMTPFileSystem::fsync(const char *path, int datasync,
     struct fuse_file_info *fi)
 {
-    return datasync ? ::fdatasync(fi->fh) : ::fsync(fi->fh);
+#ifdef HAVE_FDATASYNC
+    if (datasync)
+       return ::fdatasync(fi->fh);
+    else
+#endif
+       return ::fsync(fi->fh);
 }

 int SMTPFileSystem::opendir(const char *path, struct fuse_file_info *file_info)

stat64 is deprecated on OS X

simple-mtpfs-mtp-device.cpp:448:19: error: variable has incomplete type
      'struct stat64'
    struct stat64 file_stat;
                  ^
simple-mtpfs-mtp-device.cpp:448:12: note: forward declaration of 'stat64'
    struct stat64 file_stat;
           ^
1 error generated.
diff --git a/src/simple-mtpfs-mtp-device.cpp b/src/simple-mtpfs-mtp-device.cpp
index 0280fd7..4e85d77 100644
--- a/src/simple-mtpfs-mtp-device.cpp
+++ b/src/simple-mtpfs-mtp-device.cpp
@@ -24,6 +24,7 @@
 extern "C" {
 #  include <unistd.h>
 #  include <sys/types.h>
+#  define _DARWIN_USE_64_BIT_INODE
 #  include <sys/stat.h>
 }
 #include "simple-mtpfs-fuse.h"
@@ -445,8 +446,8 @@ int MTPDevice::filePush(const std::string &src, const std::string &dst)
         }
     }

-    struct stat64 file_stat;
-    stat64(src.c_str(), &file_stat);
+    struct stat file_stat;
+    stat(src.c_str(), &file_stat);
     TypeFile file_to_upload(0, dir_parent->id(), dir_parent->storageid(),
         dst_basename, static_cast<uint64_t>(file_stat.st_size), 0);
     LIBMTP_file_t *f = file_to_upload.toLIBMTPFile();

malloc/free scope vs. clang33/gcc48

In file included from simple-mtpfs-main.cpp:20:0:
simple-mtpfs-fuse.h: In destructor 'SMTPFileSystem::SMTPFileSystemOptions::~SMTPFileSystemOptions()':
simple-mtpfs-fuse.h:59:70: error: 'free' was not declared in this scope
         ~SMTPFileSystemOptions() { free(static_cast<void*>(m_tmp_dir)); }
                                                                      ^
simple-mtpfs-type-dir.cpp:67:9: error: use of undeclared identifier 'malloc'
        malloc(sizeof(LIBMTP_folder_t)));
        ^
simple-mtpfs-type-file.cpp:54:9: error: use of undeclared identifier 'malloc'
        malloc(sizeof(LIBMTP_file_t)));
        ^
diff --git a/src/simple-mtpfs-fuse.h b/src/simple-mtpfs-fuse.h
index 2f7b1ad..f78cb1e 100644
--- a/src/simple-mtpfs-fuse.h
+++ b/src/simple-mtpfs-fuse.h
@@ -18,6 +18,7 @@
 #ifndef SMTPFS_FUSE_H
 #define SMTPFS_FUSE_H

+#include <cstdlib>
 #include <memory>
 #include <string>
 extern "C" {
diff --git a/src/simple-mtpfs-type-dir.cpp b/src/simple-mtpfs-type-dir.cpp
index 47689a0..df2ab17 100644
--- a/src/simple-mtpfs-type-dir.cpp
+++ b/src/simple-mtpfs-type-dir.cpp
@@ -17,6 +17,7 @@

 #include <config.h>
 #include <algorithm>
+#include <cstdlib>
 #include <cstring>
 extern "C" {
 #  include <libmtp.h>
diff --git a/src/simple-mtpfs-type-file.cpp b/src/simple-mtpfs-type-file.cpp
index 3d03220..5ec2785 100644
--- a/src/simple-mtpfs-type-file.cpp
+++ b/src/simple-mtpfs-type-file.cpp
@@ -16,6 +16,7 @@
 * ***** END LICENSE BLOCK ***** */

 #include <config.h>
+#include <cstdlib>
 #include "simple-mtpfs-type-file.h"

 TypeFile::TypeFile():

simple-mtpfs keeps up using tmp until all memory is gone

Hi,

It's common now for people to use a ramdisk as /tmp.

However simple-mtpfs keeps adding to it's tmp directory forever, always growing it. Never shrinking. It seems it keeps a copy of every single bit of data I transfer.

This fills up all memory.

Can you make it only use so much tmp space before cleaning up old data?

Hang on cd DCIM/Camera

Hi, I'm able to mount my Android device and move files to my host. However when I cd to DCIM/Camera, my shell hangs and I see these messages from simple-mtpfs -d:

getattr /
   unique: 213, success, outsize: 120
unique: 214, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 19375
LOOKUP /DCIM
getattr /DCIM
   NODEID: 2
   unique: 214, success, outsize: 144
unique: 215, opcode: LOOKUP (1), nodeid: 2, insize: 47, pid: 19375
LOOKUP /DCIM/Camera
getattr /DCIM/Camera
   NODEID: 24
   unique: 215, success, outsize: 144
unique: 216, opcode: LOOKUP (1), nodeid: 24, insize: 45, pid: 19400
LOOKUP /DCIM/Camera/.git
getattr /DCIM/Camera/.git

Here are the messages I see when starting simple-mptfs -d:

zuz@ziz:~ (master)$ simple-mtpfs -d --device 1 ~/mnt
FUSE library version: 2.9.7
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.26
flags=0x001ffffb
max_readahead=0x00020000
   INIT: 7.19
   flags=0x00000011
   max_readahead=0x00020000
   max_write=0x00020000
   max_background=0
   congestion_threshold=0
   unique: 1, success, outsize: 40
unique: 2, opcode: ACCESS (34), nodeid: 1, insize: 48, pid: 6301
   unique: 2, error: -38 (Function not implemented), outsize: 16
unique: 3, opcode: LOOKUP (1), nodeid: 1, insize: 47, pid: 6301
LOOKUP /.Trash
getattr /.Trash
   unique: 3, error: -2 (No such file or directory), outsize: 16
unique: 4, opcode: OPENDIR (27), nodeid: 1, insize: 48, pid: 6286
opendir flags: 0x18800 /
   opendir[0] flags: 0x18800 /
   unique: 4, success, outsize: 32
unique: 5, opcode: LOOKUP (1), nodeid: 1, insize: 45, pid: 19369
LOOKUP /BDMV
getattr /BDMV
   unique: 5, error: -2 (No such file or directory), outsize: 16

(etc)

LIBMTP PANIC: Trying to dump the error stack of a NULL device!

I have been using simple-mtpfs to rsync my music to my phone (AT&T Samsung Galaxy 6 (SM-G920A)) from Fedora Linux 23.
It has been working great (thank you!) ... until ...
My phone was updated ...
Android 6.0.1
Kernel 3.10.61-8851614
Build MMB29K.G920AUCS5DPI1
...
... and things broke.

simple-mtpfs will list (-l) the device but on mount complains

LIBMTP PANIC: Trying to dump the error stack of a NULL device!

I upgraded to Fedora 24.
simple-mtpfs-0.2-6.fc24.x86_64
No change.

I got the latest ...
git clone https://github.com/phatina/simple-mtpfs
commit ea08fdb
... and have been trying it.
I have seen the same error but most of the time I see

Could not retrieve device storage.
For android phones make sure the screen is unlocked.

My screen is unlocked but it asks

Allow access to device data
An MTP connection will be established to access the data on the connected device.
DENY
ALLOW

This all happens very quickly.

As a shot in the dark, I saw ...
#47
... and tried something you suggested there ...
https://github.com/phatina/simple-mtpfs/blob/master/src/simple-mtpfs-mtp-device.cpp#L199
... to no avail.

I would be glad to help you fix/diagnose this problem but I have no idea what to do.
Help!?


I have always had a problem with my desktop gvfs mount colliding with simple-mtpfs.
The gfvs mount does not work for me (rsync).
I don't recognize any change/problem with gvfs (which is libmtp based too).
The phone asks to ALLOW this as well.
It still doesn't work for me.
To resolve the collision I have always used ...
gvfs-mount --unmount $mount
... to unmount it ($mount, e.g. mtp://[usb:003,019]/) before trying simple-mtpfs.
I have also tried booting without graphics (multi-user.target) to no avail.

Problem transferring files

Hi I seem to be having problems transferring some files from my Nexus 4 device to my Linux machine via simple-mtpfs.

Here is the debug log ( https://gist.github.com/delcypher/5020105 )

I try to transfer a file /SmartVoiceRecorder/Record_0004.wav when mounted (/home/dan/mnt/) and various tools say they cannot open the file (vlc, rsync, cp...)

I see this error message in the debug output
Error 2: PTP Layer error 02fe: LIBMTP_Get_File_To_File_Descriptor(): Could not get file from device.

Would I be right in thinking this a problem with libmtp and not with simple-mtpfs?

Error: Could not retrieve device storage. Exiting.

hello,
i haven't used the simple-mtpfs for a few months and, as such, can not pinpoint what might have broke it.
Env:
fedora 22 just updated to the latest packages.
[code]
[root@toshiba ~]# simple-mtpfs --version
simple-mtpfs version 0.2
FUSE library version: 2.9.4
fusermount version: 2.9.4
using FUSE kernel interface version 7.19
[/code]

And errors:
[code]
root@toshiba ~]# simple-mtpfs -l
1: SamsungGalaxy models (MTP)
[root@toshiba ~]# simple-mtpfs -v /media/Android/
2015/10/27 16:34:45: Error: Could not retrieve device storage. Exiting.
2015/10/27 16:34:45: Disconnected.
[root@toshiba ~]# mount | grep /media
[root@toshiba ~]# simple-mtpfs /media/Android/
[root@toshiba ~]# mount | grep /media
[root@toshiba ~]# simple-mtpfs -o debug /media/Android/
[root@toshiba ~]# mount | grep /media
[/code]

"Media device(MTP)" option is enabled on the device. Device was not updated for months.

libmtp not found on Mac although it is properly installed

First at all, I'd like to clarify you have to rename INSTALL to install.sh for example, so configure can start.

Then, configure is not able to find libmt although it is linked in /lib and can see my device using mtp-detect and even access the filetree..

I'd be up to help improving the quality on Mac OS X. I am using Yosemite.

Thanks

simple-mtpfs not work in Mac OS X 10.11.3

My OSXFUSE Version is 2.8.3.

The output of 'simple-mtpfs -d ~/mtp':
unique: 0, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.8
flags=0x00000000
max_readahead=0x00100000
INIT: 7.8
flags=0x00000000
max_readahead=0x00100000
max_write=0x01000000
unique: 0, error: 0 (Undefined error: 0), outsize: 40
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: ACCESS (34), nodeid: 1, insize: 48
ACCESS / 00
unique: 0, error: -78 (Function not implemented), outsize: 16
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 128
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: GETXATTR (22), nodeid: 1, insize: 77
unique: 2, error: -78 (Function not implemented), outsize: 16
unique: 0, opcode: LOOKUP (1), nodeid: 1, insize: 44
LOOKUP /._.
unique: 0, error: -2 (No such file or directory), outsize: 16
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 1, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 96
unique: 0, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 0, error: 0 (Undefined error: 0), outsize: 96
unique: 2, opcode: STATFS (17), nodeid: 1, insize: 40
unique: 2, error: 0 (Undefined error: 0), outsize: 96
unique: 1, opcode: STATFS (17), nodeid: 1, insize: 40

uploaded files doesn't get visible by audio player

I've got Nokia Lumia 630 mobile phone. Recently I tried to upload files onto it. When I use libmtp directly:

$ mtp-newfolder uploaded 0 0
libmtp version: 1.1.8

Device 0 (VID=0421 and PID=06fc) is a Nokia Nokia Lumia 630.
ignoring libusb_claim_interface() = -6PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
object 1 has parent 0xffffffff (-1) continuing anyway
object 2 has parent 0xffffffff (-1) continuing anyway
object 3 has parent 0xffffffff (-1) continuing anyway
object 8 has parent 0xffffffff (-1) continuing anyway
object b has parent 0xffffffff (-1) continuing anyway
object c has parent 0xffffffff (-1) continuing anyway
Device have files in "root folder" 0xffffffffU - this is a firmware bug (but continuing)
New folder created with ID: 13
$ mtp-filetree
Device 0 (VID=0421 and PID=06fc) is a Nokia Nokia Lumia 630.
Attempting to connect device(s)
Device: Windows Phone
Storage: Phone
1 Documents
2 Downloads
3 Music
  4 Album
  5 Artist
  6 Playlist
  7 PodcastSeries
4 Album
5 Artist
6 Playlist
7 PodcastSeries
8 Pictures
  9 Camera Roll
  10 Saved Pictures
9 Camera Roll
10 Saved Pictures
11 Ringtones
12 uploaded
13 Videos
OK.
$ mtp-sendfile /run/media/yuri/wdata/torrents/Metallica\ \(mp3\)/01\ -\ Studio\ albums/2008\ -\ Death\ Magnetic\ \[UICR-1077\]/07.\ The\ Unforgiven\ III.mp3 12
libmtp version: 1.1.8

Device 0 (VID=0421 and PID=06fc) is a Nokia Nokia Lumia 630.
object 1 has parent 0xffffffff (-1) continuing anyway
object 2 has parent 0xffffffff (-1) continuing anyway
object 3 has parent 0xffffffff (-1) continuing anyway
object 8 has parent 0xffffffff (-1) continuing anyway
object b has parent 0xffffffff (-1) continuing anyway
object c has parent 0xffffffff (-1) continuing anyway
object d has parent 0xffffffff (-1) continuing anyway
Device have files in "root folder" 0xffffffffU - this is a firmware bug (but continuing)
Sending /run/media/yuri/wdata/torrents/Metallica (mp3)/01 - Studio albums/2008 - Death Magnetic [UICR-1077]/07. The Unforgiven III.mp3 to 12
type: mp3, 2
Sending file...
Progress: 18757750 of 18757750 (100%)
New file ID: 14
$ mtp-filetree 
Device 0 (VID=0421 and PID=06fc) is a Nokia Nokia Lumia 630.
Attempting to connect device(s)
Device: Windows Phone
Storage: Phone
1 Documents
2 Downloads
3 Music
  4 Album
    15 Death Magnetic [UICR-1077{56C2A1D1-543D-4320-83BA-63E870526220}
  5 Artist
    16 Metallica
  6 Playlist
  7 PodcastSeries
4 Album
  15 Death Magnetic [UICR-1077{56C2A1D1-543D-4320-83BA-63E870526220}
5 Artist
  16 Metallica
6 Playlist
7 PodcastSeries
8 Pictures
  9 Camera Roll
  10 Saved Pictures
9 Camera Roll
10 Saved Pictures
11 Ringtones
12 uploaded
  13 07. The Unforgiven III.mp3
13 07. The Unforgiven III.mp3
14 Videos
15 Death Magnetic [UICR-1077{56C2A1D1-543D-4320-83BA-63E870526220}
16 Metallica
OK.

it creates some extra files and Music app is able to see the uploaded file. Which doesn't happen when I use simple-mtpfs. I filed a bug report to gvfs-mtp guys, and they were able to remedy this. But I just switched to awesome and using gvfs is likely to be troublesome and counterproductive. So having this issue with simple-mtpfs fixed would be nice.

Reporting Vendor ID/Product ID of Sony Xperia S LT26i

Hello, here is the vendor ID and Product ID of my smartphone Sony Xperia S LT26i

Device 0 (VID=0fce and PID=5169) is UNKNOWN.
Please report this VID/PID and the device model to the libmtp development team

This is a extract of dmesg log with the relevant info about the device:

[35633.792076] usb 1-6: new high-speed USB device number 4 using ehci_hcd
[35633.927066] usb 1-6: New USB device found, idVendor=0fce, idProduct=5169
[35633.927076] usb 1-6: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[35633.927083] usb 1-6: Product: LT26i
[35633.927089] usb 1-6: Manufacturer: Sony Ericsson
[35633.927095] usb 1-6: SerialNumber: **********`

It says the Vendor ID is Sony Ericsson because it was manufactured before both companies split out. Outside it just display Sony Xperia.

Thanks in advance.

Galaxy A5 2016 USB reset when trying to mount with simple-mtpfs

Hi! I don't know if this a problem of simple-mtpfs or the phone itself...
But when I'm trying to mount my galaxy A5 2016 (SM-A510F) (stock firmware) with simple-mtpfs, it results in a usb reset O_o.
dmesg from the phone is in the attachment.
mtp_reset.txt

MTP is obviously not mounted after reset, simple-mtpfs says:
LIBMTP PANIC: Trying to dump the error stack of a NULL device!
(this is because the device file in /sys/bus/usb vanishes)

This does not occur when mounting the phone with, for example, jmtpfs or android-file-transfer. But jmtpfs is very buggy and android-file-transfer fails to mount this phone read-write because it says "your device does not have android EditObject extension, mounting read-only".

Maybe it is possible to fix simple-mtpfs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.