Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, liam.r.girdwood@intel.com
Subject: [PATCH - AAF PCM plugin 6/7] aaf: Implement dump() ioplug callback
Date: Wed,  3 Oct 2018 16:45:46 -0700	[thread overview]
Message-ID: <20181003234547.16839-7-andre.guedes@intel.com> (raw)
In-Reply-To: <20181003234547.16839-1-andre.guedes@intel.com>

This patch introduces the aaf_dump() function which prints information
about both PCM and AVTP setup.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
---
 aaf/pcm_aaf.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/aaf/pcm_aaf.c b/aaf/pcm_aaf.c
index e5c222f..f3159a1 100644
--- a/aaf/pcm_aaf.c
+++ b/aaf/pcm_aaf.c
@@ -23,6 +23,7 @@
 #include <arpa/inet.h>
 #include <avtp.h>
 #include <avtp_aaf.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <linux/if.h>
 #include <linux/if_ether.h>
@@ -961,6 +962,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, "  frame 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)
 {
@@ -1183,6 +1206,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,
-- 
2.14.4

  parent reply	other threads:[~2018-10-03 23:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 23:45 [PATCH - AAF PCM plugin 0/7] Introduce AVTP Audio Format (AAF) plugin Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 1/7] aaf: Introduce plugin skeleton Andre Guedes
2018-10-10 10:27   ` Takashi Iwai
2018-10-10 21:22     ` Guedes, Andre
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 2/7] aaf: Load configuration parameters Andre Guedes
2018-10-10 10:29   ` Takashi Iwai
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 3/7] aaf: Implement Playback mode support Andre Guedes
2018-10-10 10:34   ` Takashi Iwai
2018-10-10 21:27     ` Guedes, Andre
2018-10-11  7:31       ` Takashi Iwai
2018-10-11  7:45         ` Takashi Sakamoto
2018-10-11  8:00           ` Takashi Iwai
2018-10-11 19:53             ` Guedes, Andre
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 4/7] aaf: Prepare for Capture " Andre Guedes
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 5/7] aaf: Implement " Andre Guedes
2018-10-03 23:45 ` Andre Guedes [this message]
2018-10-03 23:45 ` [PATCH - AAF PCM plugin 7/7] aaf: Add support for direct read/write transfers Andre Guedes
2018-10-10 10:25 ` [PATCH - AAF PCM plugin 0/7] Introduce AVTP Audio Format (AAF) plugin Takashi Iwai
2018-10-10 21:19   ` Guedes, Andre
2018-10-22 16:51     ` Pierre-Louis Bossart
2018-10-23 20:01       ` Guedes, Andre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181003234547.16839-7-andre.guedes@intel.com \
    --to=andre.guedes@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=liam.r.girdwood@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox