Moode Forum
How to attach MOCP player, instead of MPD? - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: How to attach MOCP player, instead of MPD? (/showthread.php?tid=547)



How to attach MOCP player, instead of MPD? - mactolinux - 10-04-2018

Hi guys,

I tried few systems like Volumio, Rune, MoOde (best one, for sure) – and then compared music... being played by MOCP.

I would like to know – is there any chance to teach MoOde to send commands (play/stop/pause/forward/back – enough) and file path to the MOCP? 

Sadly, this one sounds much much better than MPD, sonically. But the UI......

Many thanks!

P.S. I use external USB (Amanero) DAC.


RE: How to attach MOCP player, instead of MPD? - Tim Curtis - 10-04-2018

If you turn on the metadata file in System config it will be updated after at most 3 seconds whenever current song metadata, volume, play state etc changes.

Example contents:
Code:
pi@rp3:~ $ cat /var/local/www/currentsong.txt
file=http://aac-64.streamthejazzgroove.com:80/stream
artist=Radio station
album=The Jazz Groove
title=Antonio Carlos Jobim - O Morro Nao Tem Vez
coverurl=images/radio-logos/The Jazz Groove.jpg
track=
date=
composer=
encoded=VBR
bitrate=59 kbps
outrate=16 bit, 44.1 kHz, Stereo, 1.411 mbps
volume=20
mute=0
state=play

You could also turn on the LCD updater engine and enter the path to a user-written script that parses currentsong.txt and does things based on the contents. The script doesn't have to update an LCD, it could for example send commands to another program.

The advantage of using the LCD updater engine to fire the script rather than having a stand-alone script with its own polling loop for detecting changes in currentsong.txt is that the LCD updater uses a very efficient inotifywait event mechanism and thus no polling loop :-) It only fires the script when currentsong.txt has been changed.

If you turn it on and don't specify a script it will by default create and update a file named /home/pi/lcd.txt

-Tim


RE: How to attach MOCP player, instead of MPD? - mactolinux - 10-04-2018

Wow, thank you Tim, brilliant idea! I see it's working great, I see my tracks there!

So I can play MPD to nowhere (if it is possible), or to Pi's analogue out which I don't use, while MOC Player will proceed to my USB DAC.

The only thing is.. how to get MOC peaking the file path... Here my almost zero knowledge of Linux ends... :-(


P.S. The script doesn't clear up upon STOP command? So, MOC will be play forever... well, "you wanted it – you got it" Smile


RE: How to attach MOCP player, instead of MPD? - Tim Curtis - 10-04-2018

Yes, just configure MPD to use the on-board audio device (Pi analog out)

What do these items refer to?
- "peaking the file path"
- "The script doesn't clear up upon STOP command"


RE: How to attach MOCP player, instead of MPD? - mactolinux - 10-05-2018

(10-04-2018, 08:46 PM)Tim Curtis Wrote: Yes, just configure MPD to use the on-board audio device (Pi analog out)

What do these items refer to?
- "peaking the file path"
- "The script doesn't clear up upon STOP command"

Sorry, got the last line in the script, this reflects play/pause. All good, now looking to adjust MOCP somehow, to get it dependant on the script...