Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 May 2026 15:30:10 +0000
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 88bc1d7325aa - main - sound: Retire EQ states
Message-ID:  <6a170e02.3000d.7bf78db0@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=88bc1d7325aa97520f7a308d70a5fcb39acdc5d2

commit 88bc1d7325aa97520f7a308d70a5fcb39acdc5d2
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-04-17 15:23:38 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-05-27 15:27:11 +0000

    sound: Retire EQ states
    
    The SD_F_EQ_ENABLED does the same thing, and is actually what we test
    against in order to create the EQ feeder.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/15
---
 sys/dev/sound/pcm/channel.c   |  3 ---
 sys/dev/sound/pcm/feeder.h    |  3 ---
 sys/dev/sound/pcm/feeder_eq.c | 25 ++-----------------------
 3 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index c97a3158dbd9..a0ee16a14386 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -2209,9 +2209,6 @@ chn_syncstate(struct pcm_channel *c)
 				device_printf(c->dev,
 				    "EQ: Failed to set preamp -- %d\n",
 				    d->eqpreamp);
-			if (d->flags & SD_F_EQ_ENABLED &&
-			    FEEDER_SET(f, FEEDEQ_STATE, FEEDEQ_ENABLE) != 0)
-				device_printf(c->dev, "EQ: Failed to enable\n");
 		}
 	}
 }
diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h
index 10bfe9dca8f3..127b479cd7c9 100644
--- a/sys/dev/sound/pcm/feeder.h
+++ b/sys/dev/sound/pcm/feeder.h
@@ -119,9 +119,6 @@ enum {
 	FEEDEQ_TREBLE,
 	FEEDEQ_BASS,
 	FEEDEQ_PREAMP,
-	FEEDEQ_STATE,
-	FEEDEQ_ENABLE,
-	FEEDEQ_UNKNOWN
 };
 
 int feeder_eq_validrate(uint32_t);
diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c
index 6fd7d7f2bfff..fdb786171d5a 100644
--- a/sys/dev/sound/pcm/feeder_eq.c
+++ b/sys/dev/sound/pcm/feeder_eq.c
@@ -122,7 +122,6 @@ struct feed_eq_info {
 	uint32_t rate;
 	uint32_t align;
 	int32_t preamp;
-	int state;
 };
 
 #if !defined(_KERNEL) && defined(FEEDEQ_ERR_CLIP)
@@ -277,7 +276,6 @@ feed_eq_init(struct pcm_feeder *f)
 	info->treble.gain = FEEDEQ_L2GAIN(50);
 	info->bass.gain = FEEDEQ_L2GAIN(50);
 	info->preamp = FEEDEQ_PREAMP2IDX(FEEDEQ_PREAMP_DEFAULT);
-	info->state = FEEDEQ_UNKNOWN;
 
 	f->data = info;
 
@@ -303,8 +301,6 @@ feed_eq_set(struct pcm_feeder *f, int what, int value)
 		if (feeder_eq_validrate(value) == 0)
 			return (EINVAL);
 		info->rate = (uint32_t)value;
-		if (info->state == FEEDEQ_UNKNOWN)
-			info->state = FEEDEQ_ENABLE;
 		return (feed_eq_setup(info));
 	case FEEDEQ_TREBLE:
 	case FEEDEQ_BASS:
@@ -320,12 +316,6 @@ feed_eq_set(struct pcm_feeder *f, int what, int value)
 			return (EINVAL);
 		info->preamp = FEEDEQ_PREAMP2IDX(value);
 		break;
-	case FEEDEQ_STATE:
-		if (value != FEEDEQ_ENABLE)
-			return (EINVAL);
-		info->state = value;
-		feed_eq_reset(info);
-		break;
 	default:
 		return (EINVAL);
 	}
@@ -449,8 +439,6 @@ static int
 sysctl_dev_pcm_eq(SYSCTL_HANDLER_ARGS)
 {
 	struct snddev_info *d;
-	struct pcm_channel *c;
-	struct pcm_feeder *f;
 	int err, val, oval;
 
 	d = oidp->oid_arg1;
@@ -477,20 +465,11 @@ sysctl_dev_pcm_eq(SYSCTL_HANDLER_ARGS)
 
 		PCM_LOCK(d);
 
-		if (val == 1) {
-			val = FEEDEQ_ENABLE;
+		if (val == 1)
 			d->flags |= SD_F_EQ_ENABLED;
-		} else
+		else
 			d->flags &= ~SD_F_EQ_ENABLED;
 
-		CHN_FOREACH(c, d, channels.pcm.busy) {
-			CHN_LOCK(c);
-			f = feeder_find(c, FEEDER_EQ);
-			if (f != NULL)
-				(void)FEEDER_SET(f, FEEDEQ_STATE, val);
-			CHN_UNLOCK(c);
-		}
-
 		PCM_RELEASE(d);
 		PCM_UNLOCK(d);
 	} else


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a170e02.3000d.7bf78db0>