Page 1 of 1

Local Jukebox (No Internet) with PSA's in park setting

Posted: December 22nd, 2015, 2:56 am
by LaughterOnWater
Greetings! New to MPD, not new to linux.

I'm interested in a player/script that will do the following:
  • Start automatically at 9:00am, stop at 5:30pm.
  • Insert a series of general Public Service Announcements (PSA's) every few songs. (We're open from 9 to 5, Bathrooms are to the right, Join us for a celebration next week, etc.)
  • Give 20-minute and 10-minute about-to-close message, then a final we're-closed message at 5:00pm.
  • Play a random curated assortment of thousands of audio files located in a specific folder (holiday, summer, winter, etc.) on a local hard-drive/sd card, etc., separate from the folder of recorded PSA's.
  • Don't play the same song again until all other songs have been played, then randomly resort and start over.
  • No reliance on internet streaming. It would just be hooked into a local audio system.
  • Start where it left off in its current playlist after a power failure or from 5:00PM the previous night.
  • Check for new songs on resort and incorporate into play.
I've looked around at what's available, and most GUI's seem to be geared toward organizing things manually. I'd rather not insert skatey-eight PSA's manually throughout a day's worth of audio, nor play songs in the same order every day.

It doesn't have to have a GUI. It doesn't even have to be command-line interface. If it just managed itself that could work. However, if it had a bluetooth or wifi GUI for android, I wouldn't hate that. (For skipping a song, stopping playback, blacklisting from future playback, etc.)

I'm asking because, while I could probably write a thoroughly messy script that would work with mpd and mpc that will handle this in bash, I'd rather find out if someone has already invented the wheel -- or at least the hub and spokes -- before creating my own.

I could try this on any of the following:
  • Raspberry Pi 2 with Raspbian
  • OrangePi PC with Ubuntu Vivid Mate
  • Dell Vostro 100 with Linux Mint 17.3 (Half a GB of RAM. Ugh.)
I'd be grateful for any reasonable suggestions or ideas on where to start, what works, what to avoid, etc.

Cheers,

Chris

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: December 22nd, 2015, 8:02 am
by max
Much of that can be done by simple "mpc" commands run by a scheduling daemon such as "cron". That is, start playback is just "mpc play"; inserting an announcement is "mpc insert ...". Some of the rest is what MPD does already: after reboot, it resumes where it stopped last time; its random mode ensures that no file is played twice until all have been played. What it does not do is auto-insert new songs into the queue.

You're probably ending up writing a few shell scripts. There will be no user interface, though. One could write a complex special client with a user interface for your use case, and others would probably benefit from such a client as well, but I know no existing one.

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: December 22nd, 2015, 12:30 pm
by LaughterOnWater
max wrote:Much of that can be done by simple "mpc" commands run by a scheduling daemon such as "cron". That is, start playback is just "mpc play"; inserting an announcement is "mpc insert ...". Some of the rest is what MPD does already: after reboot, it resumes where it stopped last time; its random mode ensures that no file is played twice until all have been played. What it does not do is auto-insert new songs into the queue.

You're probably ending up writing a few shell scripts. There will be no user interface, though. One could write a complex special client with a user interface for your use case, and others would probably benefit from such a client as well, but I know no existing one.
max, thanks for this. It's good to know whether I'm covering new ground beforehand. I haven't installed this on any of my devices yet, but just looking around, I must be seeing an older version of the mpc man page, as it does not include the command "mpc insert". I'll check it out once I've installed mpd and mpc.

Example man pages:
http://linux.die.net/man/1/mpc
http://man.cx/mpc%281%29

Again, thanks!

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 16th, 2016, 2:19 am
by LaughterOnWater
Okay, I've followed the directions in the Ultimate MPD Guide.
I've also installed mpc, ncmpcpp and gmpc successfully.
I am impressed with the various clients. And commandline access is sweet.

I've got it set to play music out of ~/Music/ in the ~/.mpd/mpd.conf file.

Everything works as expected.

My PSA's are in a folder ~/PSAs/

This is what happens when I try an insert from ~/PSAs/

Code: Select all

~$ mpc insert ~/PSAs/Ten-Minutes-To-Close.mp3
Segmentation Fault
~$
I also tried:

Code: Select all

~$ mpc insert /home/chris/PSAs/Ten-Minutes-To-Close.mp3
Segmentation Fault
~$
I want all the mp3's in the ~/Music folder to be automatically added to the current playlist, saved as ~/.mpd/playlists/All Music.m3u. I've set mpc to play them randomly. This all works fine.

However, I want my PSA's to live in a different folder so they are not automatically added to playlist nor played randomly. I want these to be inserted at specific times via cron job. I don't want people to hear that that it's 10 minutes to closing in the middle of the day.

What's causing the segmentation fault? Manpage suggests

Code: Select all

insert <file>
meaning I should be able to specify a file the normal way.

Have I missed something? Is my syntax incorrect?

Cheers,

Chris

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 16th, 2016, 5:12 pm
by max
If you see a crash, report a bug. Posting on the forum will not solve your problem.
However in this case, I believe your mpc version is outdated. It is annoying that you don't post your version numbers when you post about a problem, though.

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 16th, 2016, 6:51 pm
by LaughterOnWater
max wrote:If you see a crash, report a bug. Posting on the forum will not solve your problem.
However in this case, I believe your mpc version is outdated. It is annoying that you don't post your version numbers when you post about a problem, though.
Max,

Thanks for your reply. Linux Mint latest, Cinnamon UI. I've tried it on both 32 and 64-bit Linux Mint for two different Dell Vostro 1000's. Please assume I have the lastest version of mpd and mpc, as Linux Mint is set to automatically install whatever needs updating. I have not seen any logs indicating there was an update that would affect the install I did this weekend.

Apparently, as of yesterday, there is a new version of mpd that fixes a non-linux problem.

As for bug tracking, I see a bug tracker for mpd. Do we use the same bug tracker for mpc? It is not readily apparent. Edit -- Okay I see where the MPC bug-tracker is.

Thanks for your patience.

Chris

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 17th, 2016, 11:28 am
by max
LaughterOnWater wrote:Please assume I have the lastest version of mpd and mpc, as Linux Mint is set to automatically install whatever needs updating.
I dont believe that.
According to http://community.linuxmint.com/software/view/mpd the latest MPD version in Linux Mint is 0.18.7, i.e. the package hasn't been updated for nearly 2 years!
Then there's http://community.linuxmint.com/software/view/mpc which states that the latest mpc version is 0.25, but that is 3 years old already!
Linux Mint is in a very bad state, its packages are not well-maintained. Don't use its MPD/mpc packages!

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 17th, 2016, 1:14 pm
by LaughterOnWater
max wrote:
LaughterOnWater wrote:Please assume I have the lastest version of mpd and mpc, as Linux Mint is set to automatically install whatever needs updating.
I dont believe that.
According to http://community.linuxmint.com/software/view/mpd the latest MPD version in Linux Mint is 0.18.7, i.e. the package hasn't been updated for nearly 2 years!
Then there's http://community.linuxmint.com/software/view/mpc which states that the latest mpc version is 0.25, but that is 3 years old already!
Linux Mint is in a very bad state, its packages are not well-maintained. Don't use its MPD/mpc packages!
Sweet! Thanks. I had no clue. So I need to compile these myself?
Edit: I've downloaded and compiled mpd and mpc.

How do I fix this?

Code: Select all

~ $ mpd --version
Music Player Daemon 0.19.12

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Database plugins:
 simple proxy

Storage plugins:
 local

Decoders plugins:
 [dsdiff] dff
 [dsf] dsf
 [pcm]

Output plugins:
 null fifo oss httpd recorder

Encoder plugins:
 null wave

Input plugins:
 file

Playlist plugins:
 extm3u m3u pls xspf asx rss cue embcue

Protocols:
 file://
It no longer recognizes pulse, and seems to have trouble seeing my library at ~/Music/

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 18th, 2016, 8:40 am
by skidoo
How do I fix this?
Missing developer (*-dev) packages? Please check configure output and logfile.

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 18th, 2016, 9:15 pm
by LaughterOnWater
skidoo wrote:
How do I fix this?
Missing developer (*-dev) packages? Please check configure output and logfile.
Excellent. Done. mpd and mpc now work as expected. Thank you!

Only the mysqlite module would not install. All of the others did fine.
Although I had installed sqlite, libsqlite0, and libsqlite0-dev it remained disabled.

It's not a deal breaker, but all the other packages installed so easily on both 32 and 64-bit instances. Any ideas?

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 19th, 2016, 12:05 pm
by skidoo

Code: Select all

Only the mysqlite module would not install. All of the others did fine.
Although I had installed sqlite, libsqlite0, and libsqlite0-dev it remained disabled.
MySQL <> SQLite. Try libsqlite3-0 and libsqlite3-dev on your *buntus.

Re: Local Jukebox (No Internet) with PSA's in park setting

Posted: January 19th, 2016, 7:22 pm
by LaughterOnWater
skidoo wrote: MySQL <> SQLite. Try libsqlite3-0 and libsqlite3-dev on your *buntus.
Yup -- I conflated two totally different SQL packages didn't I? (Sorry.)

I'll definitely give it a shot next.

Thanks!