Make all PCM core sysctls tunable and remove redundant TUNABLE()

statements. This allows for setting all PCM core parameters in the
kernel environment through loader.conf(5) or kenv(1) which is useful
for pluggable PCM devices like USB audio devices which might be
plugged after that sysctl.conf(5) is executed.
This commit is contained in:
hselasky 2015-03-24 16:31:22 +00:00
parent 3cad1a07e8
commit dddd3326a1
8 changed files with 87 additions and 94 deletions

View File

@ -42,14 +42,13 @@ SND_DECLARE_FILE("$FreeBSD$");
int report_soft_formats = 1;
SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW,
&report_soft_formats, 1, "report software-emulated formats");
&report_soft_formats, 0, "report software-emulated formats");
int report_soft_matrix = 1;
SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_matrix, CTLFLAG_RW,
&report_soft_matrix, 1, "report software-emulated channel matrixing");
&report_soft_matrix, 0, "report software-emulated channel matrixing");
int chn_latency = CHN_LATENCY_DEFAULT;
TUNABLE_INT("hw.snd.latency", &chn_latency);
static int
sysctl_hw_snd_latency(SYSCTL_HANDLER_ARGS)
@ -67,12 +66,11 @@ sysctl_hw_snd_latency(SYSCTL_HANDLER_ARGS)
return err;
}
SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, latency, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_latency, "I",
"buffering latency (0=low ... 10=high)");
int chn_latency_profile = CHN_LATENCY_PROFILE_DEFAULT;
TUNABLE_INT("hw.snd.latency_profile", &chn_latency_profile);
static int
sysctl_hw_snd_latency_profile(SYSCTL_HANDLER_ARGS)
@ -90,13 +88,12 @@ sysctl_hw_snd_latency_profile(SYSCTL_HANDLER_ARGS)
return err;
}
SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, latency_profile, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_latency_profile, "I",
"buffering latency profile (0=aggressive 1=safe)");
static int chn_timeout = CHN_TIMEOUT;
TUNABLE_INT("hw.snd.timeout", &chn_timeout);
#ifdef SND_DEBUG
static int
sysctl_hw_snd_timeout(SYSCTL_HANDLER_ARGS)
{
@ -113,17 +110,15 @@ sysctl_hw_snd_timeout(SYSCTL_HANDLER_ARGS)
return err;
}
SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, timeout, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_timeout, "I",
"interrupt timeout (1 - 10) seconds");
#endif
static int chn_vpc_autoreset = 1;
SYSCTL_INT(_hw_snd, OID_AUTO, vpc_autoreset, CTLFLAG_RWTUN,
&chn_vpc_autoreset, 0, "automatically reset channels volume to 0db");
static int chn_vol_0db_pcm = SND_VOL_0DB_PCM;
TUNABLE_INT("hw.snd.vpc_0db", &chn_vol_0db_pcm);
static void
chn_vpc_proc(int reset, int db)
@ -169,7 +164,7 @@ sysctl_hw_snd_vpc_0db(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_0db, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_vpc_0db, "I",
"0db relative level");
@ -193,16 +188,13 @@ SYSCTL_PROC(_hw_snd, OID_AUTO, vpc_reset, CTLTYPE_INT | CTLFLAG_RW,
"reset volume on all channels");
static int chn_usefrags = 0;
TUNABLE_INT("hw.snd.usefrags", &chn_usefrags);
static int chn_syncdelay = -1;
TUNABLE_INT("hw.snd.syncdelay", &chn_syncdelay);
#ifdef SND_DEBUG
SYSCTL_INT(_hw_snd, OID_AUTO, usefrags, CTLFLAG_RW,
&chn_usefrags, 1, "prefer setfragments() over setblocksize()");
SYSCTL_INT(_hw_snd, OID_AUTO, syncdelay, CTLFLAG_RW,
&chn_syncdelay, 1,
SYSCTL_INT(_hw_snd, OID_AUTO, usefrags, CTLFLAG_RWTUN,
&chn_usefrags, 0, "prefer setfragments() over setblocksize()");
SYSCTL_INT(_hw_snd, OID_AUTO, syncdelay, CTLFLAG_RWTUN,
&chn_syncdelay, 0,
"append (0-1000) millisecond trailing buffer delay on each sync");
#endif
/**
* @brief Channel sync group lock

View File

@ -44,7 +44,7 @@
SND_DECLARE_FILE("$FreeBSD$");
static int dsp_mmap_allow_prot_exec = 0;
SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RW,
SYSCTL_INT(_hw_snd, OID_AUTO, compat_linux_mmap, CTLFLAG_RWTUN,
&dsp_mmap_allow_prot_exec, 0,
"linux mmap compatibility (-1=force disable 0=auto 1=force enable)");

View File

@ -682,12 +682,10 @@ feeder_eq_initsys(device_t dev)
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"eq", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d),
"eq", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_eq, "I",
"Bass/Treble Equalizer (0=disable, 1=enable, 2=bypass)");
bzero(buf, sizeof(buf));
(void)snprintf(buf, sizeof(buf), "Bass/Treble Equalizer Preamp "
"(-/+ %d.0dB , %d.%ddB step)",
FEEDEQ_GAIN_MAX, FEEDEQ_GAIN_STEP / FEEDEQ_GAIN_DIV,
@ -696,7 +694,7 @@ feeder_eq_initsys(device_t dev)
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"eq_preamp", CTLTYPE_STRING | CTLFLAG_RW, d, sizeof(d),
"eq_preamp", CTLTYPE_STRING | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_eq_preamp, "A", buf);
}
#endif

View File

@ -162,12 +162,6 @@ static int feeder_rate_polyphase_max = Z_POLYPHASE_MAX;
static char feeder_rate_presets[] = FEEDER_RATE_PRESETS;
SYSCTL_STRING(_hw_snd, OID_AUTO, feeder_rate_presets, CTLFLAG_RD,
&feeder_rate_presets, 0, "compile-time rate presets");
TUNABLE_INT("hw.snd.feeder_rate_min", &feeder_rate_min);
TUNABLE_INT("hw.snd.feeder_rate_max", &feeder_rate_max);
TUNABLE_INT("hw.snd.feeder_rate_round", &feeder_rate_round);
TUNABLE_INT("hw.snd.feeder_rate_quality", &feeder_rate_quality);
SYSCTL_INT(_hw_snd, OID_AUTO, feeder_rate_polyphase_max, CTLFLAG_RWTUN,
&feeder_rate_polyphase_max, 0, "maximum allowable polyphase entries");
@ -189,7 +183,7 @@ sysctl_hw_snd_feeder_rate_min(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_min, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_feeder_rate_min, "I",
"minimum allowable rate");
@ -211,7 +205,7 @@ sysctl_hw_snd_feeder_rate_max(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_max, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_feeder_rate_max, "I",
"maximum allowable rate");
@ -233,7 +227,7 @@ sysctl_hw_snd_feeder_rate_round(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_round, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_feeder_rate_round, "I",
"sample rate converter rounding threshold");
@ -285,7 +279,7 @@ sysctl_hw_snd_feeder_rate_quality(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, feeder_rate_quality, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_feeder_rate_quality, "I",
"sample rate converter quality ("__XSTRING(Z_QUALITY_MIN)"=low .. "
__XSTRING(Z_QUALITY_MAX)"=high)");

View File

@ -883,10 +883,10 @@ mixer_hwvol_init(device_t dev)
m->hwvol_step = 5;
SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "hwvol_step", CTLFLAG_RW, &m->hwvol_step, 0, "");
OID_AUTO, "hwvol_step", CTLFLAG_RWTUN, &m->hwvol_step, 0, "");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RW, m, 0,
OID_AUTO, "hwvol_mixer", CTLTYPE_STRING | CTLFLAG_RWTUN, m, 0,
sysctl_hw_snd_hwvol_mixer, "A", "");
return 0;
}

View File

@ -83,7 +83,6 @@ static int sndstat_files = 0;
static SLIST_HEAD(, sndstat_entry) sndstat_devlist = SLIST_HEAD_INITIALIZER(sndstat_devlist);
int snd_verbose = 0;
TUNABLE_INT("hw.snd.verbose", &snd_verbose);
#ifdef SND_DEBUG
static int
@ -104,7 +103,7 @@ sysctl_hw_snd_sndstat_pid(SYSCTL_HANDLER_ARGS)
sx_unlock(&sndstat_lock);
return (err);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, sndstat_pid, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_sndstat_pid, "I", "sndstat busy pid");
#endif
@ -125,7 +124,7 @@ sysctl_hw_sndverbose(SYSCTL_HANDLER_ARGS)
}
return error;
}
SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, verbose, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_sndverbose, "I", "verbosity level");
static int

View File

@ -49,20 +49,17 @@ devclass_t pcm_devclass;
int pcm_veto_load = 1;
int snd_unit = -1;
TUNABLE_INT("hw.snd.default_unit", &snd_unit);
static int snd_unit_auto = -1;
SYSCTL_INT(_hw_snd, OID_AUTO, default_auto, CTLFLAG_RWTUN,
&snd_unit_auto, 0, "assign default unit to a newly attached device");
int snd_maxautovchans = 16;
/* XXX: a tunable implies that we may need more than one sound channel before
the system can change a sysctl (/etc/sysctl.conf), do we really need
this? */
TUNABLE_INT("hw.snd.maxautovchans", &snd_maxautovchans);
SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver");
static void pcm_sysinit(device_t);
/*
* XXX I've had enough with people not telling proper version/arch
* while reporting problems, not after 387397913213th questions/requests.
@ -444,7 +441,7 @@ sysctl_hw_snd_default_unit(SYSCTL_HANDLER_ARGS)
}
/* XXX: do we need a way to let the user change the default unit? */
SYSCTL_PROC(_hw_snd, OID_AUTO, default_unit,
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_ANYBODY,
0, sizeof(int), sysctl_hw_snd_default_unit, "I",
"default sound device");
@ -474,7 +471,7 @@ sysctl_hw_snd_maxautovchans(SYSCTL_HANDLER_ARGS)
}
return (error);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, maxautovchans, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_maxautovchans, "I", "maximum virtual channel");
struct pcm_channel *
@ -766,16 +763,17 @@ pcm_setstatus(device_t dev, char *str)
{
struct snddev_info *d = device_get_softc(dev);
/* should only be called once */
if (d->flags & SD_F_REGISTERED)
return (EINVAL);
PCM_BUSYASSERT(d);
if (d->playcount == 0 || d->reccount == 0)
d->flags |= SD_F_SIMPLEX;
if ((d->playcount > 0 || d->reccount > 0) &&
!(d->flags & SD_F_AUTOVCHAN)) {
if (d->playcount > 0 || d->reccount > 0)
d->flags |= SD_F_AUTOVCHAN;
vchan_initsys(dev);
}
pcm_setmaxautovchans(d, snd_maxautovchans);
@ -794,6 +792,12 @@ pcm_setstatus(device_t dev, char *str)
PCM_UNLOCK(d);
/*
* Create all sysctls once SD_F_REGISTERED is set else
* tunable sysctls won't work:
*/
pcm_sysinit(dev);
if (snd_unit_auto < 0)
snd_unit_auto = (snd_unit < 0) ? 1 : 0;
if (snd_unit < 0 || snd_unit_auto > 1)
@ -1001,11 +1005,49 @@ sysctl_hw_snd_clone_gc(SYSCTL_HANDLER_ARGS)
return (err);
}
SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, CTLTYPE_INT | CTLFLAG_RW,
SYSCTL_PROC(_hw_snd, OID_AUTO, clone_gc, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), sysctl_hw_snd_clone_gc, "I",
"global clone garbage collector");
#endif
static void
pcm_sysinit(device_t dev)
{
struct snddev_info *d = device_get_softc(dev);
/* XXX: an user should be able to set this with a control tool, the
sysadmin then needs min+max sysctls for this */
SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_bitperfect, "I",
"bit-perfect playback/recording (0=disable, 1=enable)");
#ifdef SND_DEBUG
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_flags", CTLTYPE_UINT | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_clone_flags, "IU",
"clone flags");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_deadline", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_clone_deadline, "I",
"clone expiration deadline (ms)");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_gc", CTLTYPE_INT | CTLFLAG_RWTUN, d, sizeof(d),
sysctl_dev_pcm_clone_gc, "I",
"clone garbage collector");
#endif
if (d->flags & SD_F_AUTOVCHAN)
vchan_initsys(dev);
if (d->flags & SD_F_EQ)
feeder_eq_initsys(dev);
}
int
pcm_register(device_t dev, void *devinfo, int numplay, int numrec)
{
@ -1087,41 +1129,9 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec)
d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx,
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec",
CTLFLAG_RD, 0, "record channels node");
/* XXX: an user should be able to set this with a control tool, the
sysadmin then needs min+max sysctls for this */
SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"bitperfect", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d),
sysctl_dev_pcm_bitperfect, "I",
"bit-perfect playback/recording (0=disable, 1=enable)");
#ifdef SND_DEBUG
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_flags", CTLTYPE_UINT | CTLFLAG_RW, d, sizeof(d),
sysctl_dev_pcm_clone_flags, "IU",
"clone flags");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_deadline", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d),
sysctl_dev_pcm_clone_deadline, "I",
"clone expiration deadline (ms)");
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
"clone_gc", CTLTYPE_INT | CTLFLAG_RW, d, sizeof(d),
sysctl_dev_pcm_clone_gc, "I",
"clone garbage collector");
#endif
if (numplay > 0 || numrec > 0) {
if (numplay > 0 || numrec > 0)
d->flags |= SD_F_AUTOVCHAN;
vchan_initsys(dev);
}
if (d->flags & SD_F_EQ)
feeder_eq_initsys(dev);
sndstat_register(dev, d->status, sndstat_prepare_pcm);

View File

@ -45,7 +45,7 @@ SND_DECLARE_FILE("$FreeBSD$");
#ifdef SND_DEBUG
static int snd_passthrough_verbose = 0;
SYSCTL_INT(_hw_snd, OID_AUTO, passthrough_verbose, CTLFLAG_RW,
SYSCTL_INT(_hw_snd, OID_AUTO, passthrough_verbose, CTLFLAG_RWTUN,
&snd_passthrough_verbose, 0, "passthrough verbosity");
#endif
@ -946,45 +946,45 @@ vchan_initsys(device_t dev)
/* Play */
SYSCTL_ADD_PROC(&d->play_sysctl_ctx,
SYSCTL_CHILDREN(d->play_sysctl_tree),
OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RW,
OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchans, "I", "total allocated virtual channel");
SYSCTL_ADD_PROC(&d->play_sysctl_ctx,
SYSCTL_CHILDREN(d->play_sysctl_tree),
OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RW,
OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanmode, "A",
"vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive");
SYSCTL_ADD_PROC(&d->play_sysctl_ctx,
SYSCTL_CHILDREN(d->play_sysctl_tree),
OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RW,
OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate");
SYSCTL_ADD_PROC(&d->play_sysctl_ctx,
SYSCTL_CHILDREN(d->play_sysctl_tree),
OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RW,
OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, PLAY), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format");
/* Rec */
SYSCTL_ADD_PROC(&d->rec_sysctl_ctx,
SYSCTL_CHILDREN(d->rec_sysctl_tree),
OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RW,
OID_AUTO, "vchans", CTLTYPE_INT | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchans, "I", "total allocated virtual channel");
SYSCTL_ADD_PROC(&d->rec_sysctl_ctx,
SYSCTL_CHILDREN(d->rec_sysctl_tree),
OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RW,
OID_AUTO, "vchanmode", CTLTYPE_STRING | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanmode, "A",
"vchan format/rate selection: 0=fixed, 1=passthrough, 2=adaptive");
SYSCTL_ADD_PROC(&d->rec_sysctl_ctx,
SYSCTL_CHILDREN(d->rec_sysctl_tree),
OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RW,
OID_AUTO, "vchanrate", CTLTYPE_INT | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanrate, "I", "virtual channel mixing speed/rate");
SYSCTL_ADD_PROC(&d->rec_sysctl_ctx,
SYSCTL_CHILDREN(d->rec_sysctl_tree),
OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RW,
OID_AUTO, "vchanformat", CTLTYPE_STRING | CTLFLAG_RWTUN,
VCHAN_SYSCTL_DATA(unit, REC), VCHAN_SYSCTL_DATA_SIZE,
sysctl_dev_pcm_vchanformat, "A", "virtual channel mixing format");
}