Lines Matching defs:hwbuf
2334 audio_ring_t *hwbuf;
2520 hwbuf = &sc->sc_pmixer->hwbuf;
2524 hwbuf->mem,
2525 hwbuf->capacity *
2526 hwbuf->fmt.channels * hwbuf->fmt.stride / NBBY);
2539 hwbuf = &sc->sc_rmixer->hwbuf;
2543 hwbuf->mem,
2544 hwbuf->capacity *
2545 hwbuf->fmt.channels * hwbuf->fmt.stride / NBBY);
5202 * Calculate blktime [msec] from mixer(.hwbuf.fmt).
5214 fmt = &mixer->hwbuf.fmt;
5272 mixer->hwbuf.fmt = *hwfmt;
5279 mixer->frames_per_block = frame_per_block(mixer, &mixer->hwbuf.fmt);
5280 blksize = frametobyte(&mixer->hwbuf.fmt, mixer->frames_per_block);
5283 audio_params_t p = format2_to_params(&mixer->hwbuf.fmt);
5290 if ((rounded * NBBY) % (mixer->hwbuf.fmt.stride *
5291 mixer->hwbuf.fmt.channels) != 0) {
5298 mixer->hwbuf.fmt.stride,
5299 mixer->hwbuf.fmt.channels);
5305 (mixer->hwbuf.fmt.stride *
5306 mixer->hwbuf.fmt.channels);
5310 mixer->blktime_d = mixer->hwbuf.fmt.sample_rate;
5313 bufsize = frametobyte(&mixer->hwbuf.fmt, capacity);
5347 mixer->hwbuf.capacity = capacity;
5351 mixer->hwbuf.mem = sc->hw_if->allocm(sc->hw_hdl, mode, bufsize);
5352 if (mixer->hwbuf.mem == NULL) {
5357 mixer->hwbuf.mem = kmem_alloc(bufsize, KM_SLEEP);
5382 mixer->track_fmt.channels = mixer->hwbuf.fmt.channels;
5383 mixer->track_fmt.sample_rate = mixer->hwbuf.fmt.sample_rate;
5385 if (mixer->hwbuf.fmt.encoding == AUDIO_ENCODING_SLINEAR_OE &&
5386 mixer->hwbuf.fmt.precision == AUDIO_INTERNAL_BITS) {
5416 mixer->codecarg.dstfmt = &mixer->hwbuf.fmt;
5418 mixer->codecarg.srcfmt = &mixer->hwbuf.fmt;
5432 audio_encoding_name(mixer->hwbuf.fmt.encoding),
5433 mixer->hwbuf.fmt.precision);
5471 bufsize = frametobyte(&mixer->hwbuf.fmt, mixer->hwbuf.capacity);
5473 if (mixer->hwbuf.mem != NULL) {
5476 sc->hw_if->freem(sc->hw_hdl, mixer->hwbuf.mem, bufsize);
5478 kmem_free(mixer->hwbuf.mem, bufsize);
5480 mixer->hwbuf.mem = NULL;
5513 TRACE(2, "%smixseq=%d hwseq=%d hwbuf=%d/%d/%d%s",
5516 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity,
5521 while (mixer->hwbuf.used < mixer->frames_per_block * minimum) {
5529 TRACE(3, "end mixseq=%d hwseq=%d hwbuf=%d/%d/%d",
5531 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity);
5552 * hwbuf [............] NBLKHW blocks ring buffer
5561 * hwbuf [............] NBLKHW blocks ring buffer
5565 * hwbuf: HW encoding, HW precision, HW ch, HW freq.
5569 * Performs track mixing and converts it to hwbuf.
5570 * Note that this function doesn't transfer hwbuf to hardware.
5588 KASSERTMSG(auring_get_contig_free(&mixer->hwbuf) >= frame_count,
5590 auring_get_contig_free(&mixer->hwbuf), frame_count);
5689 mixer->codecarg.dst = auring_tailptr(&mixer->hwbuf);
5698 mixer->codecarg.dst = auring_tailptr(&mixer->hwbuf);
5701 mixer->codecarg.dstfmt = &mixer->hwbuf.fmt;
5705 auring_push(&mixer->hwbuf, frame_count);
5707 TRACE(4, "done mixseq=%d hwbuf=%d/%d/%d%s",
5709 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity,
5865 * Output one block from hwbuf to HW.
5879 TRACE(4, "pbusy=%d hwbuf=%d/%d/%d",
5881 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity);
5882 KASSERTMSG(mixer->hwbuf.used >= mixer->frames_per_block,
5883 "mixer->hwbuf.used=%d mixer->frames_per_block=%d",
5884 mixer->hwbuf.used, mixer->frames_per_block);
5886 blksize = frametobyte(&mixer->hwbuf.fmt, mixer->frames_per_block);
5891 start = mixer->hwbuf.mem;
5892 end = (uint8_t *)start + auring_bytelen(&mixer->hwbuf);
5893 params = format2_to_params(&mixer->hwbuf.fmt);
5906 start = auring_headptr(&mixer->hwbuf);
5948 auring_take(&mixer->hwbuf, mixer->frames_per_block);
5951 "HW_INT ++hwseq=%" PRIu64 " cmplcnt=%" PRIu64 " hwbuf=%d/%d/%d",
5953 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity);
5972 if (mixer->hwbuf.used >= mixer->frames_per_block) {
5978 if (mixer->hwbuf.used < mixer->frames_per_block) {
6027 * hwbuf [............] NBLKHW blocks ring buffer
6038 * hwbuf [............] NBLKHW blocks ring buffer
6043 * hwbuf: HW encoding, HW precision, HW ch, HW freq.
6068 count = auring_get_contig_used(&mixer->hwbuf);
6079 mixer->codecarg.src = auring_headptr(&mixer->hwbuf);
6094 codecarg.srcfmt = &mixer->hwbuf.fmt;
6118 /* drain hwbuf */
6119 auring_take(&mixer->hwbuf, count);
6123 codecarg.src = auring_headptr(&mixer->hwbuf);
6130 auring_take(&mixer->hwbuf, count);
6185 * Input one block from HW to hwbuf.
6199 blksize = frametobyte(&mixer->hwbuf.fmt, mixer->frames_per_block);
6204 start = mixer->hwbuf.mem;
6205 end = (uint8_t *)start + auring_bytelen(&mixer->hwbuf);
6206 params = format2_to_params(&mixer->hwbuf.fmt);
6219 start = auring_tailptr(&mixer->hwbuf);
6261 auring_push(&mixer->hwbuf, mixer->frames_per_block);
6264 "HW_INT ++hwseq=%" PRIu64 " cmplcnt=%" PRIu64 " hwbuf=%d/%d/%d",
6266 mixer->hwbuf.head, mixer->hwbuf.used, mixer->hwbuf.capacity);
6305 sc->sc_pmixer->hwbuf.head = 0;
6306 sc->sc_pmixer->hwbuf.used = 0;
6335 sc->sc_rmixer->hwbuf.head = 0;
6336 sc->sc_rmixer->hwbuf.used = 0;
7555 hwfmt = &track->mixer->hwbuf.fmt;
8083 phwfmt = sc->sc_pmixer->hwbuf.fmt;
8087 rhwfmt = sc->sc_rmixer->hwbuf.fmt;