Page 5 of 88

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Jan 26, 2010 2:38 am
by rhaynes
Hi Mark,

Quick question, whenever I launch MM it launches iTunes. Would it be possible to only launch iTunes if the iTunes box is checked in the Tools>Options>Portable/Audio Devices? Since I'm using this only to occasionally sync my library, having iTunes launch every time is a pain. My alternative is to launch MM with a couple of batch files that rename the DLL to control whether MM launches iTunes. It seems like it might be a pain for other people also. Or am I missing some other way.

Ray Haynes
Oceanside, CA.

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Jan 26, 2010 3:01 am
by markstuartwalker
I knew that would be asked for sooner or later.

New version

25/1/2010
* Fixed problem of adding new tracks and creating playlist on one step
26/1/2010
* Addressed a few memory leak issues (.free called)
* Added launchItunesAutomatically configuration setting (default=true)
* Non-updating playlist bug fixed
28/1/2010
* Better use of newTracks using separate unit and hash indexing
* Reuse of existing iTunes tracks not already under <MM> folder for speed increase


Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Fri Jan 29, 2010 4:07 am
by jfarr
jfarr wrote:I haven't tried the debug version yet - that will have to wait until I come back towards the end of the week, but in the meantime this is how the latest release has effected me:

If I place the new dll in the plugins directory, on opening Media Monkey I get a new message, after the splash screen appears (but before it disappears. The caption says "Error", and the text is "Error during player initialization."

Before I can press the OK button, I get another error. The caption says "17. Lighthouse Family - End of the Sky - MediaMonkey" and the text reads "Access violation at address 00630069 in module 'MediaMonkey.exe'. Read of address FFFFFFFF."

When I then go to Tools / Options, and then select "Portable/Audio Devices", iTunes is still not one of the options.

I guess my best bet is to try the debug version!

Jules
I have now tried the debug versions. I'm not sure that the output is a great deal of help but this is all it says in relation to the iTunes plugin:

00000163 103.56593323 [908] iTunes Plugin Init
00000164 103.56765747 [908] iTunes Plugin Done

Does that help?

Jules

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Fri Jan 29, 2010 11:10 am
by markstuartwalker

I have now tried the debug versions. I'm not sure that the output is a great deal of help but this is all it says in relation to the iTunes plugin:

00000163 103.56593323 [908] iTunes Plugin Init
00000164 103.56765747 [908] iTunes Plugin Done

Does that help?

Jules
Unfortunately, no :-(. Except that it confirms that the problem is extremely low-level. The code in this area looks like

Code: Select all

procedure InitItunes;
begin
  regReadIni(@Config);
  logInit(mminterf,config.debug);
  logs('Init');

  appInit(MMInterf,Config.launchItunesAutomatically);

  if AppInstalled( ) then
  begin
    // send the error messages to us
    SetErrorMode(SEM_FAILCRITICALERRORS);

    DeviceName := iTunes_DeviceID;
    UpdateDeviceState(true);
    logs('Itunes installed');
  end
  else
  begin
    UpdateDeviceState(false);
    logs('Itunes not installed');
  end;
end;

procedure DoneItunes;
begin
  regWriteIni(@Config);
  logs('Done');
end;

... and you never see 'Itunes installed" or "Itunes not installed" so I suspect there is an exception being raised that we are not seeing. Can I ask you to download the version I'm about to post and try again. I've added a few more. logging messages and removed the SetErrorMode function - this was part of the code that I was provided with and suspect that it is superfluous.


Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Sun Jan 31, 2010 11:44 am
by sakurakessho
All of my music is on my external hard drive. While, of course, my MM and iTunes installs are in my main hard drive.

Does this move every bit of music to my main hard drive? Please say its not so!

Or does this just kinda copy the MM library and make it something that iTunes can digest?

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Sun Jan 31, 2010 12:28 pm
by markstuartwalker
sakurakessho wrote:All of my music is on my external hard drive. While, of course, my MM and iTunes installs are in my main hard drive.

Does this move every bit of music to my main hard drive? Please say its not so!

Or does this just kinda copy the MM library and make it something that iTunes can digest?
My main collection is on a network drive too.

iTunes can be configured to copy into it's iTunes folder. The setting is on the advanced tab in the preferences 'Copy files to iTunes media folder when adding to library'. On my system this is deselected.

Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Sun Jan 31, 2010 2:04 pm
by sakurakessho
markstuartwalker wrote:
sakurakessho wrote:All of my music is on my external hard drive. While, of course, my MM and iTunes installs are in my main hard drive.

Does this move every bit of music to my main hard drive? Please say its not so!

Or does this just kinda copy the MM library and make it something that iTunes can digest?
My main collection is on a network drive too.

iTunes can be configured to copy into it's iTunes folder. The setting is on the advanced tab in the preferences 'Copy files to iTunes media folder when adding to library'. On my system this is deselected.

Mark
It is deselected. Does it maybe have something to do w/ the fact that my itunes library (that i don't use) is on my main computer and not on the external? I try to sync within MM and it says that there's not enough space. Which would make sense if i were trying to copy my music library from MM to iTunes.

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Sun Jan 31, 2010 5:01 pm
by Zeeno
When I download d_iTunes.dll to my MediaMonkey/Plugins folder and then try to run MediaMonkey, I immediately get "Error during player initialization" at the MediaMonkey splash screen and then continually get "Access violation at address...in module 'kernel32.dll' (and sometimes MediaMonkey.exe)" when I try to go to Tools/Options in MediaMonkey.

It seems like the plugin is having trouble locating or interfacing with my iTunes installation. It's in (\Program Files\iTunes)

Anyone know what is going on here?

Thanks

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Mon Feb 01, 2010 4:08 am
by jfarr
markstuartwalker wrote:

... and you never see 'Itunes installed" or "Itunes not installed" so I suspect there is an exception being raised that we are not seeing. Can I ask you to download the version I'm about to post and try again. I've added a few more. logging messages and removed the SetErrorMode function - this was part of the code that I was provided with and suspect that it is superfluous.


Mark
You can ask!

This is the resulting output - again I am not sure how much it's going to help, but it does sound like maybe I have some company.

00000194 5.60312653 [12436] 12440 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iPhone.dll'
00000195 5.60730886 [12436] 12440 DB lock finished, took 1565352.
00000196 5.61619282 [12436] FastMM has been installed.
00000197 5.70178080 [12436] iPhone: Loading library: C:\Program Files\Common Files\Apple\Mobile Device Support\bin\iTunesMobileDevice.dll
00000198 5.76169014 [12436] 12440 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iPod.dll'
00000199 5.76283455 [12436] 12440 DB lock finished, took 2715868.
00000200 6.47293186 [12436] 12440 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iRiverH.dll'
00000201 6.47358799 [12436] 12440 DB lock finished, took 1467072.
00000202 6.51864386 [12436] 12440 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iTunes.dll'
00000203 6.51930523 [12436] 12440 DB lock finished, took 1460964.
00000204 6.52210379 [12436] Devices: Unloading C:\Program Files\MediaMonkey\Plugins\d_iTunes.dll
00000205 6.52274895 [12436] Devices: fQuit called
00000206 6.54976606 [12436] Thread has started 12556

Thanks

Jules

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Mon Feb 01, 2010 4:52 am
by markstuartwalker
Hmmmm, I wonder what that 'fQuit called' is doing ....

Mine looks like

Code: Select all

[4928] Thread has started 5052
[4928] Winamp sim - message left to the default processing
[4928] Thread registered, going to initialize 5052
[4928] Thread initialized 5052
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='<temp>' 
[4928] 4932 DB lock finished, took 2482.
[4928] FastMM has been installed.
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iPhone.dll' 
[4928] 4932 DB lock finished, took 1714.
[4928] FastMM has been installed.
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iPod.dll' 
[4928] iPhone: Loading library: C:\Program Files\Common Files\Apple\Mobile Device Support\bin\iTunesMobileDevice.dll
[4928] 4932 DB lock finished, took 3417.
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iRiverH.dll' 
[4928] 4932 DB lock finished, took 1.
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_iTunes.dll' 
[4928] 4932 DB lock finished, took 1.
[4928] iTunes Plugin Init
[4928] iTunes Plugin UpdateDeviceState
[4928] iTunes Plugin Starting device
[4928] iTunes Plugin DeviceCaption iTunes
[4928] 4932 DB exec SQL: UPDATE Devices SET DeviceCaption='iTunes' WHERE ID=16 
[4928] 4932 DB lock successful.
[4928] 4932 DB lock finished, took 816814.
[4928] 4932 DB open SQL: SELECT * FROM Filters WHERE ID=0 
[4928] 4932 DB lock finished, took 1352.
[4928] iTunes Plugin UpdateDeviceState done
[4928] iTunes Plugin Itunes installed
[4928] iTunes Plugin Init done
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_USBMass1.dll' 
[4928] 4932 DB lock finished, took 3006.
[4928] FastMM has been installed.
[4928] 4932 DB open SQL: SELECT * FROM Devices WHERE PluginName='d_WMDM.dll' 
[4928] 4932 DB lock finished, took 1680.
[4928] WMDM: Inializing WMDM
[4928] WMDM: Queueing action id:0
[4928] WMDM: Starting action id: 0
[4928] WMDM: Creating Dev Mgr
[4928] 4932 DB exec SQL: DROP TABLE IF EXISTS TmpAFF1 
[4928] 4932 DB lock successful.
[4928] 4932 DB lock finished, took 1062.
Have you got the HKEY_CURRENT_USER\Software\Songs-DB\Device\iTunes\debug switch set to 1?

I have reverted the UpdateDeviceState() to it's 'as supplied' logic which I straightened out somewhat. Also initialised the isPresent flag.

Code: Select all

var
  isPresent: boolean=false;

procedure UpdateDeviceState(newState: boolean);
begin
  logs('UpdateDeviceState');

  if not newState or (newState and isPresent) then
  begin // Remove from MM
    logss('Stopping device',inttostr(DeviceHandle));
    if DeviceHandle <> 0 then
      DeviceInterf.DeviceStop(DeviceHandle);
  end;

  if newState then
  begin // Show in MM
    logs('Starting device');
    logss('DeviceCaption',DeviceName);
    DeviceCaption := DeviceName;
    DeviceHandle := DeviceInterf.DeviceStart(hInstance, DeviceCaption, 0);
    DeviceInterf.CreateDeviceNode(DeviceHandle);
    logss('DeviceHandle',inttostr(DeviceHandle))
  end;

  isPresent := newState;

  logs('UpdateDeviceState done');
end;
It works just the same for me but maybe something very wierd is going on. Please try again.

Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Feb 02, 2010 9:04 am
by Troublemaker
Hey,
I tried d_itunes.dll, cause my shuffle 3gen doesnt sync play counts with MM but it works in iTunes.
But I cant make it work. I kept trying but coudnt find a way how to make it work.

Sometimes mm syncs a song with itunes if I rightclick on a song>Send>iTunes(sync). but it never syncs my playlist that I marked in device options.

So I downloaded the debug version of MM and it says:

"Acces violation at address 0D148BB1 in modile 'd_iTunes.dll'. Read of address 00000000."

Any help?

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Feb 02, 2010 3:00 pm
by markstuartwalker
Troublemaker wrote:Hey,
I tried d_itunes.dll, cause my shuffle 3gen doesnt sync play counts with MM but it works in iTunes.
But I cant make it work. I kept trying but coudnt find a way how to make it work.

Sometimes mm syncs a song with itunes if I rightclick on a song>Send>iTunes(sync). but it never syncs my playlist that I marked in device options.

So I downloaded the debug version of MM and it says:

"Acces violation at address 0D148BB1 in modile 'd_iTunes.dll'. Read of address 00000000."

Any help?
To get the sync of playcounts and ratings to work then you must use the autosync mode. I've updated the operation notes and included them here aloong with the notes on iPod/iPhone/iTounch sychronisation.

Operation ...
* Configure the device by right-clicking icon and "Configure Device".
* Select the Artists/Playlists in the Music and Playlists tabs which are required to be synchronised into iTunes.
* Synchronise the selection into iTunes by right-clicking iTunes icon and "Autosync".
* The iTunes icon in the browser tree can be expanded to see the content of iTunes within MM. Remember to refresh the view to see newly synchronised items.
* The selected playlists are sycnhronised into iTunes under a <MM> folder. The <MM> folder is the only place in iTunes that the plugin sees.
* If you wish for previously synchronised playlists to be removed from the <MM> folder then ensure the "Delete Tracks that aren't on the auto-sync list" switch.
* It is also possible to send playlists and tracks adhoc by right-clicking and SendTo/iTunes(Synchronise) but this does not synchronise the ratings and playcounts.

Usage with iPod/iPhone synchronisation...
* Once tracks and playlists are synchronised into iTunes then iTunes can be used to synchronise to any iTunes supported device in the normal manner.
* The usual practice is to synchronise to an iPod/iPhone by playlists only i.e. not by genre,artist etc. If you do wish to synchronise an iPod/iPhone by (say) genre then create a playlist in MM to that effect and synchronise into iTunes
* All the synchronised playlists are put under an <MM> folder. This allows en-masse selection of all playlists to be sycnhronised to an iPod/iPhone. Playlists synchronised from MM are never actually deleted, they are emptied of tracks and renamed to be 'zzz'. When new playilsts are created the zzz 'empties' are renamed. This is so that if that playlist were synchronised then it's replacement is sycnhronised too.
* This plugin can work alongside manually added tracks in iTunes provided the track contents does not overlap.
* iTunes synchronises the iPod/iPhone<->iTunes playcounts and ratings. This plugin synchronises iTunes<-> similarly. Thus the counts and ratings are maintained across all 3 devices.

Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Feb 02, 2010 3:57 pm
by Troublemaker
markstuartwalker wrote: To get the sync of playcounts and ratings to work then you must use the autosync mode. I've updated the operation notes and included them here aloong with the notes on iPod/iPhone/iTounch sychronisation.

Operation ...
* Configure the device by right-clicking icon and "Configure Device".
* Select the Artists/Playlists in the Music and Playlists tabs which are required to be synchronised into iTunes.
* Synchronise the selection into iTunes by right-clicking iTunes icon and "Autosync".

Mark
I did everything as you described..until the last point I quoted.
It didnt sync anything :-( it just pop-up this error!
"Acces violation at address 0D148BB1 in modile 'd_iTunes.dll'. Read of address 00000000."

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Feb 02, 2010 4:05 pm
by markstuartwalker
Troublemaker wrote: I did everything as you described..until the last point I quoted.
It didnt sync anything :-( it just pop-up this error!
"Acces violation at address 0D148BB1 in modile 'd_iTunes.dll'. Read of address 00000000."
I'm wondering if you have the same (unresolved) problem as jfarr. Are you running XP or Windows 7?

OK, debug time.

Switch on the debug feature via HKEY_CURRENT_USER\Software\Songs-DB\Device\iTunes\debug. Set the value to 1.
Debugview can be downloaded from http://download.sysinternals.com/Files/DebugView.zip. Filter the output by "iTunes Plugin' and capture the output.

Mark

Re: MediaMonkey iTunes device plugin (d_itunes.dll)

Posted: Tue Feb 02, 2010 4:47 pm
by sakurakessho
Okay I've been playing around with it and I've kinda figured it out. My only beef is that for my FLAC files it creates a mp3 that is in a temp folder.

Is there a way I can control where those mp3 files go? Or better yet, can we convert them to another format like AAC just for the sake of smaller file size?

I love this idea and really support you.

Hell, if you decided to throw up a donation link I'd toss ya $5. (I know, I know it doesn't seem worth it. Buuuuut, I'm poor. lol) :P