NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.32k stars 13.56k forks source link

libmtp 1.1.19 upgrade breaks GVFS mounting (MTP, Android Devices, etc) #145824

Closed MatthewCroughan closed 2 years ago

MatthewCroughan commented 2 years ago

Describe the bug

When setting services.gvfs.enable = true; in a NixOS system based on https://github.com/NixOS/nixpkgs/pull/144290, mounting Android phones via MTP stops working, as GVFS crashes continually.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Ensure your system is being built from 7b0696106d5ab653284d17cd7a070e40e3f3f3cf of Nixpkgs
  2. Set services.gvfs.enable = true; in your NixOS config
  3. Try to mount any android device via MTP, and observe that GVFS in fact crashes outright, even though MTP is only one of its features.

Expected behavior

Being able to use GVFS in any capacity.

Additional context

This breakage happens in any context, regardless of desktop environment. The upstream developer seems confused about the cause of this bug, and as far as I have read is blaming KDE/OpenSuse for the breakage.

https://github.com/libmtp/libmtp/issues/84

Notify maintainers

@lovesegfault

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[pasha@newtoncrosby:~]$ nixos-version --revision
7b0696106d5ab653284d17cd7a070e40e3f3f3cf

[pasha@newtoncrosby:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.14.15, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.5pre20211007_844dd90`
 - channels(root): `"nixos-21.11pre327669.b67e752c29f"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
davidak commented 2 years ago

I noticed that MTP does not work anymore.

The device is not correctly recognized:

[Fri Nov 19 19:47:11 2021] usb 1-7: new high-speed USB device number 6 using xhci_hcd
[Fri Nov 19 19:47:11 2021] usb 1-7: device descriptor read/all, error -71
[Fri Nov 19 19:47:11 2021] usb 1-7: new high-speed USB device number 7 using xhci_hcd
[Fri Nov 19 19:47:11 2021] usb 1-7: device descriptor read/all, error -71
[Fri Nov 19 19:47:11 2021] usb usb1-port7: attempt power cycle
[Fri Nov 19 19:47:12 2021] usb 1-7: new high-speed USB device number 8 using xhci_hcd
[Fri Nov 19 19:47:12 2021] usb 1-7: string descriptor 0 read error: -71
[Fri Nov 19 19:47:12 2021] usb 1-7: New USB device found, idVendor=2717, idProduct=ff40, bcdDevice= 3.18
[Fri Nov 19 19:47:12 2021] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Fri Nov 19 19:47:38 2021] usb 1-7: USB disconnect, device number 8
[Fri Nov 19 19:47:39 2021] usb 1-7: new high-speed USB device number 9 using xhci_hcd
[Fri Nov 19 19:47:39 2021] usb 1-7: New USB device found, idVendor=2717, idProduct=ff40, bcdDevice= 3.18
[Fri Nov 19 19:47:39 2021] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Fri Nov 19 19:47:39 2021] usb 1-7: Product: Android
[Fri Nov 19 19:47:39 2021] usb 1-7: Manufacturer: Android
[Fri Nov 19 19:47:39 2021] usb 1-7: SerialNumber: ******
[Fri Nov 19 19:47:39 2021] usb 1-7: can't set config #1, error -71

(reconnecting and reboot does not solve this)

Here it looks normal:

[root@gaming:~]# lsusb 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 019: ID 2717:ff40 Xiaomi Inc. Mi/Redmi series (MTP)
Bus 001 Device 005: ID 046d:c08f Logitech, Inc. G403 HERO Gaming Mouse
Bus 001 Device 004: ID feed:1307 ZSA Ergodox EZ
Bus 001 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 002: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And here are also a lot of errors:

[davidak@gaming:~]$ mtp-detect
libmtp version: 1.1.19

Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 19
Attempting to connect device(s)
Android device detected, assigning default bug flags
LIBMTP PANIC: could not inspect object property description 0x3001!
LIBMTP PANIC: could not inspect object property description 0x3004!
LIBMTP PANIC: could not inspect object property description 0x3005!
LIBMTP PANIC: could not inspect object property description 0x3008!
LIBMTP PANIC: could not inspect object property description 0x3009!
LIBMTP PANIC: could not inspect object property description 0x300b!
LIBMTP PANIC: could not inspect object property description 0x3801!
LIBMTP PANIC: could not inspect object property description 0x3802!
LIBMTP PANIC: could not inspect object property description 0xb902!
LIBMTP PANIC: could not inspect object property description 0xb903!
LIBMTP PANIC: could not inspect object property description 0xb982!
LIBMTP PANIC: could not inspect object property description 0xb983!
Error 7: Unable to read Maximum Battery Level for this device even though the device supposedly supports this functionality
Error 1: Get Storage information failed.
USB low-level info:
   bcdUSB: 512
   bDeviceClass: 0
   bDeviceSubClass: 0
   bDeviceProtocol: 0
   idVendor: 2717
   idProduct: ff40
   IN endpoint maxpacket: 512 bytes
   OUT endpoint maxpacket: 512 bytes
   Raw device info:
      Bus location: 1
      Device number: 19
      Device entry info:
         Vendor: Xiaomi
         Vendor id: 0x2717
         Product: Mi-2s (id2) (MTP)
         Vendor id: 0xff40
         Device flags: 0x18008106
Device info:
   Manufacturer: Xiaomi
   Model: Redmi Note 4
   Device version: 1.0
   Serial number: ******
   Vendor extension ID: 0x00000006
   Vendor extension description: microsoft.com: 1.0; android.com: 1.0;
   Detected object size: 64 bits
   Extensions:
        microsoft.com: 1.0
        android.com: 1.0
Supported operations:
   1001: Get device info
   1002: Open session
   1003: Close session
   1004: Get storage IDs
   1005: Get storage info
   1006: Get number of objects
   1007: Get object handles
   1008: Get object info
   1009: Get object
   100a: Get thumbnail
   100b: Delete object
   100c: Send object info
   100d: Send object
   1010: Reset device
   1014: Get device property description
   1015: Get device property value
   1016: Set device property value
   1017: Reset device property value
   101b: Get partial object
   9801: Get object properties supported
   9802: Get object property description
   9803: Get object property value
   9804: Set object property value
   9805: Get object property list
   9810: Get object references
   9811: Set object references
   95c1: Get Partial Object (64bit Offset)
   95c2: Send Partial Object
   95c3: Truncate Object
   95c4: Begin Edit Object
   95c5: End Edit Object
Events supported:
   0x4002: ObjectAdded
   0x4003: ObjectRemoved
   0x4004: StoreAdded
   0x4005: StoreRemoved
   0x4006: DevicePropChanged
Device Properties Supported:
   0xd401: Synchronization Partner
   0xd402: Friendly Device Name
   0x5003: Image Size
   0x5001: Battery Level
   0xd407: Perceived Device Type
Playable File (Object) Types and Object Properties Supported:
   3000: Undefined Type
   3001: Association/Directory
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc04: Object Size UINT64 data type READ ONLY GROUP 0x0
      dc07: Object File Name STRING data type GET/SET GROUP 0x0
      dc09: Date Modified STRING data type DATETIME FORM ((null)) READ ONLY GROUP 0x0
      dc0b: Parent Object UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc41: Persistant Unique Object Identifier   3004: Text
   3005: HTML
   3008: MS Wave
   3009: MP3
   300b: MPEG
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc04: Object Size UINT64 data type READ ONLY GROUP 0x0
      dc07: Object File Name STRING data type GET/SET GROUP 0x0
      dc09: Date Modified STRING data type DATETIME FORM ((null)) READ ONLY GROUP 0x0
      dc0b: Parent Object UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc41: Persistant Unique Object Identifier   3801: JPEG
   3802: TIFF EP
   3804: BMP
   3807: GIF
   3808: JFIF
   380b: PNG
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc04: Object Size UINT64 data type READ ONLY GROUP 0x0
      dc07: Object File Name STRING data type GET/SET GROUP 0x0
      dc09: Date Modified   380d: TIFF
   b901: WMA
   b902: OGG
   b903: AAC
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc04: Object Size UINT64 data type READ ONLY GROUP 0x0
      dc07: Object File Name STRING data type GET/SET GROUP 0x0
      dc09: Date Modified STRING data type DATETIME FORM ((null)) READ ONLY GROUP 0x0
      dc0b: Parent Object   b982: MP4
   b983: MP2
   b984: 3GP
   ba05: Abstract Audio Video Playlist
   ba10: WPL Playlist
   ba11: M3U Playlist
   ba14: PLS Playlist
   ba82: XMLDocument
   b906: FLAC
   3811: DNG
   3812: Unknown(3812)
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc04: Object SizeSpecial directories:
   Default music folder: 0xffffffff
   Default playlist folder: 0xffffffff
   Default picture folder: 0xffffffff
   Default video folder: 0xffffffff
   Default organizer folder: 0xffffffff
   Default zencast folder: 0xffffffff
   Default album folder: 0xffffffff
   Default text folder: 0xffffffff
MTP-specific device properties:
   Friendly name: (NULL)
   Synchronization partner: (NULL)
libmtp supported (playable) filetypes:
   Folder
   Text file
   HTML file
   RIFF WAVE file
   ISO MPEG-1 Audio Layer 3
   MPEG video stream
   JPEG file
   BMP bitmap file
   GIF bitmap file
   JFIF file
   Portable Network Graphics
   TIFF bitmap file
   Microsoft Windows Media Audio
   Ogg container format
   Advanced Audio Coding (AAC)/MPEG-2 Part 7/MPEG-4 Part 3
   MPEG-4 Part 14 Container Format (Audio+Video Emphasis)
   ISO MPEG-1 Audio Layer 2
   Abstract Playlist file
   XML file
   Free Lossless Audio Codec (FLAC)
ERROR: Could not close session!
inep: usb_get_endpoint_status(): Resource temporarily unavailable
outep: usb_get_endpoint_status(): Resource temporarily unavailable
OK.

I tried with the old version and also got similar issues:

[davidak@gaming:~]$ nix run -f channel:nixos-21.05 libmtp
[38 copied (86.6 MiB), 36.2 MiB DL]

[davidak@gaming:~]$ mtp-detect
libmtp version: 1.1.18

Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 19
Attempting to connect device(s)
PTP_ERROR_IO: failed to open session, trying again after resetting USB interface
LIBMTP libusb: Attempt to reset device
LIBMTP PANIC: failed to open session on second attempt
Unable to open raw device 0
OK.

[davidak@gaming:~]$ mtp-detect
libmtp version: 1.1.18

Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 19
Attempting to connect device(s)
LIBMTP PANIC: Unable to read device information on device 19 on bus 1, trying to continueUnable to open raw device 0
OK.

[davidak@gaming:~]$ mtp-detect
libmtp version: 1.1.18

Listing raw device(s)
Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
   Found 1 device(s):
   Xiaomi: Mi-2s (id2) (MTP) (2717:ff40) @ bus 1, dev 20
Attempting to connect device(s)
Android device detected, assigning default bug flags
LIBMTP PANIC: could not inspect object property description 0x3001!
LIBMTP PANIC: could not inspect object property description 0x3004!
LIBMTP PANIC: could not inspect object property description 0x3804!
LIBMTP PANIC: could not inspect object property description 0x3807!
LIBMTP PANIC: could not inspect object property description 0x3808!
LIBMTP PANIC: could not inspect object property description 0xb982!
LIBMTP PANIC: could not inspect object property description 0xb983!
LIBMTP PANIC: could not inspect object property description 0xb984!
LIBMTP PANIC: could not inspect object property description 0xba05!
LIBMTP PANIC: could not inspect object property description 0xba82!
LIBMTP PANIC: could not inspect object property description 0xb906!
LIBMTP PANIC: could not inspect object property description 0x3811!
LIBMTP PANIC: could not inspect object property description 0x3812!
Error 7: Unable to read Maximum Battery Level for this device even though the device supposedly supports this functionality
Error 1: Get Storage information failed.
USB low-level info:
   bcdUSB: 512
   bDeviceClass: 0
   bDeviceSubClass: 0
   bDeviceProtocol: 0
   idVendor: 2717
   idProduct: ff40
   IN endpoint maxpacket: 512 bytes
   OUT endpoint maxpacket: 512 bytes
   Raw device info:
      Bus location: 1
      Device number: 20
      Device entry info:
         Vendor: Xiaomi
         Vendor id: 0x2717
         Product: Mi-2s (id2) (MTP)
         Vendor id: 0xff40
         Device flags: 0x18008106
Configuration 0, interface 0, altsetting 0:
   Interface description contains the string "MTP"
   Device recognized as MTP, no further probing.
Device info:
   Manufacturer: Xiaomi
   Model: Redmi Note 4
   Device version: 1.0
   Serial number: ******
   Vendor extension ID: 0x00000006
   Vendor extension description: microsoft.com: 1.0; android.com: 1.0;
   Detected object size: 64 bits
   Extensions:
        microsoft.com: 1.0
        android.com: 1.0
Supported operations:
   1001: Get device info
   1002: Open session
   1003: Close session
   1004: Get storage IDs
   1005: Get storage info
   1006: Get number of objects
   1007: Get object handles
   1008: Get object info
   1009: Get object
   100a: Get thumbnail
   100b: Delete object
   100c: Send object info
   100d: Send object
   1010: Reset device
   1014: Get device property description
   1015: Get device property value
   1016: Set device property value
   1017: Reset device property value
   101b: Get partial object
   9801: Get object properties supported
   9802: Get object property description
   9803: Get object property value
   9804: Set object property value
   9805: Get object property list
   9810: Get object references
   9811: Set object references
   95c1: Get Partial Object (64bit Offset)
   95c2: Send Partial Object
   95c3: Truncate Object
   95c4: Begin Edit Object
   95c5: End Edit Object
Events supported:
   0x4002: ObjectAdded
   0x4003: ObjectRemoved
   0x4004: StoreAdded
   0x4005: StoreRemoved
   0x4006: DevicePropChanged
Device Properties Supported:
   0xd401: Synchronization Partner
   0xd402: Friendly Device Name
   0x5003: Image Size
   0x5001: Battery Level
   0xd407: Perceived Device Type
Playable File (Object) Types and Object Properties Supported:
   3000: Undefined Type
   3001: Association/Directory
   3004: Text
   3005: HTML
   3008: MS Wave
   3009: MP3
   300b: MPEG
   3801: JPEG
   3802: TIFF EP
   3804: BMP
   3807: GIF
   3808: JFIF
   380b: PNG
   380d: TIFF
   b901: WMA
   b902: OGG
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status   b903: AAC
   b982: MP4
      dc01: Storage ID UINT32 data type ANY 32BIT VALUE form READ ONLY GROUP 0x0
      dc02: Object Format UINT16 data type ANY 16BIT VALUE form READ ONLY GROUP 0x0
      dc03: Protection Status   b983: MP2
   b984: 3GP
   ba05: Abstract Audio Video Playlist
   ba10: WPL Playlist
   ba11: M3U Playlist
   ba14: PLS Playlist
   ba82: XMLDocument
   b906: FLAC
   3811: DNG
   3812: Unknown(3812)
Special directories:
   Default music folder: 0xffffffff
   Default playlist folder: 0xffffffff
   Default picture folder: 0xffffffff
   Default video folder: 0xffffffff
   Default organizer folder: 0xffffffff
   Default zencast folder: 0xffffffff
   Default album folder: 0xffffffff
   Default text folder: 0xffffffff
MTP-specific device properties:
   Friendly name: (NULL)
   Synchronization partner: (NULL)
libmtp supported (playable) filetypes:
   Folder
   Text file
   HTML file
   RIFF WAVE file
   ISO MPEG-1 Audio Layer 3
   MPEG video stream
   JPEG file
   BMP bitmap file
   GIF bitmap file
   JFIF file
   Portable Network Graphics
   TIFF bitmap file
   Microsoft Windows Media Audio
   Ogg container format
   Advanced Audio Coding (AAC)/MPEG-2 Part 7/MPEG-4 Part 3
   MPEG-4 Part 14 Container Format (Audio+Video Emphasis)
   ISO MPEG-1 Audio Layer 2
   Abstract Playlist file
   XML file
   Free Lossless Audio Codec (FLAC)
ERROR: Could not close session!
inep: usb_get_endpoint_status(): Resource temporarily unavailable
OK.

Does this work for you with the old version? Maybe my smartphone is broken.

lovesegfault commented 2 years ago

The reason I bumped libmtp to 1.1.19 to begin with was that I tried to get 1.1.18 working and failed, and figured maybe bumping might help.

It didn't.

I'm not sure what the issue is though, I wonder if anyone recalls a nixpkgs revision where it did work

MatthewCroughan commented 2 years ago

@davidak @lovesegfault I created a NixOS test which proves that the upgrade to libmtp 1.1.19 is not the cause of the regression. https://github.com/NixOS/nixpkgs/pull/146084, if someone uses nix-bisect with my test, we can find the cause of the regression.

nixos-discourse commented 2 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/android-mtp-doesnt-work-with-nixos-21-11/16482/3

nixos-discourse commented 2 years ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/android-file-transfert-mtp-support-has-always-been-half-broken-in-kde/16694/1

tobiasBora commented 2 years ago

Just to mention a workaround: the android-file-transfer program always works way more reliably than libmtp. Including in that scenario. Would be so much better if this library could be integrable inside Dolphin.

Also, am I supposed to install gvfs to get MTP working in KDE/Dolphin? It was not installed in my system before and I was able to connect through MTP as far as I could remember.

Also, I get a similar problem as I reported here, but the errors are not identical (gvfs was not installed, but I also get the same error with gvfs installed). Therefore, I'm not sure if the issue is the same or not.

tobiasBora commented 2 years ago

Also, I got an error in journalctl that may make sense:

$ journalctl -e | grep mtp
déc. 20 09:37:21 bestos dbus-daemon[6065]: [session uid=1000 pid=6065] Activating service name='org.kde.kmtpd5' requested by ':1.53' (uid=1000 pid=9441 comm="mtp.so [kdeinit5] mtp local:/run/user/1000/klaunch" label="kernel")
déc. 20 09:37:21 bestos dbus-daemon[6065]: [session uid=1000 pid=6065] Activated service 'org.kde.kmtpd5' failed: Failed to execute program org.kde.kmtpd5: No such file or directory
jtojnar commented 2 years ago

Possibly fixed by https://github.com/NixOS/nixpkgs/pull/152289

MatthewCroughan commented 2 years ago

@jtojnar It seems to have successfully fixed my test, https://github.com/NixOS/nixpkgs/pull/146084. After rebasing this test on master where the fix is merged.

alexeymuranov commented 2 years ago

Still an issue on NixOS 21.11.335072, despite #152306 being merged.

jtojnar commented 2 years ago

Turns out that fix was wrong, https://github.com/NixOS/nixpkgs/pull/153501 does fix it but looks like backport failed so someone will need to do it manually.

cirno-999 commented 2 years ago

Hello, I think I have the same issue on NixOS 21.11. Running KDE Plasma, device is LG V20, works on Wind-ws.

nix-shell -p nix-info --run "nix-info -m"

lsusb

Bus 002 Device 002: ID 05e3:0626 Genesys Logic, Inc. USB3.1 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 8087:0a2a Intel Corp. Bluetooth wireless interface
Bus 001 Device 003: ID 5986:0670 Acer, Inc Lenovo EasyCamera
Bus 001 Device 013: ID 1004:62ce LG Electronics, Inc. LGE Android Phone   <---- this
Bus 001 Device 007: ID 0763:4005 M-Audio Keystation 49
Bus 001 Device 006: ID 413c:2113 Dell Computer Corp. KB216 Wired Keyboard
Bus 001 Device 004: ID 046d:c050 Logitech, Inc. RX 250 Optical Mouse
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

mtp-detect (I'm using KDE Plasma)

libmtp version: 1.1.19

Listing raw device(s)
Device 0 (VID=1004 and PID=62ce) is a LG Electronics Inc. LG G5 Phone.
   Found 1 device(s):
   LG Electronics Inc.: LG G5 Phone (1004:62ce) @ bus 1, dev 13
Attempting to connect device(s)
libusb_claim_interface() reports device is busy, likely in use by GVFS or KDE MTP device handling alreadyLIBMTP PANIC: Unable to initialize device
Unable to open raw device 0
OK.

journalctl -xe

░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 125.
Feb 06 16:35:41 berlin kernel: usb 1-3: new high-speed USB device number 8 using xhci_hcd
Feb 06 16:35:41 berlin kernel: usb 1-3: New USB device found, idVendor=1004, idProduct=62ce, bcdDev>
Feb 06 16:35:41 berlin kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 06 16:35:41 berlin kernel: usb 1-3: Product: LGE Android Phone
Feb 06 16:35:41 berlin kernel: usb 1-3: Manufacturer: LG Electronics Inc.
Feb 06 16:35:41 berlin kernel: usb 1-3: SerialNumber: LGUS🫑🫑🫑🫑🫑🫑🫑🫑🫑🫑
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequenc>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequenc>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequenc>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequenc>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequenc>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequ>
Feb 06 16:35:43 berlin kernel: usb 1-3: USB disconnect, device number 8
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: ERROR: Could not close session!
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: inep: usb_get_endpoint_status(): No such device
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: outep: usb_get_endpoint_status(): No such device
Feb 06 16:35:44 berlin kernel: usb 1-3: new high-speed USB device number 9 using xhci_hcd
Feb 06 16:35:44 berlin kernel: usb 1-3: New USB device found, idVendor=1004, idProduct=62ce, bcdDev>
Feb 06 16:35:44 berlin kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 06 16:35:44 berlin kernel: usb 1-3: Product: LGE Android Phone
Feb 06 16:35:44 berlin kernel: usb 1-3: Manufacturer: LG Electronics Inc.
Feb 06 16:35:44 berlin kernel: usb 1-3: SerialNumber: LGUS🫑🫑🫑🫑🫑🫑🫑🫑🫑🫑
lines 2241-2274/2274 (END)
░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 125.
Feb 06 16:35:41 berlin kernel: usb 1-3: new high-speed USB device number 8 using xhci_hcd
Feb 06 16:35:41 berlin kernel: usb 1-3: New USB device found, idVendor=1004, idProduct=62ce, bcdDevice= 3.18
Feb 06 16:35:41 berlin kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 06 16:35:41 berlin kernel: usb 1-3: Product: LGE Android Phone
Feb 06 16:35:41 berlin kernel: usb 1-3: Manufacturer: LG Electronics Inc.
Feb 06 16:35:41 berlin kernel: usb 1-3: SerialNumber: LGUS996270e5d
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 4351, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4352, resource id: 33554621, major code: 55 (CreateGC), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4353, resource id: 33554621, major code: 72 (PutImage), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 4354, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4355, resource id: 33554623, major code: 55 (CreateGC), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4356, resource id: 33554623, major code: 72 (PutImage), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 4357, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4358, resource id: 33554625, major code: 55 (CreateGC), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4359, resource id: 33554625, major code: 72 (PutImage), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 4360, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4361, resource id: 33554627, major code: 55 (CreateGC), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4362, resource id: 33554627, major code: 72 (PutImage), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 2 (BadValue), sequence: 4363, resource id: 0, major code: 53 (CreatePixmap), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4364, resource id: 33554629, major code: 55 (CreateGC), minor code: 0
Feb 06 16:35:42 berlin xsession[1571]: qt.qpa.xcb: QXcbConnection: XCB error: 9 (BadDrawable), sequence: 4365, resource id: 33554629, major code: 72 (PutImage), minor code: 0
Feb 06 16:35:43 berlin kernel: usb 1-3: USB disconnect, device number 8
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: ERROR: Could not close session!
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: inep: usb_get_endpoint_status(): No such device
Feb 06 16:35:43 berlin org.kde.kmtpd5[1844]: outep: usb_get_endpoint_status(): No such device
Feb 06 16:35:44 berlin kernel: usb 1-3: new high-speed USB device number 9 using xhci_hcd
Feb 06 16:35:44 berlin kernel: usb 1-3: New USB device found, idVendor=1004, idProduct=62ce, bcdDevice= 3.18
Feb 06 16:35:44 berlin kernel: usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 06 16:35:44 berlin kernel: usb 1-3: Product: LGE Android Phone
Feb 06 16:35:44 berlin kernel: usb 1-3: Manufacturer: LG Electronics Inc.
Feb 06 16:35:44 berlin kernel: usb 1-3: SerialNumber: LGUS🫑🫑🫑🫑🫑🫑🫑🫑🫑🫑

Edit: Wait, I managed to get it working... It's super buggy though to start the transfer (and it stopped midway..), maybe it's more of a KDE issue. Sorry for bothering if so image

jtojnar commented 2 years ago

This issue has been fixed for both gvfs (GNOME & co.) and Plasma and relevant PRs backported to 21.11.

nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/mounting-of-camera-not-working-gphoto2-canon-camera/24038/2

cptX commented 1 year ago

Hi I have possible the same issue with Xiaomi Redmi 9T. These are the errors I get in syslog:

May 23 16:56:19 i7 gvfsd[9121]: PTP_ERROR_IO: failed to open session, trying again after resetting USB interface May 23 16:56:19 i7 gvfsd[9121]: LIBMTP libusb: Attempt to reset device May 23 16:56:19 i7 kernel: [ 3011.442049] usb 1-11: reset high-speed USB device number 17 using xhci_hcd May 23 16:56:20 i7 kernel: [ 3011.718190] usb 1-11: reset high-speed USB device number 17 using xhci_hcd May 23 16:56:34 i7 gvfsd[9121]: LIBMTP PANIC: failed to open session on second attempt May 23 16:56:34 i7 kernel: [ 3026.035385] usb 1-11: USB disconnect, device number 17 May 23 16:56:35 i7 gvfsd[9121]: Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP). May 23 16:56:36 i7 kernel: [ 3027.869938] usb 1-11: new high-speed USB device number 19 using xhci_hcd May 23 16:56:36 i7 kernel: [ 3028.018914] usb 1-11: New USB device found, idVendor=2717, idProduct=ff10, bcdDevice= 2.23 May 23 16:56:36 i7 kernel: [ 3028.018927] usb 1-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3 May 23 16:56:36 i7 kernel: [ 3028.018934] usb 1-11: Product: Redmi Note 9T May 23 16:56:36 i7 kernel: [ 3028.018940] usb 1-11: Manufacturer: Xiaomi May 23 16:56:36 i7 kernel: [ 3028.018944] usb 1-11: SerialNumber: cyl7wszpug8tpfj7 May 23 16:56:36 i7 mtp-probe: checking bus 1, device 19: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11" May 23 16:56:36 i7 mtp-probe: bus: 1, device: 19 was not an MTP device May 23 16:56:36 i7 mtp-probe: checking bus 1, device 19: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-11" May 23 16:56:36 i7 mtp-probe: bus: 1, device: 19 was not an MTP device May 23 17:00:35 i7 kernel: [ 3266.817063] usb 1-11: USB disconnect, device number 19 May 23 17:00:36 i7 kernel: [ 3267.832859] usb 1-11: new full-speed USB device number 20 using xhci_hcd May 23 17:00:36 i7 kernel: [ 3267.992139] usb 1-11: not running at top speed; connect to a high speed hub May 23 17:00:36 i7 kernel: [ 3268.010106] usb 1-11: New USB device found, idVendor=2717, idProduct=ff40, bcdDevice= 2.23 May 23 17:00:36 i7 kernel: [ 3268.010120] usb 1-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3 May 23 17:00:36 i7 kernel: [ 3268.010126] usb 1-11: Product: Redmi Note 9T May 23 17:00:36 i7 kernel: [ 3268.010132] usb 1-11: Manufacturer: Xiaomi May 23 17:00:36 i7 kernel: [ 3268.010136] usb 1-11: SerialNumber: cyl7wszpug8tpfj7 May 23 17:00:41 i7 gvfsd[9266]: PTP_ERROR_IO: failed to open session, trying again after resetting USB interface May 23 17:00:41 i7 gvfsd[9266]: LIBMTP libusb: Attempt to reset device May 23 17:00:41 i7 kernel: [ 3273.213222] usb 1-11: reset full-speed USB device number 20 using xhci_hcd May 23 17:00:42 i7 kernel: [ 3273.509323] usb 1-11: reset full-speed USB device number 20 using xhci_hcd May 23 17:01:42 i7 gvfsd[9266]: LIBMTP PANIC: failed to open session on second attempt May 23 17:01:43 i7 gvfsd[9266]: Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP). May 23 17:02:23 i7 gvfsd[9311]: PTP_ERROR_IO: failed to open session, trying again after resetting USB interface May 23 17:02:23 i7 gvfsd[9311]: LIBMTP libusb: Attempt to reset device May 23 17:02:23 i7 kernel: [ 3375.346410] usb 1-11: reset full-speed USB device number 20 using xhci_hcd May 23 17:02:24 i7 kernel: [ 3375.738435] usb 1-11: reset full-speed USB device number 20 using xhci_hcd

I recently upgraded from LM20.3 to LM21.1 with the hope to solve this but no luck. Any suggestions?

tobiasBora commented 1 year ago

Note that I recently tried again MTP from 2caf4ef5005ecc68141ecb4aac271079f7371c44, and it's still really unstable (first copy/paste fails, and then I just can't access my device anymore). Details are in https://github.com/NixOS/nixpkgs/issues/186158