From patchwork Thu Jan 28 08:32:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 8147531 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B0189F818 for ; Thu, 28 Jan 2016 08:28:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA4E52024F for ; Thu, 28 Jan 2016 08:28:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 85D1820154 for ; Thu, 28 Jan 2016 08:28:45 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5919926582C; Thu, 28 Jan 2016 09:28:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 84FF6265558; Thu, 28 Jan 2016 09:28:36 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 83DAD265680; Thu, 28 Jan 2016 09:28:35 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 57BF02654F6 for ; Thu, 28 Jan 2016 09:28:28 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 28 Jan 2016 00:28:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,357,1449561600"; d="scan'208";a="642664536" Received: from vkoul-udesk7.iind.intel.com ([10.223.84.34]) by FMSMGA003.fm.intel.com with ESMTP; 28 Jan 2016 00:28:23 -0800 From: Vinod Koul To: alsa-devel@alsa-project.org Date: Thu, 28 Jan 2016 14:02:18 +0530 Message-Id: <1453969938-27867-1-git-send-email-vinod.koul@intel.com> X-Mailer: git-send-email 1.9.1 Cc: liam.r.girdwood@linux.intel.com, tiwai@suse.de, broonie@kernel.org, Vinod Koul , patches.audio@intel.com Subject: [alsa-devel] [PATCH v4] amixer: skip showing asoc tlv byte controls X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- amixer/amixer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/amixer/amixer.c b/amixer/amixer.c index db1849333da3..f9b09cb54276 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -682,6 +682,14 @@ 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 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)) { + 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));