Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

MTP devices are visible in file manager after disconnecting

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
giaur
Posts: 120
Joined: 2013-03-08 07:03

MTP devices are visible in file manager after disconnecting

#1 Post by giaur »

Debian Sid, Cinnamon. I'm, getting annoying issue. Scenario:
- connect any Android Phone in MTP mode. Device mounted, all ok.
- unmount phone, disconnect USB cable. Device is still visible in file manager, can't be mounted or removed
- connect phone again. New device is added to file manager. Disconnect phone - 2 dead devices visible

... and so on. Every time I connect my phone, new device appears. I need to restart computer to remove dead items. Do you know any workaround for this annoying bug? It seems to be related to MTP only, if I connect usb disk/pendrive, it disappears correctly after disconnectiong.

So I'm looking some workaround, or even any way to clear dead device items without reboot my computer.
Last edited by giaur on 2017-11-16 07:41, edited 2 times in total.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: MTP devices are visible in file manager after disconnect

#2 Post by Dai_trying »

As you are using Sid and have found a bug you should report it to let the developers fix it, that would give you a real solution rather than a "workaround".

giaur
Posts: 120
Joined: 2013-03-08 07:03

Re: MTP devices are visible in file manager after disconnect

#3 Post by giaur »

Agree, but I'm not sure where to report. I need to know specific package to report bug about. I suspect something related to gvfs (since file manager used does not matter). Also, please can anybody confirm issue?

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: MTP devices are visible in file manager after disconnect

#4 Post by pylkko »

What does this first hit on google say about when you don't know the package name?

https://www.debian.org/Bugs/Reporting

giaur
Posts: 120
Joined: 2013-03-08 07:03

Re: MTP devices are visible in file manager after disconnect

#5 Post by giaur »

I know all of these. However, I must know if I need to report bug in Nautilus, mtp tools etc. I need to know some internals. Of course, exact package name is not a problem. I hope you can understand what I mean.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: MTP devices are visible in file manager after disconnect

#6 Post by debiman »

giaur wrote:I must know if I need to report bug in Nautilus, mtp tools etc. I need to know some internals.
exactly.
i'm sure you can check yourself if it's a nautilus bug (look if some dirs/files in the tree reflect the problem. if they do, it's not nautilus).
my guess is it's the backend. start with gvfs, work your way down.

all in all, i'm wondering why you use sid...

giaur
Posts: 120
Joined: 2013-03-08 07:03

Re: MTP devices are visible in file manager after disconnect

#7 Post by giaur »

Don't wonder. Sid is pretty stable (except some small bugs like this one, from time to time) and it has always newest software. From other hand, if any bug is present in Testing, you will need to wait much longer for fix.

P.S. I know how to report bug. Reason why I created this topic here is to ask if anybody can confirm issue. So, anybody?

Barracuda72
Posts: 2
Joined: 2017-11-22 19:01

Re: MTP devices are visible in file manager after disconnect

#8 Post by Barracuda72 »

So, anybody?
Yes, I can confirm this issue. It's SO ANNOYING that I even registered on this forum just to write this message.
Unfortunately, the bug isn't Debian-specific. I'm running Gentoo GNU/Linux on my two machines:
1) Kernel 4.12, libusb 1.0.19, gvfs 1.30.4, libmtp 1.1.13 - no issues, works fine
2) Kernel 4.14, libusb 1.0.19, gvfs 1.30.4, libmtp 1.1.13 - same problem as yours
After upgrading second machine to libusb 1.0.21, gvfs 1.32.1, libmtp 1.1.14 problem still exists. So it's not
related to these 3 components. I doubt that it is related to kernel, as

Code: Select all

mtp-detect
correctly shows no attached devices, it's

Code: Select all

gvfs-mount -li
that lists all those "dead" ones. So it's definitely some bug around some this things.
Reloading udev rules doesn't help either; the only way I managed to get around that is by killing

Code: Select all

gvfs-mtp-volume-monitor
and restarting it again by hand (it's in /usr/libexec, BTW). VERY, VERY annoying bug, especially if you have damaged cable that
makes your device reconnect every so often... Dozens of dead labels, AAARGGGH!
P.S.: Your report was FIRST that I found on this problem, so it should be very recent regression. It's much easier to catch problems
"in hot pursuit" (as with criminals), so please report this issue as soon as possible.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: MTP devices are visible in file manager after disconnect

#9 Post by debiman »

well i am NOT seeing this behavior with my single android device (4.4.2), pcmanfm (1.2.5) using gvfs (1.34.1) backends on archlinux (4.9.63-1-lts).
the phone has a micro sd card, and whenever i plug the phone in i see first 2, then (after clicking = mounting) 3 devices pop up in pcmanfm's sidebar, but they all disappear again after unplugging. this is 100% reproducible.

quick stab in the dark:
maybe volume management has something to do with the problem you're seeing?
i.e. try to disable automount, make it click-to-mount?

personally i find mtp on linux flaky and much prefer to use adb, e.g. with this.

giaur
Posts: 120
Joined: 2013-03-08 07:03

Re: MTP devices are visible in file manager after disconnect

#10 Post by giaur »

Barracuda72 wrote:
So, anybody?
Yes, I can confirm this issue. It's SO ANNOYING that I even registered on this forum just to write this message.
Unfortunately, the bug isn't Debian-specific. I'm running Gentoo GNU/Linux on my two machines:
1) Kernel 4.12, libusb 1.0.19, gvfs 1.30.4, libmtp 1.1.13 - no issues, works fine
2) Kernel 4.14, libusb 1.0.19, gvfs 1.30.4, libmtp 1.1.13 - same problem as yours
After upgrading second machine to libusb 1.0.21, gvfs 1.32.1, libmtp 1.1.14 problem still exists. So it's not
related to these 3 components. I doubt that it is related to kernel, as

Code: Select all

mtp-detect
correctly shows no attached devices, it's

Code: Select all

gvfs-mount -li
that lists all those "dead" ones. So it's definitely some bug around some this things.
Reloading udev rules doesn't help either; the only way I managed to get around that is by killing

Code: Select all

gvfs-mtp-volume-monitor
and restarting it again by hand (it's in /usr/libexec, BTW). VERY, VERY annoying bug, especially if you have damaged cable that
makes your device reconnect every so often... Dozens of dead labels, AAARGGGH!
P.S.: Your report was FIRST that I found on this problem, so it should be very recent regression. It's much easier to catch problems
"in hot pursuit" (as with criminals), so please report this issue as soon as possible.
Hi,
Good to see I'm not alone. I have already reported this to Debian: https://bugs.debian.org/cgi-bin/bugrepo ... bug=882213 so, guys, please vote and comment.

Barracuda72
Posts: 2
Joined: 2017-11-22 19:01

Re: MTP devices are visible in file manager after disconnect

#11 Post by Barracuda72 »

Hi,
Good to see I'm not alone. I have already reported this to Debian: https://bugs.debian.org/cgi-bin/bugrepo ... bug=882213 so, guys, please vote and comment.
OK, I managed to figure out the problem. It's in the Udev itself, or probably in some communication between gvfs-mtp and udev. For me, as Gentoo user, solution was pretty
simple: installation of udev version 233 instead of default Gentoo's EUdev demolished the problem.

giaur
Posts: 120
Joined: 2013-03-08 07:03

Re: MTP devices are visible in file manager after disconnect

#12 Post by giaur »

So, do you mean, that specific udev version solves the problem? Pretty old. I'm sure I don't even want to try downgrading on Debian, bunch of dependencies to latest version

sej7278
Posts: 225
Joined: 2011-06-11 17:03

Re: MTP devices are visible in file manager after disconnect

#13 Post by sej7278 »

seeing this too on sid, replied to the bug. assume its the 1.30 to 1.31-1 upgrade in October and it wasn't fixed in December's 1.31-2

killing and restarting gvfs-mtp-volume-monitor "fixes" it easier than rebooting.

Post Reply