summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/channel.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-24 00:49:43 +0000
committerdes <des@FreeBSD.org>2002-02-24 00:49:43 +0000
commit01635cd066f3bfcd2be4a2db737e728ab71c4ce6 (patch)
treeb886cb4b0e543fbe2b1cf7d822b4660bb9d26edc /sys/dev/sound/pcm/channel.c
parent2ffffff20157730e12764729880e645f596c766d (diff)
downloadFreeBSD-src-01635cd066f3bfcd2be4a2db737e728ab71c4ce6.zip
FreeBSD-src-01635cd066f3bfcd2be4a2db737e728ab71c4ce6.tar.gz
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
Diffstat (limited to 'sys/dev/sound/pcm/channel.c')
-rw-r--r--sys/dev/sound/pcm/channel.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 9a5b6d3..3d36e10 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;
}
OpenPOWER on IntegriCloud