From patchwork Thu Oct 25 01:11:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guedes, Andre" X-Patchwork-Id: 10655295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5BE413BF for ; Thu, 25 Oct 2018 01:12:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C09DA2AA69 for ; Thu, 25 Oct 2018 01:12:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4EEA2B5A8; Thu, 25 Oct 2018 01:12:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C34B2AA69 for ; Thu, 25 Oct 2018 01:12:36 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id DC4A5267A70; Thu, 25 Oct 2018 03:12:07 +0200 (CEST) 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 DCBD72679C6; Thu, 25 Oct 2018 03:11:57 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by alsa0.perex.cz (Postfix) with ESMTP id 4885B267967 for ; Thu, 25 Oct 2018 03:11:54 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 18:11:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,422,1534834800"; d="scan'208";a="91027665" Received: from aguedesl-mobl1.jf.intel.com ([10.24.15.12]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2018 18:11:48 -0700 From: Andre Guedes To: alsa-devel@alsa-project.org Date: Wed, 24 Oct 2018 18:11:15 -0700 Message-Id: <20181025011116.12360-7-andre.guedes@intel.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181025011116.12360-1-andre.guedes@intel.com> References: <20181025011116.12360-1-andre.guedes@intel.com> Cc: tiwai@suse.de, pierre-louis.bossart@linux.intel.com, liam.r.girdwood@intel.com Subject: [alsa-devel] [PATCH v2 - AAF PCM plugin 6/7] aaf: Implement dump() ioplug callback 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 This patch introduces the aaf_dump() function which prints information about both PCM and AVTP setup. Signed-off-by: Andre Guedes --- aaf/pcm_aaf.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/aaf/pcm_aaf.c b/aaf/pcm_aaf.c index 147e5b0..b022575 100644 --- a/aaf/pcm_aaf.c +++ b/aaf/pcm_aaf.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -964,6 +965,28 @@ static int aaf_close(snd_pcm_ioplug_t *io) return 0; } +static void aaf_dump(snd_pcm_ioplug_t *io, snd_output_t *out) +{ + snd_pcm_aaf_t *aaf = io->private_data; + snd_pcm_t *pcm = io->pcm; + + snd_output_printf(out, "%s\n", io->name); + snd_output_printf(out, "PCM setup is:\n"); + snd_pcm_dump_setup(pcm, out); + snd_output_printf(out, "AVTP setup is:\n"); + snd_output_printf(out, " ifname: %s\n", aaf->ifname); + snd_output_printf(out, " macaddr: %.2X:%.2X:%.2X:%.2X:%.2X:%.2X\n", + aaf->addr[0], aaf->addr[1], aaf->addr[2], + aaf->addr[3], aaf->addr[4], aaf->addr[5]); + snd_output_printf(out, " priority: %d\n", aaf->prio); + snd_output_printf(out, " streamid: %"PRIX64"\n", aaf->streamid); + snd_output_printf(out, " mtt: %d\n", aaf->mtt / NSEC_PER_USEC); + snd_output_printf(out, " time uncertainty: %d\n", + aaf->t_uncertainty / NSEC_PER_USEC); + snd_output_printf(out, " frames per AVTPDU: %lu\n", + aaf->frames_per_pdu); +} + static int aaf_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params ATTRIBUTE_UNUSED) { @@ -1186,6 +1209,7 @@ static snd_pcm_sframes_t aaf_transfer(snd_pcm_ioplug_t *io, static const snd_pcm_ioplug_callback_t aaf_callback = { .close = aaf_close, + .dump = aaf_dump, .hw_params = aaf_hw_params, .hw_free = aaf_hw_free, .sw_params = aaf_sw_params,