Lines Matching full:pcm

10 // PCM Layer, interface between ALSA and IPC.
51 dev_err(scomp->dev, "error: got wrong reply for PCM %d\n", in sof_pcm_dsp_params()
52 spcm->pcm.pcm_id); in sof_pcm_dsp_params()
58 * sof pcm period elapse work
70 * sof pcm period elapse, this could be called at irq thread context.
89 * when the PCM is done draining or xrun happened, a STOP IPC will in snd_sof_pcm_period_elapsed()
127 struct sof_ipc_pcm_params pcm; in sof_pcm_hw_params() local
149 dev_dbg(component->dev, "pcm: hw params stream %d dir %d\n", in sof_pcm_hw_params()
150 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_params()
152 memset(&pcm, 0, sizeof(pcm)); in sof_pcm_hw_params()
163 pcm.params.buffer.pages = PFN_UP(runtime->dma_bytes); in sof_pcm_hw_params()
165 /* set IPC PCM parameters */ in sof_pcm_hw_params()
166 pcm.hdr.size = sizeof(pcm); in sof_pcm_hw_params()
167 pcm.hdr.cmd = SOF_IPC_GLB_STREAM_MSG | SOF_IPC_STREAM_PCM_PARAMS; in sof_pcm_hw_params()
168 pcm.comp_id = spcm->stream[substream->stream].comp_id; in sof_pcm_hw_params()
169 pcm.params.hdr.size = sizeof(pcm.params); in sof_pcm_hw_params()
170 pcm.params.buffer.phy_addr = in sof_pcm_hw_params()
172 pcm.params.buffer.size = runtime->dma_bytes; in sof_pcm_hw_params()
173 pcm.params.direction = substream->stream; in sof_pcm_hw_params()
174 pcm.params.sample_valid_bytes = params_width(params) >> 3; in sof_pcm_hw_params()
175 pcm.params.buffer_fmt = SOF_IPC_BUFFER_INTERLEAVED; in sof_pcm_hw_params()
176 pcm.params.rate = params_rate(params); in sof_pcm_hw_params()
177 pcm.params.channels = params_channels(params); in sof_pcm_hw_params()
178 pcm.params.host_period_bytes = params_period_bytes(params); in sof_pcm_hw_params()
184 pcm.params.sample_container_bytes = ret >> 3; in sof_pcm_hw_params()
189 pcm.params.frame_fmt = SOF_IPC_FRAME_S16_LE; in sof_pcm_hw_params()
192 pcm.params.frame_fmt = SOF_IPC_FRAME_S24_4LE; in sof_pcm_hw_params()
195 pcm.params.frame_fmt = SOF_IPC_FRAME_S32_LE; in sof_pcm_hw_params()
198 pcm.params.frame_fmt = SOF_IPC_FRAME_FLOAT; in sof_pcm_hw_params()
208 &pcm.params); in sof_pcm_hw_params()
214 dev_dbg(component->dev, "stream_tag %d", pcm.params.stream_tag); in sof_pcm_hw_params()
217 ret = sof_ipc_tx_message(sdev->ipc, pcm.hdr.cmd, &pcm, sizeof(pcm), in sof_pcm_hw_params()
221 pcm.params.stream_tag); in sof_pcm_hw_params()
231 /* save pcm hw_params */ in sof_pcm_hw_params()
253 dev_dbg(component->dev, "pcm: free stream %d dir %d\n", in sof_pcm_hw_free()
254 spcm->pcm.pcm_id, substream->stream); in sof_pcm_hw_free()
291 dev_dbg(component->dev, "pcm: prepare stream %d dir %d\n", in sof_pcm_prepare()
292 spcm->pcm.pcm_id, substream->stream); in sof_pcm_prepare()
299 "error: set pcm hw_params after resume\n"); in sof_pcm_prepare()
330 dev_dbg(component->dev, "pcm: trigger stream %d dir %d cmd %d\n", in sof_pcm_trigger()
331 spcm->pcm.pcm_id, substream->stream, cmd); in sof_pcm_trigger()
416 /* free PCM if reset_hw_params is set and the STOP IPC is successful */ in sof_pcm_trigger()
450 "PCM: stream %d dir %d DMA position %lu DAI position %lu\n", in sof_pcm_pointer()
451 spcm->pcm.pcm_id, substream->stream, host, dai); in sof_pcm_pointer()
475 dev_dbg(component->dev, "pcm: open stream %d dir %d\n", in sof_pcm_open()
476 spcm->pcm.pcm_id, substream->stream); in sof_pcm_open()
479 caps = &spcm->pcm.caps[substream->stream]; in sof_pcm_open()
523 dev_err(component->dev, "error: pcm open failed %d\n", ret); in sof_pcm_open()
544 dev_dbg(component->dev, "pcm: close stream %d dir %d\n", in sof_pcm_close()
545 spcm->pcm.pcm_id, substream->stream); in sof_pcm_close()
549 dev_err(component->dev, "error: pcm close failed %d\n", in sof_pcm_close()
570 struct snd_pcm *pcm = rtd->pcm; in sof_pcm_new() local
574 /* find SOF PCM for this RTD */ in sof_pcm_new()
577 dev_warn(component->dev, "warn: can't find PCM with DAI ID %d\n", in sof_pcm_new()
582 dev_dbg(component->dev, "creating new PCM %s\n", spcm->pcm.pcm_name); in sof_pcm_new()
585 if (!spcm->pcm.playback) in sof_pcm_new()
588 caps = &spcm->pcm.caps[stream]; in sof_pcm_new()
595 if (!pcm->streams[stream].substream) { in sof_pcm_new()
600 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()
607 if (!spcm->pcm.capture) in sof_pcm_new()
610 caps = &spcm->pcm.caps[stream]; in sof_pcm_new()
617 if (!pcm->streams[stream].substream) { in sof_pcm_new()
622 snd_pcm_set_managed_buffer(pcm->streams[stream].substream, in sof_pcm_new()
819 /* increment module refcount when a pcm is opened */ in snd_sof_new_platform_drv()