RANDOM PLAY whole library and AUTOSTART

when selecting shuffle, the pimusicbox only seems to play tracks from the actual folder.
is there a way to random play tracks from the whole library?
(the library contains the tracks from a connected windows share)

after boot, i first have to select the tracks to play.
is there a way to autostart playing all tracks from the library in a random order after startup?


1 Like

It will shuffle what is in your queue (AKA current playlist). If your entire library is in the queue then it will shuffle your entire library.

Yes, after boot you must add all tracks you want to the queue. And then you would have to shuffle the queue (or enable random mode - these are not the same thing). I think there is already a thread on here somewhere discussing such a plan and it involves first creating a m3u playlist containing all the tracks in your library, and then adding that playlist to the queue on startup.

thanx for the info.
so how can i get the pimusicbox to generate a playlist containing the complete library?
in fact, i didn’t manage to generate any playlist ;-(

I don’t think Musicbox does produce a playlist. I have written out how I do it, it’s probably not the most effective but it works. It is written assuming you are using a windows pc and WinSCP - the idea will be the same.

To make playlists.

Playlists are stored as .m3u files.

Open and connect WinSCP

In the R/H Pane (the Raspi) click through until you find the
album you want.

From the top, double click Music – Musicbox -Artist –Album

Make sure tracks are in correct order by clicking on the
‘Name’ option at the top

Click on the Track at top of list

Hold down Ctrl & A on your keyboard to select all tracks

Hold down Ctrl and use mouse to deselect any files not

Right click on highlighted files,

Choose ‘File Names’ then choose ‘Copy to clipboard (Include

To save as an .m3u file

Open a Notepad document on your computer.

Paste the copied file names into it.

To make it tidy do ‘Edit’ ‘Replace’ Type “ (Double Quotation
Marks) into the ‘Find What’ box then click ‘Replace All’

Save this to the Desktop as ‘Paul Simon – 50 Glorious
Years.m3u’ or however you want the playlist to appear.

Go back to WinSCP- if you are still in the MusicBox section
double click on the top folder (with an arrow on it) until you come back to the
Home or Root folder. It should have a folder called ‘bin’ at the top.

Double click ‘var’

Double click ‘lib’

Double click ‘mopidy’

Double click ‘Playlists’

Find the playlist on your computer desktop, click, hold and
drag to the playlists section.

Once in the playlist
section, click the folder next to drop down box and you are offered the chance
to add that path to the list – saves time later when adding any more.

Go back to the web interface, ‘System’ and select ‘reboot’

If you haven’t added any new music it would be worth
changing the* option in setting to not scan each time.

When the system comes up, have a look in the playlist option
and your new playlist will be in there. You need to do the same for each playlist you want.

You can make a mixed playlist of tracks in the same way, and
move items round the list but it’s quite time consuming.

Using the search functionality shows the post I was referring to: Playlist Refresh

Another way to make a giant playlist with all the files from some location is by the following command in terminal:

find /path/of/music/* -type f > /var/lib/mopidy/playlists/nameofplaylist.m3u

This command will list all files (but not directories or devices names) in all folders (recursively at lower paths). It is important to use absolute paths, as the command find outputs absolute paths when the input path is absolute also, and because it is convenient to get the .m3u list in the correct folder.

If you then desire to edit the .m3u list (maybe file order, or it has some errors in it or something, then use nano editor.

nano /var/lib/mopidy/playlists/nameofplaylist.m3u

EDIT: this command doesn’t escape empty spaces, so if the folder name has a space, this space character will be listed in the path on the .m3u. I don’t know if that should be like that or not.