Skip to contentSkip to conversation

ASoC: topology: Increase SND_SOC_TPLG_NUM_TEXTS to 32

PATCH In review Puneeth Prabhu 3 participants 7 messages Jul 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: topology: Increase SND_SOC_TPLG_NUM_TEXTS to 32

Topology supports maximum of 32 configs for a path whereas kernel can support only 16 configs of a path. So, increase SND_SOC_TPLG_NUM_TEXTS to 32 to support 32 configs for a path.

---
 include/uapi/sound/asoc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/sound/asoc.h +1 -1
index a74ca23..5b1411b 100644
@@ -88,7 +88,7 @@
 #define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
 
 /* string sizes */
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32
 
 /* ABI version */
 #define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 topology: ABI: Increase SND_SOC_TPLG_NUM_TEXTS to 32

Topology supports upto 32 configs for a path whereas alsatplg can parse a maximum of 16 configs of a path from the topology conf file.
So, increase SND_SOC_TPLG_NUM_TEXTS to 32 to support parsing upto 32 configs of a path.

---
 include/sound/asoc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/asoc.h +1 -1
index bb8aec7..eb61483 100644
@@ -84,7 +84,7 @@
 #define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
 
 /* string sizes */
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32
 
 /* ABI version */
 #define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */
Signature · 1 line
2.1.4
maintainer
#2 lore raw

Re: [PATCH] topology: ABI: Increase SND_SOC_TPLG_NUM_TEXTS to 32

include/sound/asoc.h line 90

Quoted 12 lines · Puneeth Prabhu

index bb8aec7..eb61483 100644

include/sound/asoc.h +1 -1
@@ -84,7 +84,7 @@
 #define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
 
 /* string sizes */
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32
 
 /* ABI version */
 #define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */

Hrm, we should be getting rid of the duplication here - include the UAPI header in sound/asoc.h rather than duplicating definitions between the two. Otherwise someone might modify something in sound/asoc.h and not realize that the UAPI is affected.

maintainer
#3 lore raw
In reply to Puneeth Prabhu

include/uapi/sound/asoc.h line 91

Quoted 3 lines · Puneeth Prabhu

/* string sizes */

include/uapi/sound/asoc.h +1 -1
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32

This will increase the size of the texts and values fields of at least snd_soc_tplg_enum_control which on the face of it appears to be an incompatible ABI change, topology files created with the old value will have a different layout for these structures to those created with the new one.

#4 lore raw
Quoted 11 lines · Mark Brown

include/uapi/sound/asoc.h line 91

Quoted 3 lines · Puneeth Prabhu

/* string sizes */

include/uapi/sound/asoc.h +1 -1
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32

This will increase the size of the texts and values fields of at least snd_soc_tplg_enum_control which on the face of it appears to be an incompatible ABI change, topology files created with the old value will have a different layout for these structures to those created with the new one.

Agree with Mark on both points (de-duplication needed and backwards compatibility). If we are going to respin a new version, there are a couple of known limitations we may want to fix as well, such as the limitation to 8 channels and others I will remember once I've had more coffee.

maintainer
#5 lore raw
Quoted 4 lines · Pierre-Louis Bossart

Agree with Mark on both points (de-duplication needed and backwards compatibility). If we are going to respin a new version, there are a couple of known limitations we may want to fix as well, such as the limitation to 8 channels and others I will remember once I've had more coffee.

Actually it looks like the duplication isn't a thing, I can't see the definition the patch was intended to modify in upstream.

#6 lore raw
In reply to Puneeth Prabhu
Quoted 4 lines · Puneeth Prabhu

Topology supports maximum of 32 configs for a path whereas kernel can support only 16 configs of a path. So, increase SND_SOC_TPLG_NUM_TEXTS to 32 to support 32 configs for a path.

What do you mean by "Topology supports maximum of 32 configs for a path"? I checked in alsa-lib and the same value of 16 is used. I don't get how a change at the kernel level is going to help if the information generated by alsatplg uses a different structure.

I also don't get how you enable this change, the code in skl-topology only accesses the .priv structure in the enum, but if you change the size of the texts array then all your pointers are incorrect so you'd handle garbage data.

Quoted 21 lines
---
  include/uapi/sound/asoc.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/sound/asoc.h +1 -1
index a74ca23..5b1411b 100644
@@ -88,7 +88,7 @@
  #define SND_SOC_TPLG_MAGIC		0x41536F43 /* ASoC */
 
  /* string sizes */
-#define SND_SOC_TPLG_NUM_TEXTS		16
+#define SND_SOC_TPLG_NUM_TEXTS		32
 
  /* ABI version */
  #define SND_SOC_TPLG_ABI_VERSION	0x5	/* current version */