From nobody Tue Nov 17 15:44:35 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4jTTYv4p7nz71H7X for ; Tue, 17 Nov 2026 15:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jTTYv2qbwz3CK9 for ; Tue, 17 Nov 2026 15:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794930275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPipYncwtGWAj/HLwVIj7fuFIqbXFI9dPxxdA8jV6SI=; b=fzdVtNM0xAXm43nMXrhJBfxUZ4B+RxDmZHGz0G6QE5Wdc69bQh8MTiRKlvnjq9RS2jVkvq mAaFf+9DHSLVI9rRn35iAFbfd+sTrFxQ1WAHrkpHc9Nz+x7zh7KfE2ZDF4+2SwFHR5OFJd VxDUbMypFOv9zRr9eydIyJYDKl/nqXy8LPXrbp8Cyh3F8Z3MJD1EbKyrAGzXO10Wt5KdE6 GCvOCD8GZEZo3ws7Pjm5xO6Gs6kVvxaDO1463UnvpewPueWxZSnAq7Q9YIEZmqGSO2Riey QSDcdSxt0jScyDF4GYwhRjSYNLRUBGkt25El1C40zJa50Lzm6zEXwsiD5LRitA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794930275; b=HesG5sG4zkAV5BscZgPlEUA7VH71t17tAkryfgCnPRyiSMqh0sntSE5/jPtn6eljxbY8sU tOpzyQ0LWktscdYublWM6EpSEtoiS+GKQalK0uITSuiwNelPtL8qi9qYLmirs965IONnin 98C2nxJa8IkULQVfZqHPsu4CKhlJwhdrWwv0dlSrUqQGKQA4EUYl3pzsvrfmh0asN+yCLp GUONKENBFLlMRfFImc7eG8gJWb7gDw9hNH5Qa/ncuw6V+uSw9XnOe7nmsFNwsHhJ0Z/pzL cayXVn0xpUVGfVVkFBuHWNUqsCTeAcOSUxe/OyVjS2dDWLOMmURwCMvv96CTxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794930275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XPipYncwtGWAj/HLwVIj7fuFIqbXFI9dPxxdA8jV6SI=; b=aLLdT5gFRk9+KdIe+vrlzWWNpHxkMqZq41ZvZJH2YlG7v6ia3xsxpfKSpjL6nBM0uqmP6L TdsUrlmwxgRelar0nLLnR4IbAFNN3+lXu01DrpmQePHSOlRgAnPbS09TMkv9xpotqcXSGc Kx3bW7FTR5V3fCXksc0BvJ4TcFJKEaETz95TXV2GBRGlsWBYlQ/4oMpmbb3sT6583fFh1+ hD7iYIQ6o127DQ1hgupPsEUeFDra53WaDeUqgfLsuf+1/XTd+Pw9tUiVmpiQBFYYeAgxZ+ hTynYNnQAYmcZAu7XGeesoGu+QkxcySPvUUpB8GeQWg7rxMOsKj24LAfAwYP/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jTTYv1k7qzp07 for ; Tue, 17 Nov 2026 15:44:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 16d3c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 17 Nov 2026 15:44:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: a6ef377dc297 - main - sound: Retire OSSV4_EXPERIMENT List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6ef377dc29760c43a189ade18cbccd2bdcd298a Auto-Submitted: auto-generated Date: Tue, 17 Nov 2026 15:44:35 +0000 Message-Id: <6afc7663.16d3c.5fb983ba@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a6ef377dc29760c43a189ade18cbccd2bdcd298a commit a6ef377dc29760c43a189ade18cbccd2bdcd298a Author: Christos Margiolis AuthorDate: 2026-11-17 15:43:00 +0000 Commit: Christos Margiolis CommitDate: 2026-11-17 15:43:00 +0000 sound: Retire OSSV4_EXPERIMENT Added in 2006 (b611c801f0ac) but these stubs are still not implemented or specified by 4Front. MFC after: 1 week Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D61671 --- sys/dev/sound/pcm/buffer.c | 28 ------ sys/dev/sound/pcm/buffer.h | 4 - sys/dev/sound/pcm/channel.c | 9 -- sys/dev/sound/pcm/channel.h | 8 -- sys/dev/sound/pcm/channel_if.m | 33 -------- sys/dev/sound/pcm/dsp.c | 187 ----------------------------------------- sys/sys/soundcard.h | 11 --- 7 files changed, 280 deletions(-) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 2b3021480700..d2cdfb13e32a 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -610,31 +610,3 @@ sndbuf_clearshadow(struct snd_dbuf *b) if ((b->shadbuf != NULL) && (b->sl > 0)) memset(b->shadbuf, sndbuf_zerodata(b->fmt), b->sl); } - -#ifdef OSSV4_EXPERIMENT -/** - * @brief Return peak value from samples in buffer ready area. - * - * Peak ranges from 0-32767. If channel is monaural, most significant 16 - * bits will be zero. For now, only expects to work with 1-2 channel - * buffers. - * - * @note Currently only operates with linear PCM formats. - * - * @param b buffer to analyze - * @param lpeak pointer to store left peak value - * @param rpeak pointer to store right peak value - */ -void -sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp) -{ - uint32_t lpeak, rpeak; - - lpeak = 0; - rpeak = 0; - - /** - * @todo fill this in later - */ -} -#endif diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h index 4363a637bc34..bf0a41c84fd7 100644 --- a/sys/dev/sound/pcm/buffer.h +++ b/sys/dev/sound/pcm/buffer.h @@ -97,10 +97,6 @@ int sndbuf_acquire(struct snd_dbuf *b, uint8_t *from, unsigned int count); int sndbuf_dispose(struct snd_dbuf *b, uint8_t *to, unsigned int count); int sndbuf_feed(struct snd_dbuf *from, struct snd_dbuf *to, struct pcm_channel *channel, struct pcm_feeder *feeder, unsigned int count); -#ifdef OSSV4_EXPERIMENT -void sndbuf_getpeaks(struct snd_dbuf *b, int *lp, int *rp); -#endif - static inline uint32_t snd_xbytes(uint32_t v, uint32_t from, uint32_t to) { diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index c79761ccc22e..5d429240448b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2624,12 +2624,3 @@ chn_syncdestroy(struct pcm_channel *c) return sg_id; } - -#ifdef OSSV4_EXPERIMENT -int -chn_getpeaks(struct pcm_channel *c, int *lpeak, int *rpeak) -{ - CHN_LOCKASSERT(c); - return CHANNEL_GETPEAKS(c->methods, c->devinfo, lpeak, rpeak); -} -#endif diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 12185628b11d..32508dab581d 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -143,10 +143,6 @@ struct pcm_channel { * container. */ struct pcmchan_syncmember *sm; -#ifdef OSSV4_EXPERIMENT - uint16_t lpeak, rpeak; /**< Peak value from 0-32767. */ -#endif - struct { SLIST_HEAD(, pcm_channel) head; SLIST_ENTRY(pcm_channel) link; @@ -306,10 +302,6 @@ int chn_notify(struct pcm_channel *c, uint32_t flags); int chn_getrates(struct pcm_channel *c, int **rates); int chn_syncdestroy(struct pcm_channel *c); -#ifdef OSSV4_EXPERIMENT -int chn_getpeaks(struct pcm_channel *c, int *lpeak, int *rpeak); -#endif - #define CHN_LOCKOWNED(c) mtx_owned(&(c)->lock) #define CHN_LOCK(c) mtx_lock(&(c)->lock) #define CHN_UNLOCK(c) mtx_unlock(&(c)->lock) diff --git a/sys/dev/sound/pcm/channel_if.m b/sys/dev/sound/pcm/channel_if.m index 1bf04a9bf33a..1248ddbe4a85 100644 --- a/sys/dev/sound/pcm/channel_if.m +++ b/sys/dev/sound/pcm/channel_if.m @@ -65,12 +65,6 @@ CODE { return 0; } - static int - channel_nogetpeaks(kobj_t obj, void *data, int *lpeak, int *rpeak) - { - return -1; - } - static int channel_nogetrates(kobj_t obj, void *data, int **rates) { @@ -168,33 +162,6 @@ METHOD int notify { uint32_t changed; } DEFAULT channel_nonotify; -/** - * @brief Retrieve channel peak values - * - * This function is intended to obtain peak volume values for samples - * played/recorded on a channel. Values are on a linear scale from 0 to - * 32767. If the channel is monaural, a single value should be recorded - * in @c lpeak. - * - * If hardware support isn't available, the SNDCTL_DSP_GET[IO]PEAKS - * operation should return EINVAL. However, we may opt to provide - * software support that the user may toggle via sysctl/mixext. - * - * @param obj standard kobj object (usually @c channel->methods) - * @param data driver-specific data (usually @c channel->devinfo) - * @param lpeak pointer to store left peak level - * @param rpeak pointer to store right peak level - * - * @retval -1 Error; usually operation isn't supported. - * @retval 0 success - */ -METHOD int getpeaks { - kobj_t obj; - void *data; - int *lpeak; - int *rpeak; -} DEFAULT channel_nogetpeaks; - /** * @brief Retrieve discrete supported sample rates * diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 6fa00dbd3aa7..8f05139b3617 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -101,14 +101,6 @@ static int dsp_oss_cookedmode(struct pcm_channel *wrch, struct pcm_channel *rdch static int dsp_oss_getchnorder(struct pcm_channel *wrch, struct pcm_channel *rdch, unsigned long long *map); static int dsp_oss_setchnorder(struct pcm_channel *wrch, struct pcm_channel *rdch, unsigned long long *map); static int dsp_oss_getchannelmask(struct pcm_channel *wrch, struct pcm_channel *rdch, int *mask); -#ifdef OSSV4_EXPERIMENT -static int dsp_oss_getlabel(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_label_t *label); -static int dsp_oss_setlabel(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_label_t *label); -static int dsp_oss_getsong(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *song); -static int dsp_oss_setsong(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *song); -static int dsp_oss_setname(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *name); -#endif - static uint32_t dsp_clamp_fragments(uint32_t maxfrags, uint32_t fragsz, uint32_t maxsize) { @@ -1790,52 +1782,6 @@ dsp_ioctl(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode, case SNDCTL_DSP_BIND_CHANNEL: /* XXX what?!? */ ret = EINVAL; break; -#ifdef OSSV4_EXPERIMENT - /* - * XXX The following ioctls are not yet supported and just return - * EINVAL. - */ - case SNDCTL_DSP_GETOPEAKS: - case SNDCTL_DSP_GETIPEAKS: - chn = (cmd == SNDCTL_DSP_GETOPEAKS) ? wrch : rdch; - if (chn == NULL) - ret = EINVAL; - else { - oss_peaks_t *op = (oss_peaks_t *)arg; - int lpeak, rpeak; - - CHN_LOCK(chn); - ret = chn_getpeaks(chn, &lpeak, &rpeak); - if (ret == -1) - ret = EINVAL; - else { - (*op)[0] = lpeak; - (*op)[1] = rpeak; - } - CHN_UNLOCK(chn); - } - break; - - /* - * XXX Once implemented, revisit this for proper cv protection - * (if necessary). - */ - case SNDCTL_GETLABEL: - ret = dsp_oss_getlabel(wrch, rdch, (oss_label_t *)arg); - break; - case SNDCTL_SETLABEL: - ret = dsp_oss_setlabel(wrch, rdch, (oss_label_t *)arg); - break; - case SNDCTL_GETSONG: - ret = dsp_oss_getsong(wrch, rdch, (oss_longname_t *)arg); - break; - case SNDCTL_SETSONG: - ret = dsp_oss_setsong(wrch, rdch, (oss_longname_t *)arg); - break; - case SNDCTL_SETNAME: - ret = dsp_oss_setname(wrch, rdch, (oss_longname_t *)arg); - break; -#endif /* !OSSV4_EXPERIMENT */ case SNDCTL_DSP_MAPINBUF: case SNDCTL_DSP_MAPOUTBUF: case SNDCTL_DSP_SETSYNCRO: @@ -3106,136 +3052,3 @@ dsp_kqfilter(struct cdev *dev, struct knote *kn) return (err); } - -#ifdef OSSV4_EXPERIMENT -/** - * @brief Retrieve an audio device's label - * - * This is a handler for the @c SNDCTL_GETLABEL ioctl. - * - * See @c http://manuals.opensound.com/developer/SNDCTL_GETLABEL.html - * for more details. - * - * From Hannu@4Front: "For example ossxmix (just like some HW mixer - * consoles) can show variable "labels" for certain controls. By default - * the application name (say quake) is shown as the label but - * applications may change the labels themselves." - * - * @note As the ioctl definition is still under construction, FreeBSD - * does not currently support @c SNDCTL_GETLABEL. - * - * @param wrch playback channel (optional; may be NULL) - * @param rdch recording channel (optional; may be NULL) - * @param label label gets copied here - * - * @retval EINVAL Operation not yet supported. - */ -static int -dsp_oss_getlabel(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_label_t *label) -{ - return (EINVAL); -} - -/** - * @brief Specify an audio device's label - * - * This is a handler for the @c SNDCTL_SETLABEL ioctl. Please see the - * comments for @c dsp_oss_getlabel immediately above. - * - * See @c http://manuals.opensound.com/developer/SNDCTL_GETLABEL.html - * for more details. - * - * @note As the ioctl definition is still under construction, FreeBSD - * does not currently support SNDCTL_SETLABEL. - * - * @param wrch playback channel (optional; may be NULL) - * @param rdch recording channel (optional; may be NULL) - * @param label label gets copied from here - * - * @retval EINVAL Operation not yet supported. - */ -static int -dsp_oss_setlabel(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_label_t *label) -{ - return (EINVAL); -} - -/** - * @brief Retrieve name of currently played song - * - * This is a handler for the @c SNDCTL_GETSONG ioctl. Audio players could - * tell the system the name of the currently playing song, which would be - * visible in @c /dev/sndstat. - * - * See @c http://manuals.opensound.com/developer/SNDCTL_GETSONG.html - * for more details. - * - * @note As the ioctl definition is still under construction, FreeBSD - * does not currently support SNDCTL_GETSONG. - * - * @param wrch playback channel (optional; may be NULL) - * @param rdch recording channel (optional; may be NULL) - * @param song song name gets copied here - * - * @retval EINVAL Operation not yet supported. - */ -static int -dsp_oss_getsong(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *song) -{ - return (EINVAL); -} - -/** - * @brief Retrieve name of currently played song - * - * This is a handler for the @c SNDCTL_SETSONG ioctl. Audio players could - * tell the system the name of the currently playing song, which would be - * visible in @c /dev/sndstat. - * - * See @c http://manuals.opensound.com/developer/SNDCTL_SETSONG.html - * for more details. - * - * @note As the ioctl definition is still under construction, FreeBSD - * does not currently support SNDCTL_SETSONG. - * - * @param wrch playback channel (optional; may be NULL) - * @param rdch recording channel (optional; may be NULL) - * @param song song name gets copied from here - * - * @retval EINVAL Operation not yet supported. - */ -static int -dsp_oss_setsong(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *song) -{ - return (EINVAL); -} - -/** - * @brief Rename a device - * - * This is a handler for the @c SNDCTL_SETNAME ioctl. - * - * See @c http://manuals.opensound.com/developer/SNDCTL_SETNAME.html for - * more details. - * - * From Hannu@4Front: "This call is used to change the device name - * reported in /dev/sndstat and ossinfo. So instead of using some generic - * 'OSS loopback audio (MIDI) driver' the device may be given a meaningfull - * name depending on the current context (for example 'OSS virtual wave table - * synth' or 'VoIP link to London')." - * - * @note As the ioctl definition is still under construction, FreeBSD - * does not currently support SNDCTL_SETNAME. - * - * @param wrch playback channel (optional; may be NULL) - * @param rdch recording channel (optional; may be NULL) - * @param name new device name gets copied from here - * - * @retval EINVAL Operation not yet supported. - */ -static int -dsp_oss_setname(struct pcm_channel *wrch, struct pcm_channel *rdch, oss_longname_t *name) -{ - return (EINVAL); -} -#endif /* !OSSV4_EXPERIMENT */ diff --git a/sys/sys/soundcard.h b/sys/sys/soundcard.h index aab67532503e..adbb1c4215fb 100644 --- a/sys/sys/soundcard.h +++ b/sys/sys/soundcard.h @@ -1558,17 +1558,6 @@ void seqbuf_dump(void); /* This function must be provided by programs */ * @todo ask about maintaining __SIOWR vs. _IOWR ioctl cmd defines */ -/** - * @note The @c OSSV4_EXPERIMENT macro is meant to wrap new development code - * in the sound system relevant to adopting 4Front's OSSv4 specification. - * Users should not enable this! Really! - */ -#if 0 -# define OSSV4_EXPERIMENT 1 -#else -# undef OSSV4_EXPERIMENT -#endif - #ifdef SOUND_VERSION # undef SOUND_VERSION # define SOUND_VERSION 0x040000