View Issue Details

IDProjectCategoryView StatusLast Update
0012999MMASynchronizationpublic2015-12-17 20:08
ReporterLudek Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.3 
Target Version1.1.3Fixed in Version1.1.3 
Summary0012999: MediaMonkey/files/ directory is presented as file over MTP (regression?)
DescriptionStarting from MMA build 516 the /MediaMonkey/files/ directory is presented as file causing that MMW cannot access the storageInfo.xml and mmstore.db files at all.

See attached screenshot
TagsNo tags attached.
Attached Files
bug12999_MMA522.LOG.zip (181,790 bytes)
Fixed in build525

Relationships

related to 0013005 closedLudek MMW v4 MWM Create double Profile each MMW Start (when info file cannot be written) 
related to 0012974 closedmarek MMA Ratings are out of sync after track Pairing 
related to 0012740 closedmarek MMA Nested autoplaylists delete on sync 
child of 0012961 resolvedpeke MMW v4 USB Sync freezes when removing content 

Activities

Ludek

2015-12-04 19:19

developer   ~0043523

Last edited: 2015-12-07 11:46

Note that in Android it is presented correctly, but in Windows the dir. is presented as file.

Unplugging/replugging cable does not help.

The workaround is to delete the /MediaMonkey/files file using Windows Explorer

Ludek

2015-12-07 11:44

developer   ~0043527

Last edited: 2015-12-07 11:48

I have been trying to replicate multiple times today and I couldn't to replicate this at all.

Once I deleted the /MediaMonkeys/files file in Windows Explorer then MMA created the directory correctly everytime I tried it, no matter whether I uninstalled MMA in between or not.

Assigned to Peke to find whether there are some steps to replicate (to see what we can do)

marek

2015-12-07 11:50

developer   ~0043528

I am not able to reproduce it too. I have observed this behaviour many times before with other folders.

It cannot be regression because build 516 has no changes when dev settings are default. I have verified it.

Btw. Peke indicated that he doesn't see it in ES file explorer too. Please note that storageInfo.xml is create on app start only. So you have to stop MMA completely (not just by backing out). But it is unrelated to this issue.

peke

2015-12-08 01:36

developer   ~0043531

Last edited: 2015-12-08 17:33

I can replicate this each time I start doing clean MMA install.
1. Uninstall MMA
2. Delete MediaMonkey Folder from Internal+External Storage
3. Restart Device
4. Install MMA (Start)
5. Set permissions for SD CARD
6. Tap menu -> Options -> Choose Library folders
7. Delete all Internal Storage folders
8. Go to Tracks and ensure that there is no tracks in MMA
9. Connect USB to PC (MMW not started MMA still open)
10. Open File explorer -> Device -> Internal Storage -> MediaMonkey folder
11. files is not folder, but artwork is.

Tests were done on Moto G LTE Lollipop 5.1

Ludek

2015-12-09 20:23

developer   ~0043576

Last edited: 2015-12-09 20:24

Marek, are you able to reproduce it using the Peke's steps ?

Peke indicated that device reboot does not solve the problem, so I guess it is quite serious because USB will never work correctly once the issue occurs for users.

If you are not able to solve it on MMA side then I guess that MMW should auto-delete the 'files' once it finds that it is presented as file instead of folder over MTP

peke

2015-12-09 22:35

developer   ~0043577

Last edited: 2015-12-09 22:58

From additional testing of downgrade version by version.

Looks like last MMA version that correctly create files as folder is 499.

Moto G LTE Lollipop 5.1

marek

2015-12-10 01:28

developer   ~0043579

Fixed in build 518

Ludek

2015-12-11 17:54

developer   ~0043618

Re-opened,
Peke and Rusty observed this again.

The best would be if MMA could somehow detect the situation and repair, if it is not possible then MMW should delete the 'files' file as I previously suggested, but the former is preferable

rusty

2015-12-11 18:17

administrator   ~0043619

Last edited: 2015-12-11 18:26

From testing out the cases described at 0012974:0043596 close to 10 times, it seems to confirm that the problem is likely within MMA:
Build 520 vs Asusfone 2 (lollipop):
0 Reboot the device
1 Install and run MMA (lollipop) and configure SAF then exit MMA
--> mmstore.db/storageinfo.xml is in /MediaMonkey as it should be, but in Windows Explorer '/files' appears as a file instead of as a directory

2a On the Android device, using ES Explorer rename '/files' to '/files2' and then back to '/files'
--> In Windows Explorer, '/files' appears as file! (and when '/files' was renamed to '/files2' Windows explorer showed both '/files2' folder and 'files' file.
2b On the Android device, using the file explorer that came with the device rename '/files' to '/files2' and then back to '/files'
--> In Windows Explorer, '/files' appears correctly as a folder (but it doesn't display mmstore.db or storageInfo.xml--even though both are on the device).

3 USB sync a playlist
3a--> In Windows Explorer, '/files' appears as a file!
3b--> In Windows Explorer, '/files' appears correctly as a folder (but it only displays the mmstore.db file--not the storageInfo.xml file).

4a&b Run MMA (usb cable happened to be connected this time)
--> Ratings are missing!!
--> no changes to the folder status from 3a/3b

Note:
-The problem happens 100% of the time with the Asus Zenphone. I'm not sure that this tells me anything other than the fact that for some reason, the creation of the mmstore.db and storageInfo.xml files in /MediaMonkey on the sd card with build 520 always seems to cause MTP to incorrectly interpret it as a single file.
-renaming the directories doesn't seem to be a solution
-build 515 doesn't solve this issue either for the Zenfone 2 device (Ludek mentioned that the problem started occurring in build 516 on his device). I suspect that this issue has existed for a long time on Zenfone devices.

rusty

2015-12-14 20:19

administrator   ~0043651

I tested move/copy operations (using ES Explorer) on the Asus device and observed the following behaviors:

1) copy /MediaMonkey/* to /MM1 --> Fail--Artwork appears as a drive!
1b) copy /MediaMonkey/* except for /.nomedia to /MM1 --> Fail--Artwork and files appears as a drive!
1c) move /MediaMonkey/* to /MM6 --> Fail--Artwork appears as a drive!
2) /MediaMonkey/.nomedia to /MM2
 /MediaMonkey/Artworks to /MM2
 /MediaMonkey/files to /MM2
--> Fail--files appears as a drive!
2b) copy /MediaMonkey/Artworks to /MM3
 /MediaMonkey/files to /MM3
--> Success.
2c) move /MediaMonkey/Artworks to /MM7
 /MediaMonkey/files to /MM7
--> Success.
3) copy /MediaMonkey/.nomedia to /MM4
 /MediaMonkey/Artworks/* to /MM4/artworks/
 /MediaMonkey/files/* to /MM4/files
--> Success.
 4) move /MediaMonkey/Files/* to /MM8/Temp
/MediaMonkey/Artworks/* to /MM5/artworks/
 /MediaMonkey/files to /MM8
 /MediaMonkey/Temp/* to /MM8/files
--> Fail. Files appears as a drive

I'm still not sure what to make of this, but it seems that:
I) case 2a fails because of the .nomedia file that is in /MediaMonkey (by not copying it, cases 2b/2c succeed)
II) case 3 seems to succeed because the files are copied rather than the directories containing the files as in 2a
III) case 4) fails for some unknown reason
In general, it seems that it would be a good idea to:
- not include .nomedia in the /MediaMonkey directory
- copy/create the two directories separately
- copy/create the contents of the two directories separately

marek

2015-12-14 22:59

developer   ~0043656

Fixed in build 522

I have found out that it might be caused by notifying StorageScanner about changes in folders. It was removed in build 522.

rusty

2015-12-15 05:47

administrator   ~0043659

Tested build 522 on the Asus Zenphone 2 / lollipop and it still fails:

1 Install and run MMA (lollipop) and configure SAF
Debug log: W0JYU8RJDN
--> in windows explorer /artworks and /files both show up as directories in internal memory, but /files has the mmstore.db but not the xml file
2 Connect usb cable ~line 1067
3 USB sync 2 playlists within a hierarchy ~line 2848
4 Run MMA
--> Playlist hierarchy is missing / Ratings are missing!! i.e. the DB wasn't used!
Debug log: SEZJAZJ3D2
MMW log attached

Test note: the following can be tested if the above works:
1 USB sync a playlist1 a clean Android device (no traces of MMA)
2 Install MMA and grant access to the SD card
3 Perform another USB sync operation (e.g. add another playlist2)
=> track's rating are not updated in MMA for track in Playlist1 or Playlist2 !

rusty

2015-12-15 06:22

administrator   ~0043661

Last edited: 2015-12-15 06:26

In addition to failing on Lollipop (see above), build 522 also fails on kitkat--which previously worked!

1 Install and run MMA
2 Connect usb cable
3 USB sync playlists within a hierarchy
4 Run MMA
--> Playlist hierarchy is missing / Ratings are missing!! i.e. the DB wasn't used!
--> in windows explorer /files/StorageInfo.xml.mmw and /Testdir appears in external memory; internal memory has /files/mmstore.db and .nomedia (I missed the other contents)
Debug log: 12JMJ50RWP

MMW debug log attached as well.

Note: this now blocks testing of 0013022

marek

2015-12-15 10:41

developer   ~0043668

Fixed in build 523

rusty

2015-12-15 19:03

administrator   ~0043672

Last edited: 2015-12-15 20:46

Verified MMA 523 / MMW 1778 on
-Asus Zenfone (Lollipop) SD. Passed
-Samsung Tab 8 (Kitkat) SD. Passed (with occasional freezes tracked at 0012621 ).
-Shield K1 internal memory. Failed.
1 Install and run MMA
2 Connect usb cable
3 USB sync playlists within a hierarchy
--> the only files in the /files folder are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
--> the only files in the /files folder visible over MTP are mmstore.db, StorageInfo.xml.mmw
4 Run MMA
--> Playlist hierarchy is missing / Ratings are missing!!
--> in windows explorer internal memory internal memory has /files/mmstore.db and .nomedia

Debug log: 2G1BCMQKQM
MMW log attached as well

rusty

2015-12-15 21:07

administrator   ~0043674

Last edited: 2015-12-15 21:09

2nd set of logs:
Debug log: BTYQ6PTL2Z
MMW log attached

Note: also tested sync to internal memory on Asus device and that works correctly (so the problem isn't generic to internal memory).

marek

2015-12-16 11:58

developer   ~0043681

There is no mmstore.db.synced in files. MMW probably doesn't recognize it as Android device with MMA... assigning to Ludek

Ludek

2015-12-16 12:20

developer   ~0043683

Last edited: 2015-12-16 12:36

Re the logs from Shield K1:

In the log bug_12999_shield_MMA523.log.zip I see that content was
\MediaMonkey\files\StorageInfo.xml.mmw
\MediaMonkey\files\mmstore.db

Why StorageInfo.xml is missing?

But the mmstore.db was there _after_ the USB sync on subsequnet rescan. MMW downloaded mmstore.db on line 6928 at 462 seconds, but the log ends early at 486 seconds just after the subsequent device re-scan.

In the bug12999_shield_mma523-2nd-log.zip there is no mmstore.db and no StorageInfo.xml so MMW uploaded StorageInfo.xml.mmw

So looks like MTP refresh issue again, nothing that could be tweaked on MMW side.

Maybe you connected the device too early?
Nevertheless thanks to recent changes like 0013006 the rating and playlist hierarchy are corrected on the next USB sync (once the MTP is up to date) so I guess that we cannot do anything better about it now.

rusty

2015-12-16 16:17

administrator   ~0043685

Last edited: 2015-12-16 19:43

Unfortunately, subsequent USB sync operations with the Shield K1 fail to resolve the problem--in fact they compound it--resulting in duplicate playlists. I'll try regenerate logs and provide more detail below:

1 Clean Install and run MMA
Debug log: 5BOMZ9ZP6L
-->files in /MediaMonkey/files are mmstore.db, storageInfo.xml
2 Connect usb cable (line ~ 1642)
3 Configure MMW to sync Playlists 'Test playlist', 'Test hierarchy' (line ~ 1842)
4 USB sync (line ~ 3132-7480)
--> the files visible in /MediaMonkey/files over MTP are mmstore.db, StorageInfo.xml.mmw
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
5 Unplug USB Cable (~line 7545)
6 Plug USB cable back in to trigger MTP refresh (~line 7632)
--> the files visible in /MediaMonkey/files over MTP are mmstore.db, StorageInfo.xml.mmw
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
7 Run MMA
--> Playlist hierarchy is missing / Ratings are missing!!
--> Debug log: 8I3GOC0NJO
--> the files visible in /MediaMonkey/files over MTP are mmstore.db, StorageInfo.xml.mmw
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
8 Unplug USB (~line 8188)
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
9 Plug USB (~line 8248)
--> the files visible in /MediaMonkey/files over MTP are mmstore.db, StorageInfo.xml.mmw
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
10 Tap Device in MMW and add 'Test list 2' to auto-sync list (~line 8700)
11 Initiate USB sync (line 9996)
-->Prompt to delete 'hierarchy 1.m3u', 'hierarchy 2.m3u', 'hierarchy 3.m3u', 'test list.m3u' (not sure why--they haven't been removed from the auto-sync list)
12 Click 'Continue' to accept deletion of the playlists (line ~ 11541)
-->For some reason 32 tracks recopy to the device even though 'Test list 2' only contains x tracks!!
--> the files visible in /MediaMonkey/files over MTP are .trashed, mmstore.db, mmstore.db.synced.0001, mmstore.db.synced.0002, StorageInfo.xml.mmw, sync_finished, sync_started
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, mmstore.db.synced.0002, storageInfo.xml, StorageInfo.xml.mmw, sync_finished
13 Disconnect USB ~line 17191
14 Run MMA
--> MMA shows tracks _with_ ratings, but playlist hierarchy is messed up, showing:
Hierarchy 1
Hierarchy 2
Hierarchy 3
Test Hierarchy (empty)
Test list 2
Test list 2

Debug log: MLJ6L7R24W

So it looks like there is some sort of MTP refresh problem, but perhaps more is also going on... Hopefully this is enough info to debug a bit further.

MMW debug log attached.

Note also: throughout all of the above tests only a single profile existed for the Shield tablet in MMW.

rusty

2015-12-16 16:37

administrator   ~0043687

Last edited: 2015-12-16 16:43

Did one more test in case it helps:
15 Ran MMA and added 'Bronski' to the auto-sync list
16 Initiated Wi-Fi sync
-->
Faulty hierarchical playlist presentation issues were resolved except for the duplicate entries for Test list 2 i.e. MMA now shows:
Test Hierarchy (3 playlists)
Test list
Test list 2
Test list 2
Test Playlists (1 playlist)

Debug log: I7U2WFNNSG

17 Close MMA and plugged the device into the USB port

--> it is recognized as a new device (a second profile is created for the Shield similar to 0013005)

Ludek

2015-12-16 16:56

developer   ~0043688

Last edited: 2015-12-16 20:23

ok, the duplicate profile issue were caused by the fact that storageInfo.xml was not seen over MTP.

The duplicate playlist issue was caused by not actual mmstore.db, on first USB sync the mmstore.db wasn't seen over MTP so the device was synced like standard memory card, M3Us were uploaded at 2970 seconds (line 7283), the first mmstore.db was downloaded at 3228 seconds (line 7868), secondly on the line 10045 before the second USB sync, but the playlists were inserted, because were not found in the mmstore.db (although based on your description they must already exists in MMA so mmstore.db was not actual)

Maybe MMW should sync the device like MMA device only if _both_ storageInfo.xml and mmstore.db are visible over MTP, but this does not solve the duplicate profile issue.

Another way would be to ask to reboot the device after MMA install (to be sure that MTP is refreshed), but this is not user friendly and probably wouldn't be taken as friendly by users.

I think that this is just for KB article now.

rusty

2015-12-16 20:20

administrator   ~0043689

I just retested to verify whether rebooting would have an effect observed:
1 Clean Install and run MMA
-->files in /MediaMonkey/files are mmstore.db, storageInfo.xml
-->files observed over MTP in /MediaMonkey/files is only mmstore.db
1b Reboot device
-->Files observed over MTP in /MediaMonkey/files are .nomedia, mmstore.db, storageInfo.xml (i.e. rebooting appears to have solved the problem)
2 Connect usb cable
3 Configure MMW to sync Playlists 'Test playlist', 'Test hierarchy'
4 USB sync
--> the files in the /MediaMonkey/files folder (seen using ES explorer) are mmstore.db, storageInfo.xml, StorageInfo.xml.mmw
5 Unplug USB Cable
6 Run MMA
--> Playlists display with hierarchy and tracks with ratings

With this confirmed:
1) Given that mmstore.db is appearing correctly, I wonder if there's a way for the storageInfo.xml file to also appear correctly. I reperformed all of the tests described at 0012999:0043651 and found that for this particular device, the only way to create files so that they're successfully recognized over MTP is the 3rd approach: i.e.
. . 3) copy /MediaMonkey/.nomedia to /MM4
. . /MediaMonkey/Artworks/* to /MM4/artworks/
. . /MediaMonkey/files/* to /MM4/files
. . --> Success.
Is it possible that we can make another change in MMA that would increase the likelihood of this working?

2) If it's really impossible to fix this problem, then I'd go with your suggestions along the following lines:
i) if only 1 of the android files is recognized, then MMW should indicate something like "MediaMonkey has detected a problem with the Media Transfer Protocol on your device which will result in corrupted. Please reboot the device before syncing over USB OR sync via Wi-Fi. [Retry] [Ignore] [Cancel]"

Retry - retry synchronization (i.e. perform the check again)
Ignore - sync as if MMA isn't on the device
Cancel - exit the sync operation

Although this isn't particularly user-friendly, it's better than the alternative of failed synchronization.

peke

2015-12-16 21:37

developer   ~0043690

Last edited: 2015-12-16 22:42

a) I tested this on an S4 (4.4.2), StorageInfo.xml was missing, MTP refresh much slower than on Moto G, but reboot was not needed when using this workaround:
 1. Open Windows explorer
 2. go to MediaMonkey folder on Internal Storage
 3. Confirm that you do not see both files.
 4. use same window to navigate to external storage
 5. open any folder
 6. return to internal storage (it should refresh)
 7. go to MediaMonkey folder -> files
 8. Right Click refresh
in 2/3 cases all files should show, if not you've done it too fast and folder cache was not refreshed.

Another way is to do HOT unplug while explorer have opened mediamonkey folder on internal storage. Somehow it refreshes teh folder on reconnect.

b) Maybe it would be better to create an progress information "Waiting for MTP folder refresh..... (Can take up to 10 Minutes)" and than after second failed scan for needed files show proposed dialog?

rusty

2015-12-17 06:26

administrator   ~0043696

Re. Peke's comment a) I've tested the following Samsung devices and they both passed:
-Samsung Tab S3 (Android 4.4.2)
-Samsung Tab 8 Pro (Android 4.4.2)
However, upon retesting the S3, it seems that as peke explained, whether the contents of the /MediaMonkey folder display correctly may be dependent on the amount of time that has passed, and as Ludek explained, whether the device has been rebooted, and upon other factors that are not quite understood. In other words, the current build 423 doesn't always resolve this issue (at least on the S3) :-(

Furthermore, although rebooting can prevent the problem from occurring, it doesn't seem to fix the problem once it has occurred :-(

Tested as follows:
1 Install and run MMA
2 Connect usb cable
--> db and xml files appear correctly over MTP
3 USB sync playlists within a hierarchy
--> hierarchy and ratings sync successfully only some of the time

Re. Peke's comment b), a message 'Waiting for MTP folder refresh' can make sense if such a refresh is guaranteed to happen. But I don't think we know that that's the case (it isn't in my experience at least).

marek

2015-12-17 10:14

developer   ~0043697

I have improved refreshing of storageInfo.xml in build 525

Ludek

2015-12-17 18:57

developer   ~0043700

Last edited: 2015-12-17 19:03

I was thinking about a mechanism to prevent from profile duplication in case the fix from 525 does not help.

I think that in this particular case (when storageInfo.xml is not visible over MTP) MMA could detect that MMW uploaded StorageInfo.xml.mmw and take the pairing key from it so that WiFi sync doesn't result in another profile creation.

MMA is already taking the key from StorageInfo.xml.mmw on install (and MMW does not have a reason to upload StorageInfo.xml.mmw once the StorageInfo.xml is already there).

rusty

2015-12-17 20:00

administrator   ~0043701

Last edited: 2015-12-17 20:02

Tested 525 successfully on the Shield Tablet, Zenfone, Tab 8. Aside from the occasional freeze, it seems to be working well.

Peke indicated that Moto G is working as well, so I think that we can consider the fix to be working.

We should probably track the issue that Ludek raises at 0012999:0043700 separately.