aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2026-06-20 17:32:21 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-06-20 17:32:21 +0000
commitf70a687bb071cdee60dc7420d75fa1dd122af51a (patch)
treeb1811a01e4a12ca8966e83fbf0dd4e01dea92816
parentf879eb3febb6c294d684e8e7fecd5cc396ec5a28 (diff)
sound: Retire SD_F_VPC and related settings
VPC is enabled by default, and the only way to turn it off is through a loader hint. That being said, there is no benefit to turning it off in the first place, because VPC provides more fine-grained volume control, as well as access to the SNDCTL_DSP_[SET|GET][REC|PLAY]VOL ioctls and dsp_ioctl_channel(). Sponsored by: The FreeBSD Foundation MFC after: 1 week
-rw-r--r--share/man/man4/pcm.422
-rw-r--r--sys/dev/sound/pcm/dsp.c2
-rw-r--r--sys/dev/sound/pcm/feeder_chain.c4
-rw-r--r--sys/dev/sound/pcm/sound.c4
-rw-r--r--sys/dev/sound/pcm/sound.h4
5 files changed, 6 insertions, 30 deletions
diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4
index cda27d734b74..fe5af8301cfe 100644
--- a/share/man/man4/pcm.4
+++ b/share/man/man4/pcm.4
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd June 17, 2026
+.Dd June 20, 2026
.Dt SOUND 4
.Os
.Sh NAME
@@ -212,26 +212,6 @@ application, without touching the master
.Nm
volume.
This is sometimes referred to as Volume Per Channel (VPC).
-The VPC feature is enabled by default.
-.Ss Loader Tunables
-The following loader tunables are used to set driver configuration at the
-.Xr loader 8
-prompt before booting the kernel, or they can be stored in
-.Pa /boot/loader.conf
-in order to automatically set them before booting the kernel.
-It is also possible to use
-.Xr kenv 1
-to change these tunables before loading the
-.Nm
-driver.
-The following tunables can not be changed during runtime using
-.Xr sysctl 8 .
-.Bl -tag -width indent
-.It Va hint.pcm.%d.vpc
-Set to 1 or 0 to explicitly enable (1) or disable (0) the VPC feature.
-This tunable is undefined by default.
-VPC is however enabled by default.
-.El
.Ss Runtime Configuration
There are a number of
.Xr sysctl 8
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 7f05da62a173..df9e241881c0 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -542,7 +542,7 @@ dsp_ioctl_channel(struct dsp_cdevpriv *priv, struct pcm_channel *ch,
int j, left, right, center, mute;
d = priv->sc;
- if (!PCM_REGISTERED(d) || !(pcm_getflags(d->dev) & SD_F_VPC))
+ if (!PCM_REGISTERED(d))
return (-1);
PCM_UNLOCKASSERT(d);
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
index 35bb12a062ec..1dbdf2fcc0e4 100644
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -714,8 +714,8 @@ feeder_chain(struct pcm_channel *c)
cdesc.dummy = 1;
if ((softfmt & AFMT_CONVERTIBLE) &&
- (((d->flags & SD_F_VPC) && !(c->flags & CHN_F_HAS_VCHAN)) ||
- (!(d->flags & SD_F_VPC) && (d->flags & SD_F_SOFTPCMVOL) &&
+ (!(c->flags & CHN_F_HAS_VCHAN) ||
+ ((d->flags & SD_F_SOFTPCMVOL) &&
!(c->flags & CHN_F_VIRTUAL))))
cdesc.use_volume = 1;
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index 235142eb5209..101b38367873 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -356,10 +356,6 @@ pcm_init(device_t dev, void *devinfo)
i = 0;
if (resource_int_value(device_get_name(dev), device_get_unit(dev),
- "vpc", &i) != 0 || i != 0)
- d->flags |= SD_F_VPC;
-
- if (resource_int_value(device_get_name(dev), device_get_unit(dev),
"bitperfect", &i) == 0 && i != 0)
d->flags |= SD_F_BITPERFECT;
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
index 4d527d69086a..60beee69d1a5 100644
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -104,7 +104,7 @@ struct snd_mixer;
#define SD_F_MPSAFE 0x00000010
#define SD_F_REGISTERED 0x00000020
#define SD_F_BITPERFECT 0x00000040
-#define SD_F_VPC 0x00000080 /* volume-per-channel */
+/* unused 0x00000080 */
/* unused 0x00000100 */
#define SD_F_EQ_ENABLED 0x00000200 /* EQ enabled */
/* unused 0x00000400 */
@@ -120,7 +120,7 @@ struct snd_mixer;
"\005MPSAFE" \
"\006REGISTERED" \
"\007BITPERFECT" \
- "\010VPC" \
+ /* "\010 */ \
/* "\011 */ \
"\012EQ_ENABLED" \
/* "\013 */ \