Skip to contentSkip to conversation

amixer: skip showing asoc tlv byte controls

PATCH Superseded Vinod Koul 2 participants 4 messages Jan 28, 2016

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

PATCH v2 1/1 amixer: skip showing asoc tlv byte controls

ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.

$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
: ASoC TLV Byte control, skipping bytes dump

---
 amixer/amixer.c | 6 ++++++
 1 file changed, 6 insertions(+)
amixer/amixer.c +6 -0
index db1849333da3..9ae75bfa3632 100644
@@ -682,6 +682,12 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
 	      __skip_read:
 		if (!snd_ctl_elem_info_is_tlv_readable(info))
 			goto __skip_tlv;
+		/* skip show for ASoC TLV Byte controls */
+		if (type == SND_CTL_ELEM_TYPE_BYTES) {
+			printf("%s: ASoC TLV Byte control, skipping bytes dump\n", space);
+			goto __skip_tlv;
+		}
+
 		tlv = malloc(4096);
 		if ((err = snd_hctl_elem_tlv_read(elem, tlv, 4096)) < 0) {
 			error("Control %s element TLV read error: %s\n", card, snd_strerror(err));
Signature · 1 line
1.9.1
#1 lore raw
Quoted 10 lines · Vinod Koul

ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.

$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
: ASoC TLV Byte control, skipping bytes dump

No, as I wrote before, checking the type isn't enough. Assigning a TLV to BYTES type doesn't mean necessarily that it's an ASoC EXT control. You need to check the r/w capabilities as well.

thanks,

Takashi

Quoted 24 lines
---
 amixer/amixer.c | 6 ++++++
 1 file changed, 6 insertions(+)
amixer/amixer.c +6 -0
index db1849333da3..9ae75bfa3632 100644
@@ -682,6 +682,12 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
 	      __skip_read:
 		if (!snd_ctl_elem_info_is_tlv_readable(info))
 			goto __skip_tlv;
+		/* skip show for ASoC TLV Byte controls */
+		if (type == SND_CTL_ELEM_TYPE_BYTES) {
+			printf("%s: ASoC TLV Byte control, skipping bytes dump\n", space);
+			goto __skip_tlv;
+		}
+
 		tlv = malloc(4096);
 		if ((err = snd_hctl_elem_tlv_read(elem, tlv, 4096)) < 0) {
 			error("Control %s element TLV read error: %s\n", card, snd_strerror(err));
Signature · 1 line
1.9.1
author
#2 lore raw
Quoted 11 lines · Takashi Iwai
Quoted 9 lines · Vinod Koul

ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.

$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
: ASoC TLV Byte control, skipping bytes dump

Quoted 5 lines
Quoted 1 line

No, as I wrote before, checking the type isn't enough. Assigning a TLV to BYTES type doesn't mean necessarily that it's an ASoC EXT control. You need to check the r/w capabilities as well.

Oops missed that part.

So am making it

if (type == SND_CTL_ELEM_TYPE_BYTES &&

	(snd_ctl_elem_info_is_tlv_readable(info) ||
	snd_ctl_elem_info_is_tlv_writable(info))) {

But this control can be read only or write only. Like a module doesnt allow read, or some is read only so OR should be good here

Also should it check it is not normal read/write ?

Thanks

Signature · 1 line
~Vinod
#3 lore raw
Quoted 23 lines · Vinod Koul
Quoted 11 lines · Takashi Iwai
Quoted 9 lines · Vinod Koul

ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.

$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
: ASoC TLV Byte control, skipping bytes dump

Quoted 5 lines
Quoted 1 line

No, as I wrote before, checking the type isn't enough. Assigning a TLV to BYTES type doesn't mean necessarily that it's an ASoC EXT control. You need to check the r/w capabilities as well.

Oops missed that part.

So am making it

Quoted 8 lines

if (type == SND_CTL_ELEM_TYPE_BYTES &&

	(snd_ctl_elem_info_is_tlv_readable(info) ||
	snd_ctl_elem_info_is_tlv_writable(info))) {

But this control can be read only or write only. Like a module doesnt allow read, or some is read only so OR should be good here

Also should it check it is not normal read/write ?

Yes.

	/* skip ASoC ext bytes controls that may have huge binary TLV data */
	if (type == SND_CTL_ELEM_TYPE_BYTES &&
 	    !snd_ctl_elem_info_is_readable(info) &&
	    !snd_ctl_elem_info_is_writable(info))
		goto __skip_tlv;

Takashi