Skip to contentSkip to conversation

pcm: 2nd round of pcm_misc DSD fixes

PATCH Applied Jurgen Kramer 2 participants 2 messages Aug 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pcm: 2nd round of pcm_misc DSD fixes

Functions 'snd_pcm_format_silence_64' and 'snd_pcm_format_size' also need to be able to handle the DSD smaple format.

Changes from v1:
- Correct silence pattern for DSD

---
 src/pcm/pcm_misc.c | 5 +++++
 1 file changed, 5 insertions(+)
src/pcm/pcm_misc.c +5 -0
index 24d52f9..46fc771 100644
@@ -317,11 +317,13 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
 	switch (format) {
 	case SNDRV_PCM_FORMAT_S8:
 	case SNDRV_PCM_FORMAT_U8:
+	case SNDRV_PCM_FORMAT_DSD_U8:
 		return samples;
 	case SNDRV_PCM_FORMAT_S16_LE:
 	case SNDRV_PCM_FORMAT_S16_BE:
 	case SNDRV_PCM_FORMAT_U16_LE:
 	case SNDRV_PCM_FORMAT_U16_BE:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
 		return samples * 2;
 	case SNDRV_PCM_FORMAT_S18_3LE:
 	case SNDRV_PCM_FORMAT_S18_3BE:
@@ -390,6 +392,9 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
 		return 0;
 	case SNDRV_PCM_FORMAT_U8:
 		return 0x8080808080808080ULL;
+	case SNDRV_PCM_FORMAT_DSD_U8:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
+		return 0x6969696969696969ULL;
 #ifdef SNDRV_LITTLE_ENDIAN
 	case SNDRV_PCM_FORMAT_U16_LE:
 		return 0x8000800080008000ULL;
Signature · 1 line
1.9.3
Applied
#1 lore raw

At Fri, 22 Aug 2014 10:15:10 +0200,

Quoted 8 lines · Jurgen Kramer

Functions 'snd_pcm_format_silence_64' and 'snd_pcm_format_size' also need to be able to handle the DSD smaple format.

Changes from v1:
- Correct silence pattern for DSD

Applied, thanks.

Takashi

Quoted 40 lines
---
 src/pcm/pcm_misc.c | 5 +++++
 1 file changed, 5 insertions(+)
src/pcm/pcm_misc.c +5 -0
index 24d52f9..46fc771 100644
@@ -317,11 +317,13 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
 	switch (format) {
 	case SNDRV_PCM_FORMAT_S8:
 	case SNDRV_PCM_FORMAT_U8:
+	case SNDRV_PCM_FORMAT_DSD_U8:
 		return samples;
 	case SNDRV_PCM_FORMAT_S16_LE:
 	case SNDRV_PCM_FORMAT_S16_BE:
 	case SNDRV_PCM_FORMAT_U16_LE:
 	case SNDRV_PCM_FORMAT_U16_BE:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
 		return samples * 2;
 	case SNDRV_PCM_FORMAT_S18_3LE:
 	case SNDRV_PCM_FORMAT_S18_3BE:
@@ -390,6 +392,9 @@ u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
 		return 0;
 	case SNDRV_PCM_FORMAT_U8:
 		return 0x8080808080808080ULL;
+	case SNDRV_PCM_FORMAT_DSD_U8:
+	case SNDRV_PCM_FORMAT_DSD_U16_LE:
+		return 0x6969696969696969ULL;
 #ifdef SNDRV_LITTLE_ENDIAN
 	case SNDRV_PCM_FORMAT_U16_LE:
 		return 0x8000800080008000ULL;
Signature · 6 lines
1.9.3

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel