Moode Forum
[SOLVED] allow local mpd modifications without overwriting them - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Feature requests (https://moodeaudio.org/forum/forumdisplay.php?fid=8)
+--- Thread: [SOLVED] allow local mpd modifications without overwriting them (/showthread.php?tid=3471)

Pages: 1 2 3


allow local mpd modifications without overwriting them - hindumagic - 02-07-2021

Hi,

I love this system and its great hardware integration!

One thing that I'd like to do is modify the mpd config file (/etc/mpd.conf) without having my changes overwritten by the web interface.  This could easily be accommodated by including a line in the mpd.conf file.

From the mpd docs regarding their configuration file options:

Quote:You can use
Code:
include_optional
instead if you want the included file to be optional; the directive will be ignored if the file does not exist:
include_optional "may_not_exist.conf"

My use case is that I want to use the fifo plugin from mpd, but I don't see somewhere to set that up from Moode's exposed configuration settings.  Defining a file for additional mpd configuration that will persist through configuration writes from the Moode interface would be most excellent.

Thoughts?


RE: allow local mpd modifications without overwriting them - bitlab - 02-07-2021

There is already a way to use custom mpd settings.
  • Create an /etc/mpd.custom.conf
  • Enable the dev tweaks with:
Code:
moodeutl -A add 32768
moodeutl -r

If you inspect the content of /etc/mpc.conf you will see that it now also contains your settings.
The settings are not only added, but also merged with existing settings. So you can even overwrite existing ones.

If this solves your issue please mark this post as solved.


RE: allow local mpd modifications without overwriting them - adrii - 02-07-2021

Hi hindumagic

If you are adding an audio_output section to /etc/mpd.conf then, unless there have been any changes to Moode (bitlab might be able to comment on this), there will be no option to enable it.

If it cannot be enabled, then I have some patches here that can enable an MPD FIFO

   https://github.com/antiprism/mpd_oled/blob/master/INSTALL_MOODE.md#build-and-install-mpd_oled

Adrian.


RE: allow local mpd modifications without overwriting them - bitlab - 02-07-2021

You can add an output without patching the code, just by hijacking an existing one :-)

For example with the release of 7.0.0 I did this for an experimental camilladsp output. There I reused the "ALSA graphic eq" for the camilladsp device.
With the fifo output you probably want a parallel output, so if you ain't using the moode http stream port server I would hijacking this one.
It requires:
  • in mpd.custom.conf overwrite the http server settings  (You can take experimental camilladsp setup for example).
  • enabling the http server to enable the output



RE: allow local mpd modifications without overwriting them - adrii - 02-07-2021

Hi bitlab

Thanks for the extra information.

Adrian.


RE: allow local mpd modifications without overwriting them - hindumagic - 02-08-2021

Hi Bitlab, thanks for the great summary. I will try that.

Unfortunately, I want to add a fifo output.
But to be clear, it sounds like you can't add another output using mpd.custom.conf. Correct?

It's unfortunate that I have to take away the option of streaming via http to hack this in. (if I understand you right - I'm new with this system but loving it so far)

I love the idea of the mpd.custom.conf and how it is merged into the final /etc/mpd.conf. That avoids the potential nameclash that my approach would allow (not sure how mpd responds to that - could test). I will see if I can define a fifo output through the custom file and report back.


RE: allow local mpd modifications without overwriting them - Tim Curtis - 02-08-2021

(02-07-2021, 07:47 AM)hindumagic Wrote: Hi,

I love this system and its great hardware integration!

One thing that I'd like to do is modify the mpd config file (/etc/mpd.conf) without having my changes overwritten by the web interface.  This could easily be accommodated by including a line in the mpd.conf file.

From the mpd docs regarding their configuration file options:

Quote:You can use
Code:
include_optional
instead if you want the included file to be optional; the directive will be ignored if the file does not exist:
include_optional "may_not_exist.conf"

My use case is that I want to use the fifo plugin from mpd, but I don't see somewhere to set that up from Moode's exposed configuration settings.  Defining a file for additional mpd configuration that will persist through configuration writes from the Moode interface would be most excellent.

Thoughts?

What's your usage scenario for MPD FIFO?

If it's a generally applicable scenario you could make the case that a dedicated option should be added to Audio Config.


SOLVED: RE: allow local mpd modifications without overwriting them - hindumagic - 02-08-2021

Success!  Thanks for your help, BitLocker.

Using the /etc/mpd.custom.conf approach worked perfectly.  I have the new output plugin defined in mpd's config file.  ...and I just poked around a little bit with moodeutl - nice!

How do I mark this thread as solved?


RE: allow local mpd modifications without overwriting them - Tim Curtis - 02-08-2021

Just keep in mind that what you are using is a developer tweak meant to make testing new things easier. It's not a feature and it might not exist in upcoming versions of moOde.

Your best bet is to make a case for an MPD fifo output to be included in stock moOde.


RE: allow local mpd modifications without overwriting them - hindumagic - 02-08-2021

(02-08-2021, 12:35 AM)Tim Curtis Wrote: What's your usage scenario for MPD FIFO?

If it's a generally applicable scenario you could make the case that a dedicated option should be added to Audio Config.

It is a corner case, but one that others might want to go down.  I have this pi hat that is a tube headphone amplifier, and I'm really digging the lush sound coming from it.  It is stuck in a bare bones, open sided case that doesn't protect it too much and is too light - I've swept it off the table twice already.

I figured that I'd build it a case that would really show it off, black walnut, tube/caps/heat sink all poking out the top, big volume/on/off knob, couple of discreet momentary buttons to pause/play and skip, and an LED strip.  The LED strip is going to take the most time...

I plan on putting up a stereo spectrum visualizer or something along those lines, and so need to push the audio output through an FFT for my own purposes, which is the plan for the FIFO.  I was going to base my code off of this project I found: https://github.com/David96/mpd_visualizer , and look into the ncmpcpp codebase which uses the same approach.
I've mostly a C/C++ background and I wanted to explore python more with this project.  End result would be a python program to interpret the audio into a nice visual output to drive the LED strip (via the pi's SPI).  I could abstract it out so others could use it - basically define the length of the LED strip in a config file and you'd be good to go.

I not in a hurry to do this.  It's just for fun and there are a bunch of other parts that need to come together.  Thanks for your interest..