From ef7a4f979bd8201324b2bcd30277c14aba889f50 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 17 Apr 2013 00:01:36 +0800 Subject: 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 Signed-off-by: Takashi Iwai --- sound/core/pcm_misc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sound/core/pcm_misc.c') diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index b875b19..43f24cc 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] = { .width = 5, .phys = 5, .le = -1, .signd = -1, .silence = {}, }, + [SNDRV_PCM_FORMAT_DSD_U8] = { + .width = 8, .phys = 8, .le = 1, .signd = 0, + .silence = {}, + }, + [SNDRV_PCM_FORMAT_DSD_U16_LE] = { + .width = 16, .phys = 16, .le = 1, .signd = 0, + .silence = {}, + }, /* FIXME: the following three formats are not defined properly yet */ [SNDRV_PCM_FORMAT_MPEG] = { .le = -1, .signd = -1, -- cgit v1.1