sound/core/oss/pcm_plugin.h

Source file repositories/reference/linux-study-clean/sound/core/oss/pcm_plugin.h

File Facts

System
Linux kernel
Corpus path
sound/core/oss/pcm_plugin.h
Extension
.h
Size
6669 bytes
Lines
166
Domain
Driver Families
Bucket
sound/core
Inferred role
Driver Families: implementation source
Status
source 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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct snd_pcm_channel_area {
	void *addr;			/* base address of channel samples */
	unsigned int first;		/* offset to first sample in bits */
	unsigned int step;		/* samples distance in bits */
};

struct snd_pcm_plugin_channel {
	void *aptr;			/* pointer to the allocated area */
	struct snd_pcm_channel_area area;
	snd_pcm_uframes_t frames;	/* allocated frames */
	unsigned int enabled:1;		/* channel need to be processed */
	unsigned int wanted:1;		/* channel is wanted */
};

struct snd_pcm_plugin_format {
	snd_pcm_format_t format;
	unsigned int rate;
	unsigned int channels;
};

struct snd_pcm_plugin {
	const char *name;		/* plug-in name */
	int stream;
	struct snd_pcm_plugin_format src_format;	/* source format */
	struct snd_pcm_plugin_format dst_format;	/* destination format */
	int src_width;			/* sample width in bits */
	int dst_width;			/* sample width in bits */
	snd_pcm_access_t access;
	snd_pcm_sframes_t (*src_frames)(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t dst_frames);
	snd_pcm_sframes_t (*dst_frames)(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t src_frames);
	snd_pcm_sframes_t (*client_channels)(struct snd_pcm_plugin *plugin,
					     snd_pcm_uframes_t frames,
					     struct snd_pcm_plugin_channel **channels);
	snd_pcm_sframes_t (*transfer)(struct snd_pcm_plugin *plugin,
				      const struct snd_pcm_plugin_channel *src_channels,
				      struct snd_pcm_plugin_channel *dst_channels,
				      snd_pcm_uframes_t frames);
	int (*action)(struct snd_pcm_plugin *plugin,
		      enum snd_pcm_plugin_action action,
		      unsigned long data);
	struct snd_pcm_plugin *prev;
	struct snd_pcm_plugin *next;
	struct snd_pcm_substream *plug;
	void *private_data;
	void (*private_free)(struct snd_pcm_plugin *plugin);
	char *buf;
	snd_pcm_uframes_t buf_frames;
	struct snd_pcm_plugin_channel *buf_channels;
	char extra_data[];
};

int snd_pcm_plugin_build(struct snd_pcm_substream *handle,
                         const char *name,
                         struct snd_pcm_plugin_format *src_format,
                         struct snd_pcm_plugin_format *dst_format,
                         size_t extra,
                         struct snd_pcm_plugin **ret);
int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin);
int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames);
snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t drv_size);
snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t clt_size);

#define FULL ROUTE_PLUGIN_RESOLUTION
#define HALF ROUTE_PLUGIN_RESOLUTION / 2

int snd_pcm_plugin_build_io(struct snd_pcm_substream *handle,
			    struct snd_pcm_hw_params *params,
			    struct snd_pcm_plugin **r_plugin);
int snd_pcm_plugin_build_linear(struct snd_pcm_substream *handle,
				struct snd_pcm_plugin_format *src_format,
				struct snd_pcm_plugin_format *dst_format,
				struct snd_pcm_plugin **r_plugin);
int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *handle,
			       struct snd_pcm_plugin_format *src_format,
			       struct snd_pcm_plugin_format *dst_format,
			       struct snd_pcm_plugin **r_plugin);
int snd_pcm_plugin_build_rate(struct snd_pcm_substream *handle,
			      struct snd_pcm_plugin_format *src_format,
			      struct snd_pcm_plugin_format *dst_format,
			      struct snd_pcm_plugin **r_plugin);
int snd_pcm_plugin_build_route(struct snd_pcm_substream *handle,
			       struct snd_pcm_plugin_format *src_format,
			       struct snd_pcm_plugin_format *dst_format,
		               struct snd_pcm_plugin **r_plugin);
int snd_pcm_plugin_build_copy(struct snd_pcm_substream *handle,
			      struct snd_pcm_plugin_format *src_format,
			      struct snd_pcm_plugin_format *dst_format,
			      struct snd_pcm_plugin **r_plugin);

int snd_pcm_plug_format_plugins(struct snd_pcm_substream *substream,

Annotation

Implementation Notes