Use network drive for Jukebox Music

The Jukebox Music Skill provides local media playback. Currently this is using MPD to play media from a USB drive plugged into the Mark II, however many people have their libraries already available on the local network.

It would be great to be able to point to an existing library / network drive for this media.

MPD provides a few plugins to access files on a network including:

Also requested by:

Outside of using what’s built in to MPD, couldn’t we just add a samba mount in the startup? Would it find files there? It would be /mnt/samba/myshare…

If you create this mount in a sub-directory of /media, the Jukebox skill will pick it up automatically.

I wondered about where it was looking, the post about it said it would find music mounted on the device. I will have to set up SSH and give it a try. Thanks!
What colors do you see if you play Scott Walker on your MK 2 I wonder…

hmm. I can’t get the share to mount, it says “cifs filesystem not supported by the system” in the terminal… I don’t know what kind of filesystem it’s supposed to be in /media…
I’m way out of my depth here now it appears.

It wont let me mount an NFS partition either.

So I installed nfs-utils, and started the systemd task, but then the mount hung.

Here’s my commands:

sudo mkdir /media/music
sudo apt install nfs-utils
sudo systemctl start nfs-utils.service  
sudo systemctl status nfs-utils.service
sudo mount -t nfs 192.168.100.92:/music/files /media/music

All within the mycroft container.

Here’s the status for the nfs-util:

● nfs-utils.service - NFS server and client services
     Loaded: loaded (/lib/systemd/system/nfs-utils.service; static; vendor preset: enabled)
     Active: active (exited) since Sun 2022-11-13 10:01:18 UTC; 6s ago
    Process: 949 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 949 (code=exited, status=0/SUCCESS)

Nov 13 10:01:18 localhost.localdomain systemd[1]: Starting NFS server and client services...
Nov 13 10:01:18 localhost.localdomain systemd[1]: Finished NFS server and client services.

The mount just hangs (and then the connection times out)

I have an emby VM which is able to connect (and is currenlty connected).

1 Like

I don’t really know much about how to work with containers, I suspect there’s something about that we’re missing… maybe gez can help us out with this?
Thanks for letting me know, I was going to try with the NFS today.

Update on the NFS mount.

I can get my NFS filesystem to mount only if I edit the /etc/resolv.conf to contain the local network domain name and DNS:

nameserver 192.168.xxx.x (actual numbers used here!)
search bjsystems.co.uk

Then the NFS will mount using:

mount -t nfs filestore:/music /media/nfsmusic

However I have been unable to get mpc/mpd to update itself to import the music.

I could add the mount to the /etc/fstab but of course the DNS would be wrong and the mount would fail. I’ll continue to experiment.

I’ve also tried using a usb drive with music on. With a full drive of music (1800 tracks), the drive (USB 2.0) seems to cause problems - I suspect that it is drawing too much current and causing the Pi to mis-behave, I’ve had this experience before with Pis. With only a few music files, it seems to work. The music is imported to mpd with when the drive is plugged in OR when the MarkII is powered up. Once again I could not get it to update other than plugging in the drive or re-booting. I’ve ordered some usb3.2gen1 drives like the supplied boot drive to try.

ok, found that you have to restart mpd after the mount before running the update:

systemctl restart mpd
mpc update

Takes quite a long time to run the import.

what device are you actually using here ? Just curious as I’m running dinkum which doesn’t seem to install pretty much any apt package.
sudo apt install nfs-utils
Reading package lists… Done
Building dependency tree… Done
E: Unable to locate package nfs-utils
I did check out mpd, the /etc/mpd.conf shows the following basic configs:
music_directory “/media”
playlist_directory “/var/lib/mpd/playlists”
db_file “/var/lib/mpd/tag_cache”
log_file “/var/log/mpd/mpd.log”
The tag_cache file ends up as a gzipped text file of all that it finds. Copied it locally and gunzipped it.
My usb holds about 1200 tracks, which it sucked in very quickly, tho have to remove the media usb at boot, otherwise the machine won’t boot …
Tried adding an m3u playlist (which apparently mpd is normally happy with), but couldn’t get mycroft to play it. Guess thats buried in the skill somewhere.
Would like to be able to install stuff with apt, tho. Are you running core or have you added repositories ?
Thanks. nfs would be the way for me to go as well.

1 Like

Didi you run apt update first?

no, I hadn’t. Assumed any updates were coming automagically from mycroft ?
However, did that. and the apt upgrade. Got some perl stuff etc.
Afterwards (and after a reboot) still got the
E: Unable to locate package nfs-utils
message.
However was able to now install some of my regular favorite tools, file, lsof, locate etc, which were all coming up with similar “unable to locate packages” before.
So many thanks for that.
Am now a little bewildered, either it has the correct repositories, and can find the packages, or it can’t. Did the “apt update” update the repositories ?
thanks again

btw, am running dinkum on the Mark2

I’m running MarkII under Dinkum, straight out of the box.

(.venv) mycroft@localhost:~$ apt list | grep nfs-

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnfs-dev/focal 4.0.0-1 arm64
libnfs-utils/focal 4.0.0-1 arm64
libyanfs-java/focal 0.0+cvs20070825-4 all
nfs-common/focal-updates,now 1:1.3.4-2.5ubuntu3.4 arm64 [installed]
nfs-ganesha-ceph/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-doc/focal-updates 3.0.3-0ubuntu3.2 all
nfs-ganesha-gluster/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-gpfs/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-mem/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-mount-9p/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-nullfs/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-proxy/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-rados-grace/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-vfs/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha-xfs/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-ganesha/focal-updates 3.0.3-0ubuntu3.2 arm64
nfs-kernel-server/focal-updates 1:1.3.4-2.5ubuntu3.4 arm64
python3-nfs-ganesha/focal-updates 3.0.3-0ubuntu3.2 all
unionfs-fuse/focal 1.0-1ubuntu2 arm64
(.venv) mycroft@localhost:~$ 

Looks like you might have to install nfs-common. No idea why nfs-utils worked for me.

Am struggling to get anything played by the skill.

Here’s a dump of the journal shgowing it having found “Something”, but not playing it.

Nov 21 10:32:19 localhost.localdomain python[601]: INFO:homescreen.mark2:Displaying the Home Screen idle screen.
Nov 21 10:32:19 localhost.localdomain python[601]: INFO:mycroft.util.log:Home screen wallpaper set to /opt/mycroft-dinkum/skills/homescreen.mark2/ui/wallpapers/moon.png
Nov 21 10:32:19 localhost.localdomain python[360]: DEBUG:mycroft.util.log:Starting session: 1675f32b-6132-4404-bb08-e8e61d8fd1a8
Nov 21 10:32:19 localhost.localdomain python[360]: DEBUG:mycroft.util.log:Disabled idle timeout
Nov 21 10:32:19 localhost.localdomain python[360]: DEBUG:mycroft.util.log:Completed action for session 1675f32b-6132-4404-bb08-e8e61d8fd1a8: ShowPageAction(namespace='homescreen.mark2.mark_ii_idle.qml', page='file:///opt/mycroft-dinkum/skills/homescreen.mark2/ui/mark_ii_idle.qml', data={'showAlarmIcon': False, 'homeScreenTemperature': 6, 'homeScreenWeatherCondition': 'file:///opt/mycroft-dinkum/skills/weather.mark2/ui/images/partial_clouds_day.svg', 'isMuted': False, 'mycroftContainerBuildDate': '', 'homeScreenTime': '10:32', 'homeScreenDate': 'Monday 21 Nov', 'wallpaperPath': '/opt/mycroft-dinkum/skills/homescreen.mark2/ui/wallpapers/moon.png'})
Nov 21 10:32:19 localhost.localdomain python[641]: DEBUG:enclosure:Idle was handled by homescreen.mark2
Nov 21 10:32:19 localhost.localdomain startx[675]: Arrived mycroft.gui.list.insert, delegateUrls are ("file:///opt/mycroft-dinkum/skills/homescreen.mark2/ui/mark_ii_idle.qml")
Nov 21 10:32:19 localhost.localdomain python[360]: DEBUG:mycroft.util.log:Cleaning up ended session: 1675f32b-6132-4404-bb08-e8e61d8fd1a8
Nov 21 10:32:19 localhost.localdomain startx[675]: Both point size and pixel size set. Using pixel size.
Nov 21 10:32:19 localhost.localdomain startx[675]: Both point size and pixel size set. Using pixel size.
Nov 21 10:32:19 localhost.localdomain startx[675]: Both point size and pixel size set. Using pixel size.
Nov 21 10:32:19 localhost.localdomain startx[675]: Both point size and pixel size set. Using pixel size.
Nov 21 10:32:19 localhost.localdomain startx[675]: Both point size and pixel size set. Using pixel size.
Nov 21 10:32:19 localhost.localdomain startx[675]: Created a new DelegateLoader DelegateLoader(0x55c158fe00) which will load QUrl("file:///opt/mycroft-dinkum/skills/homescreen.mark2/ui/mark_ii_idle.qml") for the skill "homescreen.mark2.mark_ii_idle.qml"
Nov 21 10:32:19 localhost.localdomain startx[675]: QQuickItem::stackBefore: Cannot stack Control_QMLTYPE_12_QML_22(0x55c1844320, parent=0x55c19545d0, geometry=0,0 800x480) before QQuickRepeater(0x55c1443280), which must be a sibling
Nov 21 10:32:32 localhost.localdomain python[11013]: volume: n/a   repeat: off   random: off   single: off   consume: off
Nov 21 10:32:32 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'artist', 'something']
Nov 21 10:32:32 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'album', 'something']
Nov 21 10:32:32 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'title', 'something']
Nov 21 10:32:32 localhost.localdomain python[601]: DEBUG:play-music.mark2:Result: [Song(artist='Scott Joplin', album='The Best of Scott Joplin', title='Something Doing', duration_sec=167, file_path=PosixPath('/media/nfsmusic/files/Scott Joplin/The Best of Scott Joplin/Disc 1 - 20 - Something Doing.ogg')), Song(artist='The Beatles', album='1+', title='Something', duration_sec=181, file_path=PosixPath('/media/nfsmusic/files/The Beatles/1+/1-24 Something.mp3')), Song(artist='The Beatles', album='Abbey Road', title='Something', duration_sec=183, file_path=PosixPath('/media/nfsmusic/files/The Beatles/Abbey Road/02 Something.mp3'))]
Nov 21 10:32:32 localhost.localdomain python[601]: INFO:play.mark2:Reply from play-music.mark2: something (confidence=1.0)
Nov 21 10:32:33 localhost.localdomain su[11322]: (to mycroft) root on none
Nov 21 10:32:33 localhost.localdomain su[11322]: pam_unix(su-l:session): session opened for user mycroft by (uid=0)
Nov 21 10:32:33 localhost.localdomain systemd[1]: Started Session c2 of user mycroft.
Nov 21 10:32:47 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:32:47 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/skill/settings HTTP/1.1" 304 0
Nov 21 10:32:47 localhost.localdomain python[641]: DEBUG:mycroft.util.log:No skill settings changes since last download
Nov 21 10:32:47 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Scheduling settings download in 60 second(s)
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Downloading remote settings
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/setting HTTP/1.1" 304 0
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/location HTTP/1.1" 304 0
Nov 21 10:33:01 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Scheduled download of remote config in 60 second(s)
Nov 21 10:33:47 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:33:47 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/skill/settings HTTP/1.1" 304 0
Nov 21 10:33:47 localhost.localdomain python[641]: DEBUG:mycroft.util.log:No skill settings changes since last download
Nov 21 10:33:47 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Scheduling settings download in 60 second(s)
Nov 21 10:34:01 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Downloading remote settings
Nov 21 10:34:02 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:34:02 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/setting HTTP/1.1" 304 0
Nov 21 10:34:02 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.mycroft.ai:443
Nov 21 10:34:03 localhost.localdomain python[641]: DEBUG:urllib3.connectionpool:https://api.mycroft.ai:443 "GET /v1/device/53dfd735-76ce-4b1b-8df5-21db43185eae/location HTTP/1.1" 304 0
Nov 21 10:34:03 localhost.localdomain python[641]: DEBUG:mycroft.util.log:Scheduled download of remote config in 60 second(s)


Found this in the mpd log:

Nov 21 10:32 : client: [46] opened from 127.0.0.1:49824
Nov 21 10:32 : exception: Failed to open /media/nfsmusic/.Trash-1000: Permission denied
Nov 21 10:32 : client: [46] closed

Eliminated the “Failed to Open” error, by extending the mounted file to the actual music directory (so there is no Trash directory seen). However still not getting the tracks played, despite this:

Nov 21 11:12:18 localhost.localdomain startx[675]: Created a new DelegateLoader DelegateLoader(0x55c15bb090) which will load QUrl("file:///opt/mycroft-dinkum/skills/homescreen.mark2/ui/mark_ii_idle.qml") for the skill "homescreen.mark2.mark_ii_idle.qml"
Nov 21 11:12:18 localhost.localdomain startx[675]: QQuickItem::stackBefore: Cannot stack Control_QMLTYPE_12_QML_22(0x55c175d060, parent=0x55c1885840, geometry=0,0 800x480) before QQuickRepeater(0x55c17c01e0), which must be a sibling
Nov 21 11:12:29 localhost.localdomain python[12401]: volume: n/a   repeat: off   random: off   single: off   consume: off
Nov 21 11:12:29 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'artist', 'something']
Nov 21 11:12:29 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'album', 'something']
Nov 21 11:12:29 localhost.localdomain python[601]: DEBUG:mycroft.util.log:['mpc', '-h', '127.0.0.1', 'search', '--format', '%artist%\t%album%\t%title%\t%time%\t%file%', 'title', 'something']
Nov 21 11:12:29 localhost.localdomain python[601]: DEBUG:play-music.mark2:Result: [Song(artist='Scott Joplin', album='The Best of Scott Joplin', title='Something Doing', duration_sec=167, file_path=PosixPath('/media/nfsmusic/Scott Joplin/The Best of Scott Joplin/Disc 1 - 20 - Something Doing.ogg')), Song(artist='The Beatles', album='1+', title='Something', duration_sec=181, file_path=PosixPath('/media/nfsmusic/The Beatles/1+/1-24 Something.mp3')), Song(artist='The Beatles', album='Abbey Road', title='Something', duration_sec=183, file_path=PosixPath('/media/nfsmusic/The Beatles/Abbey Road/02 Something.mp3'))]
Nov 21 11:12:29 localhost.localdomain python[601]: INFO:play.mark2:Reply from play-music.mark2: something (confidence=1.0)
N

Doing it on the command line:

(.venv) mycroft@localhost:~$ mpc search title Something
nfsmusic/Scott Joplin/The Best of Scott Joplin/Disc 1 - 20 - Something Doing.ogg
nfsmusic/The Beatles/1+/1-24 Something.mp3
nfsmusic/The Beatles/Abbey Road/02 Something.mp3
(.venv) mycroft@localhost:~$ 

Is the Jukebox skill available on mycroft-core? If so, where?

Thanks.

-Mike Mac

nfs-common wasn’t initially installed on my mark2. Did get that on, but still no package nfs-utils to be installed.
Will check in a while to see if I can mount my nfs media. Got distracted by the world cup !
Thanks for all the info tho

I think I must have tried nfs-utils then nfs-common and the latter installed, but then I coped the wrong command on to the posting. Sorry for the confusion.

I’m Keen to hear how you get on with the nfs mount.

Yes, jukebox is the skill that I am trying to use to play my music. It is integrated by MyCroft into the MarkII core, I’ve not found a trigger word for it yet, apart from maybe “music”!