Skip to contentSkip to conversation

topology: Add parsing for rates from conf

PATCH RESEND Applied Guneshwor Singh 2 participants 2 messages Jun 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 topology: Add parsing for rates from conf

In alsa-lib topology parser, rate_min and rate_max are parsed currently. Add support to parse rates also.

---
 include/topology.h        |  1 +
 src/topology/pcm.c        | 71 +++++++++++++++++++++++++++++++++++++++++++++++
 src/topology/tplg_local.h | 20 +++++++++++++
 3 files changed, 92 insertions(+)
include/topology.h +1 -0
index ccb3a004..42d23762 100644
@@ -534,6 +534,7 @@ extern "C" {
  * SectionPCMCapabilities."name" {
  *
  *	formats "S24_LE,S16_LE"		# Supported formats
+ *	rates "48000"			# Supported rates
  *	rate_min "48000"		# Max supported sample rate
  *	rate_max "48000"		# Min supported sample rate
  *	channels_min "2"		# Min number of channels
src/topology/pcm.c +71 -0

89 lines not on this page · raw message

src/topology/tplg_local.h +20 -0
index 60af0177..af599145 100644
@@ -37,6 +37,26 @@
 struct tplg_ref;
 struct tplg_elem;
 
+typedef enum _snd_pcm_rates {
+	SND_PCM_RATE_UNKNOWN = -1,
+	SND_PCM_RATE_5512 = 0,
+	SND_PCM_RATE_8000,
+	SND_PCM_RATE_11025,
+	SND_PCM_RATE_16000,
+	SND_PCM_RATE_22050,
+	SND_PCM_RATE_32000,
+	SND_PCM_RATE_44100,
+	SND_PCM_RATE_48000,
+	SND_PCM_RATE_64000,
+	SND_PCM_RATE_88200,
+	SND_PCM_RATE_96000,
+	SND_PCM_RATE_176400,
+	SND_PCM_RATE_192000,
+	SND_PCM_RATE_CONTINUOUS = 30,
+	SND_PCM_RATE_KNOT = 31,
+	SND_PCM_RATE_LAST = SND_PCM_RATE_KNOT,
+} snd_pcm_rates_t;
+
 struct snd_tplg {
 
 	/* opaque vendor data */
Signature · 1 line
2.13.0