git: 91a6647a7d48 - stable/15 - sound: Expose EQ by default
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Jun 2026 08:23:12 UTC
The branch stable/15 has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=91a6647a7d48fd8a3a13d3307ec78446481421c3
commit 91a6647a7d48fd8a3a13d3307ec78446481421c3
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-04-16 14:26:25 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-06-03 08:22:22 +0000
sound: Expose EQ by default
The dev.pcm.%d.eq* sysctls and mixer "bass" and "treble" controls are
exposed only if hint.pcm.%d.eq is set. However, there is no good reason
why we shouldn't at least expose the controls, and let the user
enable/disable/bypass equalization through the sysctl.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
(cherry picked from commit a0011c74f8f026e04803b9815198a56f50c247e6)
---
share/man/man4/pcm.4 | 9 ---------
sys/dev/sound/pcm/feeder_chain.c | 2 +-
sys/dev/sound/pcm/mixer.c | 17 +++--------------
sys/dev/sound/pcm/sound.c | 3 +--
sys/dev/sound/pcm/sound.h | 8 ++------
5 files changed, 7 insertions(+), 32 deletions(-)
diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4
index 8a92cefa3549..1efebffcc424 100644
--- a/share/man/man4/pcm.4
+++ b/share/man/man4/pcm.4
@@ -197,9 +197,6 @@ The Parametric Software Equalizer (EQ) enables the use of
controls (bass and treble).
Commonly used for ear-candy or frequency compensation due to the vast
difference in hardware quality.
-EQ is disabled by default, but can be enabled with the
-.Va hint.pcm.%d.eq
-tunable.
.Ss VCHANs
Each device can optionally support more playback and recording channels
than physical hardware provides by using
@@ -230,12 +227,6 @@ driver.
The following tunables can not be changed during runtime using
.Xr sysctl 8 .
.Bl -tag -width indent
-.It Va hint.pcm.%d.eq
-Set to 1 or 0 to explicitly enable (1) or disable (0) the equalizer.
-Requires a driver reload if changed.
-Enabling this will make bass and treble controls appear in mixer applications.
-This tunable is undefined by default.
-Equalizing is disabled by default.
.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.
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
index 4fc846f77496..35bb12a062ec 100644
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -725,7 +725,7 @@ feeder_chain(struct pcm_channel *c)
/* Soft EQ only applicable for PLAY. */
if (cdesc.dummy == 0 &&
- c->direction == PCMDIR_PLAY && (d->flags & SD_F_EQ) &&
+ c->direction == PCMDIR_PLAY && (d->flags & SD_F_EQ_ENABLED) &&
(((d->flags & SD_F_EQ_PC) &&
!(c->flags & CHN_F_HAS_VCHAN)) ||
(!(d->flags & SD_F_EQ_PC) && !(c->flags & CHN_F_VIRTUAL))))
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 6ed2d0c3ce5c..8015c8fc0c32 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -304,7 +304,7 @@ mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
if (dev == SOUND_MIXER_PCM && (d->flags & SD_F_SOFTPCMVOL))
(void)mixer_set_softpcmvol(m, d, l, r);
else if ((dev == SOUND_MIXER_TREBLE ||
- dev == SOUND_MIXER_BASS) && (d->flags & SD_F_EQ))
+ dev == SOUND_MIXER_BASS) && (d->flags & SD_F_EQ_ENABLED))
(void)mixer_set_eq(m, d, dev, (l + r) >> 1);
else if (realdev != SOUND_MIXER_NONE &&
MIXER_SET(m, realdev, l, r) < 0) {
@@ -484,8 +484,7 @@ mix_setdevs(struct snd_mixer *m, u_int32_t v)
d = device_get_softc(m->dev);
if (d != NULL && (d->flags & SD_F_SOFTPCMVOL))
v |= SOUND_MASK_PCM;
- if (d != NULL && (d->flags & SD_F_EQ))
- v |= SOUND_MASK_TREBLE | SOUND_MASK_BASS;
+ v |= SOUND_MASK_TREBLE | SOUND_MASK_BASS;
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
if (m->parent[i] < SOUND_MIXER_NRDEVICES)
v |= 1 << m->parent[i];
@@ -706,15 +705,6 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
name = device_get_name(dev);
unit = device_get_unit(dev);
- if (resource_int_value(name, unit, "eq", &val) == 0 &&
- val != 0) {
- snddev->flags |= SD_F_EQ;
- if ((val & SD_F_EQ_MASK) == val)
- snddev->flags |= val;
- else
- snddev->flags |= SD_F_EQ_DEFAULT;
- snddev->eqpreamp = 0;
- }
m = mixer_obj_create(dev, cls, devinfo, MIXER_TYPE_PRIMARY, NULL);
if (m == NULL)
@@ -762,8 +752,7 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
}
if (snddev->flags & SD_F_SOFTPCMVOL)
device_printf(dev, "Soft PCM mixer ENABLED\n");
- if (snddev->flags & SD_F_EQ)
- device_printf(dev, "EQ Treble/Bass ENABLED\n");
+ device_printf(dev, "EQ Treble/Bass ENABLED\n");
}
return (0);
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index 9eb2dffeb908..d98952d7a984 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -415,8 +415,7 @@ pcm_register(device_t dev, char *str)
"mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than "
"one mode is supported)");
vchan_initsys(dev);
- if (d->flags & SD_F_EQ)
- feeder_eq_initsys(dev);
+ feeder_eq_initsys(dev);
if (snd_unit_auto < 0)
snd_unit_auto = (snd_unit < 0) ? 1 : 0;
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h
index 40deee32ea5b..7f89c1d14df1 100644
--- a/sys/dev/sound/pcm/sound.h
+++ b/sys/dev/sound/pcm/sound.h
@@ -102,17 +102,13 @@ struct snd_mixer;
#define SD_F_REGISTERED 0x00000020
#define SD_F_BITPERFECT 0x00000040
#define SD_F_VPC 0x00000080 /* volume-per-channel */
-#define SD_F_EQ 0x00000100 /* EQ */
+/* unused 0x00000100 */
#define SD_F_EQ_ENABLED 0x00000200 /* EQ enabled */
#define SD_F_EQ_BYPASSED 0x00000400 /* EQ bypassed */
#define SD_F_EQ_PC 0x00000800 /* EQ per-channel */
#define SD_F_PVCHANS 0x00001000 /* Playback vchans enabled */
#define SD_F_RVCHANS 0x00002000 /* Recording vchans enabled */
-#define SD_F_EQ_DEFAULT (SD_F_EQ | SD_F_EQ_ENABLED)
-#define SD_F_EQ_MASK (SD_F_EQ | SD_F_EQ_ENABLED | \
- SD_F_EQ_BYPASSED | SD_F_EQ_PC)
-
#define SD_F_BITS "\020" \
"\001SIMPLEX" \
/* "\002 */ \
@@ -122,7 +118,7 @@ struct snd_mixer;
"\006REGISTERED" \
"\007BITPERFECT" \
"\010VPC" \
- "\011EQ" \
+ /* "\011 */ \
"\012EQ_ENABLED" \
"\013EQ_BYPASSED" \
"\014EQ_PC" \