Lines Matching refs:pcm
2 * \file pcm/pcm_shm.c
61 static long snd_pcm_shm_action_fd0(snd_pcm_t *pcm, int *fd)
63 snd_pcm_shm_t *shm = pcm->private_data;
81 static int snd_pcm_shm_new_rbptr(snd_pcm_t *pcm, snd_pcm_shm_t *shm,
85 if (&pcm->hw == rbptr)
86 snd_pcm_set_hw_ptr(pcm, &shm_rbptr->ptr, -1, 0);
88 snd_pcm_set_appl_ptr(pcm, &shm_rbptr->ptr, -1, 0);
95 shm->ctrl->cmd = &pcm->hw == rbptr ? SND_PCM_IOCTL_HW_PTR_FD : SND_PCM_IOCTL_APPL_PTR_FD;
96 result = snd_pcm_shm_action_fd0(pcm, &fd);
105 if (&pcm->hw == rbptr)
106 snd_pcm_set_hw_ptr(pcm, (snd_pcm_uframes_t *)((char *)ptr + offset), fd, shm_rbptr->offset);
108 snd_pcm_set_appl_ptr(pcm, (snd_pcm_uframes_t *)((char *)ptr + offset), fd, shm_rbptr->offset);
113 static long snd_pcm_shm_action(snd_pcm_t *pcm)
115 snd_pcm_shm_t *shm = pcm->private_data;
134 err = snd_pcm_shm_new_rbptr(pcm, shm, &pcm->hw, &ctrl->hw);
140 err = snd_pcm_shm_new_rbptr(pcm, shm, &pcm->appl, &ctrl->appl);
148 static long snd_pcm_shm_action_fd(snd_pcm_t *pcm, int *fd)
150 snd_pcm_shm_t *shm = pcm->private_data;
168 err = snd_pcm_shm_new_rbptr(pcm, shm, &pcm->hw, &ctrl->hw);
174 err = snd_pcm_shm_new_rbptr(pcm, shm, &pcm->appl, &ctrl->appl);
182 static int snd_pcm_shm_nonblock(snd_pcm_t *pcm ATTRIBUTE_UNUSED, int nonblock ATTRIBUTE_UNUSED)
187 static int snd_pcm_shm_async(snd_pcm_t *pcm, int sig, pid_t pid)
189 snd_pcm_shm_t *shm = pcm->private_data;
194 return snd_pcm_shm_action(pcm);
197 static int snd_pcm_shm_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
199 snd_pcm_shm_t *shm = pcm->private_data;
204 err = snd_pcm_shm_action(pcm);
211 static int snd_pcm_shm_hw_refine_cprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params ATTRIBUTE_UNUSED)
216 static int snd_pcm_shm_hw_refine_sprepare(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *sparams)
225 static int snd_pcm_shm_hw_refine_schange(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params,
244 static int snd_pcm_shm_hw_refine_cchange(snd_pcm_t *pcm ATTRIBUTE_UNUSED, snd_pcm_hw_params_t *params,
263 static int snd_pcm_shm_hw_refine_slave(snd_pcm_t *pcm,
266 snd_pcm_shm_t *shm = pcm->private_data;
271 err = snd_pcm_shm_action(pcm);
276 static int snd_pcm_shm_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
278 return snd_pcm_hw_refine_slave(pcm, params,
286 static int snd_pcm_shm_hw_params_slave(snd_pcm_t *pcm,
289 snd_pcm_shm_t *shm = pcm->private_data;
295 err = snd_pcm_shm_action(pcm);
300 static int snd_pcm_shm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
302 return snd_pcm_hw_params_slave(pcm, params,
309 static int snd_pcm_shm_hw_free(snd_pcm_t *pcm)
311 snd_pcm_shm_t *shm = pcm->private_data;
314 return snd_pcm_shm_action(pcm);
317 static int snd_pcm_shm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
319 snd_pcm_shm_t *shm = pcm->private_data;
324 err = snd_pcm_shm_action(pcm);
331 static int snd_pcm_shm_mmap(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
336 static int snd_pcm_shm_munmap(snd_pcm_t *pcm)
339 for (c = 0; c < pcm->channels; ++c) {
340 snd_pcm_channel_info_t *i = &pcm->mmap_channels[c];
347 for (c1 = c + 1; c1 < pcm->channels; ++c1) {
348 snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1];
364 static int snd_pcm_shm_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info)
366 snd_pcm_shm_t *shm = pcm->private_data;
372 err = snd_pcm_shm_action_fd(pcm, &fd);
390 static int snd_pcm_shm_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
392 snd_pcm_shm_t *shm = pcm->private_data;
397 err = snd_pcm_shm_action(pcm);
404 static snd_pcm_state_t snd_pcm_shm_state(snd_pcm_t *pcm)
406 snd_pcm_shm_t *shm = pcm->private_data;
409 return snd_pcm_shm_action(pcm);
412 static int snd_pcm_shm_hwsync(snd_pcm_t *pcm)
414 snd_pcm_shm_t *shm = pcm->private_data;
417 return snd_pcm_shm_action(pcm);
420 static int snd_pcm_shm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
422 snd_pcm_shm_t *shm = pcm->private_data;
426 err = snd_pcm_shm_action(pcm);
433 static snd_pcm_sframes_t snd_pcm_shm_avail_update(snd_pcm_t *pcm)
435 snd_pcm_shm_t *shm = pcm->private_data;
439 err = snd_pcm_shm_action(pcm);
445 static int snd_pcm_shm_htimestamp(snd_pcm_t *pcm ATTRIBUTE_UNUSED,
452 static int snd_pcm_shm_prepare(snd_pcm_t *pcm)
454 snd_pcm_shm_t *shm = pcm->private_data;
457 return snd_pcm_shm_action(pcm);
460 static int snd_pcm_shm_reset(snd_pcm_t *pcm)
462 snd_pcm_shm_t *shm = pcm->private_data;
465 return snd_pcm_shm_action(pcm);
468 static int snd_pcm_shm_start(snd_pcm_t *pcm)
470 snd_pcm_shm_t *shm = pcm->private_data;
473 return snd_pcm_shm_action(pcm);
476 static int snd_pcm_shm_drop(snd_pcm_t *pcm)
478 snd_pcm_shm_t *shm = pcm->private_data;
481 return snd_pcm_shm_action(pcm);
484 static int snd_pcm_shm_drain(snd_pcm_t *pcm)
486 snd_pcm_shm_t *shm = pcm->private_data;
491 err = snd_pcm_shm_action(pcm);
498 if (!(pcm->mode & SND_PCM_NONBLOCK))
499 snd_pcm_wait(pcm, SND_PCM_WAIT_DRAIN);
503 static int snd_pcm_shm_pause(snd_pcm_t *pcm, int enable)
505 snd_pcm_shm_t *shm = pcm->private_data;
509 return snd_pcm_shm_action(pcm);
512 static snd_pcm_sframes_t snd_pcm_shm_rewindable(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
517 static snd_pcm_sframes_t snd_pcm_shm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
519 snd_pcm_shm_t *shm = pcm->private_data;
523 return snd_pcm_shm_action(pcm);
526 static snd_pcm_sframes_t snd_pcm_shm_forwardable(snd_pcm_t *pcm ATTRIBUTE_UNUSED)
531 static snd_pcm_sframes_t snd_pcm_shm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
533 snd_pcm_shm_t *shm = pcm->private_data;
537 return snd_pcm_shm_action(pcm);
540 static int snd_pcm_shm_resume(snd_pcm_t *pcm)
542 snd_pcm_shm_t *shm = pcm->private_data;
545 return snd_pcm_shm_action(pcm);
548 static snd_pcm_sframes_t snd_pcm_shm_mmap_commit(snd_pcm_t *pcm,
552 snd_pcm_shm_t *shm = pcm->private_data;
557 return snd_pcm_shm_action(pcm);
560 static int snd_pcm_shm_poll_descriptor(snd_pcm_t *pcm)
562 snd_pcm_shm_t *shm = pcm->private_data;
566 err = snd_pcm_shm_action_fd(pcm, &fd);
572 static int snd_pcm_shm_close(snd_pcm_t *pcm)
574 snd_pcm_shm_t *shm = pcm->private_data;
578 result = snd_pcm_shm_action(pcm);
581 close(pcm->poll_fd);
586 static void snd_pcm_shm_dump(snd_pcm_t *pcm, snd_output_t *out)
589 if (pcm->setup) {
591 snd_pcm_dump_setup(pcm, out);
675 snd_pcm_t *pcm;
745 err = snd_pcm_new(&pcm, SND_PCM_TYPE_SHM, name, stream, mode);
750 pcm->mmap_rw = 1;
751 pcm->ops = &snd_pcm_shm_ops;
752 pcm->fast_ops = &snd_pcm_shm_fast_ops;
753 pcm->private_data = shm;
754 err = snd_pcm_shm_poll_descriptor(pcm);
756 snd_pcm_close(pcm);
759 pcm->poll_fd = err;
760 pcm->poll_events = stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
761 snd_pcm_set_hw_ptr(pcm, &ctrl->hw.ptr, -1, 0);
762 snd_pcm_set_appl_ptr(pcm, &ctrl->appl.ptr, -1, 0);
763 *pcmp = pcm;
783 pcm.name {
786 pcm STR # PCM name
838 if (strcmp(id, "pcm") == 0) {
850 SNDERR("pcm is not defined");