v16 BUG: Smart Playlists are not so smart; random isn't random.
#1
Thumbs Down 
So using Kodi 16.1 Smart Playlists that are set to random do not yield the expected random playlist results in many cases. The tracks that go into the playlist are randomly selected based on the rules, but the final ordering of the tracks in the playlist is not random. The ordering of selected tracks is always sorted first by track number, then artist, lastly title.

This behavior isn't very obvious if you make a small sized playlist relative to the number of matches to the input rules. With a 25 song playlist from 1000+ possible input tracks, the resulting playlist seems reasonably random if you're not paying close attention to the track order to catch how they're ordered. However, the larger the number of tracks in the smart playlist gets relative to the number of tracks that meet the matching input rules the less random and more repeatable the playlist becomes. This continues to the point that if you give it unlimited playlist size you will get the exact same playlist every time it "randomly" generates.

It seems like there should either be a 2nd randomization pass after the tracks are randomly selected, or Kodi shouldn't be re-ordering/sorting the randomly selected tracks in the first place.

How to duplicate:
1) Make smart playlist of unlimited size using whatever rules you want choosing Random.
2) Chose the smart playlist and let it generate.
3) Look at order of the playlist. Note that tracks will be sorted by the following criteria in order: track number, artist, title.
4) Make a note of the track order (screenshot, snap a picture, write it down, etc.).
5) Go back to the main menu, backing out of the playlist results
6) Go to step 2) Feel free to restart Kodi, reboot the box in between, etc.

You'll see the track order of the playlist is the same every single time it generates and is very much not random.

This behavior happens on both the RPi 3 and my Chromebox (Haswell) using a clean install of Kodi (LE 7.0.2) with no add-ons or modifications from the default settings, skins, etc.
Reply
#2
All I can say is that is not the case in Krypton. Moreover you can sort a random playlist, if you wanted, then switch back to random from the side blade, and it will be a different random order.

Solution: update to v17
Reply
#3
Isn't v17 still in beta?

Edit: LE is an Alpha to get v17.

After installing the Alpha of LE which has v17.0b5, I can confirm you are correct. The issue doesn't show up in v17.0b5.

That said, this reminds me of typical shoddy software development... No one wants to do the work to find the source of the problem and why v17 fixes it. When someone makes further changes to the codebase later on and the incorrect behavior returns no one will check for a regression because the bug was never actually found and documented.
Reply
#4
(2016-11-29, 21:53)Stereodude Wrote: That said, this reminds me of typical shoddy software development... No one wants to do the work to find the source of the problem and why v17 fixes it. When someone makes further changes to the codebase later on and the incorrect behavior returns no one will check for a regression because the bug was never actually found and documented.
That sounds typical of something an ungrateful and over expectant user would say.

I think I'm a pretty user friendly dev, certainly compared to some others on the team I am. But when I read posts like that I can understand why, after more years than me on the project, their response to users is more aggressive than mine. If you have the skills then come and share the work. If you don't then calling the work that those of us who volunteer our time and effort to developing Kodi "shoddy" is not going to motivate. What possible reason do I have to look at any issue you have in future, or offer any help?
Reply
#5
(2016-11-30, 18:15)DaveBlake Wrote: That sounds typical of something an ungrateful and over expectant user would say.

I think I'm a pretty user friendly dev, certainly compared to some others on the team I am. But when I read posts like that I can understand why, after more years than me on the project, their response to users is more aggressive than mine. If you have the skills then come and share the work. If you don't then calling the work that those of us who volunteer our time and effort to developing Kodi "shoddy" is not going to motivate. What possible reason do I have to look at any issue you have in future, or offer any help?
Hey, if you don't have any pride of ownership in your work or the project you're working on and don't want to follow best practices for software development I don't know what to tell you.

https://github.com/linuxfoundation/cii-b...riteria.md

A user reports a bug, you exert all the effort of checking that the latest beta doesn't do it, and in so many words tell the user to go use an alpha version of LE to resolve the issue. Further, you call the user ungrateful when they express some dissatisfaction with the "fix" of using an alpha after you worked so hard on the problem, but somehow I'm the one with the attitude problem. Right...
Reply
#6
Yes you are a problem with that attitude
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
If this is specifically about randomness, a specific fix by paxxi has been merged for v17, indeed.
V16 and below was not really random, as seed/salt was not applied to random.
Reply
#8
Stereodude you have assumed that just because I didn't take time to go into long explantions over why Jarvis had a bug, or what in Krypton solved it, that I didn't know or care. If you read up on Kodi you would know that Jarvis is frozen, any bug fixes will come via the next version, that is the release cycle. The bug you reported has been fixed in v17, you can upgrade or stay with v16 and the bug.

If you think Kodi is "shoddy", and you don't like my attitude, or think I don't work hard enough, then you are very welcome to use some other free media player. No one that has ever worked on Kodi, currently or in the past, will mind. Bye, bye.
Reply
#9
(2016-12-01, 08:06)Martijn Wrote: Yes you are a problem with that attitude
Open source software, where the end user is the problem if they're not happy with something.

(2016-12-01, 09:20)Koying Wrote: If this is specifically about randomness, a specific fix by paxxi has been merged for v17, indeed.
V16 and below was not really random, as seed/salt was not applied to random.
It wasn't about randomness. It was about V16 sorting the "random" smart playlist by track number, artist, and track name making an unlimited size smart playlist not the slightest bit random and 100% identical every time it is generated. I don't know in what version the behavior got introduced. It smart random playlists worked okay in Gotham, which was the version I was using before I had to upgrade.

(2016-12-01, 10:35)DaveBlake Wrote: If you think Kodi is "shoddy", and you don't like my attitude, or think I don't work hard enough, then you are very welcome to use some other free media player. No one that has ever worked on Kodi, currently or in the past, will mind. Bye, bye.
Sorry, but it is certainly less than ideal. Maybe shoddy isn't the right word for it, but there seems to be more concern with cranking out a new major release every year than making a slick, polished, well crafted product. Each major release breaks parts of the ecosystem around it. I had a skin I modified a little bit for my particular use case that I used with Gotham. That skin won't work with any newer version of Kodi and the developer of the skin I started with stopped updating it. I use Yatse as my remote and Tolriq dropped support for Gotham because he's chasing the moving target of Kodi. So I upgrade to the latest release (Jarvis) so Yatse will still support it and Jarvis has this smart playlist bug and a lack of compatibility with my last skin. Moving to Krypton all familiarity with the standard skin is gone. Kodi now looks totally different and crashes coming out of standby, but hey, at least it doesn't incorrectly sort smart playlists.

This isn't a project in its infancy. It's more than 10 years old. Why can't anything be frozen to give end users some consistency? At what point are end users going to be given a stable media playback platform? If it wasn't for Yatse I'd have already moved on.
Reply
#10
So, smart playlist randomness was broken in v16.1 per the OP.  Fixed in v17.0b5.  Over the weekend I broke out the Christmas music for the season and noticed it was broken again in v17.3/LE 8.0.2 (though with a slightly different resulting sort order from v16.1).  After getting the latest LE as of this morning I see it's fixed again in v17.6/LE 8.2.1.

I don't know about the in between versions because I didn't test them, but how does this bug manage to sneak back in?  No regression testing of bugs?
Reply
#11
So should we take that as some snarky remark that we don't every gazillion features or combinations we have?
Could also be you're the only user out of the other millions using that feature.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#12
(2017-11-27, 19:19)Martijn Wrote: So should we take that as some snarky remark that we don't every gazillion features or combinations we have?
Could also be you're the only user out of the other millions using that feature.
No, you should take it as a question.  Do you have a system that takes previously identified bugs and adds them to automated regression testing to make sure they don't reappear?

And, If I'm really the only user of the feature, then how did it get fixed again on it's own between v17.3 and v17.6?
Reply
#13
(2017-11-27, 20:30)Stereodude Wrote:
(2017-11-27, 19:19)Martijn Wrote: So should we take that as some snarky remark that we don't every gazillion features or combinations we have?
Could also be you're the only user out of the other millions using that feature.
No, you should take it as a question.  Do you have a system that takes previously identified bugs and adds them to automated regression testing to make sure they don't reappear?

And, If I'm really the only user of the feature, then how did it get fixed again on it's own between v17.3 and v17.6? 
No we don't have a system except the willingness of users to report if something is not working or again not working. To few members to check every single aspect again and again.

No idea how or why it got fixed in between. Sometimes it's by accident cause of some underlying code change
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#14
(2017-11-27, 20:35)Martijn Wrote: No we don't have a system except the willingness of users to report if something is not working or again not working. To few members to check every single aspect again and again.

No idea how or why it got fixed in between. Sometimes it's by accident cause of some underlying code change 
Well, it seems I owe you an apology.  The behavior I observed with 17.3 does actually still exist in 17.6, but it's not really the same as what I reported before.  At first glance it seemed very similar to what I saw with 16.1, but it's really not.  In fact I'm not sure its even a bug in Kodi.  It may be a bug with Yatse.  When I start the smart playlist by navigating through the UI with a keyboard or IR remote the playlists are random.  If I start the smart playlist from Yatse (in the playlist view) the playlist is not random but the tracks end up sorted/grouped first by Album then by disc/track number. Confused

I don't know if Yatse is sending extra "sorting" commands to Kodi, or if the way it controls Kodi goes through a different control path from the UI that yields different results.
Reply
#15
(2017-11-28, 19:20)Stereodude Wrote: Well, it seems I owe you an apology.  The behavior I observed with 17.3 does actually still exist in 17.6, but it's not really the same as what I reported before.  At first glance it seemed very similar to what I saw with 16.1, but it's really not.  In fact I'm not sure its even a bug in Kodi.  It may be a bug with Yatse.  When I start the smart playlist by navigating through the UI with a keyboard or IR remote the playlists are random.  If I start the smart playlist from Yatse (in the playlist view) the playlist is not random but the tracks end up sorted/grouped first by Album then by disc/track number. Confused

I don't know if Yatse is sending extra "sorting" commands to Kodi, or if the way it controls Kodi goes through a different control path from the UI that yields different results. 
 This is what I suspected, but your tone is so off previously I was not going to bother to reply.

There is a longstanding (introduced in 2011 while fixing something else) bug in the JSON API (not Yatse), that causes smartplaylists, playlists (.m3u files etc.) and upnp lists to always have the same filename based sort. This has been fixed for v18 (not v17 because that is now frozen).
Reply

Logout Mark Read Team Forum Stats Members Help
BUG: Smart Playlists are not so smart; random isn't random.0