MediaMonkey iTunes plugin (d_itunes4.dll)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

jfarr
Posts: 13
Joined: Wed Jan 20, 2010 1:54 pm

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by jfarr » Sat Feb 13, 2010 5:03 am

jfarr wrote:
I'll let you know how the rest of it goes now.

Thanks

Jules
My initial findings:

My collection is currently entirely in FLAC format, so Media Monkey is converting, as it goes into iTunes, into MP3.

The main issue I am having is that on synchronisation about 25 - 30% of the tracks in iTunes are not in the synchronisation list, so at the start of the process, MM Is asking to delete them. Presumably it then re-adds them under a different name.

I have been gradually adding tracks by increasing the size of each synchronisation, and on the last one it deleted nearly 1700 tracks (presumably only to re-add them, maybe under a different name later).

On a possibly related note, some tracks appear to have duplicated in iTunes. When you look at info, they appear to be the same (they appear under the same album) but they have a slighly different prefix / postfix combination (i.e. the 4 character codes that appear before and after the track name). It could be that the duplicates are what is being deleted, but I haven't had the chance to check that yet.

The whole synchronisation process itself is taking about 24 hours to complete (albeit I haven't just let it go from empty to complete all in one go) which I would say is about double the time it took to synch through the iPhone plugin without going through iTunes. I have to say, though, that that is one of my lower priorities, though!

Thanks

Jules

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Sat Feb 13, 2010 1:53 pm

The main issue I am having is that on synchronisation about 25 - 30% of the tracks in iTunes are not in the synchronisation list, so at the start of the process, MM Is asking to delete them. Presumably it then re-adds them under a different name.
Yes, there is something wrong there. I'm doing a full reload with convertion too and the total to go + total so far is greater than my initial list so I'm suspecting some duplication too. It needs further investigation. I'm pretty certain that these faults do not occur when not converting.

The key point is that MM builds a table (DeviceTracks) which holds references to tracks is iTunes (DeviceTrackPath) and MM (TrackId). If something fails with uploading and the upload isn't recorded in this table than the trrack will get reloaded. The referencing is NOT DONE by simple titles names because that would not allow renames to be accommodated.

Loading the extension "sqlviewer" can help diagnose the effectiveness of the load. Use "select * from devicetracks" to view that table.

I suggest checking with a small playist or two under very simplified and controlled circumstances.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Mon Feb 15, 2010 10:15 am

Well, after letting it complete I was proved wrong - the results were perfect.

The only wrinkle seems to be that randomly (about 1:1500) an MM track conversion fails (it throws an exception). Consequently the file does not get uploaded into the plugin and so is absent in iTunes. Re-running the synch has consistently picked up the missing tracks and loaded correctly. I'm guessing this is somehing to do with resource starvation of some kind at the moment the conversion takes place. Has anyone else seen this?

Development has further progressed a little more.

11/2/2010
* convertedFileFolder config item added to control location of converted files
* Removal of all DB lookups in fixFilenames to improve speed
14/2/2010
* Additional of Sync Interval to minimise the processing unnecessary of playcount+rating checks with frequent synching
* Removal of unused indices on cache entries to speed creation.
15/2/2010
* debug level 0,1,2 added
* Internal classes created for configuration and logging
* removed redundant Library name configuration setting
* DeviceID extracted from DEVICES table and SQL that updates the DEVICETRACKS table filtered by IDDEVICE so will not affect tracks synched to more than one device

Any feedback welcome.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Thu Feb 18, 2010 6:05 am

I started out get a benchmark ... load a 6110 track MM library with 85 playlists into an empty iTunes converting to MP3 VBRv6 on the fly (to make some of the larger files smaller). Running on Windows 7 laptop with a 1.8Ghz Duo CPU.

Code: Select all

[4696] iTunes Plugin SyncStart
[4696] iTunes Plugin iTunesScanContent
[4696] iTunes Plugin iTunesScanContent done 0
[4696] iTunes Plugin iTunesScanPlaylists
[4696] iTunes Plugin iTunesScanPlaylists done 85
[4696] iTunes Plugin iTunesFixFilenames 6110
[4696] iTunes Plugin iTunesFixFilenames done
[4696] iTunes Plugin iTunesDeleteFiles 0
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin iTunesDeleteFiles 84
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin SyncEnd
[4696] iTunes Plugin Report scanned=0 uploaded=6110 deleted=0 existing=0 converted=3363 fixed=6110 missing=127 new=5983 sql=6110 synced=0 Period=17:04:06
I was disappointed by the conversion rate, initially it seemed almost negligible and then appeared alot slower towards the end. Has anyone else experienced this sort of behaviour?

After this synchronisation I re-ran the sync which should have loaded no more files but in fact it did...

Code: Select all

[4696] iTunes Plugin SyncStart
[4696] iTunes Plugin iTunesScanContent
[4696] iTunes Plugin iTunesScanContent done 6106
[4696] iTunes Plugin iTunesScanPlaylists
[4696] iTunes Plugin iTunesScanPlaylists done 85
[4696] iTunes Plugin iTunesFixFilenames 6110
[4696] iTunes Plugin iTunesFixFilenames done
[4696] iTunes Plugin iTunesDeleteFiles 1
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin iTunesDeleteFiles 86
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin SyncEnd
[4696] iTunes Plugin Report scanned=6106 uploaded=7 deleted=3 existing=6108 converted=7 fixed=6110 missing=2 new=0 sql=615 synced=6105 Period=00:10:04
Notice that there is something wierd going on here, 4 appear not to have loaded in the first pass and another 3 were deleted (why?). Thus 7 were converted and uploaded. Also 6105 were checked for synchronisation, yet 6106 were scanned and found present. I have run this code many many times with a smaller number of tracks and playlists and know that it is consistent.
I ran it again.

Code: Select all

[4696] iTunes Plugin SyncStart
[4696] iTunes Plugin iTunesScanContent
[4696] iTunes Plugin iTunesScanContent done 6106
[4696] iTunes Plugin iTunesScanPlaylists
[4696] iTunes Plugin iTunesScanPlaylists done 85
[4696] iTunes Plugin iTunesFixFilenames 6110
[4696] iTunes Plugin iTunesFixFilenames done
[4696] iTunes Plugin iTunesDeleteFiles 1
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin iTunesDeleteFiles 84
[4696] iTunes Plugin iTunesDeleteFiles done
[4696] iTunes Plugin SyncEnd
[4696] iTunes Plugin Report scanned=6106 uploaded=5 deleted=1 existing=6108 converted=5 fixed=6110 missing=2 new=0 sql=9 synced=6105 Period=00:09:23
I'm VERY puzzled.
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Thu Feb 18, 2010 8:03 am

OK, problem solved! It turns out that within my collection I have tracks with exactly the same file name in different folders. This name is used for the name of the temporary converted files, hence the 2 entries tried to use the same name and conflict occurred. I've changed the converted file name to be based upon the whole source file path to guarrantee no conflict.

Output now looks more sensible and 2 minutes is a very respectable overhead for 6000+ files.

Code: Select all

[1368] iTunes Plugin iTunesScanContent
[1368] iTunes Plugin iTunesScanContent done 6110
[1368] iTunes Plugin iTunesScanPlaylists
[1368] iTunes Plugin iTunesScanPlaylists done 85
[1368] iTunes Plugin iTunesFixFilenames 6110
[1368] iTunes Plugin iTunesFixFilenames done
[1368] iTunes Plugin iTunesDeleteFiles 0
[1368] iTunes Plugin iTunesDeleteFiles done
[1368] iTunes Plugin iTunesDeleteFiles 84
[1368] iTunes Plugin iTunesDeleteFiles done
[1368] iTunes Plugin SyncEnd
[1368] iTunes Plugin WriteBackTssCache 6110
[1368] iTunes Plugin Report scanned=6110 uploaded=0 deleted=0 existing=6110 converted=0 fixed=6110 missing=0 new=0 sqlTss=0 sqlSongs=0 synced=6110 Period=00:02:00
New version posted.
16/2/2010
* Minor bug fix (induced yesterday) to allow ratings to be updated in MM from iTunes
* Converted files moved to a temporary location (quicker if on same drive)
* Converted files named better to avoid disk-eating issues caused by repeated convertion
* Streamlined tss fields to reduce memory footprint and speed DB access
17/2/2010
* Statistics gathered and reported at end of sync
* Logging messages get a good review and streamline
* Additional iTunes pointers stored in cahce so reducing number of iTunes calls
* Better use of caching to still further improve the sync performance
18/2/2010
* Converted filenames are now derived from path rather than just file name to avoid duplications



Regards
Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

sakurakessho
Posts: 76
Joined: Sat Jun 23, 2007 6:15 pm

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by sakurakessho » Thu Feb 18, 2010 9:29 am

Maybe I went a little overboard.

I didn't have enough space on my drive to convert every single solitary FLAC file I own to mp3 just so iTunes could read it. So what I did was took dbpoweramp and converted all of the FLAC files to ALAC files (I rather enjoy my lossless...) Then I took your iTunes device plugin and used that to sync all 20,000+ songs of my library with iTunes.

Took about... 12 and a half hours. No conversion so it went much faster.

Keep up the great work on the plugin. I do see it being very useful!
*MM Gold as of 04.23.08*

jazzguitar247

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by jazzguitar247 » Mon Feb 22, 2010 2:38 am

Love the plugin so far! I look forward to the eventual release in MM

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Mon Feb 22, 2010 3:17 pm

OK, I'm calling an end to the 'plugin' aspects and now want to focus on some pratical enhancements. I've been keeping a log of ideas so far but I'd like to hear the opinions of others about what they consider important.

Future...
* Force visibility of playlist order numbers on playlists viewing pages
* Speed improvement upto original script standards
* Ability to create/maintain connected iPhone source directly
* iTunes "browse only" mode (readonly)
* Ability to delete tracks/playlists from within the iTunes tree window
* Ability to launch iTunes on a remote machine
* Ensure that adhoc sync works properly (updates via SQL at end, is re-entrant etc.)
* Consider not re-scanning the DB each time but maintain the cached list permanently
* Use cached content lists to speed browsing of iTunes library
* Option for deleting converted content after loading.
* Option to fix the iTunes configuration settings directly
* Option to sync iPhone before/after syncing iTunes (No,Ask,Always)
* Right-click playlist in MM to add to autosync list
* Right-click playlist in iTunes browser to remove from autosync list
* Report capacity and free space of iPhone to MM
* Allow termination of sync cycle during ScanContent operation
* Ability to set random switch on for all/some playlists
* Ability to play tracks from iTunes browser
* Delete converted files after uploading into iTunes

Any ideas and opinions will be greatly appreciated.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Fri Feb 26, 2010 6:59 am

Updates ...

19/2/2010
* Freshly updated tracks written to DB immediately rather than at sync end
* deleteTrack and freshenTrack made to use Cached information
* Internally reorganised to use MM SongData.ID in place of the iTunes persistedID
* Used iTunes itTrack.SeasonNumber as storage for ID values (big improvement in scanning)
24/2/2010
* FreeSpace and Capacity can be read from a device connected to iTunes
25/2/2010
* Converted files can be deleted afterwards
* Connected devices can be sync'd before/after iTunes sync
* Location of iTunes tracks reported so that they can be played in iTunes
* Tracks with seasonNumber=0 are ignored in scan. This help compatibility alot.
* Date and time of DLL logged at initialisation
26/2/2010
* Connected devices synchronisation at start and end options are 0=No,1=Ask,2=Always



Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

docbobo
Posts: 34
Joined: Thu Mar 18, 2004 5:18 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by docbobo » Fri Feb 26, 2010 7:02 am

Wow! You sure are making lots of progress and I feel bad missing the time to test this out. So far I am hitting no bugs, but I am only synching all three to four days and not with really heavy scenarios (like I intended to). Should have more time in ten days.

But, again: THANK YOU! What a nice and useful piece of code!

treponem
Posts: 52
Joined: Sat Jan 12, 2008 9:54 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by treponem » Sun Feb 28, 2010 4:59 am

First of all thanks for your work.
I'm trying to get this plugin to work since the first version, but I always get a "error during player initialization"error on start up. MM starts but no Minilyrics, MonkeyRok or other Scripts are loaded. Whe trying to configure the unnamed plugin I get a "Access violation at address 65677261. Read of address 65677261", or an access violation at kernel32.dll.
I also run as admin with/without itunes already started but no success, deleted and manually populated the itunes archive but nothing helped. Using MM 3.2 & itunes 9.0.2, Win7 x86.

Help anyone?

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Sun Feb 28, 2010 11:40 am

treponem wrote:First of all thanks for your work.
I'm trying to get this plugin to work since the first version, but I always get a "error during player initialization"error on start up. MM starts but no Minilyrics, MonkeyRok or other Scripts are loaded. Whe trying to configure the unnamed plugin I get a "Access violation at address 65677261. Read of address 65677261", or an access violation at kernel32.dll.
I also run as admin with/without itunes already started but no success, deleted and manually populated the itunes archive but nothing helped. Using MM 3.2 & itunes 9.0.2, Win7 x86.

Help anyone?
Debug by
* Switch on debug mode by using regedit to change debug value at HKEY_CURRENT_USER\Software\Songs-DB\Device\iTunes to 2.
* Install DebugView from http://technet.microsoft.com/en-us/sysi ... 96647.aspx
* Run DebugView and set the filter to "iTunes Plugin" to avoid getting swamped by messages
* Start MM and see what messages come out

If you can't figure out the problem then copy/paste some of the text to this thread and I'll try and help.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

treponem
Posts: 52
Joined: Sat Jan 12, 2008 9:54 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by treponem » Sun Feb 28, 2010 2:54 pm

Strange. I did what you said but I'm only getting "[5608] iTunes Plugin 20:52:12 ItunesDone" as log, nothing more... Even after selecting and trying to configure the device plugin an error appears but nothing in debugview.

markstuartwalker
Posts: 931
Joined: Fri Jul 10, 2009 8:10 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by markstuartwalker » Mon Mar 01, 2010 2:37 am

treponem wrote:Strange. I did what you said but I'm only getting "[5608] iTunes Plugin 20:52:12 ItunesDone" as log, nothing more... Even after selecting and trying to configure the device plugin an error appears but nothing in debugview.
That is the very last message at MM close. Please check the debug value = 2 , it can only be set when MM is closed.

If that fails then remove the filtering in DebugView. Unfortunately, you'll get loads of message. Search for "d_itunes" and see what you can find.

Mark
Windows 7,8 / Ubuntu 13.10 / Mavericks 10.9 / iOS 7.1 / iTunes 11.1
iTunes plugin (d_itunes & itunes4) http://www.mediamonkey.com/forum/viewto ... =2&t=45713
Running MM under Mac OS X with Wine http://www.mediamonkey.com/forum/viewto ... =4&t=58507

treponem
Posts: 52
Joined: Sat Jan 12, 2008 9:54 am

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Post by treponem » Mon Mar 01, 2010 1:19 pm

markstuartwalker wrote:
treponem wrote:Strange. I did what you said but I'm only getting "[5608] iTunes Plugin 20:52:12 ItunesDone" as log, nothing more... Even after selecting and trying to configure the device plugin an error appears but nothing in debugview.
That is the very last message at MM close. Please check the debug value = 2 , it can only be set when MM is closed.

If that fails then remove the filtering in DebugView. Unfortunately, you'll get loads of message. Search for "d_itunes" and see what you can find.

Mark
I already set the debug value in the registry to "2" (MM closed), but this was the only message I got & MM was still running at that time. I just deleted the SongsDB entry, started MM, got the same error. I reopened the registry, set the debug to 2, but "[5616] iTunes Plugin 19:07:40 ItunesDone" is all I get... I had no filtering activated.
Ok, just installed the debug version of MM 3.2; On startup, "Error during player initialization" appears, DebugView says "[2168] iTunes Plugin 19:17:00 ItunesDone". Weird.

Post Reply