MM stuck on "Reading Tracks..." for 10+ minutes

Get answers about using MediaMonkey 4 for Windows.

Moderator: Gurus

RandomAcronym
Posts: 10
Joined: Tue Feb 02, 2010 8:11 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by RandomAcronym »

A new DB did not help. :(

right before my music showed up Debug View said this:

[6896] Going to make final callback 5544
[6896] 1440 DB lock finished, took 430.

What should I do with the Debug log?
Sansa Fuse: so good thy stopped makings it.
PC specs:
Win 8 RP 64bit
Core i7-2600K
12GB DDR3
2 1TB drives (not SSD)
AMD Radeon HD 5850
Lowlander
Posts: 56588
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Lowlander »

As per debug instructions you should send it to support: http://www.mediamonkey.com/support/inde ... &_a=submit
Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Melloware »

Our MonkeyTunes users are seeing this too. It turns out if you have File Monitor ON we are seeing this behavior but as soon as we turn File Monitor OFF and restart MM loads fine without reading Tracks... problem.

I think what might be happening is the INIT of my script is running SQL Queries and the File Monitor is trying to edit the SQl Lite database underneath it causing a deadlock.

I don't do any UpdateDB commands only read-only SELECTS starting up.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Funkafonik »

Finally some answers about this! My MM also started doing this not long ago and couldn't figure it out...
until this thread mentioning MonkeyTunes that I've bought and installed at around the time my MM started acting up.
I love File Monitor and MonkeyTunes, so hopefully a fix is coming to allow the use of both at the same time!

thx!
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by nohitter151 »

Funkafonik wrote:Finally some answers about this! My MM also started doing this not long ago and couldn't figure it out...
until this thread mentioning MonkeyTunes that I've bought and installed at around the time my MM started acting up.
I love File Monitor and MonkeyTunes, so hopefully a fix is coming to allow the use of both at the same time!

thx!
Just disable the start up scan. You can still use file monitor, and the problem won't occur.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Funkafonik »

nohitter151 wrote:
Funkafonik wrote:Finally some answers about this! My MM also started doing this not long ago and couldn't figure it out...
until this thread mentioning MonkeyTunes that I've bought and installed at around the time my MM started acting up.
I love File Monitor and MonkeyTunes, so hopefully a fix is coming to allow the use of both at the same time!

thx!
Just disable the start up scan. You can still use file monitor, and the problem won't occur.
Hmm but like I mentioned in the other thread, I did have it set to Startup Scan OFF...
Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Melloware »

Funkafonik wrote:Hmm but like I mentioned in the other thread, I did have it set to Startup Scan OFF...
I wonder if I add a line of code in MonkeyTunes that 10 seconds after it starts up to send an SDB.ProcessMessages call because I think by connecting with the Apple Remote which causes the deadlock to magically break and MM start working again.

I don't know what would be causing the deadlock but something surely is. I might add that in the code and have you try it out.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Funkafonik »

Melloware wrote:
Funkafonik wrote:Hmm but like I mentioned in the other thread, I did have it set to Startup Scan OFF...
I wonder if I add a line of code in MonkeyTunes that 10 seconds after it starts up to send an SDB.ProcessMessages call because I think by connecting with the Apple Remote which causes the deadlock to magically break and MM start working again.

I don't know what would be causing the deadlock but something surely is. I might add that in the code and have you try it out.
OK, I've played around some more and as of this morning, even with no signs of File Monitoring, MM keeps hanging on startup so I had to completely remove MonkeyTunes, and now it's all back to normal, MM is back up to full speed. So I'm guessing the problem is with MonkeyTunes itself...

I'll wait for an update before reinstalling it.

thx!
Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Melloware »

OK I ran in Debug Mode. Here is what is happening. I don't quite understand why but even though my queries have finished MM think they are still runnign which is what is causing this problem I think. I am doing queries using OpenSQL like the documentation says...

http://www.mediamonkey.com/wiki/index.p ... e::OpenSQL

It looks like for about 20 seconds after MM is started these queries look like they are still running.

Code: Select all

8.673s - PID:500 - Closing database.
        8.673s - PID:500 - DB:_Query remained running:_SELECT DISTINCT Albums.ID,Albums.Artist,Albums.Album,Albums.Tracks FROM Albums  ORDER BY Albums.Album 
        8.673s - PID:500 - DB:_Query remained running:_SELECT Playlists.IDPlaylist, IFNULL(Playlists.IsAutoPlaylist, 0) IsAutoPlaylist,IFNULL((SELECT A.PlaylistName FROM Playlists A WHERE A.IDPlaylist=Playlists.ParentPlaylist), 'Root') || ' - ' || Playlists.PlaylistName AS NAME, COUNT(PlaylistSongs.IDPlaylistSong) as REC_COUNT FROM Playlists LEFT OUTER JOIN PlaylistSongs ON Playlists.IDPlaylist = PlaylistSongs.IDPlaylist GROUP BY  Playlists.IDPlaylist, IsAutoPlaylist, NAME ORDER BY NAME
        8.673s - PID:500 - DB:_Query remained running:_SELECT Genres.GenreName FROM Genres  ORDER BY Genres.GenreName 
        8.673s - PID:500 - DB:_Query remained running:_SELECT DISTINCT Artists.Artist FROM Artists, ArtistsSongs, GenresSongs, Genres WHERE Genres.GenreName = 'Classical' AND Artists.ID=ArtistsSongs.IDArtist AND Artists.Albums != 0 AND ArtistsSongs.IDSong=GenresSongs.IDSong AND Genres.IDGenre = GenresSongs.IDGenre  ORDER BY Artists.Artist 
So I am calling queries the way I am supposed to I would assume they close closed properly. I even tried wrapping them in a BeginTransaction and Commit() method even though I am not doing any updates.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Melloware »

I think I found it!!!!!

So here is what is happening. When I start MonkeyTunes I run some queries to cache for performance. What happens is MediaMonkey thinks those queries are still Open according to my DEBUG Log. MonkeyTunes is a .NET application therefore it handles all object management and cleanup.

So when I run a query like this in .NET...

Code: Select all

SDBDBIterator iterator = (SDBDBIterator)MediaMonkey.Database.OpenSQL( "SELECT DISTINCT TextData FROM AddSongInfo WHERE DataType=200 Order BY TextData");
while (!iterator.EOF) {
   iterator.Next();
}
I though the query was closed. However because .NET uses Garbage Collection the Query is not "closed" in MediaMonkey until the SDBDBIterator is Garbage Collected. So if the queries are open other processes like File Monitor are locked until those queries are released which is why it works after 10+ minutes because the garbage collector finally runs and cleans up the queries.

So to fix it what I do is after my pre-cache queries run I then call

Code: Select all

System.GC.Collect()
to force .NET to Garbage collect and it closes the queries in MediaMonkey.

I tested locally and everything appears to be working. If you want to download our latest version and give it a shot download the version from our website and try again.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Funkafonik
Posts: 58
Joined: Fri Feb 13, 2009 12:33 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Funkafonik »

Works great so far! Thanks alot for that! :)
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by nohitter151 »

Works great for me, MM seems to load up much quicker now.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Melloware
Posts: 339
Joined: Mon Aug 18, 2008 9:46 am
Location: Philadelphia, PA, US
Contact:

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by Melloware »

I am relieved that we got this solved. This was a tricky one to diagnose and track down.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Melloware Inc.
MonkeyTunes - DACP Server for MediaMonkey
Intelliremote - Take Back Control of your HTPC!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
matthewschenker

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by matthewschenker »

Hello,
I am having the same problem. When MediaMonkey starts up, it is stuck in the "Reading Tracks..." mode apparently forever. I've let it run for over 30 minutes before closing the program. The first time I ran the software, it scanned my library and added all the music folders and files with no problem. But the second time I ran MediaMonkey, the hangups began.

I've tried most of what was suggested here. But I still have the problem.

One of the things I can't figure out is how to disable the start-up scan. Where do I do that?

The other things is to remove monkeyTunes. how do I do that?

I really like Mediamonkey's options and design, and would like to use it! Please help!

Thanks,
Matthew
matthewschenker
Posts: 13
Joined: Mon Mar 15, 2010 1:36 pm

Re: MM stuck on "Reading Tracks..." for 10+ minutes

Post by matthewschenker »

Hello,
I am having the same problem. When MediaMonkey starts up, it is stuck in the "Reading Tracks..." mode apparently forever. I've let it run for over 30 minutes before closing the program. The first time I ran the software, it scanned my library and added all the music folders and files with no problem. But the second time I ran MediaMonkey, the hangups began.

I've tried most of what was suggested here. But I still have the problem.

One of the things I can't figure out is how to disable the start-up scan. Where do I do that?

The other things is to remove monkeyTunes. how do I do that?

I really like Mediamonkey's options and design, and would like to use it! Please help!

Thanks,
Matthew
Post Reply