mpd server | proxy plugin | on RPi

  • Dear all,

    is it possible to use the mpd server addon along with the proxy plugin?

    #see Chapter 9. Plugin reference

    #mpd.conf

    database {

    plugin "proxy"

    host "$DB_SERVER"

    }

    Trying to use this switch brings an error that the proxy plugin is missing. I use the Milhouse build [#1222] but it does not seem to be related to that, and seems to be also the case for all Krypton builds. The proxy plugin is very helpful as it reduces the load on the RPi and the sd card.

    As I intend to use kodi + mpd parallel to each other, is the following possible? I use hifiberry-digi:

    #taken from Asoundrc

    #/storage/.config/asound.conf

    pcm.dmixer {

    type dmix

    ipc_key 1024

    slave {

    pcm "hw:0,0"

    period_time 0

    period_size 1024

    buffer_size 8192

    rate 48000

    }

    bindings {

    0 0

    1 1

    }

    }

    pcm.!default {

    type plug

    slave.pcm "dmixer"

    }


    Thanks and best

    lcg

  • urgs it is possible that the proxy plugin is just missing

    we disabling a lot stuff basically because it was always disabled without knowing why (afaik nobody from the team is using mpd)

    pls have a look LibreELEC.tv/package.mk at master · LibreELEC/LibreELEC.tv · GitHub

    Trying to use this switch brings an error that the proxy plugin is missing.

    could you paste the output here ? I searched but didn't found anything obviouse to enable/disable it

  • Hij,

    thanks for your mail. The error is very unspecific:

    'Dec 29 12:33 : exception: No such database plugin: proxy'

    According to the mpd plugin reference at

    Chapter 9. Plugin reference

    the db plugin points to libmpdclient.

    The sources for the db proxy plugin can be found here:

    MPD/src/db/plugins at master · MusicPlayerDaemon/MPD · GitHub

    From './configure --help' this should be:

    --enable-database enable support for the music database

    --enable-libmpdclient enable support for the MPD client

    which does not seem to be set at 'auto', so probably it has to be enabled manually which maybe would mean for LibreELEC.tv/package.mk at master · LibreELEC/LibreELEC.tv · GitHub to add those switches mentioned above. But indeed, there is not much to be found how to enable it. So the two options above are just a 'good guess'.

    Some note as a workaround: using a 'ldd mpd' on raspbian stretch's mpd + copy all necessary libs to LE into one unique folder + raspbian-mpd, and calling that mpd version after changing the LD_LIBRARY_PATH seems to get it working. However, this is no real long-term solution, but maybe a workable short-cut.

    best regards

    lcg

  • could you try Index of /addons/9.0/mpd/

    I reworked a lot of the options (some bigger face palm moments including) and activated "everything" what makes sense and we had already at the toolchain.

    thanks, but to be honest no change:

    # mpd --verbose --no-daemon mpd.conf

    config_file: loading file mpd.conf

    Dec 29 20:49 : exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use

    Dec 29 20:49 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'

    Dec 29 20:49 : vorbis: Xiph.Org libVorbis 1.3.5

    Dec 29 20:49 : opus: libopus 1.2.1-fixed

    Dec 29 20:49 : sndfile: libsndfile-1.0.28

    Dec 29 20:49 : exception: No such database plugin: proxy


    which surprises me...

    I started the mpd from your link directly on the cmdline and added to mpd.conf only the

    database {

    plugin "proxy"

    host "$PROXY_SERVER"

    }


    config entry. Starting via from within kodi did not add any additional info - successfully started and immediately terminated.

  • not really sure what is required - I pushed a new version that includes libmpc (an mpd client) - the faq sounds like it is required

    current mpd configuration

  • not really sure what is required - I pushed a new version that includes libmpc (an mpd client) - the faq sounds like it is required

    current mpd configuration

    >>this looks much better now:

    # mpd --no-daemon --verbose /storage/mpd/mpd.conf

    mpd: error while loading shared libraries: libmpdclient.so.2: cannot open shared object file: No such file or directory

    so it needs now the libmpdclient lib.

  • Code
    # mpd --no-daemon --verbose /storage/mpd/mpd.conf
    config_file: loading file /storage/mpd/mpd.conf
    Dec 30 19:01 : exception: bind to '0.0.0.0:6600' failed (continuing anyway, because binding to '[::]:6600' succeeded): Failed to bind socket: Address already in use
    Dec 30 19:01 : libsamplerate: libsamplerate converter 'Fastest Sinc Interpolator'
    Dec 30 19:01 : vorbis: Xiph.Org libVorbis 1.3.5
    Dec 30 19:01 : opus: libopus 1.2.1
    Dec 30 19:01 : sndfile: libsndfile-1.0.28
    Dec 30 19:01 : simple_db: reading DB
    Dec 30 19:01 : curl: version 7.56.1
    Dec 30 19:01 : curl: with OpenSSL/1.0.2l

    looks better now, I included the libmpdclient.so*

    updated archives, pls try again

  • pretty pretty amazing... yes, seems to work now! :D The proxy on a different computer (mpd db host) was found immediately!

    Thanks a lot!

    @For all those who may think "why I need mpd if I have already kodi?", please allow some short notes on this topic:

    Yes - that's true, kodi is amazing. But think of a pure headless setup (or even a setup with screen): kodi controlled by an app (e.g. to play radio streams, YT live concerts, whatever) - and mpd controlled by a webfrontend (like o!mpd) or app which leaves not much left to wish for. Some functions are not yet implemented in kodi like playing randomly from the filesystem (not from the db) which is possible with mpd (and I like that function very much)...

    Thanks again and all the best for the next year!

  • Is anything else needed ? I have sadly ZERO knowledge about mpd.

    thanks, I'll check v4 tomorrow. What is needed is someone who tells me how to configure alsa with 'dmix' plugin (see /storage/asound.conf) so that kodi AND mpd can play at the same time, ie a non-exclusive access to the soundcard. I have managed to get it working so that either mpd or kodi plays properly, but not at the same time. Then the other app (either kodi or mpd) complains about no access to the soundcard. If the sound stops, the soundcard is free again (turned off ~"stay alive device"). Will prepare the configs and send it along as this is directly related to mpd-server addon as it would be good to add such a asound.conf to the addon install script (or the mpd_start script).

    Then it requires some more trials what is best so that turning on mpd does not damages the amp, because the mixer setting is too different from kodis volume settings. mpd allows for software mix as well as hardware mix. Using no mix can result in max. volume of a DAC - and that is very loud... 'software mix' allows to control mpd via remote (e.g. app) which works rather well to adjust it to kodis volume. Then it would make sense - see above - to tweak asound.conf/ alsamixer so that both kodi and mpd result in approximately the same volume while changing between them. But this is new to me, too, and requires some more careful testing - but surely help others, too.

    And it also seems that the mpd addon client is broken (Krypton as well as Leia alpha builds). But maybe here I should contact the addon maintainer directly before mixing threads.

  • ..here is the kodi.log while trying to start mpd.client (v.2.0.8), installed from the official repo:


    Please decide whether I should contact the developer of the plugin or whether it is something related to LE.

    The mpd server v4 seems to work like v3, thanks. I hope to find time soon to prepare the alsa related logfiles and reproducible procedure, and before that check whether mixing works on the cmdline with aplay. This will give some confidence that everything later is related to kodi and/ or mpd. Switching to pulseaudio does not necessarily solves the problem, see here (I assume you understand German?): MPD als Systemdienst mit ALSA und Pulseaudio. If not, it just tells us that mpd (as a server) and pulseaudio not necessarily like each other. Some investment in a proper config for kodi, mpd, and alsa seems to be easier.

    @ALL - if anybody has done this already (ie. mix mpd and kodi with alsa), please feel free to share such infos.

  • Code
    ERROR: EXCEPTION: XML File for Window is missing
    ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <type 'exceptions.RuntimeError'>
    Error Contents: XML File for Window is missing

    sounds like an add-on problem, nothing we could help (likely)

    MPD als Systemdienst mit ALSA und Pulseaudio.

    ... outch ... no idea really

    The mpd server v4 seems to work like v3, thanks.

    great, official update soonish

  • If someone wants to reproduce kodi + mpd-server, please have a look at MPD als Systemdienst mit ALSA und Pulseaudio – DebianforumWiki and just take the config part regarding default-alsa and mpd and leave out the pulseaudio-config part. At the bottom there is also an explanation how to configure mpd.conf properly.

    You can ignore the German if you do not understand it - the config itself should be self-explanatory.

    Confirmed that this works with Libreelec Milhouse build + mpd-server (kodi youtube addon, mpd from NAS, aplay from locally).

    You can replace mpd.conf in the addon config folder and asound.conf is located here: /storage/.config/asound.conf. if not present, just create it with nano or any other text editor.

    For the bitperfect part, this is not bitperfect anymore as dsp takes place due to the mixing itself. But probably this is clear anway.

  • Hi, I am new to LIbreElec and I am trying to build the same setup as Icgh (kodi + mpd with database on a remote server/ kodi and mpd sharing the output thru PulseAudio).

    Like him, I seem to be missing the proxy plugin:

    (I installed the mpd server from within Kodi from the addons list):

    Code
    Kodi-Livingroom:~ # mpd --version
    Music Player Daemon 0.20.9
    Database plugins:
     simple
    Storage plugins:
     local nfs curl
    ....

    How can I install the version of the mpd server addon that CvH pointed to?

    lcgh could you test Index of /addons/9.0/mpd/ 104-4 if it still works, that includes a recent libmpdclient (we could fix building at LE for it) but I am unsure if it still works or not

    Thanks for the help