Author Topic: Enhancements to device synching  (Read 4512 times)

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 29631
On getting a new android phone, I am having a few of the weird issues reported in a number of posts. I have put in handling for the issues I found and also taken the opportunity to optimise a number of aspects of the synching. Synching overall should be a bit faster and robust for all types of devices and significantly noticeable for MTP devices (although MTP is still a very slow protocol).
There is still one issue which I dont think I can completely solve, and thats when any files are deleted from a MTP device (including replacing an existing file), at some point the device will block activity for up to a couple of minutes (I assume because the device needs to  scan the entire contents). Its often noticeable when MB gets to the playlist synch part. I have made some improvements so I think it should happen less often than before.

Ensure you replace all files in this zip (especially Interop.PortableDeviceApiLib.dll and Interop.PortableDeviceTypesLib.dll otherwise you may get crashes)
https://getmusicbee.com/patches/MusicBee33_Patched.zip

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4527
That's good to hear and great timing. Today is 're-sync' day. I'll be testing and will let you know if I see any issues. Thanks.
Download the latest MusicBee v3.3 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

frankz

  • Hero Member
  • *****
  • Posts: 1452
Just started us MB to sync to my Galaxy S8 this week, so this is my second sync.  Using the new patch as of today.  I've verified that the 2 dlls referenced above are dated today, not older versions.

Getting a lot of "Delete Failed - Exception from HRESULT: 0x80042009" and "Copy Failed - Exception from HRESULT: 0x80042009"

Not sure what information you'd need to trouble shoot, as I don't know what that means.

Here's one full delete failure from the error log:
Code
1/13/2019 1:45:57 PM - Exception from HRESULT: 0x80042009
1/13/2019 1:45:57 PM - 10.0.17134.0 - 3.3.6952.24850S - System.Exception: delete SM-G950U\Card\Music\Lucy Dacus\Historian\06 - Body to Flame.mp3 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80042009
   at PortableDeviceApiLib.IPortableDeviceContent.EnumObjects(UInt32 dwFlags, String pszParentObjectID, IPortableDeviceValues pFilter, IEnumPortableDeviceObjectIDs& ppenum)
   at #=zPeQASBZ_L72EJcgr9UGxHZLqioVF.#=z3kSOeIIdMvFe(String #=zgLsxXQaHAGRr)
   at #=zPeQASBZ_L72EJcgr9UGxHZLqioVF.#=z5JVkugoxxZo6(String #=z4$RSwU8M2L_d, String #=zwGYqcek=)
   at #=zPeQASBZ_L72EJcgr9UGxHZLqioVF.#=zCZRHR5m0DJPz(IList`1 #=z5jFYUUM=, Boolean #=z3JPcya5eOsbx3EIQPA==)
   at #=zHGLAitcTmrBiJv5aEv7fTk4=.#=zGhCX2sHZ9I7aDKkV1B_cUEK5vk4z(List`1 #=zyKefCR$Uxe3e, Object #=zBcedkP$4afSD)
   --- End of inner exception stack trace ---

Here's one full copy failure from the error log:
Code
1/13/2019 1:54:16 PM - Exception from HRESULT: 0x80042009
1/13/2019 1:54:19 PM - Copy \\DESKTOP\Music\Organized\The Kills\(2008) Midnight Boom\09 - Sour Cherry.mp3 to SM-G950U\Card\Music\The Kills\Midnight Boom\09 - Sour Cherry.mp3

Besides "delete if not in sync" and "confirm deletion" which are out of frame, here are my settings:
Last Edit: January 13, 2019, 07:02:32 PM by frankz

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 29631
do you think it might be the case that all files in the folder:
SM-G950U\Card\Music\Lucy Dacus\Historian
were deleted

frankz

  • Hero Member
  • *****
  • Posts: 1452
do you think it might be the case that all files in the folder:
SM-G950U\Card\Music\Lucy Dacus\Historian
were deleted
No, they're all still there listed as last modified as of my last sync

frankz

  • Hero Member
  • *****
  • Posts: 1452
That said, looking at the full list of delete failures, it is the case where the files were in fact deleted from the device and the directory removed although it's reading as a failure result.

OK - I see what's happening now. Every single delete threw an error even though some did get deleted and some did not.

The copy failures are all legit copy failures.  The files aren't on the card.
Last Edit: January 13, 2019, 07:21:39 PM by frankz

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 29631
That said, looking at the full list of delete failures, it is the case where the files were in fact deleted from the device and the directory removed although it's reading as a failure result.
in all cases, or just some?

frankz

  • Hero Member
  • *****
  • Posts: 1452
That said, looking at the full list of delete failures, it is the case where the files were in fact deleted from the device and the directory removed although it's reading as a failure result.
in all cases, or just some?
Sorry, I was modifying my last message while you were asking this.

Some files got deleted and some did not but every single attempted delete threw that error regardless of if it was actually successful or not.
Last Edit: January 13, 2019, 07:27:05 PM by frankz

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 29631
Thanks. I should be able to put in handling but it will take a day or so.
Is this the first time the sync process has needed to delete files? (I ask because i dont see anything about the new version that would cause this issue - i believe its a device specific issue)

frankz

  • Hero Member
  • *****
  • Posts: 1452
It's my second sync, so yes no deletions last time.  The first time there were no files on the card.


phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4527
Using the version you posted earlier today, I have synced a couple of times to two different (Android-based) devices, one of which is a Galaxy S8. I experienced the same issue as frankz with files needing to be deleted - "Delete Failed - Exception from HRESULT: 0x80042009"

Using the patch you posted most recently seems to have solved the issue. Lots of deleted and copied tracks with no errors.
Download the latest MusicBee v3.3 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

frankz

  • Hero Member
  • *****
  • Posts: 1452
could you try with this version:
https://getmusicbee.com/patches/MusicBee33_Patched.zip
Perfect sync. 1295 deletions 1466 copies all successful and files move much faster than before the improvements.  Thanks!

frankz

  • Hero Member
  • *****
  • Posts: 1452
Ah, I lied.  My playlists didn't make it over.  They're still the same versions from January 10.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4527
Ah, I lied.  My playlists didn't make it over.  They're still the same versions from January 10.
I only have two playlists on my S8. Via MB's device music settings I removed those two and selected two others and then performed a sync. No problem. Two were deleted and two were added. Then I tried again, removing the two new ones and re-adding the two old ones. No problem.

@frankz- are you using the Samsung default player, or a third-party app? If the latter, which one? I'm using GoneMAD Music Player and use M3U playlists. You should also make sure you're using a dedicated Playlists directory and not trying to dump the playlists in the Music directory.
Download the latest MusicBee v3.3 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.