From nobody Sat Jul 27 11:56:16 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 4WWNPY1hnRz5S6Kc; Sat, 27 Jul 2024 11:56:17 +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 4WWNPX3yPRz42kf; Sat, 27 Jul 2024 11:56:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081376; 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=WqPpj+LPW9mcgZ29T76iBwxiI7U7qMooFN/aJOX4ovk=; b=uAfH+4Paj+qngaiUtEpB7HTWBTczbk5+EWh7EJTdKU+A6ocfbmeqcE7E9YS9hixfivQRCC C8u7tqlNS1i5ilkKkAKF/+CU6hdTWxidIU7JSJno+cPjduusL1VGroW1gRCojIHAxeFR1Y iGqibjdLbz0gOjGLCVa3URigdT4+Bn9Omtyghs7l+Pxjpj3vVNIPYT2BmdMUwoZlQk2nHV ipBpi4gLPgs0PZBSH+U4viz60BNgamEU3wPDVmolDiyucLF06sm14KqGlB4G/6s1BMC2ik gxFQaNefYNZ96hpr0xtMHkTsmu4UcmIc8k3QpiNY0b6pDtEHjS7UsN3LHFldgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081376; a=rsa-sha256; cv=none; b=LDJ3RaXU/GysNhcwcal94NVuQhfeQrnnxabu+Ac0dcDmz2MqsONsoQkbnD6GYFmfw6TY+Q ahl+T6MC6owoD9ZKPyoJunpn54+o0LIbncmqGOaLVpSepSALcjdewocnaG0wa+gjbbgKgP C6zI10J/t3cGo+RUBNUPcvLP6DOSzw+EMJTe2TQ6RSEx0T2+packgutlVtGBm63g27TyZE xLwKiXP8MSYElFRRy9OdwcoGL8FQt4goxkWkBcar1loyzxRVzGS4mSqQ2+TFdIk+VpP7ZC hMsVKB33AQ1K/x7yjeZiGb/uXFLTKaQ1gRuRTkHffpI/cj6jSwtj/Iv/3SeFcg== 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=1722081376; 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=WqPpj+LPW9mcgZ29T76iBwxiI7U7qMooFN/aJOX4ovk=; b=EoZu+RIZJ3hV9NFN3pyxxjdqwVOcwlQSNBMZPnl/HJeLjSG/qojFy7UZZ7AnxenIWO6kf5 dXBW56hU90wDEzcgcPNJ3eESJjqMqStIiiqLyrnQhaXVnBnEDE79FJX+062/x8M50u5f3P xtqcz/lJhu/gN7bcVRzbi8lYRbjiUN4xNSuTqiZmP2iLbFCByw2AGvABS2zBnjtU6ALWH8 yS3Y67lG/5NxnsQtuBkRwHeYrOgDKpFZi/CA/AU9bVcMP6HLaYqNpv5sPUNkkw0/L+HZ7B 3Wuk3eFoppcflhc3dmHio8ewYpeZujE9EsR1JSVr2A462idFEDL1qjxNaaMk3w== 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 4WWNPX3FBcz15nH; Sat, 27 Jul 2024 11:56:16 +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 46RBuG5b039564; Sat, 27 Jul 2024 11:56:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuGW3039561; Sat, 27 Jul 2024 11:56:16 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:16 GMT Message-Id: <202407271156.46RBuGW3039561@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: bd5bcc848c57 - main - sound: Add OSS channel capabilities to sndstat nvlist 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: bd5bcc848c5764229926ad27a4bd77af4f87d189 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bd5bcc848c5764229926ad27a4bd77af4f87d189 commit bd5bcc848c5764229926ad27a4bd77af4f87d189 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:27 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:27 +0000 sound: Add OSS channel capabilities to sndstat nvlist Assignment taken from dsp_oss_engineinfo(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46166 --- share/man/man4/sndstat.4 | 3 +++ sys/dev/sound/pcm/sndstat.c | 7 ++++++- sys/sys/sndstat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 2f745f418b79..2fc55f0045c1 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -86,6 +86,7 @@ dsps (NVLIST ARRAY): 1 name (STRING): pcm0:virtual_play:dsp0.vp0 parentchan (STRING): pcm0:play:dsp0.p0 unit (NUMBER): 1 + caps (NUMBER): 0x073200 latency (NUMBER): 2 rate (NUMBER): 48000 format (NUMBER): 0x201000 @@ -201,6 +202,8 @@ Channel name. Parent channel name (e.g., in the case of virtual channels). .It Dv unit Channel unit. +.It Dv caps +OSS capabilities. .It Dv latency Latency. .It Dv rate diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index b0d2c5b6ca21..f09fa7139884 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -385,7 +385,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) struct pcm_channel *c; struct pcm_feeder *f; struct sbuf sb; - uint32_t maxrate, minrate, fmts, minchn, maxchn; + uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; @@ -467,10 +467,15 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) CHN_LOCK(c); + caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((c->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | + ((c->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); + nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_NAME, c->name); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_PARENTCHAN, c->parentchannel != NULL ? c->parentchannel->name : ""); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_UNIT, nchan++); + nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_CAPS, caps); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_LATENCY, c->latency); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_RATE, c->speed); diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index f7d0b2f29bd5..6fd2e06ac483 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -82,6 +82,7 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_CHAN_NAME "name" #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" #define SNDST_DSPS_SOUND4_CHAN_UNIT "unit" +#define SNDST_DSPS_SOUND4_CHAN_CAPS "caps" #define SNDST_DSPS_SOUND4_CHAN_LATENCY "latency" #define SNDST_DSPS_SOUND4_CHAN_RATE "rate" #define SNDST_DSPS_SOUND4_CHAN_FORMAT "format"