summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-26 18:31:16 +0100
committerMax Kellermann <max@duempel.org>2016-02-26 18:44:58 +0100
commit6a53fb33da34afbaf494a537ca19035edfd86916 (patch)
tree1cadb8ff09a5a72ff2f71e14a05c96c86a79d775
parentdcaf299864ccfbaae79e6a603d1d3de09fc378c9 (diff)
output/alsa: basic infrastructure for DSD_U16 and DSD_U32
-rw-r--r--src/output/plugins/AlsaOutputPlugin.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx
index 3b85fa198..36d715076 100644
--- a/src/output/plugins/AlsaOutputPlugin.cxx
+++ b/src/output/plugins/AlsaOutputPlugin.cxx
@@ -39,6 +39,11 @@
#define HAVE_ALSA_DSD
#endif
+#if SND_LIB_VERSION >= 0x1001d
+/* alsa-lib supports DSD_U32 since version 1.0.29 */
+#define HAVE_ALSA_DSD_U32
+#endif
+
static const char default_device[] = "default";
static constexpr unsigned MPD_ALSA_BUFFER_TIME_US = 500000;
@@ -314,6 +319,21 @@ byteswap_bitformat(snd_pcm_format_t fmt)
return SND_PCM_FORMAT_S24_3BE;
case SND_PCM_FORMAT_S32_BE: return SND_PCM_FORMAT_S32_LE;
+
+#ifdef HAVE_ALSA_DSD_U32
+ case SND_PCM_FORMAT_DSD_U16_LE:
+ return SND_PCM_FORMAT_DSD_U16_BE;
+
+ case SND_PCM_FORMAT_DSD_U16_BE:
+ return SND_PCM_FORMAT_DSD_U16_LE;
+
+ case SND_PCM_FORMAT_DSD_U32_LE:
+ return SND_PCM_FORMAT_DSD_U32_BE;
+
+ case SND_PCM_FORMAT_DSD_U32_BE:
+ return SND_PCM_FORMAT_DSD_U32_LE;
+#endif
+
default: return SND_PCM_FORMAT_UNKNOWN;
}
}