Chapter 2. PCM API

Table of Contents

PCM Core
PCM Format Helpers
PCM Memory Management
PCM DMA Engine API

PCM Core

snd_pcm_format_name — Return a name string for the given PCM format
snd_pcm_new_stream — create a new PCM stream
snd_pcm_new — create a new PCM instance
snd_pcm_new_internal — create a new internal PCM instance
snd_pcm_notify — Add/remove the notify list
snd_pcm_set_ops — set the PCM operators
snd_pcm_set_sync — set the PCM sync id
snd_interval_refine — refine the interval value of configurator
snd_interval_ratnum — refine the interval value
snd_interval_list — refine the interval value from the list
snd_interval_ranges — refine the interval value from the list of ranges
snd_pcm_hw_rule_add — add the hw-constraint rule
snd_pcm_hw_constraint_mask64 — apply the given bitmap mask constraint
snd_pcm_hw_constraint_integer — apply an integer constraint to an interval
snd_pcm_hw_constraint_minmax — apply a min/max range constraint to an interval
snd_pcm_hw_constraint_list — apply a list of constraints to a parameter
snd_pcm_hw_constraint_ranges — apply list of range constraints to a parameter
snd_pcm_hw_constraint_ratnums — apply ratnums constraint to a parameter
snd_pcm_hw_constraint_ratdens — apply ratdens constraint to a parameter
snd_pcm_hw_constraint_msbits — add a hw constraint msbits rule
snd_pcm_hw_constraint_step — add a hw constraint step rule
snd_pcm_hw_constraint_pow2 — add a hw constraint power-of-2 rule
snd_pcm_hw_rule_noresample — add a rule to allow disabling hw resampling
snd_pcm_hw_param_value — return params field var value
snd_pcm_hw_param_first — refine config space and return minimum value
snd_pcm_hw_param_last — refine config space and return maximum value
snd_pcm_lib_ioctl — a generic PCM ioctl callback
snd_pcm_period_elapsed — update the pcm status for the next period
snd_pcm_add_chmap_ctls — create channel-mapping control elements
snd_pcm_stream_lock — Lock the PCM stream
snd_pcm_stream_unlock — Unlock the PCM stream
snd_pcm_stream_lock_irq — Lock the PCM stream
snd_pcm_stream_unlock_irq — Unlock the PCM stream
snd_pcm_stream_unlock_irqrestore — Unlock the PCM stream
snd_pcm_stop — try to stop all running streams in the substream group
snd_pcm_stop_xrun — stop the running streams as XRUN
snd_pcm_suspend — trigger SUSPEND to all linked streams
snd_pcm_suspend_all — trigger SUSPEND to all substreams in the given pcm
snd_pcm_lib_default_mmap — Default PCM data mmap function
snd_pcm_lib_mmap_iomem — Default PCM data mmap function for I/O mem
snd_pcm_stream_linked — Check whether the substream is linked with others
snd_pcm_stream_lock_irqsave — Lock the PCM stream
snd_pcm_group_for_each_entry — iterate over the linked substreams
snd_pcm_running — Check whether the substream is in a running state
bytes_to_samples — Unit conversion of the size from bytes to samples
bytes_to_frames — Unit conversion of the size from bytes to frames
samples_to_bytes — Unit conversion of the size from samples to bytes
frames_to_bytes — Unit conversion of the size from frames to bytes
frame_aligned — Check whether the byte size is aligned to frames
snd_pcm_lib_buffer_bytes — Get the buffer size of the current PCM in bytes
snd_pcm_lib_period_bytes — Get the period size of the current PCM in bytes
snd_pcm_playback_avail — Get the available (writable) space for playback
snd_pcm_capture_avail — Get the available (readable) space for capture
snd_pcm_playback_hw_avail — Get the queued space for playback
snd_pcm_capture_hw_avail — Get the free space for capture
snd_pcm_playback_ready — check whether the playback buffer is available
snd_pcm_capture_ready — check whether the capture buffer is available
snd_pcm_playback_data — check whether any data exists on the playback buffer
snd_pcm_playback_empty — check whether the playback buffer is empty
snd_pcm_capture_empty — check whether the capture buffer is empty
snd_pcm_trigger_done — Mark the master substream
params_channels — Get the number of channels from the hw params
params_rate — Get the sample rate from the hw params
params_period_size — Get the period size (in frames) from the hw params
params_periods — Get the number of periods from the hw params
params_buffer_size — Get the buffer size (in frames) from the hw params
params_buffer_bytes — Get the buffer size (in bytes) from the hw params
snd_pcm_format_cpu_endian — Check the PCM format is CPU-endian
snd_pcm_set_runtime_buffer — Set the PCM runtime buffer
snd_pcm_gettime — Fill the timespec depending on the timestamp mode
snd_pcm_lib_alloc_vmalloc_buffer — allocate virtual DMA buffer
snd_pcm_lib_alloc_vmalloc_32_buffer — allocate 32-bit-addressable buffer
snd_pcm_sgbuf_get_addr — Get the DMA address at the corresponding offset
snd_pcm_sgbuf_get_ptr — Get the virtual address at the corresponding offset
snd_pcm_sgbuf_get_chunk_size — Compute the max size that fits within the contig. page from the given size
snd_pcm_mmap_data_open — increase the mmap counter
snd_pcm_mmap_data_close — decrease the mmap counter
snd_pcm_limit_isa_dma_size — Get the max size fitting with ISA DMA transfer
snd_pcm_stream_str — Get a string naming the direction of a stream
snd_pcm_chmap_substream — get the PCM substream assigned to the given chmap info
pcm_format_to_bits — Strong-typed conversion of pcm_format to bitwise