If the constructor moves from an ExportedSong instance which refers to
somebody else's "Tag" instance, the newly constructed instance will
instead refer to its own empty "tag_buffer" field. This broke
SimpleDatabase::GetSong(), i.e. all songs on the queue restored from
the state file or added using the "addid" command.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1089
The "move" command doesn't allow open-ended ranges because they don't
make a lot of sense; moving an open-ended range is only possible if
the destination index is before the range, and in that case, the
client should be well aware how many songs there are.
Closes https://github.com/MusicPlayerDaemon/MPD/pull/1057
After commit 1afa33c3c7, an old bug was revealed:
SimpleDatabase::GetSong() constructs an ExportedSong instance by
moving the return value of Song::Export(), which causes the
LightSong::tag field to be dangling on the moved-from
ExportedSong::tag_buffer. This broke tags from CUE sheets.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1070
Commit 79b2366387 added the field `skip`
to support unaligned reads, but set the `offset` field to a wrong
value. This resulted in miscalculation of `remaining`, causing
an assertion failure.
The fix is to assign `offset` the correct value, but consider the
`skip` value in the assertion.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1067
I havn't yet figured out how to use Android's system CA certificates
with CURL/OpenSSL, so a temporary workaround is to disable verify_peer
by default. The data MPD transfers isn't extremely important, so the
servers's authenticity isn't extremely important either.
The original base relative path was introduced due to an erroneous test
where the URL started with three slashes: "https:///" instead of two,
which led to implementing handling for such cases but broke the two
slashes case.
This fix removes the base relative path handling because with two
slashes the path is anyway always relative to the host (aka absolute
URI, without host).
This reverts 216f62ea14 and part of 74b2fc7fdc
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
Use uri_has_scheme to find out if the href in Webdav responses is absolute
to use the matching base path extraction.
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
There can be more than one propstat block each with their own status
code. We're only interested in the one with the 200 status, the found
properties.
This fixes parsing to make sure we process all propstat blocks instead
of just the last one, which might have a 404 status for not-found
properties.
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
Remove additional "a:prop" in PROPFIND request to match RFC 4918 section 9.1.3.
Added Content-Type header as the body is not a true multipart POST.
Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
Some FFmpeg filters change the sample format, and since MPD assumes
this never happens, this results in loud noise instead of music. This
commit finally implements the TODO comment by sending one frame of
silence to the filter and checking the output frame's format.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1009
Pass a std::string to PathTraitsUTF8::Relative(), implicitly casting
it to std::string_view. This selects the right overload which returns
std::string_view instead of `const char *`; the latter could return
`nullptr` which would cause the implicit conversion of the return
value to std::string_view to crash.
Regression caused by commits ead208987d and a98d627c0b.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/995
This allows users to disable the "CUE files as directories" feature
without having to disable the CUE playlist plugin completely. This
feature has been annoying some users.
It's been 9 years already, and there's no point in insisting on the 21
year old C standard. MPD doesn't have a lot of C code left, but why
not compile it with the latest language revision.
Since MPD is a long-running daemon, it doesn't make sense to use
dynamic binding. That allows the relocations to be read-only
("relro"), which a hardening feature.
The bug https://bugzilla.samba.org/show_bug.cgi?id=11413 makes MPD
crash after at most a minute of using the plugin. Since this bug is
five years old already and it doesn't look like it will ever be fixed,
all libsmbclient code in MPD is scheduled for removal. For now, the
plugin is disabled by default so people are less likely to hit the
crash bug.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/991
This got lost in commit 5d597a3646 (v0.21.19), but it was never
noticed because the state_file_interval was way too short due to
commit 3413d1bf23, fixed recently by commit 27cc7b352d
snprintf() is available on mingw, and the libnfs kludge broke the
build with mingw, because sprintf_s() was now both an inline function
and a "dllimport" function (because the macro renamed the inline
function snprintf() to sprintf_s() in mingw's stdio.h).
Fixes regression by commit 23d5a2b862 -
that commit always pretended that any Opus file has both track and
album gain, and thus disabled the fallback to the other if one is not
set.
This patch changes the logic to only submit ReplayGain if at least one
value is set, and apply the offset only to that value. If none is
available, then the new check in HandleAudio() will submit only the
output gain.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/977
By bit-wise ANDing the reported flags with GetScheduledFlags(),
ERROR/HANGUP always get cleared. This means the MPD event loop could
never report those conditions.
Oh no, 3413d1bf23 was broken! Instead of passing a number as
"seconds" to the duration constructor, it just abused the duration
constructor as cast operator, which caused custom state_file_interval
settings to be extremely short.
This allows canceling the blocking method LockWaitWriteAvailable(),
and thus allows breaking free of misbehaving ALSA drivers, avoiding a
MPD lockup.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/966
This allows interrupting the output thread (for some plugins which
implement this method). This way, operations can be canceled
properly, instead of waiting for some external entity.
clocale is part of C++11.
In practical terms, gcc's libstdc++ comes with its own locale defines
when the libc does not have them.
Also reworked to be dependent on !ANDROID.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
My concept with `class CancellableOperation` doesn't work properly,
because the kernel may continue to write to the given buffer as soon
as the read finishes.
To fix this, this commit adds `class ReadOperation` which owns the
buffer and the `struct iovec`. Instances of this class persist until
the read really finishes, even if the operation is canceled.
And un-deprecate "pause" without parameter (toggles pause). I have no
idea why it was deprecated long ago; the deprecation notice was copied
from the ancient MPD wiki.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/944
Similar to commit 4e2a551f30 but for
decoder plugins. This is tailored for the FFmpeg decoder plugin which
implements some protocols (e.g. RTSP) as demuxer plugin.
This fixes a spurious "single" mode bug which occurs when using "play"
or "seek" to start playback on the song that is currently paused: in
that case, the main thread never queues the next song, and at the end
of the song, the player thread exits Run(), stopping playback, and
after that, the main thread starts the next song without considering
"single" mode.
By calling OnPlayerSync(), we ensure that the main thread gets a
chance to queue the next song before the player thread exits the Run()
loop.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/850
The log levels have always been very confusing (and badly named), but
this was most confusing: if there's a log level called "default", why
is it not the default?
Closes https://github.com/MusicPlayerDaemon/MPD/issues/926
Oh the horror! This plugin cannot possibly ever have worked. It was
broken from the start, when it was added in commit 37796699cf nearly
twelve (!) years ago.
The plugin would always read at sector boundaries, so it could only
ever work at multiples of 2 kB.
MPD uses soxr with prefined resample recipes. Soxr also support defining a recipe your self.
This commit will support a custom recipe by changing the existing quality setting to "custom".
The same structs as the predefined recipes uses can now set by hand.
This will make the following settings available:
- precision 16|20|24|28|32 bits, example "28"
- phase_response - 0-100, example "45"
- passband_end - used bandwidth of source 80-99.7%, example "99.7.0"
- stopband_begin - anti aliasing 100.0+%, example "100".
- attenuation - signal reduciton in dB's, 0-30. example "3.0".
- flags "0" - additional bitmask with extra settings
The data is set in the structs soxr_quality_spec and soxr_io_spec (found in soxr.h).
This fixes the Windows build. Linking failed because some packages
(e.g. libFLAC) default to enabling `_FORTIFY_SOURCE`, which is broken
in recent mingw versions
(https://github.com/msys2/MINGW-packages/issues/5803).
While libsndfile doesn't like partial reads in the middle of a file
(see commit 95ac6071b9), it allows partial reads at the end of a file.
It doesn't pay attention to the file size when issuing a read.
Commit ecb67a1ed1 (MPD 0.18.12) was a regression: previously,
partial reads at the end of a file were possible, but switching to
decoder_read_full() made this an error condition. This way, a portion
at the end of each file was lost, leading to corruption with gapless
playback (https://github.com/MusicPlayerDaemon/MPD/issues/936).
This fix switches to the newly introduced function
decoder_read_much(), which does the same as the code before commit
ecb67a1ed1.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/936
Our AudioObjectGetPropertyDataT() wrapper throws exception on error,
and calling it from OSXOutput::Disable() can cause MPD crash due to
std::terminate().
Closes https://github.com/MusicPlayerDaemon/MPD/issues/932
install_man() is currently broken with Meson and doesn't support a
custom target argument.
The problem with this kludge is that both mpd.1 and mpd.conf.5 are
installed in /usr/share/man/man1/, but apparently, there's no solution
yet.
This allows automatic optional detection of Sphinx. This will be
useful when we start building the manpages with Sphinx, which many
users may want to have.
Mounting one storage URI twice on different mount points can lead to
conflicts with the database cache file, and it doesn't make a lot of
sense.
But most importantly, our udisks storage plugin will unmount the disk
from the kernel VFS, and if two exist, they will compete with each
others. We could (and should) fix this in the udisks storage plugin,
but for now, this workaround is good enough (and useful).
When mounting something over a directory that is already a mount
point, CompositeStorage::Mount() silently overwrites the previously
mounted storage, disposing it. After that, SimpleDatabase::Mount()
will fail and handle_mount() will roll back the
CompositeStorage::Mount() command, effectively unmounting what was
there before (and also leaking memory).
Closes https://github.com/MusicPlayerDaemon/MPD/issues/918
Bug #915 is about an I/O exception thrown where none was allowed,
leading to crash via std::terminate(). However, instead of catching
and logging the error inside the decoder plugin, it should be able to
propagate the I/O error to the MPD core, so MPD can avoid trying other
decoder plugins.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/915
This will keep track of AudioOutputUnitStart() and
AudioOutputUnitStop(). This will provide some separation between "not
(yet) (re)started" and "paused".
The formula in osx_output_score_sample_rate() to detect multiples of
the source sample rate was broken: when given a 44.1 kHz input file,
it preferred 16 kHz over 48 kHz, because its `frac_portion(16)=0.75`
is smaller than `frac_portion(48)=0.91`.
That formula, introduced by commit 40a1ebee29, looks completely
wrong. It doesn't do what the code comment pretends it does.
Instead of using that `frac_portion` to calculate a score, this patch
adds to the score only if `frac_portion` is nearly `0` or `1`. This
means that the factor is nearly integer.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/904
Since Meson 0.51, there are special build options for "native:true"
builds, prefixed with "build.". This change breaks cross builds
because `GenParseName.cxx` is no longer built with `-std=c++17`.
This patch adds defaults for "build.c_std" and "build.cpp_std".
Closes https://github.com/MusicPlayerDaemon/MPD/issues/890
A bug report (https://github.com/MusicPlayerDaemon/MPD/issues/912)
suggests that on Linux, reading on `cifs` files may rarely return 0 (=
end of file) before the end of the file has really been reached. But
that's just a theory which I need to validate, so this runtime check
shall catch this condition before the assertion in
DecoderBridge::Read() crashes MPD. Let's see.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/912
An assertion failure in UpdateQueuedSong() could trigger because the
`prev` parameter is always `nullptr`, but `queued` may be set. And in
fact, calling UpdateQueuedSong() is only necessary when the queued
song was edited, to re-queue it with the new range.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/901
When the client wants to seek, but the decoder has already finished
decoding the current song, the player restarts the decoder with an
initial seek at the new position. When this initial seek fails, MPD
pretends nothing has happened and plays this song from the start.
With this new flag, a restarted decoder marks the initial seek as
"essential" and fails the decoder if that seek fails.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/895
Before the advent of io_uring (commit dae8da7066), this didn't
matter, because the `FileInputStream` never called this. But
`UringInputStream` is derived from `AsyncInputStream`, and needs the
handler to signal completion.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/898
Passing `length+1` to `MultiByteToWideChar()` means the function may
fill the whole buffer with output data, and could theoretically
overwrite the null terminator. In practice, this will never happen,
but this way, it's slightly more correct.
Also, null-terminate after `MultiByteToWideChar()`, after we got the
real output length. Again, this would never have been a problem, but
who knows...
This branch isn't yet ready for level 3 (`-Wpedantic`) due to several
C++ violations (e.g. variable length arrays). These are already
cleaned up in the master branch (0.22).
The WildMidi project added the pkg-config file in version 0.3.3, but
unfortunately, Debian still doesn't ship it 4 years later:
https://bugs.debian.org/916631
However, for cross-compiling, the pkg-config file is very helpful.
Commit 60f957ed64 broken the GCC 7 build, but instead of working
around missing C++17 features in old compilers, let's update the
compiler version requirements.
This commit raises the clang requirement to version 5 because this is
the first version to support `constexpr` lambdas, to be used to
`Dsd2Pcm.cxx`.
Fixes regression from commit db93bb996c because
ParseMimeTypeParameters() assumed the items were null-terminated, but
after that commit, they were not anymore.
This is the final piece of the series to establish io_uring support on
Linux.
MPD doesn't need io_uring for its efficient bulk I/O support, but to
allow file I/O to be cancelled. This is a big problem on CIFS/NFS
mounts where processes sleep uninterruptable if the file server
disappears, deadlocking MPD.
With io_uring, a flaky NFS connection allows MPD to continue to work
(even though there are still deadlocks inside MPD which need to be
addressed).
This plugin does not yet use cancellable `open()` using
`IORING_OP_OPENAT`. This will be implemented later.
Lots of other optimization opportunities for io_uring are still
missing as well - for example the database update could benefit a lot,
but unfortunately, io_uring doesn't have `readdir()` support just yet.
Reduces unstripped size. stripped size is the same.
Also took the time to remove using std::placeholders.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The command is used to configure the client's connection, and this
shouldn't require any permissions. The client should be able to do
that before sending a password.
The parser implemented in libmpdclient requires the first key-value pair
of the server response to be the file pair. This is due to the fact that
libmpdclient scan pairs sequentially and first attempts to extract the
file pair before parsing the currentsong response further. See:
5c751a761e/src/song.c (L559-L563)
Meta data encoded as pairs in the currentsong response will be ignored
if they are placed before the file pair in the response.
libnfs is compiled with `-D_FILE_OFFSET_BITS=64`, but Meson decides
not to enable this mode. We could force this mode, but then again,
these days, nobody should be using 32-bit Windows ... so this is a
kludge only for debugging with 32-bit WINE.
This fixes a freeze bug in the NFS input/storage plugins: when libnfs
auto-reconnets after a failure, it installs the new socket on the same
file descriptor number. MPD's attempt to unregister the old socket by
calling SocketMonitor::Steal() from NfsConnection::ScheduleSocket()
fails because the new/old socket number is not registered in epoll, so
epoll_ctl() returns ENOENT. The problem is that it left
`scheduled_flags`, and so subsequent Schedule() calls will use
`EPOLL_CTL_MOD`, which will fail again and again. Instead, we need to
use `EPOLL_CTL_ADD` to register the new socket.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/806
Closes https://github.com/MusicPlayerDaemon/MPD/issues/756
LINGUISTIC_IGNORECASE is unimplemented on Wine, but since we don't
have any locale support (yet), and we're using LOCALE_NAME_INVARIANT,
NORM_IGNORECASE should essentially be the same, so why bother.
Unescape the base path and the path coming from the server (href) to fix the
comparison when the server uses different escaped characters.
The outputted name need to be unescaped. Doing that before or after the
HrefToEscapedName() call should not change the current behavior.
If the file name is "Hello & bye", 3 CharacterData events will be sent with the
State::HREF state:
- "Hello%20"
- "&"
- "%20bye"
Reproduced with files hosted on an apache2 DAV server: 2.4.38-3+deb10u3.
The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which
gets included by every header. Which means a header needs to be present.
(cherry picked from commit 79e9aff338)
std::all_of becomes constexpr in C++20. I'm not sure it results in better
performance.
Found with useStlAlgorithm
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This method gets called a lot during MPD startup, via FindChild() and
directory_load_subdir(), so this is worth optimizing at the expense of
code readability.
This speeds up MPD startup by 10%.
This reverts commit eb192137d6.
This is no longer necessary because we require FFmpeg 3.1 or newer
since MPD 0.21.2.
This fixes a deprecation warning because the implicit AVPacket copy
constructor copies the deprecated attribute `convergence_duration`.
_exit and std::_Exit are identical, expect the latter is standard C++.
Added several functions to the std namespace as a result of headers.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This seems to be required on recent Android versions (tested with Android 10).
This is also required for android TV services (cf. next commit).
This is done using Java reflection so that the project doesn't depend on
android compat libs.
This is the case with uClibc-ng currently.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 769cd0ee9f0cf8ceb026aa751b5d4a390bb5dbdc)
(changed define to match master)
This has nothing to do with uClibc. It has everything to do with gcc's
libstdc++.
C99 math can be compile time disabled for it. Check for that and use boost
lround when std is not available.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
lrint is a configurable version of lround that behaves either as round,
floor, ceil, or trunc based on setting the proper FE_ macro using
fset/getround. Given that it's not set at all and that it defaults to
round behavior, simply replace with round.
Also removed the util/Math defines.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The entire section falls under the else path of #ifdef _WIN32. Checking
for it makes no sense. Probably some refactoring mistake.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Documentation says the limit is 5, but it was really 10 (at least
since 2004). But since MPD wants to promote using many small clients
idling around, and these clients consume only very few resources, it
seems reasonable to raise this limit's default value.
exp10 is a GNU function, is not part of C++, and is not available
everywhere.
pow(10,x) is an alternative that works just as well. It is used in musl as
the implementation of exp10.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former is deprecated by C++14. The standard says they are the same:
The header defines all types and macros the same as the C standard library
header<stdint.h>.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former is deprecated with C++14. The standard says both are the same:
The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former was deprecated in C++14. The Standard says they are the same:
The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.
Also changed va_list to the std:: namespace version, which is the same.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former was deprecated with C++14. The standard says they are the same:
The contents of the header<csignal>are the same as the C standard library
header<signal.h>.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former was deprecated with C++14. The standard says they are the same
with one exception:
The header<climits>defines all macros the same as the C standard library
header<limits.h>.
[Note:The types of the constants defined by macros in<climits>are not
required to match the types to which themacros refer.— end note]
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former has been deprecated by C++14. They are also the same.
From the standard:
The contents and meaning of the header<cinttypes>are the same as the C
standard library header<inttypes.h>, with the following changes:
-The header<cinttypes>includes the header<cstdint>instead of<stdint.h>,and
—if and only if the typeintmax_tdesignates an extended integer type
(6.7.1), the following functionsignatures are added:intmax_t
abs(intmax_t);imaxdiv_t div(intmax_t, intmax_t);which shall have the same
semantics as the function signaturesintmax_t imaxabs(intmax_t)andimaxdiv_t
imaxdiv(intmax_t, intmax_t), respectively.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former is deprecated by C++14. It's also functionally the same.
From the standard:
19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
None of the functions in these files come from ctype.h
Also changed one instance of isdigit to the C++ variant.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
The former was deprecated with C++14.
According to the C++11 and C++17 standards, both files are identical.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Aparently, libcdio sometimes returns empty filenames, causing MPD
crashes. This shouldn't really happen, and I consider this a libcdio
bug - but if it happens, people blame MPD, so let's add a check.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/776
Fixes
../src/time/ISO8601.cxx:67:24: error: use of undeclared identifier 'strtoul'
unsigned long value = strtoul(s, &endptr, 10);
^
../src/time/ISO8601.cxx:77:14: error: use of undeclared identifier 'strtoul'
minutes = strtoul(s, &endptr, 10);
^
on NetBSD with clang 9.0.0.
Using libgme 0.6.2 on macOS, it appears that gme_info_t strings can be
empty, which creates weird track titles: (001/050)
This adds an additional check for an empty string.
"The issue is that ParseCommandArgSignedSongTime parses with
SongTime::FromS, not SignedSongTime::FromS, before casting back to a
SignedSongTime for the return. With x86 overflow rules this doesn't
matter, but on ARM the first cast turns negative values to zero."
Closes https://github.com/MusicPlayerDaemon/MPD/issues/757
This doesn't work because IterableSplitString() returns its elements
by value.
Fixes clang warning:
loop variable 'i' is always a copy because the range of type 'IterableSplitString' (aka 'BasicIterableSplitString<char>') does not return a reference [-Werror,-Wrange-loop-analysis]
When calling OggSeekFindEOS() from inside a OggVisitor callback, then
the #InputStream may be in the middle of an Ogg packet, and the newly
initialized #ogg_sync_state will not be able to load it without the
help of ogg_sync_pageseek(). By passing "synced=false" to
OggSeekFindEOS(), we force the use of ogg_sync_pageseek() even when
not actually seeking.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/719
This reverts commit c84bae739a. A
configuration option is not necessary, because the PcmConvert
constructor knows already whether integer or floating point is needed.
It appears that [[fallthrough]] is valid in C++ but not in C. And
in some Clang versions (e.g. Clang 11 on macOS), Clang is pedantic
about this and considers it an error to use [[fallthrough]] in a
.c file such as src/util/format.c.
This changes makes gcc_fallthrough a no-op under Clang in C files.
This reverts commit 4475b8ca04. Further
testing revealed that the threaded resolver still uses a timeout of
0ms. This revert however lowers the bound to a minimum of 1ms instead
of 10ms.
This prepares the migration away from strptime() for Windows
portability.
But the real reason I'm doing this is that strptime() on Apple is
buggy: strptime("14", "%H%M%S") (without separating colons) succeeds
even though only the hour has been parsed. This fixes recent Travis
failures in the ParseISO8601() unit test.
Older clang versions don't support the GCC __attribute__ syntax. For
those, don't use anything at all, and new clang versions shall use the
standard syntax.
Expand $PATH at evaluation and not at assignment, which fixes the
problem that /usr/lib/ccache was added to $PATH between the
MATRIX_EVAL assignment and its evaluation.
This can cause request completion in the I/O thread before this
constructor returns, leaving the object in an abstract state, causing
a crash due to pure virtual method call. We should not start the
request until this object is fully constructed.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/665
The ALSA "null" driver opens /dev/null and returns the file handle
from snd_pcm_poll_descriptors(), but /dev/null cannot be used with
epoll, the epoll_ctl() system call returns -EPERM. This means that
the ALSA output hangs, eventually freezing the whole MPD process.
This commit adds a workaround to the MultiSocketMonitor class which is
used by the ALSA output plugin.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/695
Most importantly, this commit translates ZZIP_ENOENT to
std::system_error(ENOENT) so IsFileNotFound() returns true and
find_stream_art() can suppress the log line.
This also reverts the previous commit which was wrong. When the
Vorbis decoder is disabled, we can't compile VorbisComments.cxx at
all.
Instead of expanding the #ifdef, this commit moves VorbisComments.cxx
to a separate library with dependencies on libvorbis (which was
missing previously, which could also lead to build failures if the
libvorbis headers were in a non-standard directory).
Commit 13208bf5a7 added range support to
the `move` command, but applied the wrong offset to the `to` variable.
When the source range is before the current song, and the song thus
gets decremented by the range size, then the final destination offset
must also be decremented by the range size.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/663
On linux-rt, kernel IRQ threads are configured with priority=50, and
this change configures MPD somewhat below that priority, leaving some
room for other programs to be configured in between.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/643
Without requesting the property, "good" WebDAV servers would not send
it, and so MPD could never recognize a directory, failing the database
update.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/660
Apparently, libmpcdec sets gain/peak variables to zero if they are not
present. This clashes with our formula and results in bogus values
which cause noise during playback.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/640
This commit adds a PlaylistPlugin attribute "as_folder" which for now
is only enabled in the "CUE" playlist plugin (which handles separate
"*.cue" files). If a playlist with this flag set is being scanned
during database update, it will be parsed and its contents will be
added to the database. This allows clients to inspect them like
directories and its contents will be searchable.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/39
This attribute is not a URI; it is just the filename without its
parent directory path. To avoid confusion, let's rename it to
"filename", leaving the struct without a "uri" attribute.
No longer allocate it as a "VarSize". This used to be a clever trick
to save memory 10 years ago, but these days, keeping the code
maintainable seems more important than saving a few kilobytes of
memory.
This header had been available for a long time on Linux, but was
removed in glibc 2.30. This commit moves the `#include` line inside
the `#ifdef __sun` block and adds a fake declaration of `I_FLUSH` for
the Linux build.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/630
This reverts commit 58d7804d66. It
caused a use-after-free bug when Client::OnSocketError() was called
due to a failed write, e.g. if the output buffer was full.
The new Response instance in the `catch` block didn't have the
`command` attribute set, so the error response didn't indicate which
command had failed, which however is required in the MPD protocol.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/628
This optimization is useless because sane pthread_cond_signal()
implementations check the number of waiters and do not invoke a system
call if there are none.
SID files are generally collections of tunes, so a SID name field makes
sense as an MPD album. The SID tune information list (STIL) has name
and title fields for individual tunes, when such are known, but MPD is
currently not using the STIL.
High Voltage SID Collection (HVSC) metadata fields are encoded in
windows-1252, as described in DOCUMENTS/SID_file_format.txt:
https://www.hvsc.c64.org/download/C64Music/DOCUMENTS/SID_file_format.txt
If utf-8 transcoding fails, or the ICU library is unavailable, fall
back to plain ASCII and replace other characters with '?'.
Genres are not part of the SID format, so SID files are genreless. This
"default_genre" option may be used to assign a default genre to all SID
music, for example "SID", "C64", "Chiptune", etc.
This is useful in multiple mpd instances scenario, or multiple pulse outputs defined on the same mpd instance.
It is actually a more flexible way to route flows than the "sink" parameter, letting the PulseAudio routing do its job, but with the ability to isolate routing for each output.
If not specified, the role remains like it was before this commit, ie "music"
Applying software volume to S16 samples means several bits of
precision are lost; at 25% volume, two bits are lost. Additionally,
dithering adds some noise.
The problem gets worse when you apply the software volume code twice:
for the software mixer volume, and again for the replay gain. This
loses some more precision and adds even more dithering noise, which
can become audible (see
https://github.com/MusicPlayerDaemon/MPD/issues/542).
By converting everything to 24 bit, we need to shift only two bits to
the right instead of ten, losing nearly no precision, and dithering is
not needed. Even if the output device is unable to play S24 directly,
we can convert back to S16 with only one stage of dithering.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/542
Pass only the amount of data to PcmExport::Export() when its full
output fits into the ring buffer. Using only a part of the
PcmExport::Export() result may cause data corruption because
PcmExport's internal state may contain partial blocks which would need
to be rolled back when only some of its output data was used.
As a side effect, this fixes an assertion failure because
PcmExport::CalcInputSize() considered partial block data and could
cause Play() to return a number larger than the "size" parameter.
Fix src/ls.cxx to only print unique schemas.
Refactor src/ls.cxx to use src/input/InputPlugin functionality.
Add dynamic enumeration support to curl plugin.
This gives MPD more control, because attempts to avoid having partial
periods in the ALSA period buffer. For example, this means that
DrainInternal() doesn't need to generate silence to fill the partial
period.
Add a `constexpr` constructor and several `constexpr` methods to
construct a DecoderPlugin at compile time, in a way which allows
adding new methods later without having to edit each plugin.
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
Don't call Seek() if the stream is already at the beginning. This
avoids unnecessary exceptions if seeking is not implemented by an
Inputstream implementation.
PluginUnconfigured exceptions are logged with level "info" instead of
"error". This suppresses some rather boring messages in the default
log level.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/565
This is the documented value, but for unknown reasons, "info" was
really the default.
This was never noticed because there are only very few "info" level
messages.
If a read error occurs, it is very unlikely that the InputStream will
ever recover. Removing the code removes some code complexity which
just isn't worth it. And it allows supporting multiple readers for
one buffer.
On Windows, we keep using our own implementations, because GCC
implements std::mutex and std::condition_variable with pthread
emulation, which is not a good choice.
using the device "default" brings this plugin into line with the AlsaOutputPlugin; and a sample rate of 48kHz is more widely used as a native default for modern hardware than 44.1kHz
Also fixes an inconsistency between the docs and code.
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 ``~/.mpd/mpd.conf`` then ``/etc/mpd.conf`` or uses ``CONF_FILE``.
Read more about MPD at http://www.musicpd.org/
OPTIONS
-------
..program:: mpd
..option:: --help
Output a brief help message.
..option:: --kill
Kill the currently running mpd session. The pid_file parameter must be specified in the config file for this to work.
..option:: --no-config
Don't read from the configuration file.
..option:: --no-daemon
Don't detach from console.
..option:: --stderr
Print messages to stderr.
..option:: --verbose
Verbose logging.
..option:: --version
Print version information.
FILES
-----
:file:`$XDG_CONFIG_HOME/mpd/mpd.conf`
User configuration file (usually :file:`~/.config/mpd/mpd.conf`).
:file:`/etc/mpd.conf`
Global configuration file.
SEE ALSO
--------
:manpage:`mpd.conf(5)`, :manpage:`mpc(1)`
BUGS
----
If you find a bug, please report it at https://github.com/MusicPlayerDaemon/MPD/issues/
@@ -27,7 +27,7 @@ The default plugin. Stores a copy of the database in memory. A file is used for
proxy
-----
Provides access to the database of another :program:`MPD` instance using libmpdclient. This is useful when you run mount the music directory via NFS/SMB, and the file server already runs a :program:`MPD` instance. Only the file server needs to update the database.
Provides access to the database of another :program:`MPD` instance using libmpdclient. This is useful when you mount the music directory via NFS/SMB, and the file server already runs a :program:`MPD` instance. Only the file server needs to update the database.
..list-table::
:widths:20 80
@@ -42,7 +42,7 @@ Provides access to the database of another :program:`MPD` instance using libmpdc
* - **password**
- The password used to log in to the "master" :program:`MPD` instance.
* - **keepalive yes|no**
- Send TCP keepalive packets to the "master" :program:`MPD` instance? This option can help avoid certain firewalls dropping inactive connections, at the expensive of a very small amount of additional network traffic. Disabled by default.
- Send TCP keepalive packets to the "master" :program:`MPD` instance? This option can help avoid certain firewalls dropping inactive connections, at the expense of a very small amount of additional network traffic. Disabled by default.
upnp
----
@@ -60,25 +60,30 @@ The default plugin which gives :program:`MPD` access to local files. It is used
curl
----
A WebDAV client using libcurl. It is used when :code:`music_directory` contains a http:// or https:// URI, for example :samp:`https://the.server/dav/`.
A WebDAV client using libcurl. It is used when :code:`music_directory`
contains a ``http://`` or ``https://`` URI, for example
:samp:`https://the.server/dav/`.
smbclient
---------
Load music files from a SMB/CIFS server. It is used when:code:`music_directory` contains a smb:// URI, for example :samp:`smb://myfileserver/Music`.
Load music files from a SMB/CIFS server. It is used when
:code:`music_directory` contains a ``smb://`` URI, for example
:samp:`smb://myfileserver/Music`.
Note that :file:`libsmbclient` has a serious bug which causes MPD to
crash, and therefore this plugin is disabled by default and should not
be used until the bug is fixed:
https://bugzilla.samba.org/show_bug.cgi?id=11413
nfs
---
Load music files from a NFS server. It is used when:code:`music_directory` contains a nfs:// URI according to RFC2224, for example :samp:`nfs://servername/path`.
Load music files from a NFS server. It is used when
:code:`music_directory` contains a ``nfs://`` URI according to
RFC2224, for example :samp:`nfs://servername/path`.
This plugin uses libnfs, which supports only NFS version 3. Since :program:`MPD` is not allowed to bind to "privileged ports", the NFS server needs to enable the "insecure" setting; example :file:`/etc/exports`:
..code-block::none
/srv/mp3 192.168.1.55(ro,insecure)
Don't fear: "insecure" does not mean that your NFS server is insecure. A few decades ago, people thought the concept of "privileged ports" would make network services "secure", which was a fallacy. The absence of this obsolete "security" measure means little.
See :ref:`input_nfs` for more information.
udisks
------
@@ -116,7 +121,7 @@ Provides a list of SMB/CIFS servers on the local network.
udisks
------
Queries the udisks2 daemon via D-Bus and obtain a list of file systems (e.g. USB sticks or other removable media).
Queries the udisks2 daemon via D-Bus and obtains a list of file systems (e.g. USB sticks or other removable media).
upnp
----
@@ -131,15 +136,39 @@ Input plugins
alsa
----
Allows :program:`MPD` on Linux to play audio directly from a soundcard using the scheme alsa://. Audio is formatted as 44.1 kHz 16-bit stereo (CD format). Examples:
Allows :program:`MPD` on Linux to play audio directly from a soundcard using the scheme alsa://. Audio is by default formatted as 48 kHz 16-bit stereo, but this default can be overidden by a config file setting or by the URI. Examples:
..code-block::none
mpc add alsa:// plays audio from device hw:0,0
mpc add alsa:// plays audio from device default
..code-block::none
mpc add alsa://hw:1,0 plays audio from device hw:1,0 cdio_paranoia
mpc add alsa://hw:1,0 plays audio from device hw:1,0
..code-block::none
mpc add alsa://hw:1,0?format=44100:16:2 plays audio from device hw:1,0 sampling 16-bit stereo at 44.1kHz.
..list-table::
:widths:20 80
:header-rows:1
* - Setting
- Description
* - **default_device NAME**
- The alsa device id to use when none is specified in the URI.
* - **default_format F**
- The sampling rate, size and channels to use. Wildcards are not allowed.
Example - "44100:16:2"
* - **auto_resample yes|no**
- If set to no, then libasound will not attempt to resample. In this case, the user is responsible for ensuring that the requested sample rate can be produced natively by the device, otherwise an error will occur.
* - **auto_channels yes|no**
- If set to no, then libasound will not attempt to convert between different channel numbers. The user must ensure that the device supports the requested channels when sampling.
* - **auto_format yes|no**
- If set to no, then libasound will not attempt to convert between different sample formats (16 bit, 24 bit, floating point, ...). Again the user must ensure that the requested format is available natively from the device.
cdio_paranoia
-------------
@@ -162,7 +191,10 @@ curl
Opens remote files or streams over HTTP using libcurl.
Note that unless overridden by the below settings (e.g. by setting them to a blank value), general curl configuration from environment variables such as http_proxy or specified in :file:`~/.curlrc` will be in effect.
Note that unless overridden by the below settings (e.g. by setting
them to a blank value), general curl configuration from environment
variables such as ``http_proxy`` or specified in :file:`~/.curlrc`
will be in effect.
..list-table::
:widths:20 80
@@ -182,7 +214,9 @@ Note that unless overridden by the below settings (e.g. by setting them to a bla
ffmpeg
------
Access to various network protocols implemented by the FFmpeg library: gopher://, rtp://, rtsp://, rtmp://, rtmpt://, rtmps://
Access to various network protocols implemented by the FFmpeg library:
Plays streams with the MMS protocol using `libmms <https://launchpad.net/libmms>`_.
.._input_nfs:
nfs
---
Allows :program:`MPD` to access files on NFSv3 servers without actually mounting them (i.e. in userspace, without help from the kernel's VFS layer). All URIs with the nfs:// scheme are used according to RFC2224. Example:
Allows :program:`MPD` to access files on NFS servers without actually
mounting them (i.e. with :program:`libnfs` in userspace, without help
from the kernel's VFS layer). All URIs with the ``nfs://`` scheme are
used according to RFC2224. Example:
..code-block::none
mpc add nfs://servername/path/filename.ogg
Note that this usually requires enabling the "insecure" flag in the server's /etc/exports file, because :program:`MPD` cannot bind to so-called "privileged" ports. Don't fear: this will not make your file server insecure; the flag was named in a time long ago when privileged ports were thought to be meaningful for security. By today's standards, NFSv3 is not secure at all, and if you believe it is, you're already doomed.
This plugin uses :program:`libnfs`, which supports only NFS version 3.
Since :program:`MPD` is not allowed to bind to so-called "privileged
ports", the NFS server needs to enable the ``insecure`` setting;
example :file:`/etc/exports`:
..code-block::none
/srv/mp3 192.168.1.55(ro,insecure)
Don't fear: this will not make your file server insecure; the flag was
named a time long ago when privileged ports were thought to be
meaningful for security. By today's standards, NFSv3 is not secure at
all, and if you believe it is, you're already doomed.
smbclient
---------
Allows :program:`MPD` to access files on SMB/CIFS servers (e.g. Samba or Microsoft Windows). All URIs with the smb:// scheme are used. Example:
Allows :program:`MPD` to access files on SMB/CIFS servers (e.g. Samba
or Microsoft Windows). All URIs with the ``smb://`` scheme are
is a MP4 container file (:file:`*.m4a`) which contains both ALAC and
is an MP4 container file (:file:`*.m4a`) which contains both ALAC and
DSD data. It is disabled by default, and works only if you explicitly
enable it. Without this plugin, the ALAC parts gets handled by the
`FFmpeg decoder plugin
<https://www.musicpd.org/doc/user/decoder_plugins.html#ffmpeg_decoder>`_. This
:ref:`FFmpeg decoder plugin <decoder_ffmpeg>`. This
plugin should be enabled only if you have a bit-perfect playback path
to a DSD-capable DAC; for everybody else, playing back the ALAC copy
of the file is better.
..list-table::
:widths:20 80
:header-rows:1
* - Setting
- Description
* - **gapless yes|no**
- This specifies whether to support gapless playback of MP3s which have the necessary headers. Useful if your MP3s have headers with incorrect information. If you have such MP3s, it is highly recommended that you fix them using `vbrfix <http://www.willwap.co.uk/Programs/vbrfix.php>`_ instead of disabling gapless MP3 playback. The default is to support gapless MP3 playback.
mad
---
@@ -434,7 +493,9 @@ Decodes Musepack files using `libmpcdec <http://www.musepack.net/>`_.
mpg123
------
Decodes MP3 files using `libmpg123 <http://www.mpg123.de/>`_.
Decodes MP3 files using `libmpg123 <http://www.mpg123.de/>`_. Currently, this
decoder does not support streams (e.g. archived files, remote files over HTTP,
...), only regular local files.
opus
----
@@ -444,7 +505,7 @@ Decodes Opus files using `libopus <http://www.opus-codec.org/>`_.
pcm
---
Read raw PCM samples. It understands the "audio/L16" MIME type with parameters "rate" and "channels" according to RFC 2586. It also understands the MPD-specific MIME type "audio/x-mpd-float".
Reads raw PCM samples. It understands the "audio/L16" MIME type with parameters "rate" and "channels" according to RFC 2586. It also understands the MPD-specific MIME type "audio/x-mpd-float".
sidplay
-------
@@ -458,9 +519,11 @@ C64 SID decoder based on `libsidplayfp <https://sourceforge.net/projects/sidplay
* - Setting
- Description
* - **songlength_database PATH**
- Location of your songlengths file, as distributed with the HVSC. The sidplay plugin checks this for matching MD5 fingerprints. See http://www.hvsc.c64.org/download/C64Music/DOCUMENTS/Songlengths.faq.
- Location of your songlengths file, as distributed with the HVSC. The sidplay plugin checks this for matching MD5 fingerprints. See http://www.hvsc.c64.org/download/C64Music/DOCUMENTS/Songlengths.faq. New songlength format support requires libsidplayfp 2.0 or later.
* - **default_songlength SECONDS**
- This is the default playing time in seconds for songs not in the songlength database, or in case you're not using a database. A value of 0 means play indefinitely.
* - **default_genre GENRE**
- Optional default genre for SID songs.
* - **filter yes|no**
- Turns the SID filter emulation on or off.
* - **kernal**
@@ -696,6 +759,29 @@ Valid quality values for libsoxr:
* "medium"
* "low"
* "quick"
* "custom"
If the quality is set to custom also the following settings are available:
..list-table::
:widths:20 80
:header-rows:1
* - Name
- Description
* - **precision**
- The precision in bits. Valid values 16,20,24,28 and 32 bits.
* - **phase_response**
- Between the 0-100, Where 0=MINIMUM_PHASE and 50=LINEAR_PHASE.
* - **passband_end**
- The % of source bandwidth where to start filtering. Typical between the 90-99.7.
* - **stopband_begin**
- The % of the source bandwidth Where the anti aliasing filter start. Value 100+.
* - **attenuation**
- Reduction in dB's to prevent clipping from the resampling process.
* - **flags**
- Bitmask with additional option see soxr documentation for specific flags.
.._output_plugins:
@@ -840,6 +926,10 @@ The jack plugin connects to a `JACK server <http://jackaudio.org/>`_.
- The names of the JACK source ports to be created. By default, the ports "left" and "right" are created. To use more ports, you have to tweak this option.
* - **destination_ports A,B**
- The names of the JACK destination ports to connect to.
* - **auto_destination_ports yes|no**
- If set to *yes*, then MPD will automatically create connections between the send ports of
MPD and receive ports of the first sound card; if set to *no*, then MPD will only create
connections to the contents of *destination_ports* if it is set. Enabled by default.
* - **ringbuffer_size NBYTES**
- Sets the size of the ring buffer for each channel. Do not configure this value unless you know what you're doing.
@@ -974,6 +1064,8 @@ The pulse plugin connects to a `PulseAudio <http://www.freedesktop.org/wiki/Soft
- Sets the host name of the PulseAudio server. By default, :program:`MPD` connects to the local PulseAudio server.
* - **sink NAME**
- Specifies the name of the PulseAudio sink :program:`MPD` should play on.
* - **media_role ROLE**
- Specifies a custom media role that :program:`MPD` reports to PulseAudio. Default is "music". (optional).
* - **scale_volume FACTOR**
- Specifies a linear scaling coefficient (ranging from 0.5 to 5.0) to apply when adjusting volume through :program:`MPD`. For example, chosing a factor equal to ``"0.7"`` means that setting the volume to 100 in :program:`MPD` will set the PulseAudio volume to 70%, and a factor equal to ``"3.5"`` means that volume 100 in :program:`MPD` corresponds to a 350% PulseAudio volume.
@@ -1044,7 +1136,8 @@ sles
Plugin using the `OpenSL ES <https://www.khronos.org/opensles/>`__
audio API. Its primary use is local playback on Android, where
:ref:`ALSA <alsa_plugin>` is not available.
:ref:`ALSA <alsa_plugin>` is not available. It supports 16 bit and
floating point samples.
solaris
@@ -1061,15 +1154,62 @@ The "Solaris" plugin runs only on SUN Solaris, and plays via /dev/audio.
- Sets the path of the audio device, defaults to /dev/audio.
wasapi
------
The `Windows Audio Session API <https://docs.microsoft.com/en-us/windows/win32/coreaudio/wasapi>`_ plugin uses WASAPI, which is supported started from Windows Vista. It is recommended if you are using Windows.
..list-table::
:widths:20 80
:header-rows:1
* - Setting
- Description
* - **device NAME**
- Sets the device which should be used. This can be any valid audio device name, or index number. The default value is "", which makes WASAPI choose the default output device.
* - **enumerate yes|no**
- Enumerate all devices in log while playing started. Useful for device configuration. The default value is "no".
* - **exclusive yes|no**
- Exclusive mode blocks all other audio source, and get best audio quality without resampling. Stopping playing release the exclusive control of the output device. The default value is "no".
.._filter_plugins:
Filter plugins
==============
ffmpeg
------
Configures a FFmpeg filter graph.
This plugin requires building with ``libavfilter`` (FFmpeg).
..list-table::
:widths:20 80
:header-rows:1
* - Setting
- Description
* - **graph "..."**
- Specifies the ``libavfilter`` graph; read the `FFmpeg
Some commands can return binary data. This is initiated by a line
containing ``binary: 1234`` (followed as usual by a newline). After
that, the specified number of bytes of binary data follows, then a
newline, and finally the ``OK`` line. Example::
newline, and finally the ``OK`` line.
If the object to be transmitted is large, the server may choose a
reasonable chunk size and transmit only a portion. The maximum chunk
size can be changed by clients with the :ref:`binarylimit
<command_binarylimit>` command.
Usually, the response also contains a ``size`` line which specifies
the total (uncropped) size, and the command usually has a way to
specify an offset into the object; this way, the client can copy the
whole file without blocking the connection for too long.
Example::
foo: bar
binary: 42
@@ -163,7 +175,7 @@ syntax::
find EXPRESSION
``EXPRESSION`` is a string enclosed in parantheses which can be one
``EXPRESSION`` is a string enclosed in parentheses which can be one
of:
-``(TAG == 'VALUE')``: match a tag value; if there are multiple
@@ -209,15 +221,15 @@ of:
or more attributes may be ``*``).
-``(!EXPRESSION)``: negate an expression. Note that each expression
must be enclosed in parantheses, e.g. :code:`(!(artist == 'VALUE'))`
must be enclosed in parentheses, e.g. :code:`(!(artist == 'VALUE'))`
(which is equivalent to :code:`(artist != 'VALUE')`)
-``(EXPRESSION1 AND EXPRESSION2 ...)``: combine two or
more expressions with logical "and". Note that each expression must
be enclosed in parantheses, e.g. :code:`((artist == 'FOO') AND
be enclosed in parentheses, e.g. :code:`((artist == 'FOO') AND
(album == 'BAR'))`
The :command:`find` commands are case sensitive, which
The :command:`find` commands are case sensitive, while
:command:`search` and related commands ignore case.
Prior to MPD 0.21, the syntax looked like this::
@@ -272,8 +284,15 @@ The following tags are supported by :program:`MPD`:
***name**: a name for this song. This is not the song title. The exact meaning of this tag is not well-defined. It is often used by badly configured internet radio stations with broken tags to squeeze both the artist name and the song title in one tag.
***genre**: the music genre.
***date**: the song's release date. This is usually a 4-digit year.
***originaldate**: the song's original release date.
***composer**: the artist who composed the song.
***performer**: the artist who performed the song.
***conductor**: the conductor who conducted the song.
***work**: `"a work is a distinct intellectual or artistic creation,
which can be expressed in the form of one or more audio recordings" <https://musicbrainz.org/doc/Work>`_
***grouping**: "used if the sound belongs to a larger category of
sounds/music" (`from the IDv2.4.0 TIT1 description
<http://id3.org/id3v2.4.0-frames>`_).
***comment**: a human-readable comment about this song. The exact meaning of this tag is not well-defined.
***disc**: the decimal disc number in a multi-disc album.
***label**: the name of the label or publisher.
@@ -368,13 +387,19 @@ Command reference
Querying :program:`MPD`'s status
================================
.._command_clearerror:
:command:`clearerror`
Clears the current error message in status (this is also
accomplished by any command that starts playback).
.._command_currentsong:
:command:`currentsong`
Displays the song info of the current song (same song that
is identified in status).
is identified in status). Information about the current song
is represented by key-value pairs, one on each line. The first
pair must be the `file` key-value pair.
.._command_idle:
@@ -390,7 +415,9 @@ Querying :program:`MPD`'s status
-``update``: a database update has started or finished. If the database was modified during the update, the ``database`` event is also emitted.
-``stored_playlist``: a stored playlist has been modified, renamed, created or deleted
-``playlist``: the queue (i.e. the current playlist) has been modified
-``player``: the player has been started, stopped or seeked
-``player``: the player has been started, stopped or seeked or
tags of the currently playing song have changed (e.g. received
from stream)
-``mixer``: the volume has been changed
-``output``: an audio output has been added, removed or modified (e.g. renamed, enabled or disabled)
-``options``: options like repeat, random, crossfade, replay gain
@@ -398,9 +425,11 @@ Querying :program:`MPD`'s status
-``sticker``: the sticker database has been modified.
-``subscription``: a client has subscribed or unsubscribed to a channel
-``message``: a message was received on a channel this client is subscribed to; this event is only emitted when the queue is empty
-``neighbor``: a neighbor was found or lost
-``mount``: the mount list has changed
Change events accumulate, even while the connection is not in
"idle" mode; no events gets lost while the client is doing
"idle" mode; no events get lost while the client is doing
something else with the connection. If an event had already
occurred since the last call, the new :ref:`idle <command_idle>`
command will return immediately.
@@ -424,6 +453,8 @@ Querying :program:`MPD`'s status
Reports the current status of the player and the volume
level.
-``partition``: the name of the current partition (see
:ref:`partition_commands`)
-``volume``: ``0-100`` (deprecated: ``-1`` if the volume cannot
be determined)
-``repeat``: ``0`` or ``1``
@@ -456,6 +487,8 @@ Querying :program:`MPD`'s status
:program:`MPD` versions used to have a "magic" value for
"unknown", e.g. ":samp:`volume: -1`".
.._command_stats:
:command:`stats`
Displays statistics.
@@ -464,23 +497,32 @@ Querying :program:`MPD`'s status
-``songs``: number of songs
-``uptime``: daemon uptime in seconds
-``db_playtime``: sum of all song times in the database in seconds
-``db_update``: last db update in UNIX time
-``db_update``: last db update in UNIX time (seconds since
1970-01-01 UTC)
-``playtime``: time length of music played
Playback options
================
.._command_consume:
:command:`consume {STATE}`[#since_0_15]_
Sets consume state to ``STATE``,
``STATE`` should be 0 or 1.
When consume is activated, each song played is removed from playlist.
.._command_crossfade:
:command:`crossfade {SECONDS}`
Sets crossfading between songs.
.._command_mixrampdb:
:command:`mixrampdb {deciBels}`
Sets the threshold at which songs will be overlapped. Like crossfading but doesn't fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values, I prefer -17dB. In the absence of mixramp tags crossfading will be used. See http://sourceforge.net/projects/mixramp
.._command_mixrampdelay:
:command:`mixrampdelay {SECONDS}`
Additional time subtracted from the overlap calculated by mixrampdb. A value of "nan" disables MixRamp overlapping and falls back to crossfading.
@@ -490,6 +532,8 @@ Playback options
Sets random state to ``STATE``,
``STATE`` should be 0 or 1.
.._command_repeat:
:command:`repeat {STATE}`
Sets repeat state to ``STATE``,
``STATE`` should be 0 or 1.
@@ -500,12 +544,16 @@ Playback options
Sets volume to ``VOL``, the range of
volume is 0-100.
.._command_single:
:command:`single {STATE}`[#since_0_15]_
Sets single state to ``STATE``,
``STATE`` should be ``0``, ``1`` or ``oneshot``[#since_0_20]_.
``STATE`` should be ``0``, ``1`` or ``oneshot``[#since_0_21]_.
When single is activated, playback is stopped after current song, or
song is repeated if the 'repeat' mode is enabled.
.._command_replay_gain_mode:
:command:`replay_gain_mode {MODE}`[#since_0_16]_
Sets the replay gain mode. One of
``off``,
@@ -514,16 +562,20 @@ Playback options
``auto``
.
Changing the mode during playback may take several
seconds, because the new settings does not affect the
seconds, because the new settings do not affect the
buffered data.
This command triggers the
``options`` idle event.
.._command_replay_gain_status:
:command:`replay_gain_status`
Prints replay gain options. Currently, only the
variable ``replay_gain_mode`` is
returned.
.._command_volume:
:command:`volume {CHANGE}`
Changes volume by amount ``CHANGE``.
Deprecated, use :ref:`setvol <command_setvol>` instead.
@@ -531,41 +583,59 @@ Playback options
Controlling playback
====================
.._command_next:
:command:`next`
Plays next song in the playlist.
:command:`pause {PAUSE}`
Toggles pause/resumes playing, ``PAUSE`` is 0 or 1.
.._command_pause:
The use of pause command without the PAUSE argument is deprecated.
:command:`pause {STATE}`
Pause or resume playback. Pass :samp:`1` to pause playback or
:samp:`0` to resume playback. Without the parameter, the pause
state is toggled.
.._command_play:
:command:`play [SONGPOS]`
Begins playing the playlist at song number
``SONGPOS``.
.._command_playid:
:command:`playid [SONGID]`
Begins playing the playlist at song
``SONGID``.
.._command_previous:
:command:`previous`
Plays previous song in the playlist.
.._command_seek:
:command:`seek {SONGPOS} {TIME}`
Seeks to the position ``TIME`` (in
seconds; fractions allowed) of entry
``SONGPOS`` in the playlist.
.._command_seekid:
:command:`seekid {SONGID} {TIME}`
Seeks to the position ``TIME`` (in
seconds; fractions allowed) of song
``SONGID``.
.._command_seekcur:
:command:`seekcur {TIME}`
Seeks to the position ``TIME`` (in
seconds; fractions allowed) within the current song. If
prefixed by ``+`` or ``-``, then the time is relative to the
current playing position.
.._command_stop:
:command:`stop`
Stops playing.
@@ -600,11 +670,20 @@ client can always be sure the correct song is being used.
Many commands come in two flavors, one for each address type.
Whenever possible, ids should be used.
.._command_add:
:command:`add {URI}`
Adds the file ``URI`` to the playlist
(directories add recursively). ``URI``
can also be a single file.
Clients that are connected via local socket may add arbitrary
local files (URI is an absolute path). Exmaple::
add "/home/foo/Music/bar.ogg"
.._command_addid:
:command:`addid {URI} [POSITION]`
Adds a song to the playlist (non-recursive) and returns the
song id. ``URI`` is always a single file or URL. For example::
@@ -613,6 +692,8 @@ Whenever possible, ids should be used.
Id: 999
OK
.._command_clear:
:command:`clear`
Clears the queue.
@@ -621,15 +702,21 @@ Whenever possible, ids should be used.
:command:`delete [{POS} | {START:END}]`
Deletes a song from the playlist.
.._command_deleteid:
:command:`deleteid {SONGID}`
Deletes the song ``SONGID`` from the
playlist
.._command_move:
:command:`move [{FROM} | {START:END}] {TO}`
Moves the song at ``FROM`` or range of songs
at ``START:END``[#since_0_15]_ to ``TO``
in the playlist.
.._command_moveid:
:command:`moveid {FROM} {TO}`
Moves the song with ``FROM`` (songid) to
``TO`` (playlist index) in the
@@ -637,6 +724,8 @@ Whenever possible, ids should be used.
is relative to the current song in the playlist (if
there is one).
.._command_playlist:
:command:`playlist`
Displays the queue.
@@ -644,10 +733,14 @@ Whenever possible, ids should be used.
Do not use this, instead use :ref:`playlistinfo
<command_playlistinfo>`.
:command:`playlistfind {TAG} {NEEDLE}`
.._command_playlistfind:
:command:`playlistfind {FILTER}`
Finds songs in the queue with strict
matching.
.._command_playlistid:
:command:`playlistid {SONGID}`
Displays a list of songs in the playlist.
``SONGID`` is optional and specifies a
@@ -661,10 +754,14 @@ Whenever possible, ids should be used.
``SONGPOS`` or the range of songs
``START:END``[#since_0_15]_
:command:`playlistsearch {TAG} {NEEDLE}`
.._command_playlistsearch:
:command:`playlistsearch {FILTER}`
Searches case-insensitively for partial matches in the
queue.
.._command_plchanges:
:command:`plchanges {VERSION} [START:END]`
Displays changed songs currently in the playlist since
``VERSION``. Start and end positions may
@@ -674,6 +771,8 @@ Whenever possible, ids should be used.
To detect songs that were deleted at the end of the
playlist, use playlistlength returned by status command.
.._command_plchangesposid:
:command:`plchangesposid {VERSION} [START:END]`
Displays changed songs currently in the playlist since
``VERSION``. This function only
@@ -699,6 +798,8 @@ Whenever possible, ids should be used.
Same as :ref:`priod <command_prio>`,
but address the songs with their id.
.._command_rangeid:
:command:`rangeid {ID} {START:END}`[#since_0_19]_
Since :program:`MPD`
0.19 Specifies the portion of the
@@ -709,19 +810,27 @@ Whenever possible, ids should be used.
range, play everything". A song that is currently
playing cannot be manipulated this way.
.._command_shuffle:
:command:`shuffle [START:END]`
Shuffles the queue.
``START:END`` is optional and specifies
a range of songs.
.._command_swap:
:command:`swap {SONG1} {SONG2}`
Swaps the positions of ``SONG1`` and
``SONG2``.
.._command_swapid:
:command:`swapid {SONG1} {SONG2}`
Swaps the positions of ``SONG1`` and
``SONG2`` (both song ids).
.._command_addtagid:
:command:`addtagid {SONGID} {TAG} {VALUE}`
Adds a tag to the specified song. Editing song tags is
only possible for remote songs. This change is
@@ -729,6 +838,8 @@ Whenever possible, ids should be used.
the server, and the data is gone when the song gets
removed from the queue.
.._command_cleartagid:
:command:`cleartagid {SONGID} [TAG]`
Removes tags from the specified song. If
``TAG`` is not specified, then all tag
@@ -750,14 +861,20 @@ playlists in arbitrary location (absolute path including the suffix;
allowed only for clients that are connected via local socket), or
remote playlists (absolute URI with a supported scheme).
.._command_listplaylist:
:command:`listplaylist {NAME}`
Lists the songs in the playlist. Playlist plugins are
supported.
.._command_listplaylistinfo:
:command:`listplaylistinfo {NAME}`
Lists the songs with metadata in the playlist. Playlist
plugins are supported.
.._command_listplaylists:
:command:`listplaylists`
Prints a list of the playlist directory.
After each playlist name the server sends its last
@@ -773,27 +890,39 @@ remote playlists (absolute URI with a supported scheme).
plugins are supported. A range may be specified to load
only a part of the playlist.
.._command_playlistadd:
:command:`playlistadd {NAME} {URI}`
Adds ``URI`` to the playlist
`NAME.m3u`.
`NAME.m3u` will be created if it does
not exist.
.._command_playlistclear:
:command:`playlistclear {NAME}`
Clears the playlist `NAME.m3u`.
.._command_playlistdelete:
:command:`playlistdelete {NAME} {SONGPOS}`
Deletes ``SONGPOS`` from the
playlist `NAME.m3u`.
.._command_playlistmove:
:command:`playlistmove {NAME} {FROM} {TO}`
Moves the song at position ``FROM`` in
the playlist `NAME.m3u` to the
position ``TO``.
.._command_rename:
:command:`rename {NAME} {NEW_NAME}`
Renames the playlist `NAME.m3u` to `NEW_NAME.m3u`.
.._command_rm:
:command:`rm {NAME}`
Removes the playlist `NAME.m3u` from
the playlist directory.
@@ -807,12 +936,15 @@ remote playlists (absolute URI with a supported scheme).
The music database
==================
.._command_albumart:
:command:`albumart {URI} {OFFSET}`
Searches the directory the file ``URI``
resides in and attempts to return a chunk of an album
Locate album art for the given song and return a chunk of an album
art image file at offset ``OFFSET``.
Uses the filename "cover" with any of ".png, .jpg,
.tiff, .bmp".
This is currently implemented by searching the directory the file
resides in for a file called :file:`cover.png`, :file:`cover.jpg`,
:file:`cover.tiff` or :file:`cover.bmp`.
Returns the file size and actual number
of bytes read at the requested offset, followed
@@ -821,10 +953,13 @@ The music database
Example::
albumart
albumart foo/bar.ogg 0
size: 1024768
binary: 8192
<8192 bytes>OK
<8192 bytes>
OK
.._command_count:
:command:`count {FILTER} [group {GROUPTYPE}]`
Count the number of songs and their total playtime in
@@ -844,10 +979,23 @@ The music database
count group artist
count title Echoes group artist
A group with an empty value contains counts of matching song which
don't this group tag. It exists only if at least one such song is
A group with an empty value contains counts of matching songs which
don't have this group tag. It exists only if at least one such song is
found.
.._command_getfingerprint:
:command:`getfingerprint {URI}`
Calculate the song's audio fingerprint. Example (abbreviated fingerprint)::
getfingerprint "foo/bar.ogg"
chromaprint: AQACcEmSREmWJJmkIT_6CCf64...
OK
This command is only available if MPD was built with
Just like with the native build, unpack the :program:`MPD` source
tarball and change into the directory. Then, instead of
@@ -183,47 +187,6 @@ ABI is the Android ABI to be built, e.g. ":code:`arm64-v8a`".
This downloads various library sources, and then configures and builds :program:`MPD`.
systemd socket activation
-------------------------
Using systemd, you can launch :program:`MPD` on demand when the first client attempts to connect.
:program:`MPD` comes with two systemd unit files:a "service" unit and
a "socket" unit. These will be installed to the directory specified
with :code:`-Dsystemd_system_unit_dir=...`,
e.g. :file:`/lib/systemd/system`.
To enable socket activation, type:
..code-block::none
systemctl enable mpd.socket
systemctl start mpd.socket
In this configuration, :program:`MPD` will ignore the :ref:`listener
settings <listeners>` (``bind_to_address`` and ``port``).
systemd user unit
-----------------
You can launch :program:`MPD` as a systemd user unit. These will be
installed to the directory specified with
:code:`-Dsystemd_user_unit_dir=...`,
e.g. :file:`/usr/lib/systemd/user` or
:file:`$HOME/.local/share/systemd/user`.
Once the user unit is installed, you can start and stop :program:`MPD` like any other service:
..code-block::none
systemctl --user start mpd
To auto-start :program:`MPD` upon login, type:
..code-block::none
systemctl --user enable mpd
Configuration
*************
@@ -258,6 +221,13 @@ another file; the given file name is relative to the current file:
include "other.conf"
You can use :code:`include_optional` instead if you want the included file
to be optional; the directive will be ignored if the file does not exist:
..code-block::none
include_optional "may_not_exist.conf"
Configuring the music directory
-------------------------------
@@ -334,6 +304,44 @@ The following table lists the input options valid for all plugins:
More information can be found in the :ref:`input_plugins` reference.
.._input_cache:
Configuring the Input Cache
^^^^^^^^^^^^^^^^^^^^^^^^^^^
The input cache prefetches queued song files before they are going to
be played. This has several advantages:
- risk of buffer underruns during playback is reduced because this
decouples playback from disk (or network) I/O
- bulk transfers may be faster and more energy efficient than loading
small chunks on-the-fly
- by prefetching several songs at a time, the hard disk can spin down
for longer periods of time
This comes at a cost:
- memory usage
- bulk transfers may reduce the performance of other applications
which also want to access the disk (if the kernel's I/O scheduler
isn't doing its job properly)
To enable the input cache, add an ``input_cache`` block to the
configuration file:
..code-block::none
input_cache {
size "1 GB"
}
This allocates a cache of 1 GB. If the cache grows larger than that,
older files will be evicted.
You can flush the cache at any time by sending ``SIGHUP`` to the
:program:`MPD` process, see :ref:`signals`.
Configuring decoder plugins
---------------------------
@@ -405,7 +413,7 @@ The following table lists the audio_output options valid for all plugins:
* - **format samplerate:bits:channels**
- Always open the audio output with the specified audio format, regardless of the format of the input file. This is optional for most plugins.
See :ref:`audio_output_format` for a detailed description of the value.
* - **enabed yes|no**
* - **enabled yes|no**
- Specifies whether this audio output is enabled when :program:`MPD` is started. By default, all audio outputs are enabled. This is just the default setting when there is no state file; with a state file, the previous state is restored.
* - **tags yes|no**
- If set to no, then :program:`MPD` will not send tags to this output. This is only useful for output plugins that can receive tags, for example the httpd output plugin.
@@ -417,7 +425,7 @@ The following table lists the audio_output options valid for all plugins:
:ref:`oss_plugin` and PulseAudio :ref:`pulse_plugin`), the
software mixer, the ":samp:`null`" mixer (allows setting the
volume, but with no effect; this can be used as a trick to
implement an external mixer :ref:`external_mixer`) or no mixer
implement an external mixer, see:ref:`external_mixer`) or no mixer
(:samp:`none`). By default, the hardware mixer is used for
devices which support it, and none for the others.
* - **filters "name,...**"
@@ -492,6 +500,11 @@ The following table lists the playlist_plugin options valid for all plugins:
- The name of the plugin
* - **enabled yes|no**
- Allows you to disable a playlist plugin without recompiling. By default, all plugins are enabled.
* - **as_directory yes|no**
- With this option, a playlist file of this type is parsed during
database update and converted to a virtual directory, allowing
MPD clients to access individual entries. By default, this is
only enabled for the :ref:`cue plugin <cue_playlist>`.
More information can be found in the :ref:`playlist_plugins`
reference.
@@ -693,7 +706,7 @@ These settings are various limitations to prevent :program:`MPD` from using too
* - **connection_timeout SECONDS**
- If a client does not send any new data in this time period, the connection is closed. Clients waiting in "idle" mode are excluded from this. Default is 60.
* - **max_connections NUMBER**
- This specifies the maximum number of clients that can be connected to :program:`MPD` at the same time. Default is 5.
- This specifies the maximum number of clients that can be connected to :program:`MPD` at the same time. Default is 100.
* - **max_playlist_length NUMBER**
- The maximum number of songs that can be in the playlist. Default is 16384.
* - **max_command_list_size KBYTES**
@@ -712,8 +725,9 @@ Do not change these unless you know what you are doing.
* - Setting
- Description
* - **audio_buffer_size KBYTES**
- Adjust the size of the internal audio buffer. Default is 4096 (4 MiB).
* - **audio_buffer_size SIZE**
- Adjust the size of the internal audio buffer. Default is
:samp:`4 MB` (4 MiB).
Zeroconf
^^^^^^^^
@@ -761,22 +775,24 @@ The :code:`music_directory` setting tells :program:`MPD` to read files from the
The database setting tells :program:`MPD` to pass all database queries on to the :program:`MPD` instance running on the file server (using the proxy plugin).
.._realtime:
Real-Time Scheduling
--------------------
On Linux, :program:`MPD` attempts to configure real-time scheduling for some threads that benefit from it.
This is only possible you allow :program:`MPD` to do it. This privilege is controlled by :envvar:`RLIMIT_RTPRIO`:envvar:`RLIMIT_RTTIME`. You can configure this privilege with :command:`ulimit` before launching :program:`MPD`:
This is only possible if you allow :program:`MPD` to do it. This privilege is controlled by :envvar:`RLIMIT_RTPRIO`:envvar:`RLIMIT_RTTIME`. You can configure this privilege with :command:`ulimit` before launching :program:`MPD`:
..code-block::none
ulimit -HS -r 50; mpd
ulimit -HS -r 40; mpd
Or you can use the :command:`prlimit` program from the util-linux package:
..code-block::none
prlimit --rtprio=50 --rttime=unlimited mpd
prlimit --rtprio=40 --rttime=unlimited mpd
The systemd service file shipped with :program:`MPD` comes with this setting.
@@ -794,10 +810,10 @@ You can verify whether the real-time scheduler is active with the ps command:
PID TID CLS RTPRIO COMMAND
16257 16257 TS - mpd
16257 16258 TS - io
16257 16259 FF 50 rtio
16257 16259 FF 40 rtio
16257 16260 TS - player
16257 16261 TS - decoder
16257 16262 FF 50 output:ALSA
16257 16262 FF 40 output:ALSA
16257 16263 IDL 0 update
The CLS column shows the CPU scheduler; TS is the normal scheduler; FF and RR are real-time schedulers. In this example, two threads use the real-time scheduler: the output thread and the rtio (real-time I/O) thread; these two are the important ones. The database update thread uses the idle scheduler ("IDL in ps), which only gets CPU when no other process needs it.
@@ -812,6 +828,89 @@ The CLS column shows the CPU scheduler; TS is the normal scheduler; FF and RR ar
Using MPD
*********
Starting and Stopping MPD
-------------------------
The simplest (but not the best) way to start :program:`MPD` is to
simply type::
mpd
This will start :program:`MPD` as a daemon process (which means it
detaches from your terminal and continues to run in background). To
stop it, send ``SIGTERM`` to the process; if you have configured a
``pid_file``, you can use the ``--kill`` option::
mpd --kill
The best way to manage :program:`MPD` processes is to use a service
manager such as :program:`systemd`.
systemd
^^^^^^^
:program:`MPD` ships with :program:`systemd` service units.
If you have installed :program:`MPD` with your operating system's
package manager, these are probably preinstalled, so you can start and
stop :program:`MPD` this way (like any other service)::
systemctl start mpd
systemctl stop mpd
systemd socket activation
^^^^^^^^^^^^^^^^^^^^^^^^^
Using systemd, you can launch :program:`MPD` on demand when the first client attempts to connect.
:program:`MPD` comes with two systemd unit files:a "service" unit and
a "socket" unit. These will be installed to the directory specified
with :code:`-Dsystemd_system_unit_dir=...`,
e.g. :file:`/lib/systemd/system`.
To enable socket activation, type:
..code-block::none
systemctl enable mpd.socket
systemctl start mpd.socket
In this configuration, :program:`MPD` will ignore the :ref:`listener
settings <listeners>` (``bind_to_address`` and ``port``).
systemd user unit
^^^^^^^^^^^^^^^^^
You can launch :program:`MPD` as a systemd user unit. These will be
installed to the directory specified with
:code:`-Dsystemd_user_unit_dir=...`,
e.g. :file:`/usr/lib/systemd/user` or
:file:`$HOME/.local/share/systemd/user`.
Once the user unit is installed, you can start and stop :program:`MPD` like any other service:
..code-block::none
systemctl --user start mpd
To auto-start :program:`MPD` upon login, type:
..code-block::none
systemctl --user enable mpd
.._signals:
Signals
-------
:program:`MPD` understands the following UNIX signals:
-``SIGTERM``, ``SIGINT``: shut down MPD
-``SIGHUP``: reopen log files (send this after log rotation) and
flush caches (see :ref:`input_cache`)
The client
----------
@@ -933,12 +1032,20 @@ Check list for bit-perfect playback:
* 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.
@@ -951,6 +1058,22 @@ is no way for :program:`MPD` to find out whether the DAC supports
it. DSD to PCM conversion is the fallback if DSD cannot be used
directly.
ICY-MetaData
------------
Some MP3 streams send information about the current song with a
This happens on Linux when :file:`/proc/sys/net/ipv6/bindv6only` is
disabled. MPD first binds to IPv6, and this automatically binds to
IPv4 as well; after that, MPD binds to IPv4, but that fails. You can
safely ignore this, because MPD works on both IPv4 and IPv6.
Database
""""""""
I can't see my music in the MPD database
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Check your :code:`music_directory` setting.
* Does the MPD user have read permission on all music files, and read+execute permission on all music directories (and all of their parent directories)?
* Did you update the database? (mpc update)
* Did you enable all relevant decoder plugins at compile time? :command:`mpd --version` will tell you.
Question: MPD doesn't read ID3 tags!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MPD doesn't read ID3 tags!
~~~~~~~~~~~~~~~~~~~~~~~~~~
* You probably compiled :program:`MPD` without libid3tag. :command:`mpd --version` will tell you.
2.Playback
"""""""""""
Playback
""""""""
Question: I can't hear music on my client!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can't hear music on my client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* That problem usually follows a misunderstanding of the nature of :program:`MPD`. :program:`MPD` is a remote-controlled music player, not a music distribution system. Usually, the speakers are connected to the box where :program:`MPD` runs, and the :program:`MPD` client only sends control commands, but the client does not actually play your music.
:program:`MPD` has output plugins which allow hearing music on a remote host (such as httpd), but that is not :program:`MPD`'s primary design goal.
Question: "Device or resource busy"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error "Device or resource busy"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* This ALSA error means that another program uses your sound hardware exclusively. You can stop that program to allow :program:`MPD` to use it.
@@ -1055,7 +1210,7 @@ You can extract the backtrace from a core dump, or by running :program:`MPD` in
..code-block::none
gdb --args mpd --stdout --no-daemon --verbose
gdb --args mpd --stderr --no-daemon --verbose
run
As soon as you have reproduced the crash, type ":command:`bt`" on the
* Copyright 2003-2018 The Music Player Daemon Project
* Copyright 2003-2021 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -19,9 +19,9 @@
#include"ReplayGainMode.hxx"
#include<cassert>
#include<stdexcept>
#include<assert.h>
#include<string.h>
constchar*
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.