Commit Graph

672 Commits

Author SHA1 Message Date
Max Kellermann 64309abc14 Merge branch 'v0.21.x' 2020-01-14 22:04:55 +01:00
Max Kellermann af20a1c994 pulse: obey Pulse's maximum sample rate (fixes DSD128 playback)
Closes https://github.com/MusicPlayerDaemon/MPD/issues/708
2020-01-12 07:58:17 +01:00
Max Kellermann 683d5848f4 Merge tag 'v0.21.17'
release v0.21.17
2019-12-16 23:44:20 +01:00
Max Kellermann 13ce07d181 output/shout: declare metadata as UTF-8
Apparently, Icecast defaults to ISO-8859-1 for MP3:

 http://icecast.org/docs/icecast-2.4.0/config-file.html#mountsettings

This change forces Icecast to UTF-8 without having to configure it in
Icecast's configuration file.
2019-11-06 16:05:22 +01:00
Max Kellermann 496f43e25d Merge branch 'v0.21.x' 2019-11-04 15:07:46 +01:00
Niklas Haas 65778a3774 output/Jack: mark ports as terminal
This is the correct thing to do for ports from which a signal ultimately
"originates", such as is the case with mpd.
2019-10-29 10:07:44 +01:00
Max Kellermann f2c3d86612 output: use StringIsEqual() 2019-09-26 14:48:31 +02:00
Max Kellermann 0643b5abad Merge tag 'v0.21.15'
release v0.21.15
2019-09-25 21:27:31 +02:00
Max Kellermann 818b7e0641 output/solaris: include sys/stropts.h only on Solaris
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
2019-08-22 11:41:12 +02:00
Max Kellermann bcccc8f66c output/jack: use jack_free() for Windows compatibility 2019-08-06 11:34:56 +02:00
Max Kellermann 848c63e2d5 output/jack: use std::atomic_bool for "shutdown" and "pause"
Without this, the compiler may optimize accesses away.
2019-08-06 11:34:00 +02:00
Max Kellermann f6d0310f9c output/jack: use SIZE_MAX instead of (size_t)-1 2019-08-06 11:33:52 +02:00
Max Kellermann 8b399b7133 output/jack: use jack_free() for Windows compatibility 2019-08-05 09:35:41 +02:00
Max Kellermann 9d24f68f51 output/jack: convert to class, make attributes/methods private 2019-08-05 09:31:40 +02:00
Max Kellermann 44652fdb13 output/jack: convert callback functions to static methods 2019-08-05 09:29:27 +02:00
Max Kellermann 2892a6f5e2 output/jack: merge set_audioformat() into Open() 2019-08-05 09:28:41 +02:00
Max Kellermann 2fc40e5575 output/jack: eliminate "shutdown" flag, use only "error" (mutex protected) 2019-08-05 09:24:43 +02:00
Max Kellermann d146bef740 output/jack: use jack_on_info_shutdown() 2019-08-04 20:25:13 +02:00
Max Kellermann 1f4c4be1f1 output/jack: use std::atomic_bool for "shutdown" and "pause"
Without this, the compiler may optimize accesses away.
2019-08-04 20:24:51 +02:00
Max Kellermann 90067d16c0 output/jack: use SIZE_MAX instead of (size_t)-1 2019-08-04 06:34:43 +02:00
Max Kellermann cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
ckdo d305f187d5 Add the ability to specify media.role for pulse output plugin
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"
2019-08-03 13:03:05 +02:00
Richard Dodd 4f6a713b32 Add option to not connect jack ports automatically 2019-08-03 13:01:47 +02:00
Max Kellermann a90685d6cf Merge tag 'v0.21.12'
release v0.21.12
2019-08-03 12:53:23 +02:00
Diomendius b81138bda1 Fix JACK plugin outputting only to left channel
The JACK output plugin would not correctly upmix mono input files when exactly 2 output ports were configured. This fixes that.
2019-08-02 15:52:20 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann 6c22c34300 output/oss: add noexcept 2019-07-04 22:42:19 +02:00
Max Kellermann f54710b100 output/oss: replace enum oss_setup_result with bool
It's not a tri-state anymore since we introduced C++ exceptions.
2019-07-04 22:23:22 +02:00
Max Kellermann 196db1a8c8 output/oss: remove redundant DoClose() calls from Reopen() 2019-07-04 22:01:44 +02:00
Max Kellermann 0a32634d8f output/alsa: check ring buffer space before writing to it
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.
2019-07-04 12:47:10 +02:00
Max Kellermann b12fc3c60d output/alsa: throw unexpected snd_pcm_writei() errors
If snd_pcm_writei() fails, throw an error and stop playback instead
of going into an endless busy loop.
2019-07-04 12:46:18 +02:00
Max Kellermann 6d013b092f output/osx: remove trailing newline from exception messages 2019-07-03 22:21:43 +02:00
Max Kellermann ccb182865c output/osx: fix coding style 2019-07-03 22:12:47 +02:00
Max Kellermann 412b04be58 output: allow throwing any exception 2019-07-03 22:10:26 +02:00
Max Kellermann 557098644b Merge tag 'v0.21.11'
release v0.21.11
2019-07-03 15:36:45 +02:00
Max Kellermann f780ac418a output/alsa: log when generating silence due to slow decoder
MPD used to do that when this code lived in the player thread, but it
was removed by commit 98a7c62d7a4f716d90af6d78e18d1a3b10bc54b3; and
the replacement code in the ALSA output plugin didn't have it.
2019-06-28 18:15:30 +02:00
Max Kellermann 61a72a5d13 output/alsa: schedule a timer to generate silence
Without this timer, DispatchSockets() may disable the
MultiSocketMonitor and if Play() doesn't get called soon, it never
gets a chance to generate silence.  However if Play() gets called,
generating silence isn't necessary anymore...

Resulting from this misdesign (added by commit ccafe3f3cf in 0.21.3),
the silence generator didn't work reliably.
2019-06-28 18:04:49 +02:00
Max Kellermann 0c0a354753 output/alsa: add a new flag "waiting" for xrun management
In DispatchSockets(), when there was not enough data, but enough for
current playback, the method would disable the "active" flag so the
next Play() call would re-enable the MultiSocketMonitor.

This was an abuse of the flag which could result in a crash
in Cancel(), because that method asserts that the period_buffer is
empty, which it may be not.

The solution is to add anther flag called "waiting" which shares some
behavior with the old flag.
2019-06-28 18:04:49 +02:00
Max Kellermann 3c5f860fb8 output/alsa: Cancel() also affects "active" (documentation) 2019-06-28 18:04:49 +02:00
Max Kellermann 3da1fa88d0 output/alsa: fix comment typo 2019-06-28 18:04:49 +02:00
Max Kellermann fac15aaffb output/alsa: fix comment typo 2019-06-28 14:39:54 +02:00
Max Kellermann a92aa0bedc output/alsa: use IsCleared() instead of IsDrained() in DrainInternal()
Really drain all data from the period_buffer in any case.
2019-06-28 09:30:33 +02:00
Max Kellermann d66f5a8590 output/alsa: replace PeriodBuffer::IsEmpty() with IsCleared()
This assertion is not about whether all data has been consumed, but
about whether there has been any data at all.
2019-06-28 09:29:18 +02:00
Max Kellermann 30ca6b8881 Merge branch 'v0.21.x' 2019-06-28 09:28:04 +02:00
Max Kellermann c926021599 output/alsa: always redo DrainInternal() after writing
Draining isn't finished just because the period_buffer has run empty.
It is only finished after snd_pcm_drain() has succeeded.
2019-06-28 09:10:16 +02:00
Max Kellermann 543776d9c9 output/alsa: check PCM state before calling snd_pcm_drain()
Apparently, if snd_pcm_drain() returns EAGAIN, it does not actually
want to be called again; the next call will snd_pcm_drain() will also
return EAGAIN, forever, even though the PCM state has meanwhile
switched to SND_PCM_STATE_SETUP.  This causes a busy loop; to fix
this, we should always check snd_pcm_state() to see if draining is
really required.
2019-06-28 08:55:25 +02:00
Max Kellermann cf631fca50 output/alsa: check GetFrames()>0 instead of IsEmpty() in WriteFromPeriodBuffer() 2019-06-27 21:59:43 +02:00
Max Kellermann f0ac63d5af output/alsa: DrainInternal() ignores postponed partial frame 2019-06-27 21:23:28 +02:00
Max Kellermann c1eb0583c4 output/alsa: add "full" assertion to WriteFromPeriodBuffer() 2019-06-27 21:22:52 +02:00
Max Kellermann 549faa8a9c output/alsa: add full check before calling FillWithSilence() 2019-06-27 21:20:38 +02:00