From nobody Sat Aug 24 12:09:17 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 4WrbMf11qLz5T0dS; Sat, 24 Aug 2024 12:09:18 +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 4WrbMd72v7z546V; Sat, 24 Aug 2024 12:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724501358; 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=Mk5veE56TxfkFEeM3E0C9h2G2Z0jK+YVk+XqhM4aS44=; b=jQb8sz1ogO6tvE6vMD79XwVDW3Ytwc90vI/AxyXF51qund7SONAezlvZf6mWG2Om/GXEFD ccFkno5g6Jcpoo4ImX7bkOQ3ofpjStmxhMma4Pj+iwDZta25ZLZ/qxmtiW1KrKQ4P0LWCA m+n2GpGrR+EtD9KS5dmbBz3LUICGh+hPwu2iV3JOPINJOieOtEHDLRYq7979vQIGvhDNp8 XG5RV9BOS9yq4ymvBcH1NhlD4NZG5kQeLmrXT1YtfkknOgAOllo2biAiQfEaz6s2lt6VW2 EEAOyDA1H94hrPb+P/eRdd82oOzMDBlaI/rPvqOGDbEAD7Ux6+PkKyxXk/3GJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724501358; a=rsa-sha256; cv=none; b=KOwhHuLmxW6EPX+oVYxpbfZnVoee5CGolp3jka9aSdVQGcxkejxFBAPWTFYqxCsxdaJHfT g84Uj5MXyDUl5hD/zW8jdqf2BxtQtnFVOnx1Thlwl30JAzlXySDwSM4gvhI+zlEvs3gBtb ukjZ2Nq+8ud5J7eQqaIv5qtwpUds+TJH6GPWyGzdqP2GsEcbN3OIgx1D2pNYOP8FcvHsOU QV5+1VvGYicOV6IU3NpeDO7NO8H4XP15H7Azyd3AxgcV86Y9CUj/gejUe0m/dewaYs5Y9Q xyOb5AUoOHcw2rrHT060INhvFhnvN8zKwKwFqPWdrEMe8gYrw/7ehw/1p5JEfw== 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=1724501358; 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=Mk5veE56TxfkFEeM3E0C9h2G2Z0jK+YVk+XqhM4aS44=; b=JxHXXtnqk+HKineSRA4pex699wNKGlR14HQgzKvf8Yw34JI6A/fLiisrV9OECgEtk+7kSb c3Fkn9U6zl5vYh9sh8OiLTVtXupv/T7fCHF1V7o0/bLJLNj9C7OFqXvEAmwmstOWRQvTEl sFz2eBHK0RGaqL+sFvk2hhhpci+bJtl7uXWUCVbneFUYnu9JAMb7DCxhH9SNQ2ywaxzaTg bEd1EwIp4M6s0GfAD8MB6T/dM7vhnUXjeoCXZDFslHUoPI5dJWT9BPu/mjvtfNLQyWW8Be y/jh7H0EFVL5OzEv8AgllpSEHp6lgRcCHvffplC1iPQsnar7B0k65FxExbZ8WA== 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 4WrbMd6fVPzvHJ; Sat, 24 Aug 2024 12:09:17 +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 47OC9HDx048233; Sat, 24 Aug 2024 12:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47OC9H03048230; Sat, 24 Aug 2024 12:09:17 GMT (envelope-from git) Date: Sat, 24 Aug 2024 12:09:17 GMT Message-Id: <202408241209.47OC9H03048230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0864dfe6299b - main - 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/main X-Git-Reftype: branch X-Git-Commit: 0864dfe6299b75e424b845c0d0e1a593da905ae3 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0864dfe6299b75e424b845c0d0e1a593da905ae3 commit 0864dfe6299b75e424b845c0d0e1a593da905ae3 Author: Christos Margiolis AuthorDate: 2024-08-24 12:07:54 +0000 Commit: Christos Margiolis CommitDate: 2024-08-24 12:07:54 +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 --- 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;