doctorfree / MusicPlayerPlus

Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
https://musicplayerplus.dev
MIT License
69 stars 1 forks source link

Improve default mpd.conf #30

Closed JOJ0 closed 1 year ago

JOJ0 commented 1 year ago

The buffer_time option throws a warning, I'm not sure if it's my mpd version (0.23.5) that doesn't understand it or if it's valid if the pipewire output option is commented out. I suggest commenting it out in the mpd.conf template. If it's not valid at all it could certainly be removed entirely:

Jan 22 19:35:02 veery mpd[17417]: config: option 'buffer_time' on line 47 was not recognized
Jan 22 19:35:02 veery systemd[1083]: Started Music Player Daemon.

I'd like to include another fix to the mpd.conf, but I'm not sure where in the mppinit code is a good place for installing it. To fix this warning, it's sufficient to just install the timidty package - at least on Debian-ish this would work. A clumsy workaround would be to just touch an empty file there but that would lead to an apt-install prompt to the user whether they would like to overwrite the existing conf (the empty file), which is kind of ugly and misleading. So, I'm a little lost in finding out where in mppinit the mpd package is actually installed. A quick hint and I'll include it in this PR :-)

Jan 22 19:12:38 veery mpd[17020]: decoder: Decoder plugin 'wildmidi' is unavailable: configuration file does not exist: /etc/timidity/timidity.cfg
doctorfree commented 1 year ago

I think buffer_time is only used by a couple of MPD audio outputs (alsa and sndio). I've used it with alsa to good effect. Commenting it out may be the best solution for now. However, reducing it to 50000 for ALSA output does improve throughput synchronization with mpcplus and mppcava. See https://wiki.archlinux.org/title/ncmpcpp

I will confirm which audio outputs support this setting and think about how to enable it selectively.

I've seen the wildmidi decoder plugin message before but never figured out how to disable it. I will give it another look.

doctorfree commented 1 year ago

FYI, mpd is installed as a dependency during package installation. The MusicPlayerPlus MPD configuration file is copied in during mppinit if no previous configuration is detected. This happens around line 2828 in mppinit. There is some further editing of mpd.conf when syncing changes and some effort is made to preserve user customizations in sync_sys_mpd_conf() and sync_music_dir(). I do not think any changes to mppinit will be required to address the issues you raise here. We should be able to simply modify config/mpd/mpd.conf as you have done in this pull request and perhaps additionally for wildmidi config.

doctorfree commented 1 year ago

Try adding the following to your mpd.conf and restarting mpd to see if this avoids the wildmidi config file not found message:

decoder {
    plugin "wildmidi"
    enabled "no"
    #config_file "/etc/timidity/timidity.cfg"
}
doctorfree commented 1 year ago

I am going to merge this pull request as I think commenting out the buffer_time setting is best for now since that is not supported by some commonly used audio outputs. If you wish to continue discussing wildmidi decoder configuration, let's open an issue.