From nobody Fri Aug 02 12:53:51 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 4Wb5PD1Qn3z5Rg9W; Fri, 02 Aug 2024 12:53:52 +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 4Wb5PD0vVNz4vjG; Fri, 2 Aug 2024 12:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722603232; 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=t5MyJkbLWo9yNeVEgprxd4zBgySLoJtZnyHd9xRRWLA=; b=by2Lw5XcK4Fwlyzi2lsk98L6uZU7RwbSmPoco0C6iVGxWEhw68xxhXtUgvlVt7PuWeEcFT YbzKnNV3KpSIcwin0URE+m1wrb+L+RJtR9ozu5nt87uC6rl/PjmrLnxYjqNdFlmA7VLzGN 6fYdeoxfcHZsKtofQNgr3+7H1ZfZUjQXDMHDprmXZy1knvYs4cTa4JdEOxQzwKn/eRfDpQ Tax8Vk8mEVVZAoiRyPcfniZgM06AEMyktCPr2mYJHeRKN5hJpYha1JZKDjNe+8BqEONqKr rEYef6GAe5W7jycfzpVv85kjY18OGPIrs/WyuZrh4dAql2skO7a6OByxEffcSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722603232; a=rsa-sha256; cv=none; b=PqfYY3p1KzFxxq+zwASPRLzWefp+Stpjgv47sDFQ3qafAOo45Zr5HUFvImlIgd02JqoBhT whGdJtLBjGIGgx/WhqPqKqB+v/3E2P22JrWhsz6CTbhYxEhVDZzvLR4MIUo9xN+0zu8Z2U 6XPDNJ/AG7325eVK7qRKtxVG5zSE0IP3zS7TxouLlp1z0jfmORzAl1VwhwuhF48UrTP2DW 1B5H8vQLmCj4s9ePaZZrh94/8z4ap6+egRUsHE/z/cnznw9LeQrtKHfmgtYKB4kyb5FK9a T1+S1TnFaLJx2adxziEox18ZgYPrJog1D4+AZ/Fad8m+uOFGov/nwn/6XlqwTg== 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=1722603232; 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=t5MyJkbLWo9yNeVEgprxd4zBgySLoJtZnyHd9xRRWLA=; b=h8Xu2Py/P3F9G0NLlP75O9qEe7JSrgD53u6GqPZpfJpCWPLaDUwnkniNNTeJeZXZEIgAC3 n9FImeHectKwKgkF/C/fdDamqWucJQ5A6W9INKSAXRmUmQ4acuWbGULZyu+TX9N0ScVq58 XpTzBxIGchigyxtvW8Kg2jv1rpvMp/QIEMrF6G2SiqfKMfk7WOZx6qz39h5F+dsthsgXYa Tphs7SoxPkaE9VZutfs25Ar9IcnrHubGq2hrYV2TGHPbRttA7jemlHjCaxqKuWo+Z3VSx1 X9YBaiaPHKZYOp6FZ5D4itQHA9gKBKiAGcIyaAyNqwnm25ISYapu8odW6tDhMg== 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 4Wb5PD0VgDzT22; Fri, 2 Aug 2024 12:53:52 +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 472Crpr4099329; Fri, 2 Aug 2024 12:53:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 472CrpPM099326; Fri, 2 Aug 2024 12:53:51 GMT (envelope-from git) Date: Fri, 2 Aug 2024 12:53:51 GMT Message-Id: <202408021253.472CrpPM099326@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: b58d9db4d77a - main - sound: Fix VCHANs' starting and ending points in feeder chain 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: b58d9db4d77a6f42ac7cf3cdb2af2443666033e2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b58d9db4d77a6f42ac7cf3cdb2af2443666033e2 commit b58d9db4d77a6f42ac7cf3cdb2af2443666033e2 Author: Christos Margiolis AuthorDate: 2024-08-02 12:53:16 +0000 Commit: Christos Margiolis CommitDate: 2024-08-02 12:53:16 +0000 sound: Fix VCHANs' starting and ending points in feeder chain sndstat(4) falsely reports "hardware" as the starting point of recording, and ending point of playback VCHANs. Recording VCHANs get their input from the primary recording channel, and playback VCHANs send their input to the primary playback channel. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D46177 --- sys/dev/sound/pcm/sndstat.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index f09fa7139884..4fac6a97a3f0 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -517,8 +517,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_SWBUF_READY, sndbuf_getready(c->bufsoft)); - sbuf_printf(&sb, "[%s", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(&sb, " -> "); f = c->feeder; while (f->source != NULL) @@ -550,8 +555,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) sbuf_printf(&sb, " -> "); f = f->parent; } - sbuf_printf(&sb, "%s]", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); @@ -1306,8 +1316,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, "channel flags=0x%b", c->flags, CHN_F_BITS); sbuf_printf(s, "\n\t"); - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(s, " -> "); f = c->feeder; while (f->source != NULL) @@ -1339,8 +1354,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, " -> "); f = f->parent; } - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); }