Lines Matching defs:slave
62 snd_pcm_channel_area_t *sareas; /* areas for splitted period (slave pcm) */
71 int start_pending; /* start is triggered but not commited to slave */
210 snd_output_printf(out, "REFINE (slave params):\n");
220 snd_output_printf(out, "REFINE (slave params):\n");
243 snd_pcm_t *slave = rate->gen.slave;
278 sinfo->format = slave->format;
279 sinfo->rate = slave->rate;
280 sinfo->buffer_size = slave->buffer_size;
281 sinfo->period_size = slave->period_size;
351 return snd_pcm_hw_free(rate->gen.slave);
357 snd_pcm_t *slave = rate->gen.slave;
361 *val = slave->buffer_size;
365 *val = div * slave->period_size;
367 *val = muldiv_near(*val, slave->period_size, pcm->period_size);
374 snd_pcm_t *slave = rate->gen.slave;
380 err = snd_pcm_sw_params_current(slave, sparams);
386 boundary2 = slave->buffer_size;
388 boundary2 * 2 <= LONG_MAX - slave->buffer_size) {
402 if (sparams->start_threshold <= slave->buffer_size) {
403 if (sparams->start_threshold > (slave->buffer_size / sparams->avail_min) * sparams->avail_min)
404 sparams->start_threshold = (slave->buffer_size / sparams->avail_min) * sparams->avail_min;
417 return snd_pcm_sw_params(slave, sparams);
546 do_convert(slave_areas, slave_offset, rate->gen.slave->period_size,
560 slave_areas, slave_offset, rate->gen.slave->period_size,
569 snd_pcm_t *slave = rate->gen.slave;
577 (appl_ptr / pcm->period_size) * rate->gen.slave->period_size;
578 diff = slave_appl_ptr - *slave->appl.ptr;
579 if (diff < -(snd_pcm_sframes_t)(slave->boundary / 2)) {
580 diff = (slave->boundary - *slave->appl.ptr) + slave_appl_ptr;
581 } else if (diff > (snd_pcm_sframes_t)(slave->boundary / 2)) {
582 diff = -((slave->boundary - slave_appl_ptr) + *slave->appl.ptr);
587 ndiff = snd_pcm_forward(rate->gen.slave, diff);
589 ndiff = snd_pcm_rewind(rate->gen.slave, diff);
593 slave_appl_ptr = *slave->appl.ptr;
595 (slave_appl_ptr / rate->gen.slave->period_size) * pcm->period_size +
598 rate->appl_ptr += rate->ops.input_frames(rate->obj, slave_appl_ptr % rate->gen.slave->period_size);
600 rate->appl_ptr += rate->ops.output_frames(rate->obj, slave_appl_ptr % rate->gen.slave->period_size);
603 if (diff < -(snd_pcm_sframes_t)(slave->boundary / 2)) {
604 diff = (slave->boundary - rate->appl_ptr) + orig_appl_ptr;
605 } else if (diff > (snd_pcm_sframes_t)(slave->boundary / 2)) {
606 diff = -((slave->boundary - orig_appl_ptr) + rate->appl_ptr);
619 snd_pcm_uframes_t slave_hw_ptr = *rate->gen.slave->hw.ptr;
623 /* FIXME: boundary overlap of slave hw_ptr isn't evaluated here!
624 * e.g. if slave rate is small...
627 (slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
628 rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
634 int err = snd_pcm_hwsync(rate->gen.slave);
659 err = snd_pcm_prepare(rate->gen.slave);
678 err = snd_pcm_reset(rate->gen.slave);
738 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
747 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, slave_size);
751 result = snd_pcm_rewind(rate->gen.slave, result);
769 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
780 rate->gen.slave->format);
781 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, cont);
785 result = snd_pcm_rewind(rate->gen.slave, result);
798 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
810 rate->gen.slave->format);
811 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, cont);
815 result = snd_pcm_rewind(rate->gen.slave, result + xfer);
825 snd_pcm_start(rate->gen.slave);
836 rate->gen.slave->period_size);
851 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
854 if (slave_frames < rate->gen.slave->period_size)
858 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, rate->gen.slave->period_size);
859 if (result < (snd_pcm_sframes_t)rate->gen.slave->period_size) {
862 result = snd_pcm_rewind(rate->gen.slave, result);
869 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
875 if (cont > rate->gen.slave->period_size)
876 cont = rate->gen.slave->period_size;
880 rate->gen.slave->format);
881 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, cont);
885 result = snd_pcm_rewind(rate->gen.slave, result);
892 if (xfer == rate->gen.slave->period_size)
896 cont = rate->gen.slave->period_size - cont;
898 result = snd_pcm_mmap_begin(rate->gen.slave, &slave_areas, &slave_offset, &slave_frames);
910 rate->gen.slave->format);
911 result = snd_pcm_mmap_commit(rate->gen.slave, slave_offset, cont);
915 result = snd_pcm_rewind(rate->gen.slave, result + xfer);
946 snd_pcm_t *slave = rate->gen.slave;
951 slave_size = snd_pcm_avail_update(slave);
960 (snd_pcm_uframes_t)slave_size >= rate->gen.slave->period_size) {
967 slave_size -= rate->gen.slave->period_size;
998 snd_pcm_t *slave = rate->gen.slave;
1001 slave_size = snd_pcm_avail_update(slave);
1016 slave_size >= rate->gen.slave->period_size) {
1024 slave_size -= rate->gen.slave->period_size;
1050 /* timestamp is taken from the slave PCM */
1051 err = snd_pcm_htimestamp(rate->gen.slave, &tmp, tstamp);
1067 return snd_pcm_poll_descriptors_revents(rate->gen.slave, pfds, nfds, revents);
1083 snd_pcm_sw_params(rate->gen.slave, &sw_params);
1090 if (snd_pcm_wait(rate->gen.slave, -1) < 0)
1094 spsize = rate->gen.slave->period_size;
1107 snd_pcm_sw_params(rate->gen.slave, &sw_params);
1109 return snd_pcm_drain(rate->gen.slave);
1117 return snd_pcm_state(rate->gen.slave);
1127 return snd_pcm_start(rate->gen.slave);
1129 if (snd_pcm_state(rate->gen.slave) != SND_PCM_STATE_PREPARED)
1134 avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
1141 return snd_pcm_start(rate->gen.slave);
1152 err = snd_pcm_status(rate->gen.slave, status);
1199 snd_pcm_dump(rate->gen.slave, out);
1328 * \param slave Slave PCM handle
1329 * \param close_slave When set, the slave PCM handle is closed with copy PCM
1338 snd_pcm_t *slave, int close_slave)
1349 assert(pcmp && slave);
1357 rate->gen.slave = slave;
1363 err = snd_pcm_new(&pcm, SND_PCM_TYPE_RATE, name, slave->stream, slave->mode);
1426 pcm->poll_fd = slave->poll_fd;
1427 pcm->poll_events = slave->poll_events;
1429 pcm->monotonic = slave->monotonic;
1446 slave STR # Slave name
1448 slave { # Slave definition
1492 snd_config_t *slave = NULL, *sconf;
1504 if (strcmp(id, "slave") == 0) {
1505 slave = n;
1515 if (!slave) {
1516 SNDERR("slave is not defined");
1520 err = snd_pcm_slave_conf(root, slave, &sconf, 2,
1528 SNDERR("slave format is not linear");