From a0eed7bc1cf2f2a4a1fbf15bbf0267594e802966 Mon Sep 17 00:00:00 2001 From: Dag-Erling Smørgrav Date: Sun, 24 Feb 2002 00:49:43 +0000 Subject: Add a sysctl, sysctl hw.snd.report_soft_formats, that controls whether the AIOGCAP ioctl reports software-emulated formats. It defaults to on. People who use performance-sensitive audio software and do not want it to pick a software-emulated audio format instead of one supported by their hardware should turn it off. This unbreaks isdnphone(1) on systems with PCM-only sound cards. Approved by: cg --- sys/dev/sound/pcm/channel.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys/dev/sound/pcm') diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 9a5b6d376c58a..3d36e10afe346 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -60,7 +60,10 @@ sysctl_hw_snd_targetirqrate(SYSCTL_HANDLER_ARGS) return err; } SYSCTL_PROC(_hw_snd, OID_AUTO, targetirqrate, CTLTYPE_INT | CTLFLAG_RW, - 0, sizeof(int), sysctl_hw_snd_targetirqrate, "I", ""); + 0, sizeof(int), sysctl_hw_snd_targetirqrate, "I", ""); +static int report_soft_formats = 1; +SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW, + &report_soft_formats, 1, "report software-emulated formats"); static int chn_buildfeeder(struct pcm_channel *c); @@ -1023,6 +1026,11 @@ chn_getformats(struct pcm_channel *c) for (i = 0; fmtlist[i]; i++) fmts |= fmtlist[i]; + /* report software-supported formats */ + if (report_soft_formats) + fmts |= AFMT_MU_LAW|AFMT_A_LAW|AFMT_U16_LE|AFMT_U16_BE| + AFMT_S16_LE|AFMT_S16_BE|AFMT_U8|AFMT_S8; + return fmts; } -- cgit v1.3