summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-11-11 12:43:50 +0100
committerMax Kellermann <max@musicpd.org>2020-11-11 12:43:50 +0100
commiteb9f5339b683d037ab3224e362071e22991e0e83 (patch)
tree497dd4f5dff3ea7b75962a4143696be59767af63
parenta9714e73c86747a3e4f1d165d308e33528cdfccd (diff)
parent60d19b23803d33c99bed644976387b78c17a470a (diff)
Merge branch 'v0.22.x' into master
-rw-r--r--NEWS4
-rw-r--r--doc/conf.py2
-rw-r--r--doc/mpd.1.rst6
-rw-r--r--doc/mpd.conf.5.rst43
-rw-r--r--doc/mpdconf.example43
-rw-r--r--doc/plugins.rst16
-rw-r--r--doc/user.rst12
-rw-r--r--src/decoder/plugins/DsdiffDecoderPlugin.cxx13
8 files changed, 96 insertions, 43 deletions
diff --git a/NEWS b/NEWS
index 16a9d5e57..697cad074 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ ver 0.23 (not yet released)
* protocol
- new command "getvol"
+ver 0.22.4 (not yet released)
+* decoder
+ - dsdiff: apply padding to odd-sized chunks
+
ver 0.22.3 (2020/11/06)
* playlist
- add option "as_directory", making CUE file expansion optional
diff --git a/doc/conf.py b/doc/conf.py
index 2df29d071..9b163b6cb 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -38,7 +38,7 @@ author = 'Max Kellermann'
# built documents.
#
# The short X.Y version.
-version = '0.22.3'
+version = '0.22.4'
# The full version, including alpha/beta/rc tags.
release = version
diff --git a/doc/mpd.1.rst b/doc/mpd.1.rst
index 7dbbb1344..5a1d47288 100644
--- a/doc/mpd.1.rst
+++ b/doc/mpd.1.rst
@@ -13,7 +13,7 @@ DESCRIPTION
MPD is a daemon for playing music. Music is played through the configured audio output(s) (which are generally local, but can be remote). The daemon stores info about all available music, and this info can be easily searched and retrieved. Player control, info retrieval, and playlist management can all be managed remotely.
MPD searches for a config file in ``$XDG_CONFIG_HOME/mpd/mpd.conf``
-then ``~/.mpdconf`` then ``/etc/mpd.conf`` or uses ``CONF_FILE``.
+then ``~/.mpdconf`` then ``~/.mpd/mpd.conf`` then ``/etc/mpd.conf`` or uses ``CONF_FILE``.
Read more about MPD at http://www.musicpd.org/
@@ -53,8 +53,8 @@ OPTIONS
FILES
-----
-:file:`~/.mpdconf`
- User configuration file.
+:file:`$XDG_CONFIG_HOME/mpd/mpd.conf`
+ User configuration file (usually :file:`~/.config/mpd/mpd.conf`).
:file:`/etc/mpd.conf`
Global configuration file.
diff --git a/doc/mpd.conf.5.rst b/doc/mpd.conf.5.rst
index 03ab90d4e..6b364c513 100644
--- a/doc/mpd.conf.5.rst
+++ b/doc/mpd.conf.5.rst
@@ -11,24 +11,34 @@ not specified on the command line, MPD first searches for it at
:file:`$XDG_CONFIG_HOME/mpd/mpd.conf` then at :file:`~/.mpdconf` then
at :file:`~/.mpd/mpd.conf` and then in :file:`/etc/mpd.conf`.
-Lines beginning with a :samp:`#` character are comments. All other
-non-empty lines specify parameters and their values. These lines
-contain the parameter name and parameter value (surrounded by double
-quotes) separated by whitespace (either tabs or spaces). For
-example::
+Each line in the configuration file contains a setting name and its value, e.g.:
- parameter "value"
+:code:`connection_timeout "5"`
-The exception to this rule is the audio_output parameter, which is of
-the form::
+For settings which specify a filesystem path, the tilde is expanded:
+
+:code:`music_directory "~/Music"`
+
+Some of the settings are grouped in blocks with curly braces, e.g. per-plugin settings:
+
+.. code-block:: none
audio_output {
- parameter1 "value"
- parameter2 "value"
+ type "alsa"
+ name "My ALSA output"
+ device "iec958:CARD=Intel,DEV=0"
+ mixer_control "PCM"
}
+The :code:`include` directive can be used to include settings from
+another file; the given file name is relative to the current file:
+
+:code:`include "other.conf"`
+
+You can use include_optional instead if you want the included file to be
+optional; the directive will be ignored if the file does not exist:
-Parameters that take a file or directory as an argument should use absolute paths.
+:code:`include_optional "may_not_exist.conf"`
See :file:`docs/mpdconf.example` in the source tarball for an example
configuration file.
@@ -38,7 +48,7 @@ Please read the MPD user manual for a complete configuration guide:
http://www.musicpd.org/doc/user/
-REQUIRED PARAMETERS
+OPTIONAL PARAMETERS
-------------------
db_file <file>
@@ -47,9 +57,6 @@ db_file <file>
log_file <file>
This specifies where the log file should be located. The special value "syslog" makes MPD use the local syslog daemon.
-OPTIONAL PARAMETERS
--------------------
-
sticker_file <file>
The location of the sticker database. This is a database which manages
dynamic information attached to songs.
@@ -83,7 +90,7 @@ user <username>
port <port>
This specifies the port that mpd listens on. The default is 6600.
-log_level <default, secure, or verbose>
+log_level <level>
Suppress all messages below the given threshold. The following
log levels are available:
@@ -190,8 +197,8 @@ mixer_type <hardware, software or none>
FILES
-----
-:file:`~/.mpdconf`
- User configuration file.
+:file:`$XDG_CONFIG_HOME/mpd/mpd.conf`
+ User configuration file (usually :file:`~/.config/mpd/mpd.conf`).
:file:`/etc/mpd.conf`
Global configuration file.
diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index ec1f9ffaa..a097fc652 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
@@ -5,7 +5,7 @@
# Files and directories #######################################################
#
# This setting controls the top directory which MPD will search to discover the
-# available audio files and add them to the daemon's online database. This
+# available audio files and add them to the daemon's online database. This
# setting defaults to the XDG directory, otherwise the music directory will be
# be disabled and audio files will only be accepted over ipc socket (using
# file:// protocol) or streaming files over an accepted protocol.
@@ -13,20 +13,20 @@
#music_directory "~/music"
#
# This setting sets the MPD internal playlist directory. The purpose of this
-# directory is storage for playlists created by MPD. The server will use
+# directory is storage for playlists created by MPD. The server will use
# playlist files not created by the server but only if they are in the MPD
# format. This setting defaults to playlist saving being disabled.
#
#playlist_directory "~/.mpd/playlists"
#
# This setting sets the location of the MPD database. This file is used to
-# load the database at server start up and store the database while the
+# load the database at server start up and store the database while the
# server is not up. This setting defaults to disabled which will allow
# MPD to accept files over ipc socket (using file:// protocol) or streaming
# files over an accepted protocol.
#
#db_file "~/.mpd/database"
-#
+#
# These settings are the locations for the daemon log files for the daemon.
# These logs are great for troubleshooting, depending on your log_level
# settings.
@@ -44,7 +44,7 @@
#
# This setting sets the location of the file which contains information about
# most variables to get MPD back into the same general shape it was in before
-# it was brought down. This setting is disabled by default and the server
+# it was brought down. This setting is disabled by default and the server
# state will be reset on server start up.
#
#state_file "~/.mpd/state"
@@ -74,7 +74,7 @@
#group "nogroup"
#
# This setting sets the address for the daemon to listen on. Careful attention
-# should be paid if this is assigned to anything other then the default, any.
+# should be paid if this is assigned to anything other than the default, any.
# This setting can deny access to control of the daemon. Not effective if
# systemd socket activiation is in use.
#
@@ -90,7 +90,8 @@
#port "6600"
#
# Suppress all messages below the given threshold. Use "verbose" for
-# troubleshooting.
+# troubleshooting. Available setting arguments are "notice", "info", "verbose",
+# "warning" and "error".
#
#log_level "notice"
#
@@ -113,7 +114,7 @@
# the other supported tags:
#metadata_to_use "+comment"
#
-# This setting enables automatic update of MPD's database when files in
+# This setting enables automatic update of MPD's database when files in
# music_directory are changed.
#
#auto_update "yes"
@@ -128,7 +129,7 @@
# Symbolic link behavior ######################################################
#
-# If this setting is set to "yes", MPD will discover audio files by following
+# If this setting is set to "yes", MPD will discover audio files by following
# symbolic links outside of the configured music_directory.
#
#follow_outside_symlinks "yes"
@@ -163,7 +164,7 @@
#
#password "password@read,add,control,admin"
#
-# This setting specifies the permissions a user has who has not yet logged in.
+# This setting specifies the permissions a user has who has not yet logged in.
#
#default_permissions "read,add,control,admin"
#
@@ -172,7 +173,18 @@
# Database #######################################################################
#
-
+# An example of a database section instead of the old 'db_file' setting.
+# It enables mounting other storages into the music directory.
+#
+#database {
+# plugin "simple"
+# path "~/.local/share/mpd/db
+# cache_directory "~/.local/share/mpd/cache"
+#}
+#
+# An example of database config for a sattelite setup
+#
+#music_directory "nfs://fileserver.local/srv/mp3"
#database {
# plugin "proxy"
# host "other.mpd.host"
@@ -181,7 +193,6 @@
# Input #######################################################################
#
-
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
@@ -194,8 +205,8 @@ input {
# Audio Output ################################################################
#
-# MPD supports various audio output types, as well as playing through multiple
-# audio outputs at the same time, through multiple audio_output settings
+# MPD supports various audio output types, as well as playing through multiple
+# audio outputs at the same time, through multiple audio_output settings
# blocks. Setting this block is optional, though the server will only attempt
# autodetection for one sound card.
#
@@ -386,7 +397,7 @@ input {
#replaygain_limit "yes"
#
# This setting enables on-the-fly normalization volume adjustment. This will
-# result in the volume of all playing audio to be adjusted so the output has
+# result in the volume of all playing audio to be adjusted so the output has
# equal "loudness". This setting is disabled by default.
#
#volume_normalization "no"
@@ -395,7 +406,7 @@ input {
# Character Encoding ##########################################################
#
-# If file or directory names do not display correctly for your locale then you
+# If file or directory names do not display correctly for your locale then you
# may need to modify this setting.
#
#filesystem_charset "UTF-8"
diff --git a/doc/plugins.rst b/doc/plugins.rst
index 06fe714c1..571654df6 100644
--- a/doc/plugins.rst
+++ b/doc/plugins.rst
@@ -378,10 +378,14 @@ flac
Decodes FLAC files using libFLAC.
+.. _decoder_dsdiff:
+
dsdiff
------
-Decodes DFF files containing DSDIFF data (e.g. SACD rips).
+Decodes DSDIFF (`Direct Stream Digital Interchange File Format
+<http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf>`_) files
+(:file:`*.dff`). These contain :ref:`DSD <dsd>` instead of PCM.
.. list-table::
:widths: 20 80
@@ -392,10 +396,14 @@ Decodes DFF files containing DSDIFF data (e.g. SACD rips).
* - **lsbitfirst yes|no**
- Decode the least significant bit first. Default is no.
+.. _decoder_dsf:
+
dsf
---
-Decodes DSF files containing DSDIFF data (e.g. SACD rips).
+Decodes DSF
+(<https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf>)
+files (:file:`*.dsf`). These contain :ref:`DSD <dsd>` instead of PCM.
fluidsynth
----------
@@ -755,6 +763,10 @@ Valid quality values for libsoxr:
If the quality is set to custom also the following settings are available:
+.. list-table::
+ :widths: 20 80
+ :header-rows: 1
+
* - Name
- Description
* - **precision**
diff --git a/doc/user.rst b/doc/user.rst
index abd7c7b1f..694ce0cc5 100644
--- a/doc/user.rst
+++ b/doc/user.rst
@@ -1032,12 +1032,20 @@ Check list for bit-perfect playback:
:code:`format`, :ref:`audio_output_format <audio_output_format>`).
* Verify that you are really doing bit-perfect playback using :program:`MPD`'s verbose log and :file:`/proc/asound/card*/pcm*p/sub*/hw_params`. Some DACs can also indicate the audio format.
+.. _dsd:
+
Direct Stream Digital (DSD)
---------------------------
-DSD (`Direct Stream Digital <https://en.wikipedia.org/wiki/Direct_Stream_Digital>`_) is a digital format that stores audio as a sequence of single-bit values at a very high sampling rate.
+DSD (`Direct Stream Digital
+<https://en.wikipedia.org/wiki/Direct_Stream_Digital>`_) is a digital
+format that stores audio as a sequence of single-bit values at a very
+high sampling rate. It is the sample format used on `Super Audio CDs
+<https://en.wikipedia.org/wiki/Super_Audio_CD>`_.
-:program:`MPD` understands the file formats dff and dsf. There are three ways to play back DSD:
+:program:`MPD` understands the file formats :ref:`DSDIFF
+<decoder_dsdiff>` and :ref:`DSF <decoder_dsf>`. There are three ways
+to play back DSD:
* Native DSD playback. Requires ALSA 1.0.27.1 or later, a sound driver/chip that supports DSD and of course a DAC that supports DSD.
diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
index 1fb88da16..5b483514b 100644
--- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx
+++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx
@@ -55,6 +55,17 @@ struct DsdiffChunkHeader {
uint64_t GetSize() const {
return size.Read();
}
+
+ /**
+ * Applies padding to GetSize(), according to the DSDIFF
+ * specification
+ * (http://www.sonicstudio.com/pdf/dsd/DSDIFF_1.5_Spec.pdf)
+ * section 2.3.
+ */
+ [[nodiscard]] constexpr
+ uint64_t GetPaddedSize() const noexcept {
+ return (GetSize() + 1) & ~uint64_t(1);
+ }
};
/** struct for DSDIFF native Artist and Title tags */
@@ -117,7 +128,7 @@ dsdiff_read_prop_snd(DecoderClient *client, InputStream &is,
return false;
offset_type chunk_end_offset = is.GetOffset()
- + header.GetSize();
+ + header.GetPaddedSize();
if (chunk_end_offset > end_offset)
return false;