Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177676915
D61671.1795010217.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
11 KB
Referenced Files
None
Subscribers
None
D61671.1795010217.diff
View Options
diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h
--- a/sys/dev/sound/pcm/buffer.h
+++ b/sys/dev/sound/pcm/buffer.h
@@ -97,10 +97,6 @@
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/buffer.c b/sys/dev/sound/pcm/buffer.c
--- a/sys/dev/sound/pcm/buffer.c
+++ b/sys/dev/sound/pcm/buffer.c
@@ -610,31 +610,3 @@
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/channel.h b/sys/dev/sound/pcm/channel.h
--- a/sys/dev/sound/pcm/channel.h
+++ b/sys/dev/sound/pcm/channel.h
@@ -143,10 +143,6 @@
* 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_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.c b/sys/dev/sound/pcm/channel.c
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -2624,12 +2624,3 @@
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_if.m b/sys/dev/sound/pcm/channel_if.m
--- a/sys/dev/sound/pcm/channel_if.m
+++ b/sys/dev/sound/pcm/channel_if.m
@@ -65,12 +65,6 @@
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 @@
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
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -101,14 +101,6 @@
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 @@
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 @@
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
--- a/sys/sys/soundcard.h
+++ b/sys/sys/soundcard.h
@@ -1558,17 +1558,6 @@
* @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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 18, 1:56 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41825292
Default Alt Text
D61671.1795010217.diff (11 KB)
Attached To
Mode
D61671: sound: Retire OSSV4_EXPERIMENT
Attached
Detach File
Event Timeline