include/sound/pcm.h
Source file repositories/reference/linux-study-clean/include/sound/pcm.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/pcm.h- Extension
.h- Size
- 54932 bytes
- Lines
- 1596
- Domain
- Driver Families
- Bucket
- include/sound
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sound/asound.hsound/memalloc.hsound/minors.hlinux/poll.hlinux/mm.hlinux/bitops.hlinux/pm_qos.hlinux/refcount.hlinux/uio.hsound/pcm_oss.h
Detected Declarations
struct snd_pcm_hardwarestruct snd_pcm_status64struct snd_pcm_substreamstruct snd_pcm_audio_tstamp_configstruct snd_pcm_audio_tstamp_reportstruct snd_pcm_opsstruct snd_pcm_filestruct snd_pcm_hw_rulestruct snd_pcm_hw_rulestruct snd_pcm_hw_constraintsstruct snd_ratnumstruct snd_ratdenstruct snd_pcm_hw_constraint_ratnumsstruct snd_pcm_hw_constraint_ratdensstruct snd_pcm_hw_constraint_liststruct snd_pcm_hw_constraint_rangesstruct snd_pcm_audio_tstamp_configstruct snd_pcm_audio_tstamp_reportstruct snd_pcm_runtimestruct snd_pcm_groupstruct pidstruct snd_pcm_substreamstruct snd_pcm_strstruct snd_pcmstruct snd_pcm_notifystruct snd_pcm_chmap_elemstruct snd_pcm_chmapstruct snd_pcm_status64struct snd_pcm_status32function snd_pcm_unpack_audio_tstamp_configfunction snd_pcm_pack_audio_tstamp_reportfunction snd_pcm_suspend_allfunction snd_pcm_debug_namefunction snd_pcm_stream_linkedfunction snd_pcm_runningfunction __snd_pcm_set_statefunction bytes_to_samplesfunction bytes_to_framesfunction samples_to_bytesfunction frames_to_bytesfunction frame_alignedfunction snd_pcm_lib_buffer_bytesfunction snd_pcm_lib_period_bytesfunction snd_pcm_playback_availfunction snd_pcm_capture_availfunction snd_pcm_playback_hw_availfunction snd_pcm_capture_hw_availfunction snd_pcm_playback_ready
Annotated Snippet
extern const struct file_operations snd_pcm_f_ops[2];
int snd_pcm_new(struct snd_card *card, const char *id, int device,
int playback_count, int capture_count,
struct snd_pcm **rpcm);
int snd_pcm_new_internal(struct snd_card *card, const char *id, int device,
int playback_count, int capture_count,
struct snd_pcm **rpcm);
int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
#if IS_ENABLED(CONFIG_SND_PCM_OSS)
struct snd_pcm_notify {
int (*n_register) (struct snd_pcm * pcm);
int (*n_disconnect) (struct snd_pcm * pcm);
int (*n_unregister) (struct snd_pcm * pcm);
struct list_head list;
};
int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
#endif
/*
* Native I/O
*/
int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
int snd_pcm_info_user(struct snd_pcm_substream *substream,
struct snd_pcm_info __user *info);
int snd_pcm_status64(struct snd_pcm_substream *substream,
struct snd_pcm_status64 *status);
int snd_pcm_start(struct snd_pcm_substream *substream);
int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
int snd_pcm_drain_done(struct snd_pcm_substream *substream);
int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
#ifdef CONFIG_PM
int snd_pcm_suspend_all(struct snd_pcm *pcm);
#else
static inline int snd_pcm_suspend_all(struct snd_pcm *pcm)
{
return 0;
}
#endif
int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct file *file,
struct snd_pcm_substream **rsubstream);
void snd_pcm_release_substream(struct snd_pcm_substream *substream);
int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, struct file *file,
struct snd_pcm_substream **rsubstream);
void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
#ifdef CONFIG_SND_DEBUG
void snd_pcm_debug_name(struct snd_pcm_substream *substream,
char *name, size_t len);
#else
static inline void
snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
{
*buf = 0;
}
#endif
/*
* PCM library
*/
/**
* snd_pcm_stream_linked - Check whether the substream is linked with others
* @substream: substream to check
*
* Return: true if the given substream is being linked with others
*/
static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
{
return substream->group != &substream->self_group;
}
void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
/**
* snd_pcm_stream_lock_irqsave - Lock the PCM stream
* @substream: PCM substream
* @flags: irq flags
*
* This locks the PCM stream like snd_pcm_stream_lock() but with the local
Annotation
- Immediate include surface: `sound/asound.h`, `sound/memalloc.h`, `sound/minors.h`, `linux/poll.h`, `linux/mm.h`, `linux/bitops.h`, `linux/pm_qos.h`, `linux/refcount.h`.
- Detected declarations: `struct snd_pcm_hardware`, `struct snd_pcm_status64`, `struct snd_pcm_substream`, `struct snd_pcm_audio_tstamp_config`, `struct snd_pcm_audio_tstamp_report`, `struct snd_pcm_ops`, `struct snd_pcm_file`, `struct snd_pcm_hw_rule`, `struct snd_pcm_hw_rule`, `struct snd_pcm_hw_constraints`.
- Atlas domain: Driver Families / include/sound.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.