[slim] Re: FWD on Random Mix hiccups

2006-11-07 Thread Nicola Fankhauser

new patch available, fixes aforementioned nuisances + new SQL index to
create to speed up things:

ALTER TABLE `tracks` ADD INDEX `trackAudioLastPlayed`
(`audio`,`lastPlayed`)

cheers!

nicola


-- 
Nicola Fankhauser

Nicola Fankhauser's Profile: 
http://forums.slimdevices.com/member.php?userid=1543
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-11-06 Thread Nicola Fankhauser

hi

see http://bugs.slimdevices.com/show_bug.cgi?id=4477

there is a diff as well, cheers!

regards
nicola


-- 
Nicola Fankhauser

Nicola Fankhauser's Profile: 
http://forums.slimdevices.com/member.php?userid=1543
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-11-06 Thread Nicola Fankhauser

Nicola Fankhauser;152991 Wrote: 
 hi
 
 see http://bugs.slimdevices.com/show_bug.cgi?id=4477
 
 there is a diff as well, cheers!
 
 regards
 nicola

take care, this diff optimizes your SS to the point where RandomPlay
does not even tell you what it's playing - that's what I call
performance tuning! ;)

regards
nicola


-- 
Nicola Fankhauser

Nicola Fankhauser's Profile: 
http://forums.slimdevices.com/member.php?userid=1543
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-19 Thread Heuer

At last some sanity! Will someone be posting this as a bug we can vote
for?


-- 
Heuer

Heuer's Profile: http://forums.slimdevices.com/member.php?userid=2543
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


Re: [slim] Re: FWD on Random Mix hiccups

2006-10-19 Thread kdf


On 19-Oct-06, at 12:50 AM, Heuer wrote:



At last some sanity! Will someone be posting this as a bug we can vote
for?


you sound like a volunteer to me. if you feel strongly, please do.

-kdf

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-18 Thread sicoffey

Thanks, interesting to know that MP3 might not solve the problem.

If it is fixed in 6.5.1 then its a new problem for me because, from
what I've heard, my NSLU2 won't cope with the overhead of MySQL.  Ah
well,  I needed an excuse to buy a new NAS anyway :-)


-- 
sicoffey

sicoffey's Profile: http://forums.slimdevices.com/member.php?userid=8023
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


Re: [slim] Re: FWD on Random Mix hiccups

2006-10-18 Thread Dr Lovegrove

On 18/10/06, sicoffey
[EMAIL PROTECTED] wrote:


Thanks, interesting to know that MP3 might not solve the problem.


No, it wont. The problem is with the SQL query which randommix
uses. Essentially:

SELECT * FROM tracks ORDER BY RAND() LIMIT 1

Behind the scenes this will fetch ALL the tracks, sort them
randomly, then return the first track in the list. I just tried the
query on my main server and it takes 8 seconds to complete
(70k ish tracks)..

There must be ways of speeding this up, at least for the
simple non-filtering random cases.

In fact, there seems to be a fair bit of discussion on the subject
of speeding this up down:
http://dev.mysql.com/doc/refman/5.0/en/select.html

--
- Dr Lovegrove
Free Moose for all at:
http://www.rusticrhino.com/drlovegrove
___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-18 Thread sicoffey

Hats off,  sounds like a fine patch to me.   Is there some way I can
vote for its inclusion into the code? (although I fear it wouldnt get
back ported to 6.3 for my little NSLU2..)


-- 
sicoffey

sicoffey's Profile: http://forums.slimdevices.com/member.php?userid=8023
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


Re: [slim] Re: FWD on Random Mix hiccups

2006-10-18 Thread Dr Lovegrove

On 18/10/06, Dr Lovegrove [EMAIL PROTECTED] wrote:

On 18/10/06, sicoffey
[EMAIL PROTECTED] wrote:

 Thanks, interesting to know that MP3 might not solve the problem.

No, it wont. The problem is with the SQL query which randommix
uses. Essentially:

SELECT * FROM tracks ORDER BY RAND() LIMIT 1


Just had a bit more of a play..

Ok, so the original query is this, and it takes over 8s:

SELECT me.id, me.url, me.content_type, me.title, me.titlesort,
me.titlesearch, me.album, me.tracknum, me.timestamp, me.filesize,
me.disc, me.thumb, me.remote, me.audio, me.audio_size,
me.audio_offset, me.year, me.secs, me.cover, me.vbr_scale, me.bitrate,
me.samplerate, me.samplesize, me.channels, me.block_alignment,
me.endian, me.bpm, me.tagversion, me.drm, me.moodlogic_id,
me.moodlogic_mixable, me.musicmagic_mixable, me.musicbrainz_id,
me.playcount, me.lastplayed, me.lossless, me.lyrics, me.rating,
me.replay_gain, me.replay_peak FROM tracks me
LEFT JOIN genre_track genreTracks ON ( genreTracks.track = me.id )
WHERE ( audio = '1' AND genreTracks.genre IN ( '21', '26', '17', '22',
'18', '30', '16', '23', '29', '25', '27', '28', '20', '24', '19', '31'
)
AND ( ( lastPlayed IS NULL ) OR ( lastPlayed  '1161171000' ) ) )
ORDER BY RAND() LIMIT 1

If I strip out all the columns and just get it to sort the tracks id's
like this:

SELECT me.id FROM tracks me
LEFT JOIN genre_track genreTracks ON ( genreTracks.track = me.id )
WHERE ( audio = '1' AND genreTracks.genre IN ( '21', '26', '17', '22',
'18', '30', '16', '23', '29', '25', '27', '28', '20', '24', '19', '31'
)
AND ( ( lastPlayed IS NULL ) OR ( lastPlayed  '1161171000' ) ) )
ORDER BY RAND() LIMIT 1

It now takes under a second, and you're left with the random track ID, which
should be all it needs..

--
- Dr Lovegrove
Free Moose for all at:
http://www.rusticrhino.com/drlovegrove
___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-18 Thread vacaboca

sicoffey;147237 Wrote: 
 Hats off,  sounds like a fine patch to me.   Is there some way I can
 vote for its inclusion into the code? (although I fear it wouldnt get
 back ported to 6.3 for my little NSLU2..)

Dr Lovegrove's detailing of the query definitely explains the
performance/disk hit I've seen - that seems like an incredibly
inefficient way to pull a random track.  I imagine the intersection
with selected genres is part of the problem - it necessitates creating
a subset of all tracks before pulling a random track out of it.  Since
99% of the time I listen to complete random, with no genres deselected
or singled out, it would be nice to have it intelligently realize that
fact and take the quicker path of picking a random rowid from the range
of available tracks...

Thanks for the thinking, Dr Lovegrove... I imagine it's not quite so
simple as your suggested patch, but I'd love to be wrong!  Let me know
if there's a bug/enhancement that I could vote on, too :)


-- 
vacaboca

vacaboca's Profile: http://forums.slimdevices.com/member.php?userid=2715
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-17 Thread sicoffey

Hi,

Did you ever get to the bottom of this issue?   I am seeing the exact
same (Random Mix causes a few seconds silence about 10 secs into each
song).   Suspect its performance related (given I'm using a NAS) but
I'd like to know exactly ...

thanks
Simon


-- 
sicoffey

sicoffey's Profile: http://forums.slimdevices.com/member.php?userid=8023
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-17 Thread Heuer

This has been a known problem since 6.2 and tends to show itself if you
are using FLAC or (worse) ALAC and running SS on a NAS.

According to the Infrant people it is to do with the way and time SS
builds its random play list. Advancing a song causes SS to stop all
other tasks, move forward a song and also add the next random song to
the list. Takes processing power and memory. I have a NV with 1Gb of
RAM but I still see a 2-5 second dropout - down from 10 seconds with
stock RAM. Run SS on a powerful PC and it is not an issue.

Not an expert on this but I suspect SS needs to advance to the next
song in the list and then delay adding a new entry rather than doing
both at once. Not a problem if you are using lossy files as the SB3
buffer masks the problem.

Developers - Please feel free to correct me if I am wrong.


-- 
Heuer

Heuer's Profile: http://forums.slimdevices.com/member.php?userid=2543
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-10-17 Thread sicoffey

Thanks for the reply, sounds about right - maybe a developer could
confirm or deny, as you said  :-)

I guess I'll look into scripting a conversion of my collection from
FLAC to MP3


-- 
sicoffey

sicoffey's Profile: http://forums.slimdevices.com/member.php?userid=8023
View this thread: http://forums.slimdevices.com/showthread.php?t=20494

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/discuss


[slim] Re: FWD on Random Mix hiccups

2006-01-28 Thread treble

Following up on myself with some log entries (plugins and sql).  Using
MySQL.
On 11:37 pressed next song on slimserver.  Next song starts playing
right away, but then pauses for a couple of seconds after about 10
seconds into the song.  Let the song play for a minute or so and
skipped to the next song.  Again hiccup after 10seconds.  In the
Windows Task Manager I see the mysqld-nt.exe take up the highest CPU
(after System Idle) of about 10-40% from the moment I press skip to the
end of the break in the song...

2006-01-28 11:37:00.1099 RandomPlay: received command open
file:///F:/Maho%20Backup/Music/All%20Music/Music/VA/Harley-Davidson/Harley-Davidson%20Road%20Songs%20Vol.%201%20(Disc%201)%20-%201994/04%20-%20Lynyrd%20Skynyrd%20-%20Call%20Me%20The%20Breeze.mp3
2006-01-28 11:37:00.1106 RandomPlay: No client!
2006-01-28 11:37:00. Backtrace:

frame 0: Plugins::RandomPlay::Plugin::commandCallback
(/PerlApp/Slim/Control/Command.pm line 1439)
frame 1: Slim::Control::Command::executeCallback
(/PerlApp/Slim/Player/Source.pm line 1691)
frame 2: Slim::Player::Source::openSong
(/PerlApp/Slim/Player/Source.pm line 412)
frame 3: Slim::Player::Source::playmode
(/PerlApp/Slim/Player/Source.pm line 823)
frame 4: Slim::Player::Source::jumpto
(/PerlApp/Slim/Control/Command.pm line 950)
frame 5: Slim::Control::Command::execute (/PerlApp/Slim/Web/HTTP.pm
line 674)
frame 6: Slim::Web::HTTP::processURL (/PerlApp/Slim/Web/HTTP.pm line
539)
frame 7: Slim::Web::HTTP::processHTTP
(/PerlApp/Slim/Networking/Select.pm line 111)
frame 8: Slim::Networking::Select::select (slimserver.pl line 634)
frame 9: main::idle (slimserver.pl line 38)
frame 10: PerlSvc::Startup (perlsvc.pl line 1481)
frame 11: PerlSvc::_startup (slimserver.pl line 0)
frame 12: (eval) (slimserver.pl line 0)

2006-01-28 11:37:00.3561 RandomPlay: received command playlist jump +1
2006-01-28 11:37:00.3570 RandomPlay: while in mode: track, from
Squeezebox
2006-01-28 11:37:00.9619 RandomPlay: received command newsong
2006-01-28 11:37:00.9628 RandomPlay: No client!
2006-01-28 11:37:00.9634 Backtrace:

frame 0: Plugins::RandomPlay::Plugin::commandCallback
(/PerlApp/Slim/Control/Command.pm line 1439)
frame 1: Slim::Control::Command::executeCallback
(/PerlApp/Slim/Player/Source.pm line 1212)
frame 2: Slim::Player::Source::trackStartEvent
(/PerlApp/Slim/Networking/Slimproto.pm line 524)
frame 3: Slim::Networking::Slimproto::process_slimproto_frame
(/PerlApp/Slim/Networking/Slimproto.pm line 244)
frame 4: Slim::Networking::Slimproto::client_readable
(/PerlApp/Slim/Networking/Select.pm line 111)
frame 5: Slim::Networking::Select::select (slimserver.pl line 634)
frame 6: main::idle (slimserver.pl line 38)
frame 7: PerlSvc::Startup (perlsvc.pl line 1481)
frame 8: PerlSvc::_startup (slimserver.pl line 0)
frame 9: (eval) (slimserver.pl line 0)

2006-01-28 11:37:01.6219 RandomPlay: received command newsong
2006-01-28 11:37:01.6229 RandomPlay: while in mode: track, from
Squeezebox
2006-01-28 11:37:01.6237 RandomPlay: new song detected (1)
2006-01-28 11:37:01.6241 RandomPlay: Stripping off completed track(s)
2006-01-28 11:37:01.6245 RandomPlay: playRandom called with type track
2006-01-28 11:37:01.6249 RandomPlay: 8 songs remaining, songIndex = 1
2006-01-28 11:37:01.6277 Running SQL query: [SELECT DISTINCT genres.id
AS id,genres.name AS name,genres.namesort AS
namesort,genres.moodlogic_id AS moodlogic_id,genres.moodlogic_mixable
AS moodlogic_mixable,genres.musicmagic_mixable AS musicmagic_mixable
FROM genres ]
2006-01-28 11:37:01.6882 RandomPlay: Starting random selection of 1
items for type: track
2006-01-28 11:37:01.6908 Start and End node: [default:default]
2006-01-28 11:37:01.6930 Start and End node: [genre:default]
2006-01-28 11:37:01.6939 Field query. Need additional join. start and
End node: [genre:genre]
2006-01-28 11:37:01.7010 Running SQL query: [SELECT DISTINCT tracks.id
AS id,tracks.multialbumsortkey AS multialbumsortkey,tracks.thumb AS
thumb,tracks.age AS age,tracks.remote AS remote,tracks.ct AS
ct,tracks.audio AS audio,tracks.titlesort AS titlesort,tracks.album AS
album,tracks.tracknum AS tracknum,tracks.url AS url,tracks.tag AS
tag,tracks.title AS title,tracks.disc AS disc,tracks.fs AS fs FROM
tracks, genre_track, genres WHERE genre_track.track = tracks.id AND
genres.id = genre_track.genre  AND ( genres.name IN ( ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
AND tracks.audio = ? ) ORDER BY RAND() LIMIT 1]
2006-01-28 11:37:01.7018 Bind arguments: [College Rock, Top 40,
Chanson, Christmas, New Wave, Speech, Miscellaneous, Slow Rock, Jazz,
Sonata, Post-Grunge, Alternative, New Country, Neo - Soul, Salsa,
Comedy, Celtic, Tango, Latin Balad, Cuban, National Folk, AlternRock,
Hip-Hop, Rock, Folk-Rock, Electronica,