From nobody Mon May 5 17:18:18 2025 X-Original-To: dev-commits-src-main@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 4ZrpBz18G2z5vmjJ; Mon, 05 May 2025 17:18:19 +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 4ZrpBz0ZBQz45kM; Mon, 05 May 2025 17:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746465499; 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=ABp9eku+QRAPFJ/6K1F6TamepgB2mqNw3q6FFOMh6vI=; b=KaXss4Nj4JVYdBZenByTDIom2i3lMSWMnDQg+zwsrs2eiuTdFlNXgZyMSNAvdJ9ZXeZcnY hopCseFkGgolVOWFYLAasyInQPDPCLrjGb37A74wrnM20HaN8936rfA4/gxTB0VU01uVhD css8uFuN+bGJrwsTYvOIshXZGGrYOxVDQZ72i2sWS7vkYRc8yg+/LJNqi0OWFiPkHrLF9n 6FDub/vHEUGQt/KTRVCjwDPZKbEjVIdz7oMgZsil1IpsaM6wJKTZ9Hfn5i40Uu7gGn9cG8 1r4eNz7W1vflK8rI1a7zflFOOCbuKvxRZ/DH2arCmpwoATmymmyPSOHXl8+blw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1746465499; 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=ABp9eku+QRAPFJ/6K1F6TamepgB2mqNw3q6FFOMh6vI=; b=dcRYeK29YUPX1Z6gvZuwntmvalqrLCpJj3sO403ICAUYCYDfv7KMxJnd8LT4LHKzCbIFVM AMjoTCKbQUP1g2dW/Licqq0jEAlmcgshQtmSV7gPbTXCU5AHSxcCUSorhvRB8pBRM9TLoz 0GGfN0CmVn+x1YJLiidi5/Cu+DTlRHMT4M67Oyzk9R9AgRgMy+NBjLCu+/rI3R8tbnK3PZ neP8gL/2i+pFHLNCTwcpAspXH3uFbAtD8aqZBesnqqSgigABYOiOTzFYncFm2P6+fwu+Lq FAPAOuR8Jbsfz4HbPt7spWCThdUF6HB2uuK8tFy/TdImQ6k7lxVyUKdT4HicXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1746465499; a=rsa-sha256; cv=none; b=JsITWznm5F4dN0YOoA0iaOoCVu5MJ/WYI54hr3Zwy42JH6xKUetOyTfDkMaN2XGsmhEd8X snEsSn9krcGS1CF0wS0z3rtdRCtZHil9+VSTi8JFtfStZqDV1Gi5XyMkDFWwuDgMigK14z 3/SHXWRSUJ9+x8SZl3w11cH/pV27gWOH47xRDlFQ+iH2GT++AWpNQZ18egfejAlZizgJbZ JwVHGyhy9MNv4B9Ay00KRya/3muIiyU2IAP1UJPoanvVZnM/UbZbx/f+b88skZeZ4LiP3c 7WaNQQ/Jj4FjmpwZJ9YpZqnUzXzfd71YRBVPR+z3tAwITXGAP84XOoPGJnG6Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4ZrpBz08kvz6vS; Mon, 05 May 2025 17:18:19 +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 545HIIoJ085104; Mon, 5 May 2025 17:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 545HIIO3085101; Mon, 5 May 2025 17:18:18 GMT (envelope-from git) Date: Mon, 5 May 2025 17:18:18 GMT Message-Id: <202505051718.545HIIO3085101@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: 9a37f1024ceb - main - Rename audio(8) to sndctl(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9a37f1024cebfb89dcfa15c23bb287a5d09a9ae7 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9a37f1024cebfb89dcfa15c23bb287a5d09a9ae7 commit 9a37f1024cebfb89dcfa15c23bb287a5d09a9ae7 Author: Christos Margiolis AuthorDate: 2025-05-05 17:18:08 +0000 Commit: Christos Margiolis CommitDate: 2025-05-05 17:18:08 +0000 Rename audio(8) to sndctl(8) Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50167 --- usr.sbin/Makefile | 2 +- usr.sbin/{audio => sndctl}/Makefile | 2 +- usr.sbin/{audio/audio.8 => sndctl/sndctl.8} | 14 ++--- usr.sbin/{audio/audio.c => sndctl/sndctl.c} | 94 ++++++++++++++--------------- 4 files changed, 56 insertions(+), 56 deletions(-) diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index a891e290bafe..4b3223df9f1d 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -2,7 +2,6 @@ SUBDIR= adduser \ arp \ - audio \ binmiscctl \ boottrace \ bsdconfig \ @@ -84,6 +83,7 @@ SUBDIR= adduser \ setpmac \ smbmsg \ snapinfo \ + sndctl \ spi \ spray \ syslogd \ diff --git a/usr.sbin/audio/Makefile b/usr.sbin/sndctl/Makefile similarity index 88% rename from usr.sbin/audio/Makefile rename to usr.sbin/sndctl/Makefile index 6a5d45f4b898..c1830413f931 100644 --- a/usr.sbin/audio/Makefile +++ b/usr.sbin/sndctl/Makefile @@ -1,6 +1,6 @@ .include -PROG= audio +PROG= sndctl SRCS= ${PROG}.c MAN= ${PROG}.8 LDFLAGS+= -lnv -lmixer diff --git a/usr.sbin/audio/audio.8 b/usr.sbin/sndctl/sndctl.8 similarity index 97% rename from usr.sbin/audio/audio.8 rename to usr.sbin/sndctl/sndctl.8 index 82bc170cef82..4c3810f3c16b 100644 --- a/usr.sbin/audio/audio.8 +++ b/usr.sbin/sndctl/sndctl.8 @@ -28,10 +28,10 @@ .\" SUCH DAMAGE. .\" .Dd May 5, 2025 -.Dt AUDIO 8 +.Dt SNDCTL 8 .Os .Sh NAME -.Nm audio +.Nm sndctl .Nd list and modify soundcard properties .Sh SYNOPSIS .Nm @@ -149,28 +149,28 @@ The audio device file, where X is the unit of the device, for example Disable auto-conversions and enable realtime mode to get as low latencies as possible: .Bd -literal -offset indent -$ audio autoconv=0 realtime=1 +$ sndctl autoconv=0 realtime=1 .Ed .Pp Set the playback sample format to 2-channel signed 24-bit low endian, and sample rate to 48000 Hz: .Bd -literal -offset indent -$ audio play.format=s24le:2.0 play.rate=48000 +$ sndctl play.format=s24le:2.0 play.rate=48000 .Ed .Pp List the PIDs and process names of all channels for .Pa /dev/dsp1 : .Bd -literal -offset indent -$ audio -f /dev/dsp1 pid proc +$ sndctl -f /dev/dsp1 pid proc .Ed .Pp Dump .Pa /dev/dsp0 information to a file and retrieve back later: .Bd -literal -offset indent -$ audio -f /dev/dsp0 -o > info +$ sndctl -f /dev/dsp0 -o > info \&... -$ audio -f /dev/dsp0 `cat info` +$ sndctl -f /dev/dsp0 `cat info` .Ed .Sh SEE ALSO .Xr sndstat 4 , diff --git a/usr.sbin/audio/audio.c b/usr.sbin/sndctl/sndctl.c similarity index 92% rename from usr.sbin/audio/audio.c rename to usr.sbin/sndctl/sndctl.c index f7c4aa5a7f04..f362ce840cf7 100644 --- a/usr.sbin/audio/audio.c +++ b/usr.sbin/sndctl/sndctl.c @@ -50,7 +50,7 @@ #define STATUS_LEN 64 #define FMTSTR_LEN 16 -struct audio_chan { +struct snd_chan { char name[NAME_MAX]; char parentchan[NAME_MAX]; int unit; @@ -78,11 +78,11 @@ struct audio_chan { int ready; } hwbuf, swbuf; char feederchain[BUFSIZ]; - struct audio_dev *dev; - TAILQ_ENTRY(audio_chan) next; + struct snd_dev *dev; + TAILQ_ENTRY(snd_chan) next; }; -struct audio_dev { +struct snd_dev { char name[NAME_MAX]; char desc[NAME_MAX]; char status[BUFSIZ]; @@ -104,10 +104,10 @@ struct audio_dev { int max_chans; char formats[BUFSIZ]; } play, rec; - TAILQ_HEAD(, audio_chan) chans; + TAILQ_HEAD(, snd_chan) chans; }; -struct audio_ctl { +struct snd_ctl { const char *name; size_t off; #define STR 0 @@ -115,7 +115,7 @@ struct audio_ctl { #define VOL 2 #define GRP 3 int type; - int (*mod)(struct audio_dev *, void *); + int (*mod)(struct snd_dev *, void *); }; struct map { @@ -123,18 +123,18 @@ struct map { const char *str; }; -static int mod_bitperfect(struct audio_dev *, void *); -static int mod_autoconv(struct audio_dev *, void *); -static int mod_realtime(struct audio_dev *, void *); -static int mod_play_vchans(struct audio_dev *, void *); -static int mod_play_rate(struct audio_dev *, void *); -static int mod_play_format(struct audio_dev *, void *); -static int mod_rec_vchans(struct audio_dev *, void *); -static int mod_rec_rate(struct audio_dev *, void *); -static int mod_rec_format(struct audio_dev *, void *); - -static struct audio_ctl dev_ctls[] = { -#define F(member) offsetof(struct audio_dev, member) +static int mod_bitperfect(struct snd_dev *, void *); +static int mod_autoconv(struct snd_dev *, void *); +static int mod_realtime(struct snd_dev *, void *); +static int mod_play_vchans(struct snd_dev *, void *); +static int mod_play_rate(struct snd_dev *, void *); +static int mod_play_format(struct snd_dev *, void *); +static int mod_rec_vchans(struct snd_dev *, void *); +static int mod_rec_rate(struct snd_dev *, void *); +static int mod_rec_format(struct snd_dev *, void *); + +static struct snd_ctl dev_ctls[] = { +#define F(member) offsetof(struct snd_dev, member) { "name", F(name), STR, NULL }, { "desc", F(desc), STR, NULL }, { "status", F(status), STR, NULL }, @@ -169,8 +169,8 @@ static struct audio_ctl dev_ctls[] = { #undef F }; -static struct audio_ctl chan_ctls[] = { -#define F(member) offsetof(struct audio_chan, member) +static struct snd_ctl chan_ctls[] = { +#define F(member) offsetof(struct snd_chan, member) /*{ "name", F(name), STR, NULL },*/ { "parentchan", F(parentchan), STR, NULL }, { "unit", F(unit), NUM, NULL }, @@ -333,15 +333,15 @@ bytes2frames(int bytes, int fmt) return (bytes / (samplesz * ch)); } -static struct audio_dev * +static struct snd_dev * read_dev(char *path) { nvlist_t *nvl; const nvlist_t * const *di; const nvlist_t * const *cdi; struct sndstioc_nv_arg arg; - struct audio_dev *dp = NULL; - struct audio_chan *ch; + struct snd_dev *dp = NULL; + struct snd_chan *ch; size_t nitems, nchans, i, j; int fd, caps, unit; @@ -389,7 +389,7 @@ read_dev(char *path) #define NV(type, item) \ nvlist_get_ ## type (di[i], SNDST_DSPS_ ## item) - if ((dp = calloc(1, sizeof(struct audio_dev))) == NULL) + if ((dp = calloc(1, sizeof(struct snd_dev))) == NULL) err(1, "calloc"); dp->unit = -1; @@ -469,7 +469,7 @@ read_dev(char *path) for (j = 0; j < nchans; j++) { #define NV(type, item) \ nvlist_get_ ## type (cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item) - if ((ch = calloc(1, sizeof(struct audio_chan))) == NULL) + if ((ch = calloc(1, sizeof(struct snd_chan))) == NULL) err(1, "calloc"); strlcpy(ch->name, NV(string, NAME), sizeof(ch->name)); @@ -538,9 +538,9 @@ done: } static void -free_dev(struct audio_dev *dp) +free_dev(struct snd_dev *dp) { - struct audio_chan *ch; + struct snd_chan *ch; while (!TAILQ_EMPTY(&dp->chans)) { ch = TAILQ_FIRST(&dp->chans); @@ -551,10 +551,10 @@ free_dev(struct audio_dev *dp) } static void -print_dev_ctl(struct audio_dev *dp, struct audio_ctl *ctl, bool simple, +print_dev_ctl(struct snd_dev *dp, struct snd_ctl *ctl, bool simple, bool showgrp) { - struct audio_ctl *cp; + struct snd_ctl *cp; size_t len; if (ctl->type != GRP) { @@ -587,10 +587,10 @@ print_dev_ctl(struct audio_dev *dp, struct audio_ctl *ctl, bool simple, } static void -print_chan_ctl(struct audio_chan *ch, struct audio_ctl *ctl, bool simple, +print_chan_ctl(struct snd_chan *ch, struct snd_ctl *ctl, bool simple, bool showgrp) { - struct audio_ctl *cp; + struct snd_ctl *cp; size_t len; int v; @@ -627,10 +627,10 @@ print_chan_ctl(struct audio_chan *ch, struct audio_ctl *ctl, bool simple, } static void -print_dev(struct audio_dev *dp) +print_dev(struct snd_dev *dp) { - struct audio_chan *ch; - struct audio_ctl *ctl; + struct snd_chan *ch; + struct snd_ctl *ctl; if (!oflag) { printf("%s: <%s> %s", dp->name, dp->desc, dp->status); @@ -739,7 +739,7 @@ sysctl_str(const char *buf, const char *arg, char *var, size_t varsz) } static int -mod_bitperfect(struct audio_dev *dp, void *arg) +mod_bitperfect(struct snd_dev *dp, void *arg) { char buf[64]; @@ -752,7 +752,7 @@ mod_bitperfect(struct audio_dev *dp, void *arg) } static int -mod_autoconv(struct audio_dev *dp, void *arg) +mod_autoconv(struct snd_dev *dp, void *arg) { const char *val = arg; const char *zero = "0"; @@ -780,7 +780,7 @@ mod_autoconv(struct audio_dev *dp, void *arg) } static int -mod_realtime(struct audio_dev *dp, void *arg) +mod_realtime(struct snd_dev *dp, void *arg) { const char *val = arg; int rc = -1; @@ -807,7 +807,7 @@ mod_realtime(struct audio_dev *dp, void *arg) } static int -mod_play_vchans(struct audio_dev *dp, void *arg) +mod_play_vchans(struct snd_dev *dp, void *arg) { char buf[64]; @@ -820,7 +820,7 @@ mod_play_vchans(struct audio_dev *dp, void *arg) } static int -mod_play_rate(struct audio_dev *dp, void *arg) +mod_play_rate(struct snd_dev *dp, void *arg) { char buf[64]; @@ -835,7 +835,7 @@ mod_play_rate(struct audio_dev *dp, void *arg) } static int -mod_play_format(struct audio_dev *dp, void *arg) +mod_play_format(struct snd_dev *dp, void *arg) { char buf[64]; @@ -850,7 +850,7 @@ mod_play_format(struct audio_dev *dp, void *arg) } static int -mod_rec_vchans(struct audio_dev *dp, void *arg) +mod_rec_vchans(struct snd_dev *dp, void *arg) { char buf[64]; @@ -863,7 +863,7 @@ mod_rec_vchans(struct audio_dev *dp, void *arg) } static int -mod_rec_rate(struct audio_dev *dp, void *arg) +mod_rec_rate(struct snd_dev *dp, void *arg) { char buf[64]; @@ -878,7 +878,7 @@ mod_rec_rate(struct audio_dev *dp, void *arg) } static int -mod_rec_format(struct audio_dev *dp, void *arg) +mod_rec_format(struct snd_dev *dp, void *arg) { char buf[64]; @@ -903,9 +903,9 @@ usage(void) int main(int argc, char *argv[]) { - struct audio_dev *dp; - struct audio_chan *ch; - struct audio_ctl *ctl; + struct snd_dev *dp; + struct snd_chan *ch; + struct snd_ctl *ctl; char *path = NULL; char *s, *propstr; bool show = true, found;