View Issue Details

IDProjectCategoryView StatusLast Update
0012961MediaMonkey (current)Synchronizationpublic2016-07-22 10:01
Status resolvedResolutionnot fixable 
Product Version4.1.10 
Target Version4.1.12Fixed in Version 
Summary0012961: USB Sync freezes when removing content
DescriptionPerforming USB sync on a device that was previously wi-fi synced fails to complete--the operating is stuck on 'Removing old content'.

Debug log attached.

- MMA build 501
- MMA had previously wi-fi synced 5 playlists (4 nested, 1 standalone)
- Sync profile is configured to delete all other media files from the device, but during the sync operation, I chose to _not_ delete any of the tracks/playlists that were prompted for deletion (i.e. I deselected all items).
- Wi-Fi sync immediately afterwards proceeds successfully. Debug log: DI8O62Z3P2
TagsNo tags attached.
Fixed in build


related to 0012340 closedrusty MediaMonkey (current) Optimize USB sync with Androids 
parent of 0012999 closedmarek MediaMonkey for Android MediaMonkey/files/ directory is presented as file over MTP (regression?) 
related to 0012948 closedLudek MediaMonkey (current) USB Sync: certain devices running MMA no longer recognized 
related to 0012978 closedmarek MediaMonkey for Android MediaMonkey fails to terminate after mediastore/sync operations 
related to 0012981 closedLudek MediaMonkey (current) Crash on disconnect of USB cable 
related to 0013022 closedLudek MediaMonkey (current) Tracks fail to delete on USB sync (though playlists delete successfully) on KitKat write limited devices 
related to 0013280 closedLudek MediaMonkey (current) Show error message when MTP is frozen 
related to 0013278 assignedrusty MediaMonkey for Android Sync failures on huawei device triggered by track deletion 
related to 0013420 closedpeke MediaMonkey (current) USB: Synchronization reports Can't Access device MTP Connection fail 



2015-11-16 03:28

administrator (171,272 bytes)


2015-11-16 10:42

developer   ~0043314

Last edited: 2015-11-16 10:48

View 6 revisions

This is the longstanding issue with MTP freeze after deleting a file.

My workaround used to be to let the phone plugged in for minute and then run the sync.
Unfortunatelly the freeze is on MTP layer (most probably on Android side) and I have never found a workaround that 100% works and I 've spent much time on it.
I found that the freeze often happens once MMA or MMW deletes a file on the device and the device is connected just for a few seconds.

I am also able to simulate the freeze without involving MMA/MMW.
My test case is:
- Connect the phone over USB
- Run Total Commander for Android and delete a file
- Try to browse the phone using Windows Explorer
=> freeze

So as we can see we are not the only one struggling with it.

BTW: Users indicated that killing Explorer.exe seems to be another workaround for the MTP freeze issue, although really not very comfortable, I believe.

BTW2: In my case (when the freeze happens) then it takes from 5 to 10 minutes before it is defrost, I see in your case it takes more than 10 minutes, but probably depends on amount of files already presented on the storage where Android internally recounts something on the files when a file is deleted.


2015-11-16 14:45

administrator   ~0043315

Resolved as not fixable, and documented at:


2015-11-16 20:06

administrator   ~0043318

Re-opening for feedback:
Why would this problem occur even if I uncheck all content on the delete content confirmation dialog?


2015-11-16 20:45

developer   ~0043321

There is probably still a file deletion involved, cannot tell you without seeing debug log


2015-11-25 23:06

administrator   ~0043410

Last edited: 2015-11-25 23:33

View 2 revisions

Tested USB sync further with MMA 508 vs MMW 1679, and it seems that freezes occur much more commonly when MMA is installed.

To elaborate: If MMA isn't installed, if I modify the sync profile so that MMW deletes content from the device, the sync process does experience the freeze. But if the changes in the sync profile don't trigger deletion, then the sync is very rapid. This is true even if the /MediaMonkey directory has been left behind following installation/uninstallation of MMA on the device).

In contrast, with MMA installed, freezes almost always occur--even when the sync profile doesn't require that content be deleted. Moreover, the problem seems to occur regardless of whether or not MMA is running, and most often occurs as soon as sync is initiated and shows 'Preparing list of files...'.

It's as if MMW is doing something differently depending on whether or not MMA is on the device. Any ideas how to resolve this?


2015-11-26 15:25

developer   ~0043412

Last edited: 2015-11-26 15:28

View 3 revisions

1) If you uninstall MMA, do you delete also something from /MediaMonkey/files/ or do you leave the folder untouched ?

If you leave the folder untouched then MMW does all the sync same way, i.e.
[MMA once installed + uninstalled] = [MM installed + not running]

2) In your tests, did you check phone -> apps -> running apps list to ensure that MMA was really not running?

3) I would need to compare debug logs from both the situations [MMA once installed + uninstalled] and [MM installed + not running], could you generate them?


2015-11-26 17:52

administrator   ~0043414

Last edited: 2015-11-26 18:37

View 2 revisions

1) I leave the folder untouched (but now I'm ensuring that the state of the db is in sync with what content exists by running MMA prior to uninstalling it).

2) Originally, no--I hadn't observed any problems recently re. failure of MMA to terminate, so with the notifications timer set to 10s, I was just waiting a minutes and then syncing.

BUT, it seems that there is a bug and MMA isn't terminating in some cases--tracking at: 0012978

I guess the question now is whether there's anything we can do to prevent USB syncs from being so slow even if MMA is running.


2015-11-26 20:11

developer   ~0043415

Last edited: 2015-11-26 20:12

View 2 revisions

This question we have been solving intensively in past years by ensuring that neither MMW/MMA need to delete a file needlesly during sync.

AFAIK currently MMW only renames the control files in /MediaMonkey/files/ and MMA also uses rename during sync, but at the end of USB sync it needs to delete processed mmstore.db.synced file with advanced metadata.

So I guess that running seconds USB sync causes the freeze, because at the end of the first sync MMA deleted a file, right?

I cannot reproduce the freeze now so I cannot know, but I remember that this kind of freezes were always related to a deletion of a file in android.


2015-11-26 20:33

developer   ~0043416

Last edited: 2015-11-26 22:34

View 3 revisions

Probably if MMA could detect whether it is USB connected then it could move the files to a trash folder and delete the trash while it is unconnected.

But waiting for the logs at first to review...


2015-11-26 23:21

administrator   ~0043419

Case 1: MMA not running in background
1 Sync Shlomo Katz, Test hierarchy, Test list, 2 playlists sub to 'Test Playlists'
--> Fast sync
2 Sync Test list 2
--> Fast sync
3 Remove Test list, Test list 2, and add Bar Mitzvah -1Beginning
--> Sync stuck on '(Removing old content)'

Case 2: MMA running in background
After MMA has been installed and notification timer is set to 10s:
1 Sync Shlomo Katz, Test hierarchy, 2 playlists sub to 'Test Playlists' (with MMA running)
--> Fast sync

2 Added another playlist 'Test list2' to the auto-sync list (no deletions). Initiate Wi-Fi sync (0002867:0008700 on the debug log)
--> MM is stuck '(Preparing list of files)' and finally completes after ~5 minutes.

Logs attached.


2015-11-26 23:21

administrator (545,145 bytes)


2015-11-27 11:58

developer   ~0043427

Last edited: 2015-11-27 11:59

View 3 revisions

ok, so it is clear that a file deletion triggers the freeze for you,
the good news is that we can use the same trick as for the control files in

i.e. insead of DELETE we can use RENAME to /MediaMonkey/files/trash file,
testing it now and it seems to work well also for media files (tracks+playlists)


2015-11-27 13:38

developer   ~0043431

Last edited: 2015-11-27 15:57

View 3 revisions

Progress: RENAME operation works as a workaround for the DELETE, but I cannot get MOVE operation to work over MTP (probably unsupported by Androids, returning 80045004 error code).

The consequence is that a zero bytes 'trash' file will be presented in each folder where MMW deleted a file. Not very nice, but if it will solve the freeze then it is suitable IMHO


2015-11-27 15:25

developer   ~0043432

Last edited: 2015-11-27 15:58

View 4 revisions

Hmm, after good news some bad news are coming, the workaround seem to work well when testing with small group of files, but when testing deletion of 400 files at once then on the phone screen I see "Process was unfortunately terminated" and Windows Explorer and MMW are frozen until device unplug :-(

So the situation is probably even worse than without the workaround


2015-11-27 17:21

developer   ~0043435

Added two development options to build 510

Allow deletion during USB sync
 - DBs are or aren't deleted during USB sync. Both works fine. The new version is with unchecked checkbox - without deletions.

Allow file notification during USB sync
 - MTP is notified about changes that MMA performs with files. When it is disabled...MMW might not have been notified about latest DB version. By enabling - MTP notifications may cause freezing. Default is checked.


2015-11-29 08:30

administrator   ~0043446

Last edited: 2015-11-29 08:35

View 3 revisions

Note: when MMA is in a state where its process won't terminate (0012978) I just noticed that MMW can become unstable just by navigating the MTP device. e.g.
1 click the device or Options>Locations for the device
--> MMW fails to respond
2 attempt to close MMW
--> MMW doesn't respond and eventually crashes

3 AVs were generated and submitted with the following note:
"Bug 12961 Note 43446"


2015-11-29 11:58

developer   ~0043449

Last edited: 2015-11-29 12:47

View 2 revisions

as for the original issue (when MMA is not running and MMW is deleting files) please test with this DDL:

It is the workaround with renaming all the deleted files to a zero bytes '.trashed' file and I wonder how it works with your device(s):

1) Replace it over your current d_WMDM.dll from build 1770
2) Ensure that MMA is not running at all
3) Delete 10 files from the device and ensure that the MTP freeze no longer appear
4) Delete at least 500 files from the device and ensure that on the phone screen there is no error like " has stopped"


2015-11-30 06:36

administrator   ~0043453

Last edited: 2015-11-30 06:37

View 2 revisions

Tested the new dll and the MTP freez still occurs with it (test was to remove 2 small playlists (each containing ~5 files) from the auto-sync list.

Note: MMA was already in a state in which it wouldn't terminate.


2015-11-30 07:28

developer   ~0043454

So please ensure in the step 2 that MMA is not running at all, thanks.


2015-11-30 15:23

administrator   ~0043458

Here's a new log:
1 Reboot Android device (so that MMA isn't running). Note that in this case, 'Enforce use of sync mask' is enabled (and was previously enabled).

2 USB sync 2 playlists and sync

3 Remove one of the playlists from the auto-sync list and sync
--> Success
Line 4782

4 Remove second of the playlists from the auto-sync list and sync
--> Sync operation freezes on a step with no status. i.e. "Synchronizing Sam-Tab84-Card: "
--> MMW appears remains frozen (because delete confirmation dialog is hidden)
[NEW BUG: a simple non-functional fix would be to adjust the status message to display
"Synchronizing <device>: (Confirmation)"

5 Disconnected the device
--> MMW appears remains frozen (because delete confirmation dialog is hidden)
Line 6654

6 Reconnected the device
--> Delete confirmation dialog appears (it was probably hidden previously)
--> Sync proceeds on acceptance

7 Added 2 playlists to sync list and synced
--> Success
Line 10301

8 Removed 3 playlists from sync list and synced (this time one of the playlists was hierarchical)
--> MMW freezes during the remove content phase
Line 11728


2015-11-30 15:23

administrator (217,483 bytes)


2015-11-30 16:57

developer   ~0043461

Last edited: 2015-11-30 17:03

View 5 revisions

Thanks, in your log I see that this time it frozen when uploading sync_finished file on the line 00012842 in the log and you disconnected the device after 3 minutes so the sync_finished file failed to upload with MTP error 80070002

So the workaround with renaming to the .trashed zero bytes file doesn't seem to solve the problem.

FYI: in the meantime Peke has updated his note ~43322 with a workaround of killing Google Music app (not very comfortable workaround for the KB article though).


2015-11-30 22:08

administrator   ~0043469

Note: at 0012984:0043464 (steps 3/4) there's another usecase in which MMW freezes; when the user clicks the device in MMW and attempts to view the content on the Android device by expanding the tree node while MMA is running.

This results in perpetual 'scanning' of the device.


2015-11-30 23:40

developer   ~0043471

Last edited: 2015-11-30 23:40

View 2 revisions

Peke indicated over IM that disabling the developer options in MMA (0012961:0043435) solves the freeze for him, is this the case for you too ?


2015-12-01 08:10

administrator   ~0043475

Re. Developer options:
If I disable both 'Allow deletion during USB sync' and 'Allow file notification during file sync'
Freezes don't occur during sync operations that don't delete files from the device (freezes still occur when files are deleted).

Note, however, that I can't vouch for the reliability of sync operations with these settings given time constraints and the fact that Wi-Fi sync isn't working well due to 0012986.

I did however, notice that:
- In MMA, 'test list 2' was missing after these sync operations
- After disconnecting the USB cable, an AV occurred as documented at 0012981:0043474


2015-12-01 08:13

developer   ~0043476

Last edited: 2015-12-01 08:17

View 2 revisions

I am curious whether there is difference between these options:
1. Both enabled
2. Deletion disabled, notification enabled
3. Both disabled

Case 3 (where notification is also disabled) is most painful for us. And I am not sure whether we will be able to implement it correctly.

We regularly copy our DB to SD card for USB sync. But MMW asks for fresh DB just before USB sync. And we have to notify MTP about this modification of file. It is not critical but some most recent modifications in MMA might not be synced to MMW. But maybe we will be able to solve it.

So we have to prove that option 3) is really better than 1) and 2).


2015-12-01 17:48

administrator   ~0043483

In the course of testing today, I don't notice any really change between options 1/2/3. USB sync often seems to freeze (even when tracks are only being added to the sync list).

See attached logs for cases 2 and 3.

It seems to me that the best course of action would be to:
a) do a bit more testing to set the optimal MMA default (i.e. choose case 1/2/3 setting)
b) do a bit more testing to verify whether changes in pace/timing/quantity of deletions can mitigate the bug
c) confirm whether these bugs are really specific to Samsung kitkat devices, and that they don't occur on other devices / lollipop/marshmallow as well.
d) verify a realistic workaround in which:
- initial sync is performed to SD card
- subsequent syncs are performed over Wi-Fi
(i.e. this workflow should work flawlessly)

e) update the knowledgebase accordingly


2015-12-01 17:50


bug_12961_case2.LOG (245,880 bytes)


2015-12-01 17:52


bug_12961_case2_better.LOG (748,495 bytes)


2015-12-01 23:30

developer   ~0043485

Last edited: 2015-12-02 14:18

View 2 revisions

By item d) Rusty most probably thinks to eject SD card and insert it into a PC card slot and sync via USB MS (drive letter). Then performing WiFi sync to update the advanced metadada like rating/playcount.
I verified that this works as usable workaround.


2015-12-02 15:50

developer   ~0043488

Last edited: 2015-12-02 15:51

View 3 revisions

FYI based on what I read here: it is probably causing the Android's media scanner where iSyncr for Android can detect this and showing the "Operation is taking a long time" message on the display, see item 5) there.

Marek still doing some testing to find more, but as you can see we aren't the only one fighting with this, actually there is plenty complaints of the MTP freeze if you are Googling it, but not a comfortable workaround so far.

Also based on what JRT are suggesting here:

Refreshing the media database on the android might help:
i.e. Android -> Apps -> Media Storage -> [Clear Data]


2015-12-02 19:57

developer   ~0043489

Last edited: 2015-12-02 20:02

View 3 revisions

I have made some tests. There were 5 things that could cause the freeze and I found out that "MediaStore sync" and "copying of DB file to sd card" are probably causing it.

I have added two new options to Developer options to be able to turn it off. My results:

Allow mediastore sync [X]
Allow database copy [X]
-----> FREEZE
Allow mediastore sync [ ]
Allow database copy [X]
-----> FREEZE
Allow mediastore sync [X]
Allow database copy [ ]
-----> FREEZE
Allow mediastore sync [ ]
Allow database copy [ ]

Could you please verify it? I will create a build 515 with these options.

NOTE: USB sync doesn't work correctly when both options are disabled. But it doesn't matter for now. You can only try to initiate the USB sync in different situations - and try to freeze it.

I have some tips. It really looks like it freezes when MMA is started - when mediastore is started (probably something has to be done/changed in mediastore) and DB is copied to SD card. It looks like after these operations, Android starts some background refresh service that causes USB sync freeze...

Don't do anything in MMA during tests - you can kill it, close it etc but do not create new playlists, do not wifi sync - because it will change MediaStore too and test won't be reliable.

NOTE2: Please ignore the previous two options with deletion and MTP notifications. They are probably unrelated to freeze.

NOTE3: Do not delete any track during USB sync - it is different issue on MMW side


2015-12-02 21:04

developer   ~0043493

Unfortunately it is not true, MediaStore sync is needed because we need to pair playlists. So deletion and update of playlists will be propagated from MMA to MMW.


2015-12-02 21:26

developer   ~0043494

There is maybe one option:
We can do MediaStore sync - but one way only (from MediaStore to MMA). Everything will be paired. MediaStore will have the content from MediaScanner (most probably) - so no content will be missing in Google play. The only drawback is that new changes (that will be done after USB sync) in playlists will not be propagated from MMA to MediaStore.

But I don't know - it will affect all syncs when USB cable OR charger is connected!

Btw. disabling MediaStore sync after USB sync is not a solution. It can cause freeze in next USB sync - but only when two or more USB syncs are done in a row - i.e. 95% of users will never mention it. But it will not fix freeze in first USB sync!


2015-12-03 11:37

developer   ~0043503

Last edited: 2015-12-04 06:35

View 4 revisions

OK, not sure whether it solves something if we need to refresh mmstore.db content anyway after USB sync for MMW to have actual content.

BTW: did you try the
Android -> Apps -> Media Storage -> [Clear Data]
whether it helps?

Also Peke found that this works to workaround the freeze:
Apps -> All Apps -> Media Store, Google Music -> disable.
then WMP/MMW don't freeze after file deletion based on Peke's findings.

Another tip is trying to create '.nomedia' file to see whether it helps.


2015-12-04 13:38

developer   ~0043517

In build 516, I have changed the way how DB is copied to SD card. It renames the files instead of deletion.

Please try to reproduce freeze with following developer options:
[ ] Allow deletion in MediaMonkey folder
[X] Allow file notification during USB sync
[ ] Allow MediaStore synchronization
[X] Allow copying of database to SD card

How to reproduce
1. Stop MMA and restart MMA and start USB sync immediately
2. Try add playlist and USB sync
3. Start USB sync without modifying anything

I am mixing and repeating these 3 steps and I am able to reproduce freeze - but it is not always! Sometimes, it can take up to 20 minutes to reproduce it.

If this succeed, i.e. no freeze will occur. We should retest the USB sync completely with following options:
[ ] Allow deletion in MediaMonkey folder
[X] Allow file notification during USB sync
[X] Allow MediaStore synchronization
[X] Allow copying of database to SD card

This settings does not prevent freezing but it should reduce the number of freezes. But we have to be sure that it works well on all devices before releasing.


2015-12-04 19:13

developer   ~0043522

Seems that it caused a regression 0012999


2015-12-04 21:23

developer   ~0043525

Last edited: 2015-12-04 21:58

View 3 revisions

As Ludek Noted in 0012999 USB Sync Fail due the "files" folder is presented as File in MTP.

Reverting to <516 didn't work (tested with 515->508)

Only way i get functionality back is to delete "files" file (MTP crashed) and after reconnect create "Files" folder from Windows explorer (MTP again Crashed) after 3'rd connection mmstore.db was present and I could sync USB again.


2015-12-04 22:00

developer   ~0043526

Additionally when using Android -> Apps -> Media Storage -> [Clear Data] first USB Sync seams faster also.

Almost like Media Storage data gets fragmented.


2015-12-08 03:14

developer   ~0043533

Last edited: 2015-12-08 03:26

View 3 revisions

Following Steps from 0012999:0043531
12. MMW open Tools -> Options -> Devices and disable Internal storage -> OK
13. Selected SD Card on Tree
14. Clicked on Sync Now in Tree
15. MMW freeze along with MTP

Captured LOG. and screenshot of MMA dev Settings

Repeat same steps using WiFi all went flawlessly. (Log Also captured)

NOTE: Use Archive and files from FTP /SmokeTest/ folder (Update to 1774 Portable) and MM.DB from Archive "2015-12-08 01 Freeze.rar" from /MMW/bugs/bug12961/

Initially you will need to use Locate Moved/missing tracks on all tracks due the MediaID difference and tracks are located in ...\Portable\music\

EDIT: Supplied ELF file is result Of Crash While MTP Freeze which was possible reason for 0012981 in first place


2015-12-08 06:35

developer   ~0043535

Peke, I don't understand what test conditions do you have...

Did you try that with settings described in 0012961:0043517 ?


2015-12-08 14:23

developer   ~0043543

Results Using:
[ ] Allow deletion in MediaMonkey folder
[X] Allow file notification during USB sync
[ ] Allow MediaStore synchronization
[X] Allow copying of database to SD card

Although freeze do not happen it also break USB Sync.

1. Connect Device
2. Sync via USB to SD Card
3. Disconnect Device
4. Delete All music from MMA from SD Card
5. Connect device
6. Sync via USB
7. Only playlists are sync no tracks at all even they are deleted and needs to be re-sync due the New Playlist added


2015-12-08 14:37

developer   ~0043544

As mentioned earlier:
NOTE: USB sync doesn't work correctly when both options are disabled. But it doesn't matter for now. You can only try to initiate the USB sync in different situations - and try to freeze it.

It is not a fully working app when you disable these two options. You should try to freeze it only. And follow the steps described there...

After that you can test this:
[ ] Allow deletion in MediaMonkey folder
[X] Allow file notification during USB sync
[X] Allow MediaStore synchronization
[X] Allow copying of database to SD card
and this should be fully working...


2015-12-10 21:10

developer   ~0043591

Last edited: 2015-12-10 21:17

View 2 revisions

Another workaround could be installing CyanogenMode, I installed it on my S3 and I haven't observed an MTP freeze so far. Also whole UI is much faster (but voids phone warranty).


2015-12-12 16:04

developer   ~0043626

Using workaround for 0012999 USB Sync started to work as they should while USB sync had no freeze.

I used per Marek suggestions:
[ ] Allow deletion in MediaMonkey folder
[X] Allow file notification during USB sync
[X] Allow MediaStore synchronization
[X] Allow copying of database to SD card


2015-12-14 04:32

administrator   ~0043634

Unable to test this due to 0013022 (mmw fails to prompt to delete tracks).


2016-02-04 01:15

developer   ~0044058

Verified 1783


2016-02-04 01:15

developer   ~0044059

Verified 1783


2016-02-05 15:25

administrator   ~0044076

Peke, I'm not sure how you verified this since the issue is still open. The task was to test out the various developer settings and to see which, if any, improve the situation with this bug (occasional freezes when content is removed during a USB sync).


2016-02-06 18:34

developer   ~0044079

Last edited: 2016-02-06 18:41

View 3 revisions

I retested using 0012961:0043626 settings during last smoke test and before that had 20+ syncs without freeze in past month.

I do not know maybe Windows 10 December update fixed things as it almost reinstalled whole windows.

Let me know if you need something more to test.


2016-02-08 17:18

administrator   ~0044082

The issue still occurs, though perhaps not as consistently as in the past (tested with SG tab 8 Pro on Android 4 / Huawei device on Android 5 vs Windows 10 and Windows 7).

Try syncing using some of the repro steps from this bug--I had the best luck when doing an initial sync via USB (rather than Wi-Fi). It doesn't always occur, but it occurs often enough.


2016-05-13 16:31

developer   ~0044608

As explained in IM I can replicate freeze eachtime I access Device folders where MMW save music with windows explorer. It looks like android tries to cache Album arts and thumbs Windows explorer create which by definition of multi threading causes MTP to freeze.

I wonder if there is a way to set exclusive usage flag when MMW tries to access Device?


2016-05-13 17:18

developer   ~0044611

Last edited: 2016-05-13 17:19

View 2 revisions

There is nothing like this, the freeze is on the Android side (when processing new/deleted content), added 0013280 - so users are aware of the MTP freeze now