Commit Graph

55 Commits

Author SHA1 Message Date
Max Kellermann
fb907f5f76 output/Thread: KILL implicitly closes and disables the AudioOutput
Reduce shutdown latency by two commands per output.
2016-12-14 08:29:09 +01:00
Max Kellermann
a9d7293818 output/Thread: wake up the player thread periodically while playing
Without this, the pipe would run empty very often, which may result in
an xrun if the roundtrip to the PlayerThread and back takes too long.
By waking up the PlayerThread before the pipe runs empty, we make MPD
much more latency tolerant, which is a major optimization.
2016-12-13 22:39:49 +01:00
Max Kellermann
265ad4b96a output/Thread: eliminate redundant nullptr check 2016-12-13 22:20:41 +01:00
Max Kellermann
92eeb4969f output/Thread: don't wake up the player after receiving command in Play()
If we have a pending command, then the player thread is already awake.
Even if not, we'll wake it up as soon as we have finished the command.
2016-12-13 22:17:06 +01:00
Max Kellermann
6fcddaf8fa output/Thread: use AtScopeExit() to revert the in_playback_loop flag 2016-12-13 22:15:52 +01:00
Max Kellermann
41fd583fbc output/Thread: eliminate one ScopeLock 2016-12-13 21:57:03 +01:00
Max Kellermann
ceba6816de output/Thread: split Open()
Simplify the code, eliminate duplicate rollback code and eliminate the
"goto" kludge.
2016-12-13 21:46:27 +01:00
Max Kellermann
093cb475bb output/Thread: simplify the retry_audio_format declaration 2016-12-13 21:34:43 +01:00
Max Kellermann
d44790b35f output/Thread: reduce locking further in Open() 2016-12-13 21:26:28 +01:00
Max Kellermann
f8164a3dd1 output/Thread: unlock mutex during OpenFilter() 2016-12-13 21:24:14 +01:00
Max Kellermann
c20126598f output/Thread: remove unused variable 2016-12-13 21:24:05 +01:00
Max Kellermann
6c818bb37a AudioFormat: add method WithMask(), shortcut for ApplyMask() 2016-12-13 20:57:46 +01:00
Max Kellermann
df91f3738a output/Thread: remove a useless out_audio_format setting
Now that I can see the Reopen() method clearly, it is obvious that the
out_audio_format setting will get overwritten by the following Open()
call.
2016-12-13 20:43:29 +01:00
Max Kellermann
b5b268f606 output/Thread: remove another redundant "open" check 2016-12-13 20:41:54 +01:00
Max Kellermann
ce6b8c94a2 output/Thread: convert redundant runtime check to assertion 2016-12-13 20:29:16 +01:00
Max Kellermann
6e643fe58b output/Thread: don't deinitialize the pipe in Close() 2016-12-13 20:28:19 +01:00
Max Kellermann
2bf91a0487 output/Internal: merge REOPEN and OPEN 2016-12-13 20:07:00 +01:00
Max Kellermann
2775d747ac output/Thread: move MusicPipe code to class SharedPipeConsumer 2016-12-13 16:33:23 +01:00
Max Kellermann
bfb0897b54 filter/ReplayGain: convert pointers to references 2016-12-03 12:13:45 +01:00
Max Kellermann
d9cb85df83 output/Plugin: remove 'Error&' parameters, use C++ exceptions only 2016-11-09 12:36:21 +01:00
Max Kellermann
b78cc7e48a output/Thread: remove obsolete pcm_domain check, this is defunct 2016-11-09 12:15:35 +01:00
Max Kellermann
b8aac3f8fc output/Thread: catch and log send_tag() exceptions 2016-11-07 09:25:47 +01:00
Max Kellermann
d6559e2ac9 output/Thread: fix wrong error reference in catch clause 2016-11-04 11:31:23 +01:00
Max Kellermann
8b3d934230 output/Thread: catch Pause() exceptions 2016-11-02 10:53:43 +01:00
Max Kellermann
a249a630c0 OutputThread: support plugins throwing exceptions 2016-10-28 21:10:18 +02:00
Max Kellermann
f39823eac0 OutputThread: use class ScopeUnlock for exception-safety 2016-10-28 21:10:18 +02:00
Max Kellermann
13c32111a0 Filter/Internal: migrate from class Error to C++ exceptions 2016-09-04 19:38:41 +02:00
Max Kellermann
12091fcfb1 thread/Util: throw exception on error 2016-09-04 15:15:11 +02:00
Max Kellermann
3fea624cca output/Thread: use Close() after error in ReopenFilter()
Now that CloseFilter() may be called again, we can reduce code
duplication.
2016-09-04 15:09:51 +02:00
Max Kellermann
9007dd9ab7 output/Thread: clear Filter pointers in CloseFilter()
This allows calling CloseFilter() multiple times.
2016-09-04 15:09:05 +02:00
Max Kellermann
3a21241248 filter/FilterInternal: split class Filter, add class PreparedFilter
For easier state management inside filter plugins.
2016-07-01 21:04:24 +02:00
Max Kellermann
d3c7fac606 thread/Thread: throw std::system_error on error 2016-06-17 19:11:20 +02:00
Max Kellermann
1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Christian Halaszovich
3392cbbd91 Emit a warning if the OutputThread fails to get realtime scheduling
This only applies to linux systems.  Here, sched_setscheduler() is
called to get realtime scheduling.  With this patch, the return value
of this function is now checked and a warning / error message is
generated if it fails.
2016-02-19 17:09:44 +01:00
Max Kellermann
5fba8d773c PlayerThread, ...: move to src/player/ 2015-08-15 15:55:46 +02:00
Max Kellermann
bef8c83388 OutputThread: move code to CloseOutput() 2015-06-22 13:02:13 +02:00
Max Kellermann
712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann
58a5da33c2 OutputPlugin: pass Tag reference to _send_tag() 2014-12-26 22:27:01 +01:00
Max Kellermann
c5409d52f5 output/Internal: move enum AudioOutputCommand into the struct 2014-12-24 22:18:47 +01:00
Max Kellermann
54fc8f0e8c output/Internal: convert audio_output_command to strictly-typed enum 2014-12-24 22:13:50 +01:00
Max Kellermann
d7f024c510 OutputThread: fall back to PCM if given DSD sample rate is not supported
Works around the "PCM conversion from f to dsd is not implemented"
error message that prevents DSD playback.
2014-10-25 22:06:08 +02:00
Max Kellermann
a7b09d3d1c OutputThread: close the output plugin after filter failure
Fixes memory leak because ao_plugin_close() never gets called.
2014-10-24 00:35:16 +02:00
Max Kellermann
8fc3768166 OutputThread: unlock mutex for CloseFilter()
Be consistent.
2014-10-24 00:29:03 +02:00
Max Kellermann
9270485723 Merge branch 'v0.18.x' 2014-09-24 21:49:20 +02:00
Max Kellermann
7244dc4511 Filter: FilterPCM() returns ConstBuffer
API simplification.  We can now avoid abusing a "size_t*" as
additional return value.
2014-08-12 16:40:51 +02:00
Max Kellermann
c94b4466d5 MusicChunk: rename struct to MusicChunk 2014-08-12 15:56:41 +02:00
Max Kellermann
a31738f6f1 Main, OutputThread: increase kernel timer slack (Linux)
Allows the kernel to combine timer wakeups with other processes,
reducing power usage.
2014-01-30 18:43:40 +01:00
Max Kellermann
667481c371 OutputThread: move more functions into the AudioOutput class 2014-01-29 09:26:11 +01:00
Max Kellermann
af71605769 output: rename "chunk" to "current_chunk" 2014-01-29 09:23:57 +01:00
Max Kellermann
4657a3bd0f output: move functions into the AudioOutput struct 2014-01-29 08:10:46 +01:00