aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-04-16 12:01:36 -0400
committerTakashi Iwai <tiwai@suse.de>2013-04-18 04:02:33 -0400
commitef7a4f979bd8201324b2bcd30277c14aba889f50 (patch)
tree7235f0aa55aca6d7e7f2d67210c640e9ff4b9ec4 /sound
parentd5657ec9f4ad048873f2682d8945905b29938f57 (diff)
ALSA: add DSD formats
This patch adds two formats for Direct Stream Digital (DSD), a pulse-density encoding format which is described here: https://en.wikipedia.org/wiki/Direct_Stream_Digital DSD operates on 2.8, 5.6 or 11.2MHz sample rates and as a 1-bit stream. The two new types added by this patch describe streams that are capable of handling DSD samples in DOP format as 8-bit or in 16-bit (or at a x8 or x16 data rate, respectively). DSD itself specifies samples in *bit*, while DOP and ALSA handle them as *bytes*. Hence, a factor of 8 or 16 has to be applied for the sample rare configuration, according to the following table: configured hardware 176.4KHz 352.8kHz 705.6KHz <---- sample rate 8-bit 2.8MHz 5.6MHz 16-bit 2.8Mhz 5.6MHz 11.2MHz `-----------------------------' actual DSD sample rates Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm.c2
-rw-r--r--sound/core/pcm_misc.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 578327e2bc26..17f45e8aa89c 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -209,6 +209,8 @@ static char *snd_pcm_format_names[] = {
209 FORMAT(G723_24_1B), 209 FORMAT(G723_24_1B),
210 FORMAT(G723_40), 210 FORMAT(G723_40),
211 FORMAT(G723_40_1B), 211 FORMAT(G723_40_1B),
212 FORMAT(DSD_U8),
213 FORMAT(DSD_U16_LE),
212}; 214};
213 215
214const char *snd_pcm_format_name(snd_pcm_format_t format) 216const char *snd_pcm_format_name(snd_pcm_format_t format)
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index b875b19f2d55..43f24cce3dec 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -140,6 +140,14 @@ static struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = {
140 .width = 5, .phys = 5, .le = -1, .signd = -1, 140 .width = 5, .phys = 5, .le = -1, .signd = -1,
141 .silence = {}, 141 .silence = {},
142 }, 142 },
143 [SNDRV_PCM_FORMAT_DSD_U8] = {
144 .width = 8, .phys = 8, .le = 1, .signd = 0,
145 .silence = {},
146 },
147 [SNDRV_PCM_FORMAT_DSD_U16_LE] = {
148 .width = 16, .phys = 16, .le = 1, .signd = 0,
149 .silence = {},
150 },
143 /* FIXME: the following three formats are not defined properly yet */ 151 /* FIXME: the following three formats are not defined properly yet */
144 [SNDRV_PCM_FORMAT_MPEG] = { 152 [SNDRV_PCM_FORMAT_MPEG] = {
145 .le = -1, .signd = -1, 153 .le = -1, .signd = -1,