output/alsa: support native DSD playback
Translate SampleFormat::DSD to SND_PCM_FORMAT_DSD_U8, which was added to alsa-lib 1.0.27.1.
This commit is contained in:
parent
e463244db3
commit
a86aaef4d0
2
NEWS
2
NEWS
|
@ -52,6 +52,8 @@ ver 0.19 (not yet released)
|
||||||
- mp4v2: support playback of MP4 files.
|
- mp4v2: support playback of MP4 files.
|
||||||
* encoder:
|
* encoder:
|
||||||
- shine: new encoder plugin
|
- shine: new encoder plugin
|
||||||
|
* output
|
||||||
|
- alsa: support native DSD playback
|
||||||
* threads:
|
* threads:
|
||||||
- the update thread runs at "idle" priority
|
- the update thread runs at "idle" priority
|
||||||
- the output thread runs at "real-time" priority
|
- the output thread runs at "real-time" priority
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../OutputAPI.hxx"
|
#include "../OutputAPI.hxx"
|
||||||
#include "mixer/MixerList.hxx"
|
#include "mixer/MixerList.hxx"
|
||||||
#include "pcm/PcmExport.hxx"
|
#include "pcm/PcmExport.hxx"
|
||||||
|
#include "config/ConfigError.hxx"
|
||||||
#include "util/Manual.hxx"
|
#include "util/Manual.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
|
@ -32,6 +33,11 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#if SND_LIB_VERSION >= 0x1001c
|
||||||
|
/* alsa-lib supports DSD since version 1.0.27.1 */
|
||||||
|
#define HAVE_ALSA_DSD
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char default_device[] = "default";
|
static const char default_device[] = "default";
|
||||||
|
|
||||||
static constexpr unsigned MPD_ALSA_BUFFER_TIME_US = 500000;
|
static constexpr unsigned MPD_ALSA_BUFFER_TIME_US = 500000;
|
||||||
|
@ -236,9 +242,15 @@ get_bitformat(SampleFormat sample_format)
|
||||||
{
|
{
|
||||||
switch (sample_format) {
|
switch (sample_format) {
|
||||||
case SampleFormat::UNDEFINED:
|
case SampleFormat::UNDEFINED:
|
||||||
case SampleFormat::DSD:
|
|
||||||
return SND_PCM_FORMAT_UNKNOWN;
|
return SND_PCM_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
|
case SampleFormat::DSD:
|
||||||
|
#ifdef HAVE_ALSA_DSD
|
||||||
|
return SND_PCM_FORMAT_DSD_U8;
|
||||||
|
#else
|
||||||
|
return SND_PCM_FORMAT_UNKNOWN;
|
||||||
|
#endif
|
||||||
|
|
||||||
case SampleFormat::S8:
|
case SampleFormat::S8:
|
||||||
return SND_PCM_FORMAT_S8;
|
return SND_PCM_FORMAT_S8;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue