Randomness?

Need help with MPD?
Post Reply
iconoclasthero
Posts: 3
Joined: August 29th, 2018, 1:12 pm

Randomness?

Post by iconoclasthero » August 29th, 2018, 2:02 pm

I was hoping someone could tell me if the random playback feature of MPD is truly random. Is there some way to introduce or increase the randomness? I seem to hear many of the same songs out of a large collection and I'm wondering if MPD has poor randomness or if it is just chance.

I could—but haven't—pulled my logs to count the occurrences of songs to see if there really is bias or if it is random. The problem with this approach, of course, is that it will include all of the things played on random as well as those that I've asked it to play. Obviously, this will cause problems with the count and those outliers would need to be removed ...unless I could somehow extract just the songs played on random.

max
Forum team
Posts: 853
Joined: January 15th, 2013, 3:43 pm

Re: Randomness?

Post by max » August 29th, 2018, 2:18 pm

No, it's not truly random. It uses a pseudo random number generator (PRNG). True randomness requires attaching a source for random entropy to your computer (i.e. a piece of hardware). But that's not a problem - pseudo-randomness is good enough for nearly everything.

MPD uses a Mersenne Twister PRNG, seeded from your kernel's random pool, for both "random" mode and the "shuffle" command. That should be indistinguishable from true randomness.

Subjective evaluation of randomness is nearly impossible, because the human brain is trained by evolution to see patterns where there are really none.

Btw. very old MPD versions used to use a very poor PRNG. Maybe you're using such an old version. I don't know, because you posted no information at all.

iconoclasthero
Posts: 3
Joined: August 29th, 2018, 1:12 pm

Re: Randomness?

Post by iconoclasthero » August 29th, 2018, 3:10 pm

I hadn't included the version information because *I* knew it was the current repo version, lol:

Code: Select all

sudo apt install mpd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mpd is already the newest version (0.19.12-1).
on

Code: Select all

Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.5 LTS
Release:	16.04
Codename:	xenial
I don't know if the repo version that is going on three years old is a "very old MPD version" but I doubt it (since you didn't specify where "modern" version of MPD start).

I'm well aware of the human cognitive bias for seeking intentionality, agency, and patterns. I've studied cognitive psychology, evolutionary psychology, behavioral economics, and neuroeconomics fairly extensively this year. Regardless, it certainly seems like there are songs that are played more often than others.

I've used shuffle, but then it makes finding songs in the playlist impossible. Does random start at the same place every time or something? Can MPD log when random mode is toggled?

iconoclasthero
Posts: 3
Joined: August 29th, 2018, 1:12 pm

Re: Randomness?

Post by iconoclasthero » August 29th, 2018, 3:13 pm

I compiled and installed 0.20.21 and now I can no longer connect to MPD so for the time being it's a moot point!

max
Forum team
Posts: 853
Joined: January 15th, 2013, 3:43 pm

Re: Randomness?

Post by max » August 29th, 2018, 4:49 pm

There was a serious shuffle/random problem fixed in MPD 0.14.1 (9 years ago), and MPD 0.18 switched to a PRNG with much more state (5 years ago).
Can MPD log when random mode is toggled?
In "verbose" mode, MPD logs all commands, which includes the "random" command. But how does that help you? Since it's you who sends this command, you know already.

Each time you enable "random", MPD shuffles the internal queue order. Additionally, each time the queue completes playback, MPD shuffles again, so the next time you play the queue, it is played in a different order.

Maybe there's something wrong with how you use MPD. How do you?

max
Forum team
Posts: 853
Joined: January 15th, 2013, 3:43 pm

Re: Randomness?

Post by max » August 29th, 2018, 4:54 pm

max wrote:
August 29th, 2018, 4:49 pm
Each time you enable "random", MPD shuffles the internal queue order. Additionally, each time the queue completes playback, MPD shuffles again, so the next time you play the queue, it is played in a different order.
Forgot one: each time you stop playback (with the "stop" command), MPD shuffles the internal order as well.

Post Reply