Page MenuHomeFreeBSD

D46166.diff
No OneTemporary

D46166.diff

diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4
--- a/share/man/man4/sndstat.4
+++ b/share/man/man4/sndstat.4
@@ -86,6 +86,7 @@
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 @@
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
--- a/sys/dev/sound/pcm/sndstat.c
+++ b/sys/dev/sound/pcm/sndstat.c
@@ -385,7 +385,7 @@
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 @@
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
--- a/sys/sys/sndstat.h
+++ b/sys/sys/sndstat.h
@@ -82,6 +82,7 @@
#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"

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 21, 2:42 AM (22 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14736591
Default Alt Text
D46166.diff (2 KB)

Event Timeline