Lines Matching +full:mix +full:-
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2008-2009 Ariff Abdullah <ariff@FreeBSD.org>
59 src -= PCM_##BIT##_BPS; \
60 dst -= PCM_##BIT##_BPS; \
61 count -= PCM_##BIT##_BPS; \
94 feed_mixer_t mix; member
144 if (f->desc->in != f->desc->out) in feed_mixer_init()
148 if (AFMT_ENCODING(f->desc->in) == in feed_mixer_init()
150 f->data = in feed_mixer_init()
151 FEEDMIXER_DATA(i, AFMT_CHANNEL(f->desc->in)); in feed_mixer_init()
167 f->data = FEEDMIXER_DATA(FEEDMIXER_INFOIDX(f->data), value); in feed_mixer_set()
191 b = c->bufsoft; in feed_mixer_rec()
192 b->rp = 0; in feed_mixer_rec()
193 b->rl = 0; in feed_mixer_rec()
198 cnt = FEEDER_FEED(c->feeder->source, c, b->tmpbuf, in feed_mixer_rec()
199 min(cnt, maxfeed), c->bufhard); in feed_mixer_rec()
201 sndbuf_acquire(b, b->tmpbuf, cnt); in feed_mixer_rec()
207 if (b->rl < sndbuf_getalign(b)) { in feed_mixer_rec()
208 b->rl = 0; in feed_mixer_rec()
216 rdy = b->rl; in feed_mixer_rec()
220 if (CHN_STOPPED(ch) || (ch->flags & CHN_F_DIRTY)) { in feed_mixer_rec()
225 if ((c->flags & CHN_F_DIRTY) && VCHAN_SYNC_REQUIRED(ch)) { in feed_mixer_rec()
232 bs = ch->bufsoft; in feed_mixer_rec()
233 if (ch->flags & CHN_F_MMAP) in feed_mixer_rec()
242 cnt = FEEDER_FEED(ch->feeder, ch, bs->tmpbuf, in feed_mixer_rec()
245 sndbuf_acquire(bs, bs->tmpbuf, cnt); in feed_mixer_rec()
252 if (b->rl != 0) in feed_mixer_rec()
253 ch->xruns++; in feed_mixer_rec()
258 b->rp = 0; in feed_mixer_rec()
259 b->rl = rdy; in feed_mixer_rec()
267 b->rl = 1; in feed_mixer_rec()
269 c->flags &= ~CHN_F_DIRTY; in feed_mixer_rec()
290 if (c->direction == PCMDIR_REC) in feed_mixer_feed()
297 info = &feed_mixer_info_tab[FEEDMIXER_INFOIDX(f->data)]; in feed_mixer_feed()
298 sz = info->bps * FEEDMIXER_CHANNELS(f->data); in feed_mixer_feed()
306 * list of children and calling mixer function to mix count bytes from in feed_mixer_feed()
316 if (CHN_STOPPED(ch) || (ch->flags & CHN_F_DIRTY)) { in feed_mixer_feed()
321 if ((c->flags & CHN_F_DIRTY) && VCHAN_SYNC_REQUIRED(ch)) { in feed_mixer_feed()
328 if ((ch->flags & CHN_F_MMAP) && !(ch->flags & CHN_F_CLOSING)) in feed_mixer_feed()
329 sndbuf_acquire(ch->bufsoft, NULL, in feed_mixer_feed()
330 sndbuf_getfree(ch->bufsoft)); in feed_mixer_feed()
331 if (info->mix == NULL) { in feed_mixer_feed()
338 (ch->format & AFMT_PASSTHROUGH)) { in feed_mixer_feed()
339 rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch, in feed_mixer_feed()
340 b, count, ch->bufsoft), sz); in feed_mixer_feed()
343 FEEDER_FEED(ch->feeder, ch, tmp, count, in feed_mixer_feed()
344 ch->bufsoft); in feed_mixer_feed()
345 } else if (c->flags & CHN_F_EXCLUSIVE) { in feed_mixer_feed()
351 if (passthrough == 0 && (ch->flags & CHN_F_EXCLUSIVE)) { in feed_mixer_feed()
352 rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch, in feed_mixer_feed()
353 b, count, ch->bufsoft), sz); in feed_mixer_feed()
356 FEEDER_FEED(ch->feeder, ch, tmp, count, in feed_mixer_feed()
357 ch->bufsoft); in feed_mixer_feed()
360 rcnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch, in feed_mixer_feed()
361 b, count, ch->bufsoft), sz); in feed_mixer_feed()
362 mcnt = count - rcnt; in feed_mixer_feed()
364 cnt = SND_FXROUND(FEEDER_FEED(ch->feeder, ch, in feed_mixer_feed()
365 tmp, count, ch->bufsoft), sz); in feed_mixer_feed()
370 f->desc->out), mcnt); in feed_mixer_feed()
373 info->mix(tmp, b, cnt); in feed_mixer_feed()
382 if (++c->feedcount == 0) in feed_mixer_feed()
383 c->feedcount = 2; in feed_mixer_feed()
385 c->flags &= ~CHN_F_DIRTY; in feed_mixer_feed()