Bug 4724 - Random Play
: Random Play
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.5.1
: Infrant ReadyNAS RAIDiator (SPARC)
: P2 normal (vote)
: ---
Assigned To: Chris Owens
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-01 10:51 UTC by david
Modified: 2009-01-29 11:29 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david 2007-02-01 10:51:28 UTC
Just upgraded the ReadyNAS NV to the latest 01/31/2007 version of SS 6.5.1 I was running the version of 6.5.1 Infrant supplied with RAIDiator v3.01c1-p6 released 13th December and it worked fine. With this latest version the Random Play - Songs selection creates a list of songs with all the Artists beginning with A, then B, then C etc. Only way I can get them approaching random is to switch on Shuffle. This reorganises the list. Selecting Random Play a second time switches off the Shuffle and the alphabetised list returns.

Downgraded to the earlier version of 6.5.1 and everything returned to normal.
Comment 1 david 2007-02-02 09:14:58 UTC
Forgot to add my music library is setup as A/artist name/album, B/artist name/album etc
Comment 2 david 2007-02-03 04:01:08 UTC
I asked SS to prepare a Random Song mix looking 200 ahead and 5 behind and this is what I get:

A-Ha - I've Been Losing You  from The Singles: 1984-2004
A-Ha - Velvet from The Singles: 1984-2004
ABC - The Look of Love from Into The Eighties
ABC - Tears Are Not Enough from The Lexicon Of Love
Abba - I Have A Dream from Gold - Greatest Hits
Abba - The Winner Takes It All from Gold - Greatest Hits
Aerosmith - Back In The Saddle from Greatest Hits
A3 - U Don't Dans 2 Tekno Anymore from Exile On Coldharbour Lane
Albert Collins - Honey hush from Natural Blues - Disk 1 of 2
Ana Popovich - Belly Button Window from Blue Haze - Songs Of Jimi Hendrix
Annie Lennox - Little Bird from Diva
B.B. King - You Shook Me (duet with John Lee Hooker) from Blues Summit
Barry White - I'm Gonna Love You Just A Little More, Baby from All-time Greatest Hits
Baz Luhrmann - a Mulcahy / Sparkling Diamond Caroline O'Connor, Natalie Mendoza & Lar from Moulin Rouge
Billie Holiday - One, Two, Button Your Shoe from All Of Me(FLAC)(oan)
Billie Holiday - Body And Soul from Body & Soul
Billie Holiday - Guilty from Classic Tracks
Blind Lemon Jefferson - Blind Lemon's Penitentiary Blues from Blind Lemon Jefferson
Blondie - Hanging On The Telephone from Atomic
Blues Brothers - Flip, Flop & Fly from Best Of The Blues Brothers
Bob Seger and the Silver Bullit Band - Ship of Fools from Night Moves
Bobby Womack - Doing It My Way from Lookin' For A Love (The Best Of Bobby Womack)
Bonnie Rait - All At Once from Luck Of The Draw
Brian Wilson - Let's Go Away For Awhile from Pet Sounds Live
Bryan Adams - (Everything I Do) I Do It For You from The Best Of Me
Buddy Guy - Watch Yourself from I Was Walking Through The Woods
Buddy Holly - Words Of Love from Buddy Holly
Buddy Holly - It's Not My Fault from For The First Time Anywhere
Bunny Paul - Such A Night from It's Only Rock 'n' Roll
Carole King - Corazón from Natural Woman: The Very Best of Carole King
Charlie Watts - Charlie Watts / I#ve Got A Crush On You from Long Ago And Far Away
Cher - Save Up All Your Tears from Cher's Greatest Hits: 1965-1992
Chicago - Look Away from The Chicago Story
Chicago - Street Player from The Chicago Story
Chris Rea - Bless Them All from On The Beach
Chris Rea - On The Beach from The Best of Chris Rea - New Light Through Old Windows
Chris Rea - Stainsby Girls from Best of
Christine Ohlman - All Down the Line from Exile On Blues Street
Chuck Berry - Almost Grown from American Graffiti
Chuck Berry - Down The Road A Piece from Natural Blues Album, The : Disk 2 of 2
Cliff Richard - Dynamite from The Singles Collection
Bessie Jackson - Barbecue Bess from Copulatin' Blues
David Bowie - Hallo Spaceboy (Pet Shop Boys Remix) from Best Of Bowie
David Bowie - Sound And Vision from Best Of Bowie
David Bowie - The Man Who Sold The World from Best Of Bowie
David Gilmour - The Blue: from On An Island
Del Shannon - Hey Little Girl from Greatest Hits
Diana Ross and the Supremes - Baby Love from Simply The Best Classic Soul
Dion - You Showed Me What Love Is from Born To Be With You / Streetheart
Dion - You're The One from Bronx In Blue
1 2 3 4 5

Setting 20 ahead sort of hides the problem but you can still see the alphabetic order.
Comment 3 Adrian Smith 2007-02-03 05:00:25 UTC
I think this is a bug with the new faster way of generating the random list.  Each group of items will be added in the order which the perl hash algorithm stores them.
Comment 4 Adrian Smith 2007-02-03 05:36:48 UTC
Please try tomorrow's nightly or svn after change 11332 this should add the random items to the playlist in a more random order.
Comment 5 david 2007-02-10 04:25:11 UTC
Just downloaded the Infrant 6.5.1.2 which includes the fix and the problem is still there.
Comment 6 Adrian Smith 2007-02-10 06:37:17 UTC
If you set the upcoming songs to a lower number and them press "fwd" on the remote to force new sets of random tracks to be added, are these random between different sets of tracks - its just that each set is ordered?  If so I'd to see what code is included in the intrant update you are running...
Comment 7 david 2007-02-11 07:17:23 UTC
Ok I confirmed with Infrant they have produced an add-on that includes the revised code 11332 and re-installed. With Random Mix set to 20 songs ahead I get this:


Buddy Guy - Country Man from Feels Like Rain
David Gilmour - Castellorison from On An Island
Dean Martin - Love (Your Spell Is Everywhere) from Dino: Italian Love Songs / Cha Cha De Amor
Frank Sinatra - I've Got A Crush On You from The Capitol Years
Wham! - Everything She Wants (Remix) from Twenty Five
Junior Wells - (I Can't Get No) Satisfaction (feat. Bob Margolin) from Paint It Blue: Songs of the Rolling Stones
Manic Street Preachers - My Little Empire from This Is MyTruth Tell Me Yours
Mel Torme - Nightingale sang in Berkeley Square from The Ultimate Mel Torme
Paul Weller - The Weaver from Modern Classics
Prince - Alphabet St. from The Very Best Of Prince
Red Hot Chili Peppers - Wet Sand from Stadium Arcadium
Squeeze - Another Nail In My Heart from Greatest Hits
Stevie Wonder - Higher Ground from The Definitive Collection
Talking Heads - Once In A Lifetime from DriveTime
Beach Boys - 'Til I Die from Good Vibrations: Thirty Years Of The Beach Boys
The Beatles - Girl from Rubber Soul
The Johnny Otis Show - What Else can I do from with Shuggie Otis
Traveling Wilburys - Inside Out from Vol. 3
Yazoo - Happy People from You and Me Both 

The two songs out of alphabetical order are from Wham (filed under George Michael) and Beach Boys (filed under The Beach Boys). Setting the list to 200 songs ahead gives results similar to what I reported before. 

Comment 8 david 2007-02-11 07:43:07 UTC
Returning to the older (13 Dec) Infrant 6.5.1 I get this:

Bonnie Raitt - Burning down the house  from Road Tested
Otis Redding - That's How Strong My Love Is from Sings Soul Ballads
Frankie Valli & The 4 Seasons - Stay from 25th Anniversary Collection [Disc 1 of 3]
Elvis Presley - The Girl Of My Best Friend from Elvis Is Back!
Billie Holiday - Comes Love from Body & Soul
Luther Allison - Take My Love from Bad News Is Coming
Kate Bush - Hounds of Love from The Whole Story
Paul Weller - Brushed from Modern Classics
George blackwell - Mr loser from Northern Soul Satisfaction
Blues Brothers - Going Back To Miami from Best Of The Blues Brothers
John Lee Hooker - (Twist Ain't Nothin') But The Old Time Shimmy from Simply the truth
Muddy Waters - Country Boy from Folksinger
The Righteous Brothers - He from Unchained Melody
Del Shannon - Two Kinds of Teardrops from Greatest Hits
Cream - Four Until Late from CD 1 - In The Studio
Squeeze - Labelled With Love from Greatest Hits
Marilyn Monroe - She Acts Like A Woman Should from The Essentials
Bruce Hornsby - Set Me In Motion from Greatest Radio Hits
Spaniels - Bounce from Jumping and Doowopping
Phil Collins - Separate Lives from Phil Collins - Hits
Tom Rush - Panama Limited from The Very Best of Tom Rush: No Regrets 

I did notice that after creating the initial list alphabetically 6.5.1.2 then started to add songs at random. So after Yazoo it gave me Kate Bush, Johnny Winter, George Harrison etc. Maybe the problem is with creating the initial list? 
Comment 9 Adrian Smith 2007-02-11 08:04:46 UTC
It appears to be working for me on standard linux.  Given that you do not have access to the perl, could you ask Infrant to add the following patch and post what it adds to the log when starting a random mix:

--- Plugins/RandomPlay/Plugin.pm        (revision 11355)
+++ Plugins/RandomPlay/Plugin.pm        (working copy)
@@ -90,7 +90,12 @@
 
                for (my $i = 0; $i < $limit && @allIds; ++$i) {
 
-                       push @idList, (splice @allIds, rand @allIds, 1);
+                       my $rand  = rand @allIds;
+                       my $total = scalar @allIds;
+
+                       msg("selecting item $rand of $total\n");
+
+                       push @idList, (splice @allIds, $rand, 1);
                }
 
        } else {

Comment 10 david 2007-02-13 10:00:19 UTC
Hi

I got Infrant to give me the add-on as requested. The log file shows:

2007-02-13 17:50:38.8760 selecting item 9362.48598695199 of 10482
2007-02-13 17:50:38.8987 selecting item 5282.75889166614 of 10481
2007-02-13 17:50:38.9003 selecting item 4231.78313155839 of 10480
2007-02-13 17:50:38.9019 selecting item 1266.03012950558 of 10479
2007-02-13 17:50:38.9033 selecting item 2853.90705336104 of 10478
2007-02-13 17:50:38.9048 selecting item 6816.45093053596 of 10477
2007-02-13 17:50:38.9063 selecting item 3916.19047383186 of 10476
2007-02-13 17:50:38.9079 selecting item 4228.6598704054 of 10475
2007-02-13 17:50:38.9096 selecting item 1495.61756136765 of 10474
2007-02-13 17:50:38.9110 selecting item 6894.54876387891 of 10473
2007-02-13 17:50:38.9126 selecting item 4576.3427425293 of 10472
2007-02-13 17:50:38.9142 selecting item 1744.31604092716 of 10471
2007-02-13 17:50:38.9157 selecting item 6310.59560247803 of 10470
2007-02-13 17:50:38.9173 selecting item 6435.58299413055 of 10469
2007-02-13 17:50:38.9189 selecting item 3626.72885656314 of 10468
2007-02-13 17:50:38.9205 selecting item 5026.34391116943 of 10467
2007-02-13 17:50:38.9223 selecting item 5167.66996023497 of 10466
2007-02-13 17:50:38.9240 selecting item 9673.09452685965 of 10465
2007-02-13 17:50:38.9255 selecting item 2329.32861632651 of 10464
2007-02-13 17:50:38.9270 selecting item 8494.77484886607 of 10463
2007-02-13 17:50:54.9637 selecting item 9592.71007339738 of 10481

The Playlist shows:

Cat Power - Lived in Bars  from The Greatest
Cliff Richard - It's All In The Game from The Singles Collection
David Bowie - Hallo Spaceboy (Pet Shop Boys Remix) from Best Of Bowie
Duran Duran - New Moon on Monday from Greatest
Fats Waller - Ain't Misbehavin' from That's Jazz
Andres Sisters - I'll Be With You In Apple Blossom Time from 50's Here`s to the Ladies
James Taylor - Country Road from Greatest Hits (FLAC) (oan)
John Caffert & The Beaver Brown Band - Maryia from Eddie & The Cruisers II
John Caffert & The Beaver Brown Band - NYC Song from Eddie & The Cruisers II
Johnny Winter - 01-Johnny B. Goode (Live) from A Rock n' Roll Collection
Labelle - Lady Marmelade from Disco Fever
Little Richard - Ready Teddy from 18 Greatest Hits
Lou Rawls - One Life To Live from Groovy People -The Best Of Lou Rawls
Paul Weller - The Long Hot Summer from Hit Parade
Pet Shop Boys - You Only Tell Me You Love Me When You're Drunk from PopArt: The Hits 1985-2003 - Disc 2 of 2
Red Hot Chili Peppers - Snow (Hey Oh) from Stadium Arcadium
Rihanna - Pon De Replay Remix from Music Of The Sun
The Beach Boys - Airplane from Good Vibrations: Thirty Years Of The Beach Boys
The Rolling Stones - Sweet Virginia from Stripped
Thompson Twins - Perfect Game from Singles Collection
The Who - Long Live Rock from The Ultimate Collection 

Trust t
Comment 11 Adrian Smith 2007-02-13 10:39:35 UTC
Ok thats the same as for me.  Looks like the next bit of code may be less than random.  Watch this space...
Comment 12 Adrian Smith 2007-02-15 10:02:46 UTC
Please try 6.5.1 change 11446 or tomorrow's nightly.  This should improve randomness of tracks which are added.

Previously we selected a group of tracks randomly, but then performed some functions which resulting in each selection being approximately ordered by the track id.  This change attempts to avoid this.
Comment 13 david 2007-02-19 09:35:47 UTC
Happy to report that Random Mix is now working correctly. Many thanks.
Comment 14 KDF 2007-04-25 08:21:59 UTC
marking as fixed, please reopen if issues remain.