Commit Graph

13722 Commits

Author SHA1 Message Date
Max Kellermann 1477b64d4f Merge branch 'patch-2' of git://github.com/HyShai/MPD
Closes #343
2019-01-04 19:04:52 +01:00
Max Kellermann a2c108f5ef NEWS: mention the Haiku build fix 2019-01-04 19:03:53 +01:00
Zoltán Mizsei f546e76490 Build fix. This struct is the same on Haiku and on Linux, still gcc
fails on it. This fixes.
2019-01-04 19:01:27 +01:00
Zoltán Mizsei 2568bc3957 Haiku is "haiku". 2019-01-04 18:59:49 +01:00
Max Kellermann 7104ac963b util/AllocatedArray: import std::swap 2018-12-28 17:18:41 +01:00
Max Kellermann 2cb36590b2 util/AllocatedArray: add `noexcept` 2018-12-28 17:17:28 +01:00
Max Kellermann af7b928d7c output/httpd/Page: remove obsolete API documentation 2018-12-28 17:16:12 +01:00
Max Kellermann c0d8a9b07a output/httpd/Page: add `noexcept` 2018-12-28 17:15:28 +01:00
Max Kellermann 5b0d23d553 output/httpd/IcyMetaDataServer: add `noexcept` 2018-12-28 17:14:27 +01:00
Max Kellermann ab30695bd1 output/httpd: add `noexcept` 2018-12-28 17:06:01 +01:00
Max Kellermann 53a4de35c4 util/DynamicFifoBuffer: add `noexcept` 2018-12-28 17:06:01 +01:00
Max Kellermann 22e6d95c4b remove libwrap support
libwrap is an obscure artefact from a past long ago, when source IP
address meant something.

And its API is "interesting"; it requires the application to expose
two global variables `allow_severity` and `deny_severity`.  This led
to bug #437.  I don't want to declare those variables; instead, I'd
like to remove libwrap support.

Closes #437
2018-12-28 14:16:02 +01:00
Max Kellermann 1c7bd7d5c4 db/update/InotifyQueue: check for ACK_ERROR_UPDATE_ALREADY
Since commit cc64c715a2, UpdateService::Enqueue() throws
ProtocolError(ACK_ERROR_UPDATE_ALREADY) instead of returning 0.
2018-12-28 14:02:41 +01:00
Max Kellermann 3c4ed9cbe3 db/update/InotifyQueue: catch UpdateService::Enqueue() exceptions 2018-12-28 14:00:58 +01:00
Max Kellermann 2677b90244 db/update/InotifyQueue: add `noexcept` 2018-12-28 14:00:55 +01:00
Max Kellermann 1b20fa441d db/update/InotifyQueue: update code comment 2018-12-28 14:00:10 +01:00
HyShai 18c042d4cf
remove non-block call
This is similar to b177bffa6a, in that it fixes the Windows issue of connecting to the open socket. Also, the listen_socket is set to AcceptNonBlock after the connection anyways.
2018-12-18 15:23:40 -05:00
Max Kellermann 98f92d828a NEWS: mention the "ICY" -> "HTTP/1.1" change 2018-12-14 09:26:59 +01:00
HyShai 76268773b5
change HTTP Version to a valid version 2018-12-14 01:51:54 -05:00
Max Kellermann 5cb603983e alsa/NonBlock: throw on snd_pcm_poll_descriptors_revents() error
This function is sparsely documented and a look at the bluez-alsa
source code shows that implementations make undocumented assumptions
on the `struct pollfd` array parameter which can lead to strange
effects.
2018-12-04 18:00:52 +01:00
Max Kellermann 9c5790ab1d doc/user.rst: more markup 2018-11-20 22:06:42 +01:00
Max Kellermann 4b7078297d db/upnp: use the generic ::CollectUniqueTags() function
This function implements the "group" feature on top of the
Database::Visit() method.
2018-11-19 20:08:10 +01:00
Max Kellermann 841694ccf2 db/Interface: document CollectUniqueTags() 2018-11-19 19:40:00 +01:00
Max Kellermann 12f4a8255a Main: use DatabasePlugin::RequireStorage() 2018-11-19 19:39:37 +01:00
Max Kellermann bda77ffc5b db/Interface: remove IsPlugin(), use `dynamic_cast` instead 2018-11-19 19:38:20 +01:00
Max Kellermann ed9ece5ea3 db/Interface: make the constructor `protected` 2018-11-19 19:38:20 +01:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann 2e450bbf95 src/thread/meson.build: detect pthread_setname_np()
This compile-time check got lost during the Meson transition.
2018-11-19 16:33:14 +01:00
Max Kellermann 303b3071e4 db/UniqueTags: remove `pure` attribute because function may throw 2018-11-19 11:32:53 +01:00
Max Kellermann eb6d5f34fc db/UniqueTags: include cleanup 2018-11-19 11:11:45 +01:00
Max Kellermann f80126959d meson.build: increment PROTOCOL_VERSION to 0.21.4
This version should have been incremented in 0.21.2 because this
version added new search operators.  In 0.21.4, we'll have more
protocol bug fixes which may be important for clients to know.
2018-11-19 11:11:45 +01:00
Max Kellermann 4fb4f6d1b7 increment version number to 0.21.4 2018-11-19 09:58:05 +01:00
Max Kellermann 43df4a7500 release v0.21.3 2018-11-16 13:27:58 +01:00
Max Kellermann 4cdcaa8630 output/alsa: don't call snd_pcm_drain() if nothing was written
Works around a problem where MPD goes into a busy loop because
snd_pcm_drain() always returns `-EAGAIN` without making any progress
(fixes #425).

This problem was triggered by snd_pcm_drain() after snd_pcm_cancel()
and snd_pcm_prepare(), but without submitting any data with
snd_pcm_writei().

I believe this is a kernel bug: in non-blocking mode, the kernel's
snd_pcm_drain() function returns early.  In this mode, it only checks
whether snd_pcm_drain_done() has been called already, but
snd_pcm_drain_done() is never called if no data was submitted.

In blocking mode, the following `for` loop detects this condition, so
snd_pcm_drain_done() is not necessary, but without this extra check,
we get `-EAGAIN` forever.
2018-11-16 12:49:37 +01:00
Volodymyr Medvid 04f632296f
test/meson.build: run_storage depends on event lib
test/run_storage.cxx depends on EventThread/EventLoop from libevent.a.
Depend on it explicitly. This addresses build failure with
-Dtest=true -Dcurl=disabled -Ddbus=disabled
2018-11-15 19:01:43 +02:00
Max Kellermann 7c8dbcfaac doc/protocol.rst: song position is 0-based 2018-11-15 12:34:23 +01:00
Max Kellermann 436ba3c96c output/alsa: drain the whole `ring_buffer`, not just one period
This fixes a problem which caused a failure with snd_pcm_writei()
because snd_pcm_drain() had already been called in the previous
iteration.  This commit makes sure that snd_pcm_drain() is only called
after the final snd_pcm_writei() call.

This fixes discarded samples at the end of playback.
2018-11-14 13:35:17 +01:00
Max Kellermann 5d12f52873 output/alsa: clear error after reopening device
When a playback error has occurred, MPD would never recover until one
restarts MPD.
2018-11-14 13:20:54 +01:00
Max Kellermann a8bf8ede01 event/Thread: reduce the RTIO timer slack to 10us
MPD's default is 100ms, which is too long for the real-time I/O
thread.  The OutputThread has 100us, but the real-time I/O thread
might have tighter deadlines.

This change has currently no effect (I believe), because nobody uses
timers on the RTIO thread.
2018-11-14 12:11:57 +01:00
Max Kellermann 8682183bc3 LogInit: default to journal if MPD was started as systemd service 2018-11-14 12:07:22 +01:00
Max Kellermann 94c31d0da9 doc/mpdconf.example: no, logging is not disabled without `log_file` 2018-11-14 12:07:22 +01:00
Max Kellermann 464a4cbeec python/build/libs.py: upgrade FFmpeg to 4.1 2018-11-14 11:50:51 +01:00
Max Kellermann 9f0cbf418a python/build/libs.py: upgrade CURL to 7.62.0 2018-11-14 11:50:51 +01:00
Max Kellermann b477f86c92 output/alsa: don't lock the mutex in CancelInternal()
CancelInternal() doesn't need to be protected because it is called
synchronously from Cancel().
2018-11-14 11:50:51 +01:00
Max Kellermann 020371f145 output/alsa: wake up the client thread after generating silence
Fixes a theoretical race condition which could occur in Drain() (but
was extremely unlikely).
2018-11-14 11:48:55 +01:00
Max Kellermann ccafe3f3cf output/alsa: don't generate silence if ALSA-PCM buffer has enough data
If our `ring_buffer` is smaller than the ALSA-PCM buffer (if the
latter has more than the 4 periods we allocate), it can happen that
the start threshold is crossed and ALSA switches to
`SND_PCM_STATE_RUNNING`, but the `ring_buffer` is empty.  In this
case, MPDD will generate silence, even though the ALSA-PCM buffer has
enough data.  This causes stuttering (#420).

This commit amends an older workaround for a similar problem (commit
e08598e7e2) by adding a snd_pcm_avail()
check, and only generate silence if there is less than one period of
data in the ALSA-PCM buffer.

Fixes #420
2018-11-14 11:17:59 +01:00
Max Kellermann 3830748de5 output/alsa: clear the `period_buffer` in LockCaughtError()
The method Cancel() assumes that the `period_buffer` must be empty
when `active==false`, but that is not the case when Play() fails.

Of course the assertion in Cancel() is not 100% correct, but I decided
to rather fix this in LockCaughtError() because the `period_buffer`
should only be accessed from within the RTIO thread, and this is the
only code path where `active` can be set to `false` with a non-empty
`period_buffer`.

Fixes #423
2018-11-14 10:24:08 +01:00
Max Kellermann 1a43f5145d output/alsa: throw on snd_pcm_writei() error while draining
This implements real error handling, and avoids calling
CancelInternal() from this code path.
2018-11-14 10:08:29 +01:00
Max Kellermann 7f143a83c1 output/alsa: fix wrong use of `errno`
alsa-lib doesn't set errno, it returns errors as negative integers.
2018-11-14 10:07:23 +01:00
Max Kellermann 6ccc254179 output/alsa: throw after snd_pcm_drain() error 2018-11-14 10:04:10 +01:00