You are not logged in.
I have a DAC that seems to be finicky with anything over 24bit audio. I'm running MPD with the following config:
audio_output {
type "alsa"
name "S/PDIF"
device "hw:0,1"
}My /etc/asound.conf is configured with:
defaults.pcm.!rate_converter "samplerate_best"Playing MP3s, sometimes MPD will output with S16_LE, but sometimes it will go up to S32_LE for a reason I don't understand:
➜ ~ cat /proc/asound/card0/pcm1p/sub0/hw_params
access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 4410
buffer_size: 22050How can I limit MPD or ALSA or even the drivers to prevent it from unnecessarily outputting as "S32_LE" format?
Offline
Add the "format" specifier to your audio_output control block:
audio_output {
type "alsa"
name "S/PDIF"
device "hw:0,1"
format "48000:16:2"
}
format accepts its parameters as "samplerate:bits:channels".
This can also be defined globally by using the audio_output_format control block,
but may still be overwritten individually by each definition of an audio_output.
See the mpd.conf man page in section 5.
Last edited by crxxn (2014-11-06 21:59:42)
Offline
Really, I'm trying to get MPD to output "bit perfect" without any resampling. So if I'm playing an mp3, it should output at 16bit/44.1khz. If I'm playing audiophile quality FLAC file encoded at 24bit/96khz, it should play it at the same rate. Wouldn't the format option force it to resample at that specified format/rate?
Last edited by matkam (2014-11-07 07:16:13)
Offline
Maybe you've already seen these, but Ronald van Engelen has written an excellent article (A comprehensive guide to bit perfect digital audio using Linux) and a useful config script, mpd-configure, both of which I found very helpful and informative when setting up mpd for bit-perfect play via alsa.
Enough is more.
Offline
The behaviour you're describing while playing mp3s, i mean the bitrate going up while playing a song,
depends on method used to compress your files. Newer mp3 standards implement a variable bit width.
Offline
@brix - Thanks for the link. The script looked like it had some potential, but it needs Pulseadio for some reason and I stopped there.
@crxxn - The MP3 bitrate is different than the bit depth that that I'm trying to limit. The bit depth of an MP3 ripped from a CD source should be 16 bits. More info: https://en.wikipedia.org/wiki/Audio_bit_depth
Offline
[van Engelen's 'mpd-cinfigure' script] looked like it had some potential, but it needs Pulseadio for some reason and I stopped there.
The pulseaudio handling has been added since I last used it. The current version seems to "need" pulseaudio in order to disable it (or not).
No doubt you tried setting the configs to ignore the request to disable what you don't have installed...
Enough is more.
Offline
I also had trouble with different formats and bit rates.Specifically MP3.
my solution ..
~mpd.conf
decoder {
plugin "mad"
enabled "no"
}
decoder {
plugin "ffmpeg"
enabled "yes"
}
Offline