Bug 13233 - Random Mix does not update
: Random Mix does not update
Status: RESOLVED WORKSFORME
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.4.0
: PC Windows XP
: P2 normal (vote)
: 7.5.x
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-04 13:48 UTC by James Richardson
Modified: 2011-01-14 13:15 UTC (History)
4 users (show)

See Also:
Category: Bug


Attachments
Server Log (2.85 KB, application/octet-stream)
2009-08-26 10:34 UTC, James Richardson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Richardson 2009-08-04 13:48:44 UTC
Trying to start a 2nd random mix will cause WEB UI and Player UI to halt and display spiny

Steps to repo

Start a Random Mix with all (or 1) genres selected
Change genres selection
Start another Random Mix - Notice that the Web UI mouse cursor will display a spiny

Random Mix should 'auto' stop when trying to start a new mix.

If I "stop adding songs" via the Web UI, then start a new mix, it works just fine.
Comment 1 Michael Herger 2009-08-04 14:00:23 UTC
> Trying to start a 2nd random mix

What's a 2nd mix? Another mix on the same device or a mix on another  
device?

I'm using this all the time. Never seen this.

> will cause WEB UI and Player UI to halt

Player as in Boom or Jive?

> Start a Random Mix with all (or 1) genres selected

Song, Album, Artist mix?

> Change genres selection
> Start another Random Mix - Notice that the Web UI mouse cursor will  
> display a spiny

So the important point is the change in genres? Sounds like another bug we  
had... can't find it right now.

Log file?
Comment 2 Matt Wise 2009-08-04 14:01:35 UTC
Try just reproducing the steps. The idea is, if you dont like the  
first mix (in my case, it included the Holiday genre -- so I went in  
to uncheck that and restart the mix), you can't start a new one  
without clearing out the old one manually. You used to be able to.
Comment 3 Michael Herger 2009-08-04 14:09:07 UTC
log file?
Comment 4 James Richardson 2009-08-04 14:54:37 UTC
Which logs would you like?
Comment 5 Michael Herger 2009-08-10 02:11:00 UTC
(In reply to comment #4)
> Which logs would you like?

server.log

Andy - is this a dupe or the other bug described in bug 10391?
Comment 6 Michael Herger 2009-08-17 05:03:44 UTC
James - could you please provide the server.log when this happens? thanks!
Comment 7 Ben Klaas 2009-08-26 07:49:45 UTC
this is an administrative shuffle on priority fields to help make better judgment on the top end of the priority list. P4->P5, P3->P4, and P2->P3.
Comment 8 James Richardson 2009-08-26 10:33:06 UTC
SC 7.4 r28276 still has this issue.

See attached log
Comment 9 James Richardson 2009-08-26 10:34:06 UTC
Created attachment 5699 [details]
Server Log

Server log with randomplay set to debug
Comment 10 Michael Herger 2009-08-26 13:12:31 UTC
Hmm... while I've never been able to reproduce this, I think I've run into this issues a few days ago. Eventually I killed it, only to find out that MySQL was running at max. 

This thread seems to be up to something:
http://forums.slimdevices.com/showthread.php?t=66669

"I put the debug logging on and this query seems to take forever in MySQL:

SELECT COUNT( * ) FROM tracks me LEFT JOIN tracks_persistent persistent ON persistent.url = me.url WHERE ( ( audio = ? AND ( persistent.lastplayed IS NULL OR persistent.lastplayed < ? ) ) ): '1', '1251308488'"

Andy - does this make sense to you?
Comment 11 Andy Grundman 2009-08-26 13:24:26 UTC
OK that is a really slow query, the problem is the index on the url field.  I'll see about improving it.
Comment 12 SVN Bot 2009-08-26 14:46:21 UTC
 == Auto-comment from SVN commit #28296 to the slim repo by andy ==
 == https://svn.slimdevices.com/slim?view=revision&revision=28296 ==

Bug 13233, comment out slow query for now
Comment 13 Jim McAtee 2009-08-27 10:02:34 UTC
(In reply to comment #11)
> OK that is a really slow query, the problem is the index on the url field. 
> I'll see about improving it.

Why join on BLOB columns?  URL could be tied back into tracks one time and all joins between tracks and tracks_persistent then could be done on a nicely indexed integer column.

Then there's continued use of NULL values as data.  If lastplayed were set to 0 instead of NULL then this:

WHERE (me.audio = 1)
  AND ((tp.lastplayed IS NULL) OR (tp.lastplayed < 1251308488))

becomes

WHERE (me.audio = 1)
  AND (tp.lastplayed < 1251308488)

A quick test on my server has the first one at 610ms and the second at 16ms.
Comment 14 Andy Grundman 2009-08-27 10:05:33 UTC
Well one reason is that the persistent data never gets deleted, so any track ID mapping would be invalidated by a rescan.  I guess it could be rebuilt but just linking based on URL (or MB ID) seemed better.
Comment 15 Chris Owens 2010-03-15 18:06:33 UTC
7.4.x milestone is in the past
Comment 16 Andy Grundman 2011-01-14 13:15:48 UTC
Probably invalid with various SQLite/DB changes.