* [PATCH v2] amixer: skip showing asoc tlv byte controls
@ 2016-01-28 4:49 Vinod Koul
2016-01-28 5:53 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2016-01-28 4:49 UTC (permalink / raw)
To: alsa-devel; +Cc: liam.r.girdwood, tiwai, broonie, Vinod Koul, patches.audio
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
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
amixer/amixer.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/amixer/amixer.c b/amixer/amixer.c
index db1849333da3..9ae75bfa3632 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -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));
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] amixer: skip showing asoc tlv byte controls
2016-01-28 4:49 [PATCH v2] amixer: skip showing asoc tlv byte controls Vinod Koul
@ 2016-01-28 5:53 ` Takashi Iwai
2016-01-28 6:40 ` Vinod Koul
0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2016-01-28 5:53 UTC (permalink / raw)
To: Vinod Koul; +Cc: liam.r.girdwood, patches.audio, alsa-devel, broonie
On Thu, 28 Jan 2016 05:49:42 +0100,
Vinod Koul wrote:
>
> 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
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
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
> ---
> amixer/amixer.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/amixer/amixer.c b/amixer/amixer.c
> index db1849333da3..9ae75bfa3632 100644
> --- a/amixer/amixer.c
> +++ b/amixer/amixer.c
> @@ -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));
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] amixer: skip showing asoc tlv byte controls
2016-01-28 5:53 ` Takashi Iwai
@ 2016-01-28 6:40 ` Vinod Koul
2016-01-28 7:04 ` Takashi Iwai
0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2016-01-28 6:40 UTC (permalink / raw)
To: Takashi Iwai; +Cc: liam.r.girdwood, patches.audio, alsa-devel, broonie
On Thu, Jan 28, 2016 at 06:53:49AM +0100, Takashi Iwai wrote:
> On Thu, 28 Jan 2016 05:49:42 +0100,
> Vinod Koul wrote:
> >
> > 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
> >
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
>
> 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
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] amixer: skip showing asoc tlv byte controls
2016-01-28 6:40 ` Vinod Koul
@ 2016-01-28 7:04 ` Takashi Iwai
0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2016-01-28 7:04 UTC (permalink / raw)
To: Vinod Koul; +Cc: liam.r.girdwood, patches.audio, alsa-devel, broonie
On Thu, 28 Jan 2016 07:40:11 +0100,
Vinod Koul wrote:
>
> On Thu, Jan 28, 2016 at 06:53:49AM +0100, Takashi Iwai wrote:
> > On Thu, 28 Jan 2016 05:49:42 +0100,
> > Vinod Koul wrote:
> > >
> > > 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
> > >
> > > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> >
> > 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 ?
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-28 7:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-28 4:49 [PATCH v2] amixer: skip showing asoc tlv byte controls Vinod Koul
2016-01-28 5:53 ` Takashi Iwai
2016-01-28 6:40 ` Vinod Koul
2016-01-28 7:04 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.