Commit Graph

52 Commits

Author SHA1 Message Date
Max Kellermann
ca90c75c61 lib/alsa/AllowedFormat: pass std::string_view to constructor 2022-07-01 10:57:49 +02:00
aeolio
3856224df9 lib/alsa/Error: add missing #include 2021-12-15 11:14:38 +01:00
aeolio
6d4bedfc56 lib/alsa/Error: fix typo 2021-12-15 11:14:34 +01:00
Rosen Penev
f22cf02ed8 fix wrong namespace name
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-26 08:08:45 +01:00
Max Kellermann
356d13e9dd lib/alsa/HwSetup: add missing include 2021-11-04 17:55:15 +01:00
Max Kellermann
5d0941476a lib/alsa/Error: a std::system_error category for libasound errors 2021-11-04 14:59:00 +01:00
Max Kellermann
a9344fafe9 lib/alsa/AllowedFormat: use StringView::RemoveSuffix() 2021-10-23 11:43:31 +02:00
Max Kellermann
b8890726f2 lib/alsa/AllowedFormat: use std::string_view 2021-10-23 11:42:30 +02:00
Max Kellermann
f510564d9d more [[gnu::...]] attributes 2021-10-13 12:07:05 +02:00
Max Kellermann
b29a43b4d7 decoder/mad, ...: more libfmt logging 2021-06-25 20:52:08 +02:00
Max Kellermann
5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Max Kellermann
eeb96eb367 event/TimerEvent: add type alias for std::chrono::steady_clock::duration 2020-10-08 20:48:50 +02:00
Rosen Penev
a2f5a63bbc
replace stdint.h with cstdint
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>
2020-03-12 19:04:39 -07:00
Rosen Penev
ab9f5d2067
replace assert.h with cassert
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>
2020-03-12 15:25:38 -07:00
Max Kellermann
4f22f4d357 *: use nullptr instead of NULL 2020-02-01 14:02:43 +01:00
Max Kellermann
cd612c4eef AudioFormat: move to pcm/ 2020-01-18 20:24:59 +01:00
Max Kellermann
2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann
d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann
d66ef7eac1 lib/alsa/HwSetup: don't reset dsd_mode
Fixes regression by commit 28e07e900f

Closes https://github.com/MusicPlayerDaemon/MPD/issues/596
2019-07-04 12:47:35 +02:00
Max Kellermann
5b01373356 output/alsa: more assertions in class PeriodBuffer 2019-06-28 09:31:51 +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
f0ac63d5af output/alsa: DrainInternal() ignores postponed partial frame 2019-06-27 21:23:28 +02:00
Max Kellermann
549faa8a9c output/alsa: add full check before calling FillWithSilence() 2019-06-27 21:20:38 +02:00
Max Kellermann
8f6c750064 output/alsa: improve silence generator test in DrainInternal()
There cannot be partial frames in the buffer, so we don't need
GetPeriodPosition(); it's enough to check whether head has been moved
in this period.
2019-06-27 21:17:37 +02:00
Max Kellermann
e9190f4249 lib/alsa/PeriodBuffer: add missing include 2019-06-27 15:34:40 +02:00
Max Kellermann
127b464c59 lib/alsa/PeriodBuffer: add API documentation 2019-06-27 14:58:19 +02:00
Max Kellermann
28e07e900f pcm/Export: convert the DSD bools to an enum
These options are exclusive.
2019-06-17 22:35:00 +02:00
Max Kellermann
a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann
fd5e74dbd0 pcm/Pcm{Dop,Export}: drop "Pcm" prefix 2019-06-16 12:11:44 +02:00
Max Kellermann
c176d94598 system/ByteOrder: move to util/ 2019-03-08 10:21:10 +01: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
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
fee75dc766 {output,mixer}/alsa: use snd_pcm_poll_descriptors_revents()
This call was missing, causing very high CPU usage when the ALSA
output plugin was used with dmix.

Closes #391
2018-11-11 12:37:29 +01:00
Max Kellermann
12308a0f55 lib/alsa/NonBlock: move the functions into a class managing the state 2018-11-11 12:37:25 +01:00
Max Kellermann
f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann
94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann
8ac73a9eba output/alsa: add attributes "dop" and "allowed_formats" 2017-12-19 11:57:52 +01:00
Max Kellermann
d05c3f4e4d lib/alsa/AllowedFormat: throw std::invalid_argument on error 2017-12-19 11:57:52 +01:00
Max Kellermann
cd3ed720e0 lib/alsa/AllowedFormat: add API documentation 2017-12-19 08:41:53 +01:00
Max Kellermann
7d579e7400 lib/alsa/NonBlock: throw exception on error
Avoid another potential deadlock: if no file descriptors are
registered, our non-blocking ALSA code cannot ever work.
2017-11-14 21:08:07 +01:00
Max Kellermann
44c60567dd output/alsa: add "allowed_formats" setting
Allows defining a list of supported audio formats, and allows
switching on and off DoP with certain formats.

This is a first rough draft.  The setting syntax and its semantics may
still be redesigned.
2017-11-10 23:05:50 +01:00
Max Kellermann
e2a74051dc lib/alsa/HwSetup: return effective parameters 2017-10-26 12:13:00 +02:00
Max Kellermann
b7e035b6f3 output/alsa: move AlsaSetupHw() to lib/alsa/HwSetup.cxx 2017-10-26 11:15:01 +02:00
Max Kellermann
890f1f5928 lib/alsa/Format: move HAVE_ALSA_DSD* definitions from the Alsa output plugin 2017-10-26 09:39:18 +02:00
Max Kellermann
b30c37eb79 output/alsa: move functions to lib/alsa/Format.hxx 2017-10-26 09:30:45 +02:00
Max Kellermann
b08cb148ae output/alsa: move class PeriodBuffer to lib/alsa/PeriodBuffer.hxx 2017-10-26 09:27:36 +02:00
Max Kellermann
2a6d5583d1 lib/alsa: add "noexcept" 2017-10-26 08:24:14 +02:00
Max Kellermann
c5996c0593 *: add "noexcept" to many, many function prototypes
See commit 71f0ed8b74
2017-05-15 23:05:45 +02:00