feature request: random play

259 views
Skip to first unread message

marcus

unread,
Jul 29, 2020, 7:24:40 AM7/29/20
to Brennan Forum
hi to all.

while listening to the one specific album i like the most at the moment my B2 always jumps to the same other album at the end.  it's annoying.  i'm told, the raspberry pi has a true random number generator onboard.  great.  on the other hand i've read somewhere that the random order of the albums is just calculated once by the B2 which is totally fine in most cases.

if anyone has in mind how to "tell" the B2 manually to recalculate this so called "random" order of the albums i would accept it as a workaround for the moment.  but i would really prefer a true random order of the albums - of course =;^)

ober!schöne grüße,
marcus.

Mark Fishman

unread,
Jul 29, 2020, 7:13:08 PM7/29/20
to Brennan Forum
Ah, yes, the "shuffle the albums" (not the tracks) that I've suggested/asked for several times...

The B2 always plays albums in the order that they are listed in its internal database, b2db, which is for the most part the order they were loaded in. It's not random, it's just not what I'd call "orderly" (to a person, that is).

PMB

unread,
Jul 30, 2020, 4:56:16 AM7/30/20
to Brennan Forum
Hi Marcus,

Mark is right and shuffle albums is on the wishlist.

You could enable Classical mode (Settings menu) which will make the B2 stop playing after it has finished the selected album. You could then select another one.

Paul
Brennan Support.

marcus

unread,
Jul 30, 2020, 8:11:15 AM7/30/20
to Brennan Forum
thank you mark.  not being the only one complaining about this makes life easier - at least a bit.

sorry paul.  your suggestion is far away from what i would call a workaround or solution.  this would force me to select every album.  a true random shuffle of all albums is the opposite of that!  if the algorithm "chooses" wrong, i have to decide anyway!  but always the same wrong album is annoying.

is there any chance to user-vote for some most preferred features on the wishlist?  out of my scripting experiences i know that some features are easier to achieve than others but some other challanges are more interesting to the programmer.  (btw: i wouldn't have voted for the spotify-feature for instance.)  a "re-order the internal database on demand" button would do it for me at the moment =;^)

ober!schöne grüße,
marcus.

Daniel Taylor

unread,
Jul 30, 2020, 8:22:59 AM7/30/20
to Brennan Forum
I have an idea about how this could be implemented.  Instead of having the Random button just toggle between off and on, clicking it could open a drop down menu box with selections for Off, Track, Album, or Artist.  Would that make everyone happy?

In the meantime, I'm happy to just choose the next album I want to listen to.

Mark Fishman

unread,
Jul 30, 2020, 9:21:54 AM7/30/20
to Brennan Forum
Is it too cynical to say that there is nothing that would make EVERYONE happy? :^)

> Instead of having the Random button just toggle between off and on, clicking it could open a drop down menu box with selections for Off, Track, Album, or Artist.

Now you have to explain to people who are confused (as has happened with this topic here on this very forum): 
 - "Off" means do not shuffle anything; that's clear
 - "Track" means shuffle all tracks in all albums and artists so that everything plays scrambled? (my pejorative term, sorry) IOW, the current behavior for "Random ON"?
 - "Album" COULD mean shuffle tracks within only one album so that that album plays in a random order but doesn't intermix tracks from a different album or artist -- this is what PMB thought I meant originally, but seems to be covered already by adding one album to a temporary playlist and playing that playlist with Random ON.
 - "Artist" COULD mean shuffle tracks within a single artist, or it COULD mean shuffle Albums within an artist, or -- what did you have in mind?

I have previously suggested a different method of altering the current behavior without adding a new drop down, by making the "Random" and "Classical" options interact slightly differently from the way they interact now.

CURRENT BEHAVIOR is:
 - if "Classical" is OFF, turning on "Random" shuffles all tracks fro all albums (leaving "Random OFF would play everything in b2db sequence).
 - if "Classical" is ON, turning on "Random" does absolutely nothing -- it makes no difference in this case whether Random is on or off, one album plays straight through and then playback stops.

MY SUGGESTION is:
 - if "Classical" is OFF, turning on "Random" shuffles all tracks fro all albums (leaving "Random OFF would play everything in b2db sequence); i.e., the same as the current behavior.
 - if "Classical" is ON, turning on "Random" would shuffle ALBUMS, leaving tracks in the "normal" playback sequence within each album, so that instead of playback stopping at the end of a single album, a "randomly chosen" album would play next (instead of the one in b2db sequence).

My reason for suggesting this is that (a) both variables already exist in the Brennan software, it's just that one of them effectively turns the other one OFF instead of making it shuffle at a different level; and (b) the "shuffle" capability already exists for shuffling at the "track" level, so it should be a relatively minor matter to make it function "one level up" in the folder hierarchy, i.e., albums instead of tracks.

I realize that this smacks of that dreaded managerial comment to a programmer, "All you have to do is...", so I leave it to Martin to decide what actually would be easier.

Cheers -- m.

Daniel Taylor

unread,
Jul 30, 2020, 10:29:19 AM7/30/20
to Brennan Forum
Slippery slope.  I knew the questions that would arise when I posted.  Now we begin to see the problems with adding features that cannot possibly please everyone.  But if you do it exactly the way I want it, then I'll quit complaining.

marcus

unread,
Jul 30, 2020, 5:25:59 PM7/30/20
to Brennan Forum
well.  my B2 just starts one album after the other.  that's totally fine for me.  i'm complaining on having always the same order of all albums all the time.  i would like to be able to re-order the internal database by clicking a button (or passively with every reboot).  that's it.  no need for shuffling all individual songs - this is called "radio" with a much bigger library and some spoken words, adds, news and weather.  disabling single songs or albums or artists would be fine as an additional option (and is already on the wishlist too).  but step by step: re-order the internal database first!  my vote.

oh.  just a fun-fact: the reverse order of the albums seems to differ from the forward order.  if i don't like the actual album i click the "back" button in the UI and get the first song of a different album than before.  strange.  but a kind of what i would call a workaround.

take care!

ober!schöne grüße,
marcus.

Daniel Taylor

unread,
Jul 30, 2020, 7:25:13 PM7/30/20
to Brennan Forum
I recall reading about someone who had re-ordered the b2db file.  I don't remember if he wrote a program to automate it, or if he did it manually.  A search on b2db might turn it up.

Mark Fishman

unread,
Jul 30, 2020, 8:00:49 PM7/30/20
to Brennan Forum
That's probably Andy C. His program sorts it, it doesn't randomize it.

marcus

unread,
Jul 31, 2020, 7:01:17 AM7/31/20
to Brennan Forum
a pretty good hint.  thank you, daniel and mark.  it sounds like the B2 should be able to re-order this b2bd-file by running a sh- or bash-script or something ...  hm, i will investigate =;^)

ober!schöne grüße,
marcus.

marcus

unread,
Jul 31, 2020, 10:49:05 AM7/31/20
to Brennan Forum
okay.  as far as i see the b2db file holds a text based table of contents of all albums hold on the B2 sorted by the creation time of the album folders on disk.  i suppose this list has no influence on the playback order at all.  there is no indication for.  unfortunately.  it's a human readable lightweight representation of your music library on the B2 to seek the content by name via UI without operating on the filesystem itself.  my B2 plays one album after the other but different to the order in which i've loaded them.  which means there should be another kind of procedure or database determining the playback order.

Daniel Taylor

unread,
Jul 31, 2020, 2:36:19 PM7/31/20
to Brennan Forum
Hmmm... That's new information to me.  I think most of us thought that when the B2 was not playing in alphabetical order, it would play in the order the album appears in the b2db file.  Now I don't know.

Peter Lowham

unread,
Jul 31, 2020, 4:28:17 PM7/31/20
to Brennan Forum
Hi Guys,

The 'b2db' file is an internal reference database which is built by the B2 when 'Scan Disk' is run.  The order of the 'b2db' file is based on the order in which the the CDs were loaded (or music files loaded from an external source) from the time that the start date that ripping was first started.

Although the 'Export' function does not use the 'b2db' file, it does follow the order of the 'b2db' file when it is backing up.  That is purely because 'Export' also starts at the first ripped file and works its way to the last file in the order of original ripping. Looking the the 'b2db' file during an 'Export' can be a useful way of measuring progress during that process.

Regards,
Peter.









Les Stanley

unread,
Jul 31, 2020, 6:50:16 PM7/31/20
to Brennan Forum
Random Play, my favourite subject. There's definitely room for improvement and although each time it's mentioned, the response is "it's on the wishlist" there seems to be little change.
Of course, it's Martin Brennan's product and I guess it's his decision as to which features are added. I don't need Spotify either or the youtube feature but I guess some find that useful. 
Still, as I've said before there obviously is some kind of algorithm for random play and I would have thought that it should not require a huge amount of work to improve it.
Meanwhile, back to the Playlists.

Daniel Taylor

unread,
Jul 31, 2020, 8:06:47 PM7/31/20
to Brennan Forum
At this point, the wish list is quite long.  I guess the items that get the most attention in the forum might be more likely to be addressed sooner than later.

AndyC

unread,
Aug 1, 2020, 7:27:00 AM8/1/20
to Brennan Forum
Hi Marcus,

What a great idea - randomising the albums but not the track. Until this gets to the top of the Brennan wishlist, I've put together a quick freeware program that does just this. To use it, you download b2db in the usual way, run it through this program then upload the new version & reboot. All the albums are now in a random order but all the tracks within each album play in the correct order. I'm using it now and it's great - discovering good albums I'd forgotten about.

The download also includes a ReadMe file. Here's the link:

The only slight downside is that, to re-randomise the order, you have to go through the whole procedure again. But, if you have a lot of albums, you won't need to do that very often.

(By the way, your AntiVirus will be very wary of the download as it contains a .exe file. Tell it that it's safe and once you've run it the 1st time, your AV will back off and not interfere any more.)
-----------------------------------------
The DropBox link also includes my A-Z Sorting & Back Up Analysis Program. If you plug a recent Back Up into your laptop and run the program, it'll tell you what tracks are missing from the Back Up and what extra unwanted tracks are in it (likely left overs after you've done some editing). I recently discovered an old Back Up so, rather than deleting it and starting the 36 hour Export process again, I freshened it up quickly from my b2 and ran it through  my program. A short bit of editing out of the problems later and it was 'fit for purpose'.

All the best, Andy

Daniel Taylor

unread,
Aug 1, 2020, 1:08:28 PM8/1/20
to Brennan Forum
That's terrific, Andy.  Big thanks for doing that and making it available.

One caution to point out:  If you run the Scan Disk command, it will overwrite the b2db file, thereby undoing the new random order.

marcus

unread,
Aug 2, 2020, 9:27:32 AM8/2/20
to Brennan Forum
well.  i'm confused at this point.  first things first: thank you, andyC.  BUT ...  as i already wrote before my B2 plays all albums in a pre-defined kind of random order which is NOT represented by the b2db-file.  it would be great to compare our B2 settings.  the shuffle-button of the UI is NOT active in my case.  some settings out of the b2settings file:

...
Segue
Off
...
Sorted
On
...
Classical
0
...

no idea, which other settings are related.

Brian R

unread,
Aug 2, 2020, 9:57:02 AM8/2/20
to Brennan Forum
Hi Marcus

Is it playing the albums in Alphabetic order ? Mine does when left to it's own devices.

Brian

marcus

unread,
Aug 2, 2020, 10:49:23 AM8/2/20
to Brennan Forum
no.  mine is playing in some predefined order which i'm not able to comprehend.  non-alphabetical.  not in the order of digitization (i'm not using the B2 for it).  no idea.  it's jumping from album to album mixing up the artists - thus it's near to what i would call "shuffle between all albums on the B2".  my one and only complaint is that the order is reproducable every time.  it's always the SAME order.

if i could force my B2 to the behavior others describe - shuffle defined by the b2bd file - i would try to write a small script randomizing the b2db file directly on the B2.  should be no rocket-science.  the b2db file is text based, well structured with clear keywords to split ...  if i should stumble there is andyC's program running off-B2 as a fallback.  but as long as the b2db file is NOT linked to the shuffle on my B2 it doesn't make sense.  ... and this is why i'm confused.  i will investigate a bit more.  maybe i've overlooked something.

ober!schöne grüße,
marcus.

Daniel Taylor

unread,
Aug 2, 2020, 1:20:57 PM8/2/20
to Brennan Forum
It seems that we need a Brennan representative to tell us what the thing is intended to do, design-wise.  Then we can figure out what else is needed.

marcus

unread,
Aug 21, 2020, 6:03:12 AM8/21/20
to Brennan Forum
hi.

the instructions of AndyC in another thread gave me the essential hint to switch the 'A-Z sorting' OFF in the UI.  this led to the expected behaviour.  last weekend i wrote a shell-script based at the B2 - there is no need to transfer the b2bd to another device.  the B2 is able to randomize the b2db file by it's own.  just get on your B2 via ssh (with putty or another terminal software) and start the script.  it will take about 10 seconds per 100 albums and writes a randomized b2db file.  a backup of the original b2db file is stored too.  as an add-on you can shift some of your albums to the end of your randomized b2db file by artist or artist/album tags - in my case all classic and spoken words.  if you like to use my script too, feel free to download it from the other thread.  be aware that you use it on your own risk.  be aware to logout after randomizing your b2db because you are operating as "root".  but you have to reboot anyway before your B2 recognizes the randomized b2db file.

have fun and take care.

ober!schöne grüße,
marcus.
Reply all
Reply to author
Forward
0 new messages