From nobody Sun Oct 20 11:21:43 2024 X-Original-To: dev-commits-src-branches@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 4XWbcR3P0Qz5YvPK; Sun, 20 Oct 2024 11:21:43 +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 4XWbcR1gBlz4XGl; Sun, 20 Oct 2024 11:21:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423303; 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=fTVdMLKXCSUIaUl/M8xBZL0WcODkF8+CJ5a6NnAQRlM=; b=Va+mFEBJZQkZipnrB8/0pM37crrfAhqrojwJg8hBMFZ36N4ITT13VGLMldX7Q4kwy9qPjZ 9JcRpvqFTLw4b19rsQ9sSaI+8EwwdlDmFrDqi8xlkRS1DnMU6CUQgaj5XLgEYIUgckCAiG +04kLQqPyshsrkPItETjfAqp8HXwME4EGsRNeeE8o5PEATpAdYTjX9SUdYfRkj83GcoNpG h5ABNMIYK5TGRBra8RQZSGTY+Wxmu3uAxfn7u36FFblzoLGCaRpTLIitml4k6CI9JNAWTz 7FMHWo683zQR4FPkSFcAIGFWi5KeyqZLDF9abWtgrQl4L9PbRRkuU9bnzv6Z4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423303; 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=fTVdMLKXCSUIaUl/M8xBZL0WcODkF8+CJ5a6NnAQRlM=; b=b0NPGQZs7qJw4ffikYAuzKc0Dp9qiYMEi+SG8+6HJGMZhj8m6TvbxFnrTaCo1VmusDIOK5 YkFkte2DROGQrfB5hQwKKY01DP5ukdH+IO1bDy2z/sWAbGKkOYrBM7rMx12Iao/B25xsgE sqStQ8/eHcfy1okwWTmtYqZdTlt0z5Rb4Hg+KGGMUNWoM8cpxRv61WEW5kUHx8dJdne1hF F+kp8dI2FOfuXPJLr1O4s+3xGhwwhAjX0UlLe/PowhjuKGPm6h+23cBCWWUfqIjwLzvqHq IYmUFeq7Y8hpTQ7OPaCpGq6VmLvd26ZkqHurxfXkR1JhbSewfghwfRaHhCBR9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423303; a=rsa-sha256; cv=none; b=tggRrF0zU81pQJrey4oBI9NeA5Ow5GHNpbF9xYiIXyN8qrv6Xdc3TJR7nWCpWwC4BYoI3S iwpprrMdUHNpBfp1FydxoavpuuSh0dXhx09ZJ31BIo+Haa16rWCEL7IncHVzjY0zR3XY0X aNVMDq6VIiHSUO1amCwPbNwVwN0hHz1sX2ly//JxmKBjunk4qkuCHWDUy4APX9H6CZ7EZ9 B7GQjqYgXcZUKumnTNt/1NGNY/M+PDpYzZQrNgw4OEYLETz05PSuJi80WIK/ZfpD7uQDVC gFjG5nwXaKqstjAg1+bvY2HUsV1hTSwQICXNKueqNppfrkSC9MgH0ZqqsmV+Ew== 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 4XWbcR18RJzy9n; Sun, 20 Oct 2024 11:21:43 +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 49KBLh7S063071; Sun, 20 Oct 2024 11:21:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLhA2063068; Sun, 20 Oct 2024 11:21:43 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:43 GMT Message-Id: <202410201121.49KBLhA2063068@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: f0eee0fbde8e - stable/14 - sound: Shorten channel names List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f0eee0fbde8e40e3b59e257b529697c1d07c55e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f0eee0fbde8e40e3b59e257b529697c1d07c55e7 commit f0eee0fbde8e40e3b59e257b529697c1d07c55e7 Author: Christos Margiolis AuthorDate: 2024-10-18 08:40:50 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:05 +0000 sound: Shorten channel names The current channel naming convention is: pcmX:[virtual_]play|record:dspX.[v]p|rY - pcmX and dspX share the same unit numbers - "[v]p|r" gives us the same information as "[virtual_]play|record" Remove the redundant information, so that the channel names become more readable: dspX.[virtual_]play|record.Y Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46836 (cherry picked from commit c30f531ddb629ab51359fb540c8ef6068bab288b) --- sys/dev/sound/pcm/channel.c | 10 ++-------- sys/dev/sound/pcm/dsp.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 5b0bb105c505..1e68be161322 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1182,7 +1182,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct pcm_channel *c; struct feeder_class *fc; struct snd_dbuf *b, *bs; - char *dirs, buf[CHN_NAMELEN]; + char buf[CHN_NAMELEN]; int i, direction, type; PCM_BUSYASSERT(d); @@ -1190,22 +1190,18 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, switch (dir) { case PCMDIR_PLAY: - dirs = "play"; direction = PCMDIR_PLAY; type = SND_DEV_DSPHW_PLAY; break; case PCMDIR_PLAY_VIRTUAL: - dirs = "virtual_play"; direction = PCMDIR_PLAY; type = SND_DEV_DSPHW_VPLAY; break; case PCMDIR_REC: - dirs = "record"; direction = PCMDIR_REC; type = SND_DEV_DSPHW_REC; break; case PCMDIR_REC_VIRTUAL: - dirs = "virtual_record"; direction = PCMDIR_REC; type = SND_DEV_DSPHW_VREC; break; @@ -1239,9 +1235,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, c->dev = d->dev; c->trigger = PCMTRIG_STOP; - snprintf(c->name, sizeof(c->name), "%s:%s:%s", - device_get_nameunit(c->dev), dirs, - dsp_unit2name(buf, sizeof(buf), c)); + strlcpy(c->name, dsp_unit2name(buf, sizeof(buf), c), sizeof(c->name)); c->matrix = *feeder_matrix_id_map(SND_CHN_MATRIX_1_0); c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 2b765bc8b115..bf68f64929c3 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -170,17 +170,17 @@ static const struct { char *sep; char *alias; } dsp_cdevs[] = { - { SND_DEV_DSP, "dsp", ".", NULL }, - { SND_DEV_DSPHW_PLAY, "dsp", ".p", NULL }, - { SND_DEV_DSPHW_VPLAY, "dsp", ".vp", NULL }, - { SND_DEV_DSPHW_REC, "dsp", ".r", NULL }, - { SND_DEV_DSPHW_VREC, "dsp", ".vr", NULL }, + { SND_DEV_DSP, "dsp", ".", NULL }, + { SND_DEV_DSPHW_PLAY, "dsp", ".play.", NULL }, + { SND_DEV_DSPHW_VPLAY, "dsp", ".virtual_play.", NULL }, + { SND_DEV_DSPHW_REC, "dsp", ".record.", NULL }, + { SND_DEV_DSPHW_VREC, "dsp", ".virtual_record.", NULL }, /* Low priority, OSSv4 aliases. */ - { SND_DEV_DSP, "dsp_ac3", ".", "dsp" }, - { SND_DEV_DSP, "dsp_mmap", ".", "dsp" }, - { SND_DEV_DSP, "dsp_multich", ".", "dsp" }, - { SND_DEV_DSP, "dsp_spdifout", ".", "dsp" }, - { SND_DEV_DSP, "dsp_spdifin", ".", "dsp" }, + { SND_DEV_DSP, "dsp_ac3", ".", "dsp" }, + { SND_DEV_DSP, "dsp_mmap", ".", "dsp" }, + { SND_DEV_DSP, "dsp_multich", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifout", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifin", ".", "dsp" }, }; static void