From nobody Fri Oct 18 08:45:03 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 4XVJDc2VWfz5YwPl; Fri, 18 Oct 2024 08:45:04 +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 4XVJDc0TJtz4mcJ; Fri, 18 Oct 2024 08:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241104; 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=67n7IMlo44fsXIc1lplkB8RTP515pwRGTFRzz1tKTzk=; b=Xhmak8HycbYfobFYEb+27L+HBr+mORP7r+FAxCuvlWb8cMNVqZYKlxzfvEN9MWEiq9jwvq ej+eUhuOmWyVvSIqihTq5MWWl28jzPEUfnc1TG0ZrxZZvka0rIOeBzNRY7khO6ezKS2mE/ AY+6EvZ5ThB5fx7uj6MnNxHtxo6a4mijQbWi8/Zcv4xBnc2u5bnwT/x2XxBfH7PKjYDvQm VAuK2o2k20c6QhrqKmi4aL793ppsXKe+WAOpP9btVMftZbyfZmG266C/MTE5vX0qAZmN7C xlbbQHL7cJmckk3jdkspm4BqL0Vm2ipLpvc+k/zPFoayNhiHgp2NLmpoTbi4dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729241104; 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=67n7IMlo44fsXIc1lplkB8RTP515pwRGTFRzz1tKTzk=; b=ssnPvvxZdbMhm6ymbmb3GM3/d/kH4D48Mz2h5UphDsJbkOJVBDtJasNm4ErkC9pdEU6G39 AS722NrhqOWHPoIlNvLelg0SKxS8AAD9fYd6TUmIca0vnfHSQTeWWP8GcamajWONnU9RdO mh2dC1Sp1FfMnnubrnmvGNYAKXjNml9LrNG2Gwihs1Ex/crZr3oQUOyo7PDmnzMHphbpcB f+VJvcgyNU0bxO+2ojSKnincGJBjQtLb8ZTe2gUQnqRPiTqUwH6MfQbFvQPo2L3fBtpkMj eywAK38ATUcP63sb06kLUClMFJtqu1PSuRoYHdx0Dz7Dqyc2k01NPcPzsSdo2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729241104; a=rsa-sha256; cv=none; b=QM1pfrxa2q2f+UkVtJas2vHtC0/6gsbDRYiwZEVSU/jmtghiKeEqkILjpoWIkIU+qHo7zP fjpgSVZ7kJy6zaDSw+/rufD7yNu7L/pyx1KR7jbHXlKd8YsKOxDXndRBdWc8CR9IFqlVMN aj21354lMn+F7FP8TTd3vQnNMYditQjLjMCsny0IDDvYcYvLKpFTFZgmshftE1gae78KQA 8rjAC8ohoJHDRYhAf8hCQFCUHGccAIh6KQcibKytOJaEv70dHjf+FlQY3d/D/OqAFUVHNt cnZHDJZYv/whuvJBqlVIt3wt0Q922fhdXHjIe55ByzdXu6Vp1EbToMO/EAkzGA== 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 4XVJDc04c7zRQt; Fri, 18 Oct 2024 08:45:04 +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 49I8j32o088288; Fri, 18 Oct 2024 08:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49I8j3rQ088285; Fri, 18 Oct 2024 08:45:03 GMT (envelope-from git) Date: Fri, 18 Oct 2024 08:45:03 GMT Message-Id: <202410180845.49I8j3rQ088285@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: c30f531ddb62 - main - sound: Shorten channel names 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: c30f531ddb629ab51359fb540c8ef6068bab288b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c30f531ddb629ab51359fb540c8ef6068bab288b commit c30f531ddb629ab51359fb540c8ef6068bab288b Author: Christos Margiolis AuthorDate: 2024-10-18 08:40:50 +0000 Commit: Christos Margiolis CommitDate: 2024-10-18 08:40:50 +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 --- 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