alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: Add rate defines for 352k8 and 384k
@ 2016-06-05 14:35 DigitalDreamtime
  2016-06-05 15:24 ` Clive Messer
  2016-06-07 12:26 ` Charles Keepax
  0 siblings, 2 replies; 12+ messages in thread
From: DigitalDreamtime @ 2016-06-05 14:35 UTC (permalink / raw)
  To: alsa-devel; +Cc: DigitalDreamtime

Add SNDRV_PCM_RATE_352800 and SNDRV_PCM_RATE_384000 defines to pcm.h,
 for 352k8 and 384k sample rates.

Add SNDRV_PCM_RATE_8000_384000 define to pcm.h.

Update rates list in pcm_native.c.

Yes, we can use CONTINUOUS/KNOT and constraints, to support the x8
 sample rates, but having the defines requires less code in drivers.
Many more DAC chips are now supporting the x8 44k1/48k multiples.
>From a high-res viewpoint, the DXD standard is 352k8, 24 bit.
That alone should justify the addition of a define for it.

Signed-off-by: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
---
 include/sound/pcm.h     | 5 +++++
 sound/core/pcm_native.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index af1fb37..86e0bbe 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -129,6 +129,8 @@ struct snd_pcm_ops {
 #define SNDRV_PCM_RATE_96000		(1<<10)		/* 96000Hz */
 #define SNDRV_PCM_RATE_176400		(1<<11)		/* 176400Hz */
 #define SNDRV_PCM_RATE_192000		(1<<12)		/* 192000Hz */
+#define SNDRV_PCM_RATE_352800		(1<<13)		/* 352800Hz */
+#define SNDRV_PCM_RATE_384000		(1<<14)		/* 384000Hz */
 
 #define SNDRV_PCM_RATE_CONTINUOUS	(1<<30)		/* continuous range */
 #define SNDRV_PCM_RATE_KNOT		(1<<31)		/* supports more non-continuos rates */
@@ -141,6 +143,9 @@ struct snd_pcm_ops {
 					 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
 #define SNDRV_PCM_RATE_8000_192000	(SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
 					 SNDRV_PCM_RATE_192000)
+#define SNDRV_PCM_RATE_8000_384000	(SNDRV_PCM_RATE_8000_192000 |\
+					 SNDRV_PCM_RATE_352800 |\
+					 SNDRV_PCM_RATE_384000)
 #define _SNDRV_PCM_FMTBIT(fmt)		(1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
 #define SNDRV_PCM_FMTBIT_S8		_SNDRV_PCM_FMTBIT(S8)
 #define SNDRV_PCM_FMTBIT_U8		_SNDRV_PCM_FMTBIT(U8)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index c61fd50..21cc13d 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1981,12 +1981,13 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
 	return snd_interval_refine(hw_param_interval(params, rule->var), &t);
 }
 
-#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12
+#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_384000 != 1 << 14
 #error "Change this table"
 #endif
 
 static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
-                                 48000, 64000, 88200, 96000, 176400, 192000 };
+				 48000, 64000, 88200, 96000, 176400, 192000,
+				 352800, 384000 };
 
 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
 	.count = ARRAY_SIZE(rates),
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH] ALSA: Add rate defines for 352k8 and 384k
@ 2016-06-06 12:19 DigitalDreamtime
  2016-06-06 12:59 ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: DigitalDreamtime @ 2016-06-06 12:19 UTC (permalink / raw)
  To: alsa-devel; +Cc: DigitalDreamtime

Add SNDRV_PCM_RATE_352800 and SNDRV_PCM_RATE_384000 defines to pcm.h,
 for 352k8 and 384k sample rates.

Add SNDRV_PCM_RATE_8000_384000 define to pcm.h.

Update rates list in pcm_native.c.

Yes, we can use CONTINUOUS/KNOT and constraints, to support the x8
 sample rates, but having the defines requires less code in drivers.
Many more DAC chips are now supporting the x8 44k1/48k multiples.
>From a high-res viewpoint, the DXD standard is 352k8, 24 bit.
That alone should justify the addition of a define for it.

Signed-off-by: DigitalDreamtime <clive.messer@digitaldreamtime.co.uk>
---
 include/sound/pcm.h     | 5 +++++
 sound/core/pcm_native.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index af1fb37..86e0bbe 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -129,6 +129,8 @@ struct snd_pcm_ops {
 #define SNDRV_PCM_RATE_96000		(1<<10)		/* 96000Hz */
 #define SNDRV_PCM_RATE_176400		(1<<11)		/* 176400Hz */
 #define SNDRV_PCM_RATE_192000		(1<<12)		/* 192000Hz */
+#define SNDRV_PCM_RATE_352800		(1<<13)		/* 352800Hz */
+#define SNDRV_PCM_RATE_384000		(1<<14)		/* 384000Hz */
 
 #define SNDRV_PCM_RATE_CONTINUOUS	(1<<30)		/* continuous range */
 #define SNDRV_PCM_RATE_KNOT		(1<<31)		/* supports more non-continuos rates */
@@ -141,6 +143,9 @@ struct snd_pcm_ops {
 					 SNDRV_PCM_RATE_88200|SNDRV_PCM_RATE_96000)
 #define SNDRV_PCM_RATE_8000_192000	(SNDRV_PCM_RATE_8000_96000|SNDRV_PCM_RATE_176400|\
 					 SNDRV_PCM_RATE_192000)
+#define SNDRV_PCM_RATE_8000_384000	(SNDRV_PCM_RATE_8000_192000 |\
+					 SNDRV_PCM_RATE_352800 |\
+					 SNDRV_PCM_RATE_384000)
 #define _SNDRV_PCM_FMTBIT(fmt)		(1ULL << (__force int)SNDRV_PCM_FORMAT_##fmt)
 #define SNDRV_PCM_FMTBIT_S8		_SNDRV_PCM_FMTBIT(S8)
 #define SNDRV_PCM_FMTBIT_U8		_SNDRV_PCM_FMTBIT(U8)
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index c61fd50..21cc13d 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1981,12 +1981,13 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
 	return snd_interval_refine(hw_param_interval(params, rule->var), &t);
 }
 
-#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12
+#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_384000 != 1 << 14
 #error "Change this table"
 #endif
 
 static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
-                                 48000, 64000, 88200, 96000, 176400, 192000 };
+				 48000, 64000, 88200, 96000, 176400, 192000,
+				 352800, 384000 };
 
 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
 	.count = ARRAY_SIZE(rates),
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-06-07 12:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 14:35 [PATCH] ALSA: Add rate defines for 352k8 and 384k DigitalDreamtime
2016-06-05 15:24 ` Clive Messer
2016-06-07 12:26 ` Charles Keepax
  -- strict thread matches above, loose matches on Subject: below --
2016-06-06 12:19 DigitalDreamtime
2016-06-06 12:59 ` Takashi Iwai
2016-06-06 17:07   ` Clive Messer
2016-06-06 20:29     ` Takashi Iwai
2016-06-06 21:22       ` Clive Messer
2016-06-06 21:58         ` Takashi Iwai
2016-06-06 23:00           ` Clive Messer
2016-06-07  9:27             ` Takashi Iwai
2016-06-06 17:16   ` Clive Messer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).