View Issue Details

IDProjectCategoryView StatusLast Update
0011688MMASynchronizationpublic2014-01-10 00:03
Reporterrusty Assigned To 
PriorityimmediateSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Product Version1.0.4 
Target Version1.0.4Fixed in Version1.0.4 
Summary0011688: USB sync: Storage observer service causes MMA to never close
DescriptionSometimes a USB sync operation will get MMA to a state where it'll never terminate (even if set to close after 10s). I'm not yet certain what the trigger is, but it seems to occur when:
- MMA is running at the same time as the sync operation occurs
- MMW generates an error that Album art cannot be written and the sync operation is stuck until the device is unplugged

Even after rebooting the device, as soon as MMA is started, it will never terminate.

I've copied the state of the /MediaMonkey directory that results in this bug to the ftp server, but will try to investigate the trigger further.
Additional InformationSimilar reports:
http://www.mediamonkey.com/forum/viewtopic.php?f=21&t=73746&p=381040#p380940
http://www.mediamonkey.com/forum/viewtopic.php?f=21&t=74699&start=15#p380381
TagsNo tags attached.
Fixed in build217

Relationships

related to 0011714 closedLudek MMW v4 Playlists synced prior to installation of MMA can't be updated via USB sync 

Activities

marek

2014-01-07 10:58

developer   ~0039115

Last edited: 2014-01-07 11:07

I have created new build 215 that might help us with debug. Some log messages were removed and added.

So please create log when MMA fails to stop.

EDIT: it might be API related. What device and API do you use ?

rusty

2014-01-07 17:41

administrator   ~0039117

Last edited: 2014-01-07 18:35

Tested build 215 and reproduced the bug. The key seems to be to not run MMA after deleting all settings, and then doing a USB sync while MMA is running. Tested with a Nexus 5 running Kitkat 4.4.1

The repro steps were:
1 Delete MMA appdata + /MediaMonkey directory and _don't run MMA_
2 Clean install of MMW (or delete device profile for MMA device)
3 USB Auto-sync a playlist consisting of 3 tracks (note: for those 3 tracks Artist|=Album Artist)
--> Sync occurs
3.5 Run MMA to verify what synced
--> Tracks & Playlist synced, though Album Artist changes to Artist for one of them, and ratings are absent!! In other words, MMW synced to the device as if it didn't have MMA installed on it (and there seems to be another bug in which the Album Artist field is sometimes populated with the Artist field).
4 Back out of MMA
--> It closes after x seconds (where X is the configured time)
5 Update the playlist in MMW so that it has 5 tracks
6 USB Auto-sync
--> 3 original tracks get deleted from the playlist (although they're not deleted from the device)!! My guess is that the playlists/tracks that were synced prior to running MMA are somehow not handled correctly (Wi-Fi sync performs a 'matching' operation, but there doesn't seem to be any equivalent for USB sync).
7 Back out of MMA
--> It closes after x seconds
8 Run MMA
9 USB Auto-sync (with MMA still running)
--> MMW sync operation freezes partway through
10 Back out of MMA
--> MMA fails to terminate!!
11 Force terminate MMA
--> MMA closes
12 Run MMA
13 Back out of MMA
--> MMA fails to terminate

NONE OF THESE PROBLEM OCCUR IF MMA IS RUN AT STEP 1

Debug log ID: 2F4UBL91ZX

rusty

2014-01-07 20:52

administrator   ~0039121

a) Re. 3.5-missing ratings and incorrect Album Artist, this occurs because:
 - mmstore.db has been deleted from the device, so MMW can't communicate directly
 - compilation tracks had inferred Album Artist metadata, so the Android Media Scanner either ignored it during the sync, or overwrote it with the actual tag metadata (MMW couldn't communicate with MMA via mmstore.db).

b) Re. step 6, playlist getting synced incorrectly, this is likely a consequence of the fact that the mmstore.db was deleted and/or an MTP refresh issue. I've not been able to replicate, if mmstore.db exists.

c) MMA failing to terminate: should be fixed

d) MMW freezing on sync: this is likely a problem with the MTP stack, as it occurs even when MMA isn't running.

marek

2014-01-08 01:59

developer   ~0039129

I can replicate it. Easier repro steps are:

1. Force stop MMA
2. Start USB sync
3. Start MMA
4. Start USB sync

The reason why MMA is frozen is that MMW didn't finish workflow. Please look at events. But I don't know why:
3845 15:38:06.0450 DELETE - sync_finished
3846 15:38:06.0565 CREATE - sync_started
3849 15:38:06.0567 OPEN - sync_started
3851 15:38:06.0567 CLOSE WRITE - sync_started
3853 15:38:06.0765 OPEN - storageInfo.xml
3855 15:38:06.0765 ACCESS - storageInfo.xml
3856 15:38:06.0765 CLOSE_NOWRITE - storageInfo.xml
3858 15:38:07.0273 CREATE - mmstore.db.synced.partial
3860 15:38:07.0274 OPEN - mmstore.db.synced.partial
3862 15:38:07.0275 MODIFY - mmstore.db.synced.partial
3863 15:38:07.0275 MODIFY - mmstore.db.synced.partial
3864 15:38:07.0276 MODIFY - mmstore.db.synced.partial
3865 15:38:07.0276 MODIFY - mmstore.db.synced.partial
3866 15:38:07.0277 MODIFY - mmstore.db.synced.partial
3867 15:38:07.0277 MODIFY - mmstore.db.synced.partial
3868 15:38:07.0278 MODIFY - mmstore.db.synced.partial
3869 15:38:07.0278 MODIFY - mmstore.db.synced.partial
3870 15:38:07.0279 MODIFY - mmstore.db.synced.partial
3871 15:38:07.0280 MODIFY - mmstore.db.synced.partial
3872 15:38:07.0280 MODIFY - mmstore.db.synced.partial
3873 15:38:07.0281 MODIFY - mmstore.db.synced.partial
3874 15:38:07.0281 MODIFY - mmstore.db.synced.partial
3875 15:38:07.0282 MODIFY - mmstore.db.synced.partial
3876 15:38:07.0282 MODIFY - mmstore.db.synced.partial
3877 15:38:07.0282 MODIFY - mmstore.db.synced.partial
3878 15:38:07.0283 MODIFY - mmstore.db.synced.partial
3879 15:38:07.0283 MODIFY - mmstore.db.synced.partial
3880 15:38:07.0284 MODIFY - mmstore.db.synced.partial
3881 15:38:07.0284 MODIFY - mmstore.db.synced.partial
3882 15:38:07.0284 CLOSE WRITE - mmstore.db.synced.partial
3885 15:38:08.0287 MOVED FROM - mmstore.db.synced.partial
3886 15:38:08.0287 MOVED TO - mmstore.db.processed.0001

I.e. creation of mmstore.db.synced and sync_finished is missing.

Ludek, please let me know what is wrong. I've put MMW logs to FTP.

But still, MMA should be able to terminate when this occurs. I have also added deletion of DB without sync_operations table to avoid looping for users that were syncing with previous builds of MMW and MMA. It was fixed in build 217.

Ludek

2014-01-08 12:28

developer   ~0039131

Last edited: 2014-01-08 15:16

I analyzed the log and all MTP operations were performed successfully, so it looks that the observer somehow missed in, Marek is studing more.

Re issue a) MMW writes Album Artist via IWMDMMetaData interface (WMDM/AlbumArtist), but Android's media scanner either uses only file tags or overrides this value by the value from file tag.

peke

2014-01-09 06:26

developer   ~0039139

Last edited: 2014-01-09 06:26

NOTE: I can replicate behavior, but due the low memory on LG Phone it looks like Android kills it eventually due the idle.

Also I have not noticed it on Nexus 7, could that issue be due the existence of SD Card slot?

marek

2014-01-09 18:35

developer   ~0039149

I have found an issue in workflow

Fixed in build 217

rusty

2014-01-10 00:03

administrator   ~0039154

Verified 217. The only issue is that the problem described at step 6 of this bug occurs in upgrade scenarios. That issue is documented at 0011714 .