aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm/feeder_chain.c
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-05-08 17:00:33 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-05-08 17:00:33 +0000
commit4ece1a889b02e5e685037c1c99a1c73a8a125d46 (patch)
tree25937c2b80456d238dea4896376843b573c97f0c /sys/dev/sound/pcm/feeder_chain.c
parent5abe80cf6b0bbcf6394f3876cb73d065117fe3b5 (diff)
downloadsrc-4ece1a889b02e5e685037c1c99a1c73a8a125d46.tar.gz
src-4ece1a889b02e5e685037c1c99a1c73a8a125d46.zip
Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These definitions are only used inside the kernel and can be changed later if more than one sub-channel is desired. This has been done to allow so-called USB audio rack modules to work with FreeBSD. Bump the FreeBSD version to force recompiling all external modules. MFC after: 2 weeks Reviewed by: mav
Notes
Notes: svn path=/head/; revision=282650
Diffstat (limited to 'sys/dev/sound/pcm/feeder_chain.c')
-rw-r--r--sys/dev/sound/pcm/feeder_chain.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
index a647269dba6d..308d5f2e8b61 100644
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -561,6 +561,20 @@ feeder_build_mixer(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
((c)->mode == FEEDER_CHAIN_LEAN && \
!((c)->current.afmt & (AFMT_S16_NE | AFMT_S32_NE)))))
+static void
+feeder_default_matrix(struct pcmchan_matrix *m, uint32_t fmt, int id)
+{
+ int x;
+
+ memset(m, 0, sizeof(*m));
+
+ m->id = id;
+ m->channels = AFMT_CHANNEL(fmt);
+ m->ext = AFMT_EXTCHANNEL(fmt);
+ for (x = 0; x != SND_CHN_T_MAX; x++)
+ m->offset[x] = -1;
+}
+
int
feeder_chain(struct pcm_channel *c)
{
@@ -641,10 +655,10 @@ feeder_chain(struct pcm_channel *c)
*/
hwmatrix = CHANNEL_GETMATRIX(c->methods, c->devinfo, hwfmt);
if (hwmatrix == NULL) {
- device_printf(c->dev,
- "%s(): failed to acquire hw matrix [0x%08x]\n",
- __func__, hwfmt);
- return (ENODEV);
+ /* setup a default matrix */
+ hwmatrix = &c->matrix_scratch;
+ feeder_default_matrix(hwmatrix, hwfmt,
+ SND_CHN_MATRIX_UNKNOWN);
}
/* ..... and rebuild hwfmt. */
hwfmt = SND_FORMAT(hwfmt, hwmatrix->channels, hwmatrix->ext);
@@ -656,13 +670,14 @@ feeder_chain(struct pcm_channel *c)
softmatrix->ext != AFMT_EXTCHANNEL(softfmt)) {
softmatrix = feeder_matrix_format_map(softfmt);
if (softmatrix == NULL) {
- device_printf(c->dev,
- "%s(): failed to acquire soft matrix [0x%08x]\n",
- __func__, softfmt);
- return (ENODEV);
+ /* setup a default matrix */
+ softmatrix = &c->matrix;
+ feeder_default_matrix(softmatrix, softfmt,
+ SND_CHN_MATRIX_PCMCHANNEL);
+ } else {
+ c->matrix = *softmatrix;
+ c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL;
}
- c->matrix = *softmatrix;
- c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL;
}
softfmt = SND_FORMAT(softfmt, softmatrix->channels, softmatrix->ext);
if (softfmt != c->format)