Linux Audio

Check our new training course

Loading...
v3.1
 
 1#ifndef __SOUND_PCM_OSS_H
 2#define __SOUND_PCM_OSS_H
 3
 4/*
 5 *  Digital Audio (PCM) - OSS compatibility abstract layer
 6 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
 7 *
 8 *
 9 *   This program is free software; you can redistribute it and/or modify
10 *   it under the terms of the GNU General Public License as published by
11 *   the Free Software Foundation; either version 2 of the License, or
12 *   (at your option) any later version.
13 *
14 *   This program is distributed in the hope that it will be useful,
15 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *   GNU General Public License for more details.
18 *
19 *   You should have received a copy of the GNU General Public License
20 *   along with this program; if not, write to the Free Software
21 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22 *
23 */
24
25struct snd_pcm_oss_setup {
26	char *task_name;
27	unsigned int disable:1,
28		     direct:1,
29		     block:1,
30		     nonblock:1,
31		     partialfrag:1,
32		     nosilence:1,
33		     buggyptr:1;
34	unsigned int periods;
35	unsigned int period_size;
36	struct snd_pcm_oss_setup *next;
37};
38
39struct snd_pcm_oss_runtime {
40	unsigned params: 1,			/* format/parameter change */
41		 prepare: 1,			/* need to prepare the operation */
42		 trigger: 1,			/* trigger flag */
43		 sync_trigger: 1;		/* sync trigger flag */
44	int rate;				/* requested rate */
45	int format;				/* requested OSS format */
46	unsigned int channels;			/* requested channels */
47	unsigned int fragshift;
48	unsigned int maxfrags;
49	unsigned int subdivision;		/* requested subdivision */
50	size_t period_bytes;			/* requested period size */
51	size_t period_frames;			/* period frames for poll */
52	size_t period_ptr;			/* actual write pointer to period */
53	unsigned int periods;
54	size_t buffer_bytes;			/* requested buffer size */
55	size_t bytes;				/* total # bytes processed */
56	size_t mmap_bytes;
57	char *buffer;				/* vmallocated period */
58	size_t buffer_used;			/* used length from period buffer */
59	struct mutex params_lock;
 
60#ifdef CONFIG_SND_PCM_OSS_PLUGINS
61	struct snd_pcm_plugin *plugin_first;
62	struct snd_pcm_plugin *plugin_last;
63#endif
64	unsigned int prev_hw_ptr_period;
65};
66
67struct snd_pcm_oss_file {
68	struct snd_pcm_substream *streams[2];
69};
70
71struct snd_pcm_oss_substream {
72	unsigned oss: 1;			/* oss mode */
73	struct snd_pcm_oss_setup setup;		/* active setup */
74};
75
76struct snd_pcm_oss_stream {
77	struct snd_pcm_oss_setup *setup_list;	/* setup list */
78	struct mutex setup_mutex;
79#ifdef CONFIG_SND_VERBOSE_PROCFS
80	struct snd_info_entry *proc_entry;
81#endif
82};
83
84struct snd_pcm_oss {
85	int reg;
86	unsigned int reg_mask;
87};
88
89#endif /* __SOUND_PCM_OSS_H */
v6.8
 1/* SPDX-License-Identifier: GPL-2.0-or-later */
 2#ifndef __SOUND_PCM_OSS_H
 3#define __SOUND_PCM_OSS_H
 4
 5/*
 6 *  Digital Audio (PCM) - OSS compatibility abstract layer
 7 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 8 */
 9
10struct snd_pcm_oss_setup {
11	char *task_name;
12	unsigned int disable:1,
13		     direct:1,
14		     block:1,
15		     nonblock:1,
16		     partialfrag:1,
17		     nosilence:1,
18		     buggyptr:1;
19	unsigned int periods;
20	unsigned int period_size;
21	struct snd_pcm_oss_setup *next;
22};
23
24struct snd_pcm_oss_runtime {
25	unsigned params: 1,			/* format/parameter change */
26		 prepare: 1,			/* need to prepare the operation */
27		 trigger: 1,			/* trigger flag */
28		 sync_trigger: 1;		/* sync trigger flag */
29	int rate;				/* requested rate */
30	int format;				/* requested OSS format */
31	unsigned int channels;			/* requested channels */
32	unsigned int fragshift;
33	unsigned int maxfrags;
34	unsigned int subdivision;		/* requested subdivision */
35	size_t period_bytes;			/* requested period size */
36	size_t period_frames;			/* period frames for poll */
37	size_t period_ptr;			/* actual write pointer to period */
38	unsigned int periods;
39	size_t buffer_bytes;			/* requested buffer size */
40	size_t bytes;				/* total # bytes processed */
41	size_t mmap_bytes;
42	char *buffer;				/* vmallocated period */
43	size_t buffer_used;			/* used length from period buffer */
44	struct mutex params_lock;
45	atomic_t rw_ref;		/* concurrent read/write accesses */
46#ifdef CONFIG_SND_PCM_OSS_PLUGINS
47	struct snd_pcm_plugin *plugin_first;
48	struct snd_pcm_plugin *plugin_last;
49#endif
50	unsigned int prev_hw_ptr_period;
51};
52
53struct snd_pcm_oss_file {
54	struct snd_pcm_substream *streams[2];
55};
56
57struct snd_pcm_oss_substream {
58	unsigned oss: 1;			/* oss mode */
59	struct snd_pcm_oss_setup setup;		/* active setup */
60};
61
62struct snd_pcm_oss_stream {
63	struct snd_pcm_oss_setup *setup_list;	/* setup list */
64	struct mutex setup_mutex;
65#ifdef CONFIG_SND_VERBOSE_PROCFS
66	struct snd_info_entry *proc_entry;
67#endif
68};
69
70struct snd_pcm_oss {
71	int reg;
72	unsigned int reg_mask;
73};
74
75#endif /* __SOUND_PCM_OSS_H */