I've been using MPD as the player in my system for a few months now and I am very happy with it. There is one very odd quirk that I have not been able to overcome that occurs when I first use it after boot up - it doesn't seem to implement my audio output.
I have a single MPD audio output configured. That part of my config file looks like this:
The above forces MPD to resample audio to 16/48 format, and then passes it to an ALSA device (it's an ALSA loopback).
At first bootup, the MPD service starts up and becomes active. Since I installed MPD I have had to stop the service (and I also do "mpd --kill" for good measure) and then start it again by typing mpd at the command prpompt while logged under my username (not root). After that everything works as I expect it should, specifically it resamples the audio just like my configuration states it should.
If I do not stop/kill and restart mpd the audio still makes it to the intended device (it's also set as default in my .alsarc) but is not resampled. Since I often just cue up a CD track for testing purposes I immediately notice that the sample rate is wrong, and I can test for this and discover it using other applications that are getting the audio out of the loopback. The problem is 100% reproducible and is a problem specific to MPD (e.g. not ALSA, the other applications, etc.).
Today I tried a few different things, actually many different things. But the main one was editing the file "/etc/default/mpd". It looks like this:
Supposedly, according to this web page, you can prevent the service from starting automatically either by adding the line "START_MPD=false" as shown or you can type
I tried both of these methods, assuming I could just start it myself, or let the player force it to start when the player is opened. But this didn't work. In either case, the audio would not be resampled following the audio output in my mpd.conf file.
This is really a minor annoyance for me, but I would prefer that the service starts up and actually does what I tell it to do! Not sure why this is happening. In MPD's default config there is an ALSA output described without a card or device listed, which I believe causes MPD to use the default device. That just happens to be the same device that I have set up in my .alsarc file and this is why I still get audio but it is not resampled.
Is MPD not able to switch over to the output described in my mpd.conf file? Any ideas on how to get it to do that so I no longer need to manually stop and restart the service on bootup?
I have a single MPD audio output configured. That part of my config file looks like this:
Code:
audio_output {
type "alsa"
name "ALSA Output"
device "hw:0,0" # ALSA output used
format "48000:16:2" # audio specifier string; sample_rate:data_format:num_channels
auto_resample "no" # disable alsa resampling
auto_channels "no" # disable alsa from changing the number of channels
auto_format "no" # disable alsa format conversions
mixer_type "software" # optional
always_on "no" # do not try to keep the output connected at all times
}
samplerate_converter "0" #Best Quality Sinc Interpolator
The above forces MPD to resample audio to 16/48 format, and then passes it to an ALSA device (it's an ALSA loopback).
At first bootup, the MPD service starts up and becomes active. Since I installed MPD I have had to stop the service (and I also do "mpd --kill" for good measure) and then start it again by typing mpd at the command prpompt while logged under my username (not root). After that everything works as I expect it should, specifically it resamples the audio just like my configuration states it should.
If I do not stop/kill and restart mpd the audio still makes it to the intended device (it's also set as default in my .alsarc) but is not resampled. Since I often just cue up a CD track for testing purposes I immediately notice that the sample rate is wrong, and I can test for this and discover it using other applications that are getting the audio out of the loopback. The problem is 100% reproducible and is a problem specific to MPD (e.g. not ALSA, the other applications, etc.).
Today I tried a few different things, actually many different things. But the main one was editing the file "/etc/default/mpd". It looks like this:
Code:
## Defaults for the MPD init script, sourced by /etc/init.d/mpd on Debian
## systems. Uncomment (remove the leading '#') and change values as needed.
## If you don't want MPD to be started as a system service (for example, if
## you want to run it from a regular user account), disable it using the
## command 'update-rc.d mpd disable' (or 'systemctl disable mpd' for systemd).
START_MPD=false
## The configuration file location for mpd:
MPDCONF=/home/charlie/.mpd/mpd.conf
Code:
sudo update-rc.d mpd disable
This is really a minor annoyance for me, but I would prefer that the service starts up and actually does what I tell it to do! Not sure why this is happening. In MPD's default config there is an ALSA output described without a card or device listed, which I believe causes MPD to use the default device. That just happens to be the same device that I have set up in my .alsarc file and this is why I still get audio but it is not resampled.
Is MPD not able to switch over to the output described in my mpd.conf file? Any ideas on how to get it to do that so I no longer need to manually stop and restart the service on bootup?
Last edited: