From nobody Mon Aug 26 13:54:50 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WsscW1Y99z5SxwP; Mon, 26 Aug 2024 13:54:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WsscV6Jdlz4fjR; Mon, 26 Aug 2024 13:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=KYgS9+sqR+lLKOP0L81Ho83Lmk445WxME9dd8zMM/XmLJwwCfi7bL/EuZKkl/Ccf6/ylvY m9LJqy3EduUNiVkEXEv8yX/7WPrQBMiat8d0Y0h+vgJZ8DAC6aJIVW3RU5JKZah77tWH76 p/ZOqhPQFB9CF3Rp5CBBV5UYFRcHtzs7k+Ti1JK71bLJGA6iFHJyswCQtk1jFdqbD/ojDD RE3aaOxhsCkOTSCu/SPAxI5LdL4kqNa9uKizaUrJeN+WJZZUxKUeFN/pvSt+MqmCBK8oXs PUGbHpWv7Pv8jvsz0AzfXpMRnZtYI3MwKk1HP0IatBv0akT1zOsF55vDUuuTIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724680490; a=rsa-sha256; cv=none; b=jNVMFzJu09PMHr3dC1bEnRTyvukhKxjvglm1QxfYfycvU2NAciOt/SJbkTlXyodsXsUhJZ Mu1E0dTyTs/6rB71H5ZOumtmNlpVVgLMCGhkWFHUGBOvcgL9EcU/x1a80+vDIgvwR/2zej lBKbsdElGjHKn8ktPOEX5Lgd60oKtNi/t70IG/h6R9d3r37RplsnaBTsQijZI5RY3UtVE2 OU1eOziIhUNdjRXglPPNRhBCn6I6XVaTkDYFiDag0LnashzSxvOiOdZrvShxqVGx8hsU/B 5dRhHW5I6hd2zX6aPKGCzzsE57Ld48X0hQONgA9g53eZBo7UHeGhW4FE3xC1tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724680490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq89ZYbGW+yrlqcrVlz5oGoyDoXd1kblV9qmY8tUo0k=; b=kDXvolMEO6YYFaEzinl0XseSPuCJbrQ4x7IJ30/lV5B55/DtxJzYrvm4SZ2ckOq1wOzVP9 gNchABlRcBdtXN8wMmG8B5AD5K3/zwgefC0e5LsjtNl+tsPIFgBmUjwZL2K1eAqd2XwnKg 11wCYXo1RSBiM3NZB0zdPKfEDs3dbLISPMJO6nEKMaYzSGiX+EXmczpsZXBZfAhHvyKfw2 1BNLofWag2jVj+OghNydvG8Z1/yvD31dxqxhYVKJMPMcDO98kbT5g/ttcjg0PgqQsQf8VD Pozz1ou+vm8rcLeyMYOxPaOO1fsf1+A7iO/6jE/AWMCgMPdK+IACnWCHe3IxEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WsscV5gVtz187H; Mon, 26 Aug 2024 13:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47QDso2v017513; Mon, 26 Aug 2024 13:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47QDsoU3017510; Mon, 26 Aug 2024 13:54:50 GMT (envelope-from git) Date: Mon, 26 Aug 2024 13:54:50 GMT Message-Id: <202408261354.47QDsoU3017510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 8156d8598f59 - stable/14 - sound: Improve sndstat nvlist feederchain format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8156d8598f5926a8fa996b65b742a295599b131c Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8156d8598f5926a8fa996b65b742a295599b131c commit 8156d8598f5926a8fa996b65b742a295599b131c Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:54 +0000 Commit: Christos Margiolis CommitDate: 2024-08-26 13:53:01 +0000 sound: Improve sndstat nvlist feederchain format - Use snd_afmt2str() to display format conversions in feeder_format, instead of the plain hex value. - Simplify feeder_rate contents. - Print "ch" (e.g 2.1ch) after matrix values in feeder_matrix. - Use snd_afmt2str() instead of a plain hex for the the rest of the feeder classes. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46309 (cherry picked from commit 0864dfe6299b75e424b845c0d0e1a593da905ae3) --- sys/dev/sound/pcm/sndstat.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4fac6a97a3f0..4c5efb72cc0a 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -388,6 +388,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; + char buf[AFMTSTR_LEN]; di = nvlist_create(0); if (di == NULL) { @@ -531,10 +532,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) while (f != NULL) { sbuf_printf(&sb, "%s", f->class->name); if (f->desc->type == FEEDER_FORMAT) { - sbuf_printf(&sb, "(0x%08x -> 0x%08x)", - f->desc->in, f->desc->out); + snd_afmt2str(f->desc->in, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s -> ", buf); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "%s)", buf); } else if (f->desc->type == FEEDER_MATRIX) { - sbuf_printf(&sb, "(%d.%d -> %d.%d)", + sbuf_printf(&sb, "(%d.%dch -> %d.%dch)", AFMT_CHANNEL(f->desc->in) - AFMT_EXTCHANNEL(f->desc->in), AFMT_EXTCHANNEL(f->desc->in), @@ -542,15 +545,12 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) AFMT_EXTCHANNEL(f->desc->out), AFMT_EXTCHANNEL(f->desc->out)); } else if (f->desc->type == FEEDER_RATE) { - sbuf_printf(&sb, - "(0x%08x q:%d %d -> %d)", - f->desc->out, - FEEDER_GET(f, FEEDRATE_QUALITY), + sbuf_printf(&sb, "(%d -> %d)", FEEDER_GET(f, FEEDRATE_SRC), FEEDER_GET(f, FEEDRATE_DST)); } else { - sbuf_printf(&sb, "(0x%08x)", - f->desc->out); + snd_afmt2str(f->desc->out, buf, sizeof(buf)); + sbuf_printf(&sb, "(%s)", buf); } sbuf_printf(&sb, " -> "); f = f->parent;