mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-10-29 05:40:25 -04:00 
			
		
		
		
	The main header file is not dependant on asound.h from driver.
This commit is contained in:
		
							parent
							
								
									4747044abf
								
							
						
					
					
						commit
						79531a4eb0
					
				
					 15 changed files with 242 additions and 378 deletions
				
			
		|  | @ -38,58 +38,82 @@ typedef struct _snd_ctl_event snd_ctl_event_t; | ||||||
| /** CTL element type */ | /** CTL element type */ | ||||||
| typedef enum _snd_ctl_elem_type { | typedef enum _snd_ctl_elem_type { | ||||||
| 	/** Invalid type */ | 	/** Invalid type */ | ||||||
| 	SND_CTL_ELEM_TYPE_NONE = SNDRV_CTL_ELEM_TYPE_NONE, | 	SND_CTL_ELEM_TYPE_NONE = 0, | ||||||
| 	/** Boolean contents */ | 	/** Boolean contents */ | ||||||
| 	SND_CTL_ELEM_TYPE_BOOLEAN = SNDRV_CTL_ELEM_TYPE_BOOLEAN, | 	SND_CTL_ELEM_TYPE_BOOLEAN, | ||||||
| 	/** Integer contents */ | 	/** Integer contents */ | ||||||
| 	SND_CTL_ELEM_TYPE_INTEGER = SNDRV_CTL_ELEM_TYPE_INTEGER, | 	SND_CTL_ELEM_TYPE_INTEGER, | ||||||
| 	/** Enumerated contents */ | 	/** Enumerated contents */ | ||||||
| 	SND_CTL_ELEM_TYPE_ENUMERATED = SNDRV_CTL_ELEM_TYPE_ENUMERATED, | 	SND_CTL_ELEM_TYPE_ENUMERATED, | ||||||
| 	/** Bytes contents */ | 	/** Bytes contents */ | ||||||
| 	SND_CTL_ELEM_TYPE_BYTES = SNDRV_CTL_ELEM_TYPE_BYTES, | 	SND_CTL_ELEM_TYPE_BYTES, | ||||||
| 	/** IEC958 (S/PDIF) setting content */ | 	/** IEC958 (S/PDIF) setting content */ | ||||||
| 	SND_CTL_ELEM_TYPE_IEC958 = SNDRV_CTL_ELEM_TYPE_IEC958, | 	SND_CTL_ELEM_TYPE_IEC958, | ||||||
| 	SND_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_LAST, | 	SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_IEC958, | ||||||
| } snd_ctl_elem_type_t; | } snd_ctl_elem_type_t; | ||||||
| 
 | 
 | ||||||
| /** CTL related interface */ | /** CTL related interface */ | ||||||
| typedef enum _snd_ctl_elem_iface { | typedef enum _snd_ctl_elem_iface { | ||||||
| 	/** Card level */ | 	/** Card level */ | ||||||
| 	SND_CTL_ELEM_IFACE_CARD = SNDRV_CTL_ELEM_IFACE_CARD, | 	SND_CTL_ELEM_IFACE_CARD = 0, | ||||||
| 	/** Hardware dependent device */ | 	/** Hardware dependent device */ | ||||||
| 	SND_CTL_ELEM_IFACE_HWDEP = SNDRV_CTL_ELEM_IFACE_HWDEP, | 	SND_CTL_ELEM_IFACE_HWDEP, | ||||||
| 	/** Mixer */ | 	/** Mixer */ | ||||||
| 	SND_CTL_ELEM_IFACE_MIXER = SNDRV_CTL_ELEM_IFACE_MIXER, | 	SND_CTL_ELEM_IFACE_MIXER, | ||||||
| 	/** PCM */ | 	/** PCM */ | ||||||
| 	SND_CTL_ELEM_IFACE_PCM = SNDRV_CTL_ELEM_IFACE_PCM, | 	SND_CTL_ELEM_IFACE_PCM, | ||||||
| 	/** RawMidi */ | 	/** RawMidi */ | ||||||
| 	SND_CTL_ELEM_IFACE_RAWMIDI = SNDRV_CTL_ELEM_IFACE_RAWMIDI, | 	SND_CTL_ELEM_IFACE_RAWMIDI, | ||||||
| 	/** Timer */ | 	/** Timer */ | ||||||
| 	SND_CTL_ELEM_IFACE_TIMER = SNDRV_CTL_ELEM_IFACE_TIMER, | 	SND_CTL_ELEM_IFACE_TIMER, | ||||||
| 	/** Sequencer */ | 	/** Sequencer */ | ||||||
| 	SND_CTL_ELEM_IFACE_SEQUENCER = SNDRV_CTL_ELEM_IFACE_SEQUENCER, | 	SND_CTL_ELEM_IFACE_SEQUENCER, | ||||||
| 	SND_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_LAST, | 	SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER, | ||||||
| } snd_ctl_elem_iface_t; | } snd_ctl_elem_iface_t; | ||||||
| 
 | 
 | ||||||
| /** Event class */ | /** Event class */ | ||||||
| typedef enum _snd_ctl_event_type { | typedef enum _snd_ctl_event_type { | ||||||
| 	/** Elements related event */ | 	/** Elements related event */ | ||||||
| 	SND_CTL_EVENT_ELEM = SNDRV_CTL_EVENT_ELEM, | 	SND_CTL_EVENT_ELEM = 0, | ||||||
| 	SND_CTL_EVENT_LAST = SNDRV_CTL_EVENT_LAST, | 	SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM, | ||||||
| }snd_ctl_event_type_t; | }snd_ctl_event_type_t; | ||||||
| 
 | 
 | ||||||
| /** Element has been removed (Warning: test this first and if set don't
 | /** Element has been removed (Warning: test this first and if set don't
 | ||||||
|  * test the other masks) \hideinitializer */ |   * test the other masks) \hideinitializer */ | ||||||
| #define SND_CTL_EVENT_MASK_REMOVE SNDRV_CTL_EVENT_MASK_REMOVE | #define SND_CTL_EVENT_MASK_REMOVE 	(~0U) | ||||||
| /** Element has been added \hideinitializer */ |  | ||||||
| #define SND_CTL_EVENT_MASK_ADD SNDRV_CTL_EVENT_MASK_ADD |  | ||||||
| /** Element info has been changed \hideinitializer */ |  | ||||||
| #define SND_CTL_EVENT_MASK_INFO SNDRV_CTL_EVENT_MASK_INFO |  | ||||||
| /** Element value has been changed \hideinitializer */ | /** Element value has been changed \hideinitializer */ | ||||||
| #define SND_CTL_EVENT_MASK_VALUE SNDRV_CTL_EVENT_MASK_VALUE | #define SND_CTL_EVENT_MASK_VALUE	(1<<0) | ||||||
|  | /** Element info has been changed \hideinitializer */ | ||||||
|  | #define SND_CTL_EVENT_MASK_INFO		(1<<1) | ||||||
|  | /** Element has been added \hideinitializer */ | ||||||
|  | #define SND_CTL_EVENT_MASK_ADD		(1<<2) | ||||||
| 
 | 
 | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_NONE				"" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_PLAYBACK				"Playback " | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_CAPTURE				"Capture " | ||||||
|  | 
 | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_NONE			"" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_SWITCH			"Switch" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_VOLUME			"Volume" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_DEFAULT			"Default" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_MASK			"Mask" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_CON_MASK			"Con Mask" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_PRO_MASK			"Pro Mask" | ||||||
|  | /** CTL name helper */ | ||||||
|  | #define SND_CTL_NAME_IEC958_PCM_STREAM			"PCM Stream" | ||||||
| /** Element name for IEC958 (S/PDIF) */ | /** Element name for IEC958 (S/PDIF) */ | ||||||
| #define SND_CTL_NAME_IEC958 SNDRV_CTL_NAME_IEC958 | #define SND_CTL_NAME_IEC958(expl,direction,what)	"IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /** CTL type */ | /** CTL type */ | ||||||
| typedef enum _snd_ctl_type { | typedef enum _snd_ctl_type { | ||||||
|  |  | ||||||
|  | @ -4,16 +4,6 @@ | ||||||
|  *  \{ |  *  \{ | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #ifdef SNDRV_LITTLE_ENDIAN |  | ||||||
| #define SND_LITTLE_ENDIAN SNDRV_LITTLE_ENDIAN |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| #ifdef SNDRV_BIG_ENDIAN |  | ||||||
| #define SND_BIG_ENDIAN SNDRV_BIG_ENDIAN |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| /** \} */ |  | ||||||
| 
 |  | ||||||
| /** helper macro for SND_DLSYM_BUILD_VERSION */ | /** helper macro for SND_DLSYM_BUILD_VERSION */ | ||||||
| #define __SND_DLSYM_VERSION(name, version) _ ## name ## version | #define __SND_DLSYM_VERSION(name, version) _ ## name ## version | ||||||
| /** build version for versioned dynamic symbol */ | /** build version for versioned dynamic symbol */ | ||||||
|  | @ -34,3 +24,6 @@ int snd_async_add_handler(snd_async_handler_t **handler, int fd, | ||||||
| int snd_async_del_handler(snd_async_handler_t *handler); | int snd_async_del_handler(snd_async_handler_t *handler); | ||||||
| int snd_async_handler_get_fd(snd_async_handler_t *handler); | int snd_async_handler_get_fd(snd_async_handler_t *handler); | ||||||
| void *snd_async_handler_get_callback_private(snd_async_handler_t *handler); | void *snd_async_handler_get_callback_private(snd_async_handler_t *handler); | ||||||
|  | 
 | ||||||
|  | /** \} */ | ||||||
|  | 
 | ||||||
|  |  | ||||||
|  | @ -28,7 +28,6 @@ | ||||||
| #ifndef __ASOUNDLIB_H | #ifndef __ASOUNDLIB_H | ||||||
| #define __ASOUNDLIB_H | #define __ASOUNDLIB_H | ||||||
| 
 | 
 | ||||||
| #include <sound/asound.h> |  | ||||||
| #include <sound/asoundef.h> | #include <sound/asoundef.h> | ||||||
| #include <unistd.h> | #include <unistd.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
|  | @ -36,6 +35,7 @@ | ||||||
| #include <string.h> | #include <string.h> | ||||||
| #include <fcntl.h> | #include <fcntl.h> | ||||||
| #include <assert.h> | #include <assert.h> | ||||||
|  | #include <endian.h> | ||||||
| #include <sys/poll.h> | #include <sys/poll.h> | ||||||
| #include <errno.h> | #include <errno.h> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -19,14 +19,14 @@ typedef struct _snd_hwdep_info snd_hwdep_info_t; | ||||||
| 
 | 
 | ||||||
| /** HwDep interface */ | /** HwDep interface */ | ||||||
| typedef enum _snd_hwdep_iface { | typedef enum _snd_hwdep_iface { | ||||||
| 	SND_HWDEP_IFACE_OPL2 = SNDRV_HWDEP_IFACE_OPL2,		/**< OPL2 raw driver */ | 	SND_HWDEP_IFACE_OPL2 = 0,	/**< OPL2 raw driver */ | ||||||
| 	SND_HWDEP_IFACE_OPL3 = SNDRV_HWDEP_IFACE_OPL3,		/**< OPL3 raw driver */ | 	SND_HWDEP_IFACE_OPL3,		/**< OPL3 raw driver */ | ||||||
| 	SND_HWDEP_IFACE_OPL4 = SNDRV_HWDEP_IFACE_OPL4,		/**< OPL4 raw driver */ | 	SND_HWDEP_IFACE_OPL4,		/**< OPL4 raw driver */ | ||||||
| 	SND_HWDEP_IFACE_SB16CSP = SNDRV_HWDEP_IFACE_SB16CSP,	/**< SB16CSP driver */ | 	SND_HWDEP_IFACE_SB16CSP,	/**< SB16CSP driver */ | ||||||
| 	SND_HWDEP_IFACE_EMU10K1 = SNDRV_HWDEP_IFACE_EMU10K1,	/**< EMU10K1 driver */ | 	SND_HWDEP_IFACE_EMU10K1,	/**< EMU10K1 driver */ | ||||||
| 	SND_HWDEP_IFACE_YSS225 = SNDRV_HWDEP_IFACE_YSS225,	/**< YSS225 driver */ | 	SND_HWDEP_IFACE_YSS225,		/**< YSS225 driver */ | ||||||
| 	SND_HWDEP_IFACE_ICS2115 = SNDRV_HWDEP_IFACE_ICS2115,	/**< ICS2115 driver */ | 	SND_HWDEP_IFACE_ICS2115,	/**< ICS2115 driver */ | ||||||
| 	SND_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_LAST,		/**< last know hwdep interface */ | 	SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_ICS2115,  /**< last know hwdep interface */ | ||||||
| } snd_hwdep_iface_t; | } snd_hwdep_iface_t; | ||||||
| 
 | 
 | ||||||
| /** open for reading */ | /** open for reading */ | ||||||
|  |  | ||||||
|  | @ -62,45 +62,48 @@ void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val); | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| /** instrument types */ | /** instrument types */ | ||||||
| #define SND_SEQ_INSTR_ATYPE_DATA	SNDRV_SEQ_INSTR_ATYPE_DATA	/**< instrument data */ | #define SND_SEQ_INSTR_ATYPE_DATA	0	/**< instrument data */ | ||||||
| #define SND_SEQ_INSTR_ATYPE_ALIAS	SNDRV_SEQ_INSTR_ATYPE_ALIAS	/**< instrument alias */ | #define SND_SEQ_INSTR_ATYPE_ALIAS	1	/**< instrument alias */ | ||||||
| 
 | 
 | ||||||
| /** instrument ASCII identifiers */ | /** instrument ASCII identifiers */ | ||||||
| #define SND_SEQ_INSTR_ID_DLS1		SNDRV_SEQ_INSTR_ID_DLS1		/**< DLS1 */ | #define SND_SEQ_INSTR_ID_DLS1		"DLS1"		/**< DLS1 */ | ||||||
| #define SND_SEQ_INSTR_ID_DLS2		SNDRV_SEQ_INSTR_ID_DLS2		/**< DLS2 */ | #define SND_SEQ_INSTR_ID_DLS2		"DLS2"		/**< DLS2 */ | ||||||
| #define SND_SEQ_INSTR_ID_SIMPLE		SNDRV_SEQ_INSTR_ID_SIMPLE	/**< Simple Wave */ | #define SND_SEQ_INSTR_ID_SIMPLE		"Simple Wave"	/**< Simple Wave */ | ||||||
| #define SND_SEQ_INSTR_ID_SOUNDFONT	SNDRV_SEQ_INSTR_ID_SOUNDFONT	/**< SoundFont */ | #define SND_SEQ_INSTR_ID_SOUNDFONT	"SoundFont"	/**< SoundFont */ | ||||||
| #define SND_SEQ_INSTR_ID_GUS_PATCH	SNDRV_SEQ_INSTR_ID_GUS_PATCH	/**< Gravis Patch */ | #define SND_SEQ_INSTR_ID_GUS_PATCH	"GUS Patch"	/**< Gravis Patch */ | ||||||
| #define SND_SEQ_INSTR_ID_INTERWAVE	SNDRV_SEQ_INSTR_ID_INTERWAVE	/**< InterWave FFFF */ | #define SND_SEQ_INSTR_ID_INTERWAVE	"Interwave FFFF" /**< InterWave FFFF */ | ||||||
| #define SND_SEQ_INSTR_ID_OPL2_3		SNDRV_SEQ_INSTR_ID_OPL2_3	/**< OPL2/3 FM */ | #define SND_SEQ_INSTR_ID_OPL2_3		"OPL2/3 FM"	/**< OPL2/3 FM */ | ||||||
| #define SND_SEQ_INSTR_ID_OPL4		SNDRV_SEQ_INSTR_ID_OPL4		/**< OPL4 */ | #define SND_SEQ_INSTR_ID_OPL4		"OPL4"		/**< OPL4 */ | ||||||
| 
 | 
 | ||||||
| /** instrument types */ | /** instrument types */ | ||||||
| #define SND_SEQ_INSTR_TYPE0_DLS1	SNDRV_SEQ_INSTR_TYPE0_DLS1	/**< MIDI DLS v1 */ | #define SND_SEQ_INSTR_TYPE0_DLS1	(1<<0)		/**< MIDI DLS v1 */ | ||||||
| #define SND_SEQ_INSTR_TYPE0_DLS2	SNDRV_SEQ_INSTR_TYPE0_DLS2	/**< MIDI DLS v2 */ | #define SND_SEQ_INSTR_TYPE0_DLS2	(1<<1)		/**< MIDI DLS v2 */ | ||||||
| #define SND_SEQ_INSTR_TYPE1_SIMPLE	SNDRV_SEQ_INSTR_TYPE1_SIMPLE	/**< Simple Wave */ | #define SND_SEQ_INSTR_TYPE1_SIMPLE	(1<<0)		/**< Simple Wave */ | ||||||
| #define SND_SEQ_INSTR_TYPE1_SOUNDFONT	SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT	/**< EMU SoundFont */ | #define SND_SEQ_INSTR_TYPE1_SOUNDFONT	(1<<1)		/**< EMU SoundFont */ | ||||||
| #define SND_SEQ_INSTR_TYPE1_GUS_PATCH	SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH	/**< Gravis UltraSound Patch */ | #define SND_SEQ_INSTR_TYPE1_GUS_PATCH	(1<<2)		/**< Gravis UltraSound Patch */ | ||||||
| #define SND_SEQ_INSTR_TYPE1_INTERWAVE	SNDRV_SEQ_INSTR_TYPE1_INTERWAVE	/**< InterWave FFFF */ | #define SND_SEQ_INSTR_TYPE1_INTERWAVE	(1<<3)		/**< InterWave FFFF */ | ||||||
| #define SND_SEQ_INSTR_TYPE2_OPL2_3	SNDRV_SEQ_INSTR_TYPE2_OPL2_3	/**< Yamaha OPL2/3 FM */ | #define SND_SEQ_INSTR_TYPE2_OPL2_3	(1<<0)		/**< Yamaha OPL2/3 FM */ | ||||||
| #define SND_SEQ_INSTR_TYPE2_OPL4	SNDRV_SEQ_INSTR_TYPE2_OPL4	/**< Yamaha OPL4 */ | #define SND_SEQ_INSTR_TYPE2_OPL4	(1<<1)		/**< Yamaha OPL4 */ | ||||||
| 
 | 
 | ||||||
| /** put commands */ | /** put commands */ | ||||||
| #define SND_SEQ_INSTR_PUT_CMD_CREATE	SNDRV_SEQ_INSTR_PUT_CMD_CREATE	/**< create a new layer */ | #define SND_SEQ_INSTR_PUT_CMD_CREATE	0	/**< create a new layer */ | ||||||
| #define SND_SEQ_INSTR_PUT_CMD_REPLACE	SNDRV_SEQ_INSTR_PUT_CMD_REPLACE	/**< replace the old layer with new one */ | #define SND_SEQ_INSTR_PUT_CMD_REPLACE	1	/**< replace the old layer with new one */ | ||||||
| #define SND_SEQ_INSTR_PUT_CMD_MODIFY	SNDRV_SEQ_INSTR_PUT_CMD_MODIFY	/**< modify the existing layer */ | #define SND_SEQ_INSTR_PUT_CMD_MODIFY	2	/**< modify the existing layer */ | ||||||
| #define SND_SEQ_INSTR_PUT_CMD_ADD	SNDRV_SEQ_INSTR_PUT_CMD_ADD	/**< add one to the existing layer */ | #define SND_SEQ_INSTR_PUT_CMD_ADD	3	/**< add one to the existing layer */ | ||||||
| #define SND_SEQ_INSTR_PUT_CMD_REMOVE	SNDRV_SEQ_INSTR_PUT_CMD_REMOVE	/**< remove the layer */ | #define SND_SEQ_INSTR_PUT_CMD_REMOVE	4	/**< remove the layer */ | ||||||
| 
 | 
 | ||||||
| /** get commands */ | /** get commands */ | ||||||
| #define SND_SEQ_INSTR_GET_CMD_FULL	SNDRV_SEQ_INSTR_GET_CMD_FULL	/**< get the full data stream */ | #define SND_SEQ_INSTR_GET_CMD_FULL	0	/**< get the full data stream */ | ||||||
| #define SND_SEQ_INSTR_GET_CMD_PARTIAL	SNDRV_SEQ_INSTR_GET_CMD_PARTIAL	/**< get the partial data stream */ | #define SND_SEQ_INSTR_GET_CMD_PARTIAL	1	/**< get the partial data stream */ | ||||||
|  | 
 | ||||||
|  | /* query flags */ | ||||||
|  | #define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) | ||||||
| 
 | 
 | ||||||
| /** free commands */ | /** free commands */ | ||||||
| #define SND_SEQ_INSTR_FREE_CMD_ALL	SNDRV_SEQ_INSTR_FREE_CMD_ALL	/**< remove all matching instruments */ | #define SND_SEQ_INSTR_FREE_CMD_ALL	0	/**< remove all matching instruments */ | ||||||
| #define SND_SEQ_INSTR_FREE_CMD_PRIVATE	SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE /**< remove only private instruments */ | #define SND_SEQ_INSTR_FREE_CMD_PRIVATE	1	/**< remove only private instruments */ | ||||||
| #define SND_SEQ_INSTR_FREE_CMD_CLUSTER	SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER /**< remove only cluster instruments */ | #define SND_SEQ_INSTR_FREE_CMD_CLUSTER	2	/**< remove only cluster instruments */ | ||||||
| #define SND_SEQ_INSTR_FREE_CMD_SINGLE	SNDRV_SEQ_INSTR_FREE_CMD_SINGLE	/**< remove single instrument */ | #define SND_SEQ_INSTR_FREE_CMD_SINGLE	3	/**< remove single instrument */ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  |  | ||||||
|  | @ -44,7 +44,6 @@ | ||||||
| 
 | 
 | ||||||
| #define _snd_hwdep_info sndrv_hwdep_info | #define _snd_hwdep_info sndrv_hwdep_info | ||||||
| 
 | 
 | ||||||
| #define _SND_SEQ_IN_LOCAL	1 |  | ||||||
| #define _snd_seq_queue_tempo sndrv_seq_queue_tempo | #define _snd_seq_queue_tempo sndrv_seq_queue_tempo | ||||||
| #define _snd_seq_client_info sndrv_seq_client_info | #define _snd_seq_client_info sndrv_seq_client_info | ||||||
| #define _snd_seq_port_info sndrv_seq_port_info | #define _snd_seq_port_info sndrv_seq_port_info | ||||||
|  | @ -58,6 +57,7 @@ | ||||||
| #define _snd_seq_remove_events sndrv_seq_remove_events | #define _snd_seq_remove_events sndrv_seq_remove_events | ||||||
| #define _snd_instr_header sndrv_seq_instr_header | #define _snd_instr_header sndrv_seq_instr_header | ||||||
| 
 | 
 | ||||||
|  | #if 0 | ||||||
| typedef struct sndrv_seq_addr snd_seq_addr_t; | typedef struct sndrv_seq_addr snd_seq_addr_t; | ||||||
| #define snd_seq_tick_time_t sndrv_seq_tick_time_t | #define snd_seq_tick_time_t sndrv_seq_tick_time_t | ||||||
| typedef struct sndrv_seq_real_time snd_seq_real_time_t; | typedef struct sndrv_seq_real_time snd_seq_real_time_t; | ||||||
|  | @ -65,6 +65,7 @@ typedef union sndrv_seq_timestamp snd_seq_timestamp_t; | ||||||
| typedef struct sndrv_seq_instr snd_seq_instr_t; | typedef struct sndrv_seq_instr snd_seq_instr_t; | ||||||
| typedef struct sndrv_seq_event snd_seq_event_t; | typedef struct sndrv_seq_event snd_seq_event_t; | ||||||
| #define snd_seq_instr_cluster_t sndrv_seq_instr_cluster_t | #define snd_seq_instr_cluster_t sndrv_seq_instr_cluster_t | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| #define _snd_timer_id sndrv_timer_id | #define _snd_timer_id sndrv_timer_id | ||||||
| #define _snd_timer_select sndrv_timer_select | #define _snd_timer_select sndrv_timer_select | ||||||
|  | @ -72,6 +73,8 @@ typedef struct sndrv_seq_event snd_seq_event_t; | ||||||
| #define _snd_timer_params sndrv_timer_params | #define _snd_timer_params sndrv_timer_params | ||||||
| #define _snd_timer_status sndrv_timer_status | #define _snd_timer_status sndrv_timer_status | ||||||
| 
 | 
 | ||||||
|  | #include <sound/asound.h> | ||||||
|  | #include <sound/asequencer.h> | ||||||
| #include "asoundlib.h" | #include "asoundlib.h" | ||||||
| #include "list.h" | #include "list.h" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										168
									
								
								include/pcm.h
									
										
									
									
									
								
							
							
						
						
									
										168
									
								
								include/pcm.h
									
										
									
									
									
								
							|  | @ -32,47 +32,47 @@ typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t; | ||||||
| /** PCM class */ | /** PCM class */ | ||||||
| typedef enum _snd_pcm_class { | typedef enum _snd_pcm_class { | ||||||
| 	/** standard device */ | 	/** standard device */ | ||||||
| 	SND_PCM_CLASS_GENERIC = SNDRV_PCM_CLASS_GENERIC, | 	SND_PCM_CLASS_GENERIC = 0, | ||||||
| 	/** multichannel device */ | 	/** multichannel device */ | ||||||
| 	SND_PCM_CLASS_MULTI = SNDRV_PCM_CLASS_MULTI, | 	SND_PCM_CLASS_MULTI, | ||||||
| 	/** software modem device */ | 	/** software modem device */ | ||||||
| 	SND_PCM_CLASS_MODEM = SNDRV_PCM_CLASS_MODEM, | 	SND_PCM_CLASS_MODEM, | ||||||
| 	/** digitizer device */ | 	/** digitizer device */ | ||||||
| 	SND_PCM_CLASS_DIGITIZER = SNDRV_PCM_CLASS_DIGITIZER, | 	SND_PCM_CLASS_DIGITIZER, | ||||||
| 	SND_PCM_CLASS_LAST = SNDRV_PCM_CLASS_LAST, | 	SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER, | ||||||
| } snd_pcm_class_t; | } snd_pcm_class_t; | ||||||
| 
 | 
 | ||||||
| /** PCM subclass */ | /** PCM subclass */ | ||||||
| typedef enum _snd_pcm_subclass { | typedef enum _snd_pcm_subclass { | ||||||
| 	/** subdevices are mixed together */ | 	/** subdevices are mixed together */ | ||||||
| 	SND_PCM_SUBCLASS_GENERIC_MIX = SNDRV_PCM_SUBCLASS_GENERIC_MIX, | 	SND_PCM_SUBCLASS_GENERIC_MIX = 0, | ||||||
| 	/** multichannel subdevices are mixed together */ | 	/** multichannel subdevices are mixed together */ | ||||||
| 	SND_PCM_SUBCLASS_MULTI_MIX = SNDRV_PCM_SUBCLASS_MULTI_MIX, | 	SND_PCM_SUBCLASS_MULTI_MIX, | ||||||
| 	SND_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_LAST, | 	SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX, | ||||||
| } snd_pcm_subclass_t; | } snd_pcm_subclass_t; | ||||||
| 
 | 
 | ||||||
| /** PCM stream (direction) */ | /** PCM stream (direction) */ | ||||||
| typedef enum _snd_pcm_stream { | typedef enum _snd_pcm_stream { | ||||||
| 	/** Playback stream */ | 	/** Playback stream */ | ||||||
| 	SND_PCM_STREAM_PLAYBACK = SNDRV_PCM_STREAM_PLAYBACK, | 	SND_PCM_STREAM_PLAYBACK = 0, | ||||||
| 	/** Capture stream */ | 	/** Capture stream */ | ||||||
| 	SND_PCM_STREAM_CAPTURE = SNDRV_PCM_STREAM_CAPTURE, | 	SND_PCM_STREAM_CAPTURE, | ||||||
| 	SND_PCM_STREAM_LAST = SNDRV_PCM_STREAM_LAST, | 	SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE, | ||||||
| } snd_pcm_stream_t; | } snd_pcm_stream_t; | ||||||
| 
 | 
 | ||||||
| /** PCM access type */ | /** PCM access type */ | ||||||
| typedef enum _snd_pcm_access { | typedef enum _snd_pcm_access { | ||||||
| 	/** mmap access with simple interleaved channels */ | 	/** mmap access with simple interleaved channels */ | ||||||
| 	SND_PCM_ACCESS_MMAP_INTERLEAVED = SNDRV_PCM_ACCESS_MMAP_INTERLEAVED, | 	SND_PCM_ACCESS_MMAP_INTERLEAVED = 0, | ||||||
| 	/** mmap access with simple non interleaved channels */ | 	/** mmap access with simple non interleaved channels */ | ||||||
| 	SND_PCM_ACCESS_MMAP_NONINTERLEAVED = SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, | 	SND_PCM_ACCESS_MMAP_NONINTERLEAVED, | ||||||
| 	/** mmap access with complex placement */ | 	/** mmap access with complex placement */ | ||||||
| 	SND_PCM_ACCESS_MMAP_COMPLEX = SNDRV_PCM_ACCESS_MMAP_COMPLEX, | 	SND_PCM_ACCESS_MMAP_COMPLEX, | ||||||
| 	/** snd_pcm_readi/snd_pcm_writei access */ | 	/** snd_pcm_readi/snd_pcm_writei access */ | ||||||
| 	SND_PCM_ACCESS_RW_INTERLEAVED = SNDRV_PCM_ACCESS_RW_INTERLEAVED, | 	SND_PCM_ACCESS_RW_INTERLEAVED, | ||||||
| 	/** snd_pcm_readn/snd_pcm_writen access */ | 	/** snd_pcm_readn/snd_pcm_writen access */ | ||||||
| 	SND_PCM_ACCESS_RW_NONINTERLEAVED = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, | 	SND_PCM_ACCESS_RW_NONINTERLEAVED, | ||||||
| 	SND_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_LAST, | 	SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED, | ||||||
| } snd_pcm_access_t; | } snd_pcm_access_t; | ||||||
| 
 | 
 | ||||||
| /** PCM sample format */ | /** PCM sample format */ | ||||||
|  | @ -80,129 +80,153 @@ typedef enum _snd_pcm_format { | ||||||
| 	/** Unknown */ | 	/** Unknown */ | ||||||
| 	SND_PCM_FORMAT_UNKNOWN = -1, | 	SND_PCM_FORMAT_UNKNOWN = -1, | ||||||
| 	/** Signed 8 bit */ | 	/** Signed 8 bit */ | ||||||
| 	SND_PCM_FORMAT_S8 = SNDRV_PCM_FORMAT_S8, | 	SND_PCM_FORMAT_S8 = 0, | ||||||
| 	/** Unsigned 8 bit */ | 	/** Unsigned 8 bit */ | ||||||
| 	SND_PCM_FORMAT_U8 = SNDRV_PCM_FORMAT_U8, | 	SND_PCM_FORMAT_U8, | ||||||
| 	/** Signed 16 bit Little Endian */ | 	/** Signed 16 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_S16_LE = SNDRV_PCM_FORMAT_S16_LE, | 	SND_PCM_FORMAT_S16_LE, | ||||||
| 	/** Signed 16 bit Big Endian */ | 	/** Signed 16 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_S16_BE = SNDRV_PCM_FORMAT_S16_BE, | 	SND_PCM_FORMAT_S16_BE, | ||||||
| 	/** Unsigned 16 bit Little Endian */ | 	/** Unsigned 16 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_U16_LE = SNDRV_PCM_FORMAT_U16_LE, | 	SND_PCM_FORMAT_U16_LE, | ||||||
| 	/** Unsigned 16 bit Big Endian */ | 	/** Unsigned 16 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_U16_BE = SNDRV_PCM_FORMAT_U16_BE, | 	SND_PCM_FORMAT_U16_BE, | ||||||
| 	/** Signed 24 bit Little Endian */ | 	/** Signed 24 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_S24_LE = SNDRV_PCM_FORMAT_S24_LE, | 	SND_PCM_FORMAT_S24_LE, | ||||||
| 	/** Signed 24 bit Big Endian */ | 	/** Signed 24 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_S24_BE = SNDRV_PCM_FORMAT_S24_BE, | 	SND_PCM_FORMAT_S24_BE, | ||||||
| 	/** Unsigned 24 bit Little Endian */ | 	/** Unsigned 24 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_U24_LE = SNDRV_PCM_FORMAT_U24_LE, | 	SND_PCM_FORMAT_U24_LE, | ||||||
| 	/** Unsigned 24 bit Big Endian */ | 	/** Unsigned 24 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_U24_BE = SNDRV_PCM_FORMAT_U24_BE, | 	SND_PCM_FORMAT_U24_BE, | ||||||
| 	/** Signed 32 bit Little Endian */ | 	/** Signed 32 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_S32_LE = SNDRV_PCM_FORMAT_S32_LE, | 	SND_PCM_FORMAT_S32_LE, | ||||||
| 	/** Signed 32 bit Big Endian */ | 	/** Signed 32 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_S32_BE = SNDRV_PCM_FORMAT_S32_BE, | 	SND_PCM_FORMAT_S32_BE, | ||||||
| 	/** Unsigned 32 bit Little Endian */ | 	/** Unsigned 32 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_U32_LE = SNDRV_PCM_FORMAT_U32_LE, | 	SND_PCM_FORMAT_U32_LE, | ||||||
| 	/** Unsigned 32 bit Big Endian */ | 	/** Unsigned 32 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_U32_BE = SNDRV_PCM_FORMAT_U32_BE, | 	SND_PCM_FORMAT_U32_BE, | ||||||
| 	/** Float 32 bit Little Endian */ | 	/** Float 32 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT_LE = SNDRV_PCM_FORMAT_FLOAT_LE, | 	SND_PCM_FORMAT_FLOAT_LE, | ||||||
| 	/** Float 32 bit Big Endian */ | 	/** Float 32 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT_BE = SNDRV_PCM_FORMAT_FLOAT_BE, | 	SND_PCM_FORMAT_FLOAT_BE, | ||||||
| 	/** Float 64 bit Little Endian */ | 	/** Float 64 bit Little Endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT64_LE = SNDRV_PCM_FORMAT_FLOAT64_LE, | 	SND_PCM_FORMAT_FLOAT64_LE, | ||||||
| 	/** Float 64 bit Big Endian */ | 	/** Float 64 bit Big Endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT64_BE = SNDRV_PCM_FORMAT_FLOAT64_BE, | 	SND_PCM_FORMAT_FLOAT64_BE, | ||||||
| 	/** IEC-958 Little Endian */ | 	/** IEC-958 Little Endian */ | ||||||
| 	SND_PCM_FORMAT_IEC958_SUBFRAME_LE = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, | 	SND_PCM_FORMAT_IEC958_SUBFRAME_LE, | ||||||
| 	/** IEC-958 Big Endian */ | 	/** IEC-958 Big Endian */ | ||||||
| 	SND_PCM_FORMAT_IEC958_SUBFRAME_BE = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, | 	SND_PCM_FORMAT_IEC958_SUBFRAME_BE, | ||||||
| 	/** Mu-Law */ | 	/** Mu-Law */ | ||||||
| 	SND_PCM_FORMAT_MU_LAW = SNDRV_PCM_FORMAT_MU_LAW, | 	SND_PCM_FORMAT_MU_LAW, | ||||||
| 	/** A-Law */ | 	/** A-Law */ | ||||||
| 	SND_PCM_FORMAT_A_LAW = SNDRV_PCM_FORMAT_A_LAW, | 	SND_PCM_FORMAT_A_LAW, | ||||||
| 	/** Ima-ADPCM */ | 	/** Ima-ADPCM */ | ||||||
| 	SND_PCM_FORMAT_IMA_ADPCM = SNDRV_PCM_FORMAT_IMA_ADPCM, | 	SND_PCM_FORMAT_IMA_ADPCM, | ||||||
| 	/** MPEG */ | 	/** MPEG */ | ||||||
| 	SND_PCM_FORMAT_MPEG = SNDRV_PCM_FORMAT_MPEG, | 	SND_PCM_FORMAT_MPEG, | ||||||
| 	/** GSM */ | 	/** GSM */ | ||||||
| 	SND_PCM_FORMAT_GSM = SNDRV_PCM_FORMAT_GSM, | 	SND_PCM_FORMAT_GSM, | ||||||
| 	/** Special */ | 	/** Special */ | ||||||
| 	SND_PCM_FORMAT_SPECIAL = SNDRV_PCM_FORMAT_SPECIAL, | 	SND_PCM_FORMAT_SPECIAL = 31, | ||||||
| 	SND_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_LAST, | 	SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_SPECIAL, | ||||||
|  | 
 | ||||||
|  | #if __BYTE_ORDER == __LITTLE_ENDIAN | ||||||
| 	/** Signed 16 bit CPU endian */ | 	/** Signed 16 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16, | 	SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE, | ||||||
| 	/** Unsigned 16 bit CPU endian */ | 	/** Unsigned 16 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16, | 	SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE, | ||||||
| 	/** Signed 24 bit CPU endian */ | 	/** Signed 24 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24, | 	SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE, | ||||||
| 	/** Unsigned 24 bit CPU endian */ | 	/** Unsigned 24 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24, | 	SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE, | ||||||
| 	/** Signed 32 bit CPU endian */ | 	/** Signed 32 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32, | 	SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE, | ||||||
| 	/** Unsigned 32 bit CPU endian */ | 	/** Unsigned 32 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32, | 	SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE, | ||||||
| 	/** Float 32 bit CPU endian */ | 	/** Float 32 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT, | 	SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE, | ||||||
| 	/** Float 64 bit CPU endian */ | 	/** Float 64 bit CPU endian */ | ||||||
| 	SND_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64, | 	SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE, | ||||||
| 	/** IEC-958 CPU Endian */ | 	/** IEC-958 CPU Endian */ | ||||||
| 	SND_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME, | 	SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE, | ||||||
|  | #elif __BYTE_ORDER == __BIG_ENDIAN | ||||||
|  | 	/** Signed 16 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE, | ||||||
|  | 	/** Unsigned 16 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE, | ||||||
|  | 	/** Signed 24 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE, | ||||||
|  | 	/** Unsigned 24 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE, | ||||||
|  | 	/** Signed 32 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE, | ||||||
|  | 	/** Unsigned 32 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE, | ||||||
|  | 	/** Float 32 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE, | ||||||
|  | 	/** Float 64 bit CPU endian */ | ||||||
|  | 	SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE, | ||||||
|  | 	/** IEC-958 CPU Endian */ | ||||||
|  | 	SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE, | ||||||
|  | #else | ||||||
|  | #error "Unknown endian" | ||||||
|  | #endif | ||||||
| } snd_pcm_format_t; | } snd_pcm_format_t; | ||||||
| 
 | 
 | ||||||
| /** PCM sample subformat */ | /** PCM sample subformat */ | ||||||
| typedef enum _snd_pcm_subformat { | typedef enum _snd_pcm_subformat { | ||||||
| 	/** Standard */ | 	/** Standard */ | ||||||
| 	SND_PCM_SUBFORMAT_STD = SNDRV_PCM_SUBFORMAT_STD, | 	SND_PCM_SUBFORMAT_STD = 0, | ||||||
| 	SND_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_LAST, | 	SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD, | ||||||
| } snd_pcm_subformat_t; | } snd_pcm_subformat_t; | ||||||
| 
 | 
 | ||||||
| /** PCM state */ | /** PCM state */ | ||||||
| typedef enum _snd_pcm_state { | typedef enum _snd_pcm_state { | ||||||
| 	/** Open */ | 	/** Open */ | ||||||
| 	SND_PCM_STATE_OPEN = SNDRV_PCM_STATE_OPEN, | 	SND_PCM_STATE_OPEN = 0, | ||||||
| 	/** Setup installed */  | 	/** Setup installed */  | ||||||
| 	SND_PCM_STATE_SETUP = SNDRV_PCM_STATE_SETUP, | 	SND_PCM_STATE_SETUP, | ||||||
| 	/** Ready to start */ | 	/** Ready to start */ | ||||||
| 	SND_PCM_STATE_PREPARED = SNDRV_PCM_STATE_PREPARED, | 	SND_PCM_STATE_PREPARED, | ||||||
| 	/** Running */ | 	/** Running */ | ||||||
| 	SND_PCM_STATE_RUNNING = SNDRV_PCM_STATE_RUNNING, | 	SND_PCM_STATE_RUNNING, | ||||||
| 	/** Stopped: underrun (playback) or overrun (capture) detected */ | 	/** Stopped: underrun (playback) or overrun (capture) detected */ | ||||||
| 	SND_PCM_STATE_XRUN = SNDRV_PCM_STATE_XRUN, | 	SND_PCM_STATE_XRUN, | ||||||
| 	/** Draining: running (playback) or stopped (capture) */ | 	/** Draining: running (playback) or stopped (capture) */ | ||||||
| 	SND_PCM_STATE_DRAINING = SNDRV_PCM_STATE_DRAINING, | 	SND_PCM_STATE_DRAINING, | ||||||
| 	/** Paused */ | 	/** Paused */ | ||||||
| 	SND_PCM_STATE_PAUSED = SNDRV_PCM_STATE_PAUSED, | 	SND_PCM_STATE_PAUSED, | ||||||
| 	SND_PCM_STATE_LAST = SNDRV_PCM_STATE_LAST, | 	SND_PCM_STATE_LAST = SND_PCM_STATE_PAUSED, | ||||||
| } snd_pcm_state_t; | } snd_pcm_state_t; | ||||||
| 
 | 
 | ||||||
| /** PCM start mode */ | /** PCM start mode */ | ||||||
| typedef enum _snd_pcm_start { | typedef enum _snd_pcm_start { | ||||||
| 	/** Automatic start on data read/write */ | 	/** Automatic start on data read/write */ | ||||||
| 	SND_PCM_START_DATA, | 	SND_PCM_START_DATA = 0, | ||||||
| 	/** Explicit start */ | 	/** Explicit start */ | ||||||
| 	SND_PCM_START_EXPLICIT, | 	SND_PCM_START_EXPLICIT, | ||||||
| 	SND_PCM_START_LAST, | 	SND_PCM_START_LAST = SND_PCM_START_EXPLICIT, | ||||||
| } snd_pcm_start_t; | } snd_pcm_start_t; | ||||||
| 
 | 
 | ||||||
| /** PCM xrun mode */ | /** PCM xrun mode */ | ||||||
| typedef enum _snd_pcm_xrun { | typedef enum _snd_pcm_xrun { | ||||||
| 	/** Xrun detection disabled */ | 	/** Xrun detection disabled */ | ||||||
| 	SND_PCM_XRUN_NONE, | 	SND_PCM_XRUN_NONE = 0, | ||||||
| 	/** Stop on xrun detection */ | 	/** Stop on xrun detection */ | ||||||
| 	SND_PCM_XRUN_STOP, | 	SND_PCM_XRUN_STOP, | ||||||
| 	SND_PCM_XRUN_LAST, | 	SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP, | ||||||
| } snd_pcm_xrun_t; | } snd_pcm_xrun_t; | ||||||
| 
 | 
 | ||||||
| /** PCM timestamp mode */ | /** PCM timestamp mode */ | ||||||
| typedef enum _snd_pcm_tstamp { | typedef enum _snd_pcm_tstamp { | ||||||
| 	/** No timestamp */ | 	/** No timestamp */ | ||||||
| 	SND_PCM_TSTAMP_NONE = SNDRV_PCM_TSTAMP_NONE, | 	SND_PCM_TSTAMP_NONE = 0, | ||||||
| 	/** Update mmap'ed timestamp */ | 	/** Update mmap'ed timestamp */ | ||||||
| 	SND_PCM_TSTAMP_MMAP = SNDRV_PCM_TSTAMP_MMAP, | 	SND_PCM_TSTAMP_MMAP, | ||||||
| 	SND_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_LAST, | 	SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP, | ||||||
| } snd_pcm_tstamp_t; | } snd_pcm_tstamp_t; | ||||||
| 
 | 
 | ||||||
| /** Unsigned frames quantity */ | /** Unsigned frames quantity */ | ||||||
|  | @ -223,7 +247,7 @@ typedef struct _snd_pcm snd_pcm_t; | ||||||
| /** PCM type */ | /** PCM type */ | ||||||
| enum _snd_pcm_type { | enum _snd_pcm_type { | ||||||
| 	/** Kernel level PCM */ | 	/** Kernel level PCM */ | ||||||
| 	SND_PCM_TYPE_HW, | 	SND_PCM_TYPE_HW = 0, | ||||||
| 	/** Hooked PCM */ | 	/** Hooked PCM */ | ||||||
| 	SND_PCM_TYPE_HOOKS, | 	SND_PCM_TYPE_HOOKS, | ||||||
| 	/** One ore more linked PCM with exclusive access to selected
 | 	/** One ore more linked PCM with exclusive access to selected
 | ||||||
|  | @ -725,7 +749,7 @@ void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val); | ||||||
| 
 | 
 | ||||||
| /** type of pcm hook */ | /** type of pcm hook */ | ||||||
| typedef enum _snd_pcm_hook_type { | typedef enum _snd_pcm_hook_type { | ||||||
| 	SND_PCM_HOOK_TYPE_HW_PARAMS, | 	SND_PCM_HOOK_TYPE_HW_PARAMS = 0, | ||||||
| 	SND_PCM_HOOK_TYPE_HW_FREE, | 	SND_PCM_HOOK_TYPE_HW_FREE, | ||||||
| 	SND_PCM_HOOK_TYPE_CLOSE, | 	SND_PCM_HOOK_TYPE_CLOSE, | ||||||
| 	SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE, | 	SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE, | ||||||
|  |  | ||||||
|  | @ -24,10 +24,10 @@ typedef struct _snd_rawmidi_status snd_rawmidi_status_t; | ||||||
| /** RawMidi stream (direction) */ | /** RawMidi stream (direction) */ | ||||||
| typedef enum _snd_rawmidi_stream { | typedef enum _snd_rawmidi_stream { | ||||||
| 	/** Output stream */ | 	/** Output stream */ | ||||||
| 	SND_RAWMIDI_STREAM_OUTPUT = SNDRV_RAWMIDI_STREAM_OUTPUT, | 	SND_RAWMIDI_STREAM_OUTPUT = 0, | ||||||
| 	/** Input stream */ | 	/** Input stream */ | ||||||
| 	SND_RAWMIDI_STREAM_INPUT = SNDRV_RAWMIDI_STREAM_INPUT, | 	SND_RAWMIDI_STREAM_INPUT, | ||||||
| 	SND_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_LAST, | 	SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT, | ||||||
| } snd_rawmidi_stream_t; | } snd_rawmidi_stream_t; | ||||||
| 
 | 
 | ||||||
| /** Append \hideinitializer */ | /** Append \hideinitializer */ | ||||||
|  |  | ||||||
|  | @ -210,10 +210,6 @@ enum snd_seq_event_type { | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| #ifdef _SND_SEQ_IN_LOCAL |  | ||||||
| #include <sound/asequencer.h> |  | ||||||
| #else |  | ||||||
| 
 |  | ||||||
| /** Sequencer event address */ | /** Sequencer event address */ | ||||||
| typedef struct snd_seq_addr { | typedef struct snd_seq_addr { | ||||||
| 	unsigned char client;	/**< Client id */ | 	unsigned char client;	/**< Client id */ | ||||||
|  | @ -429,7 +425,5 @@ typedef struct snd_seq_event { | ||||||
| 	} data;				/**< event data... */ | 	} data;				/**< event data... */ | ||||||
| } snd_seq_event_t; | } snd_seq_event_t; | ||||||
| 
 | 
 | ||||||
| #endif /* _SND_SEQ_IN_LOCAL */ |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| /** \} */ | /** \} */ | ||||||
|  |  | ||||||
|  | @ -29,27 +29,27 @@ typedef struct sndrv_timer_read snd_timer_read_t; | ||||||
| 
 | 
 | ||||||
| /** timer master class */ | /** timer master class */ | ||||||
| typedef enum _snd_timer_class { | typedef enum _snd_timer_class { | ||||||
| 	SND_TIMER_CLASS_NONE = SNDRV_TIMER_CLASS_NONE,		/**< invalid */ | 	SND_TIMER_CLASS_NONE = -1,	/**< invalid */ | ||||||
| 	SND_TIMER_CLASS_SLAVE = SNDRV_TIMER_CLASS_SLAVE,	/**< slave timer */ | 	SND_TIMER_CLASS_SLAVE = 0,	/**< slave timer */ | ||||||
| 	SND_TIMER_CLASS_GLOBAL = SNDRV_TIMER_CLASS_GLOBAL,	/**< global timer */ | 	SND_TIMER_CLASS_GLOBAL,		/**< global timer */ | ||||||
| 	SND_TIMER_CLASS_CARD = SNDRV_TIMER_CLASS_CARD,		/**< card timer */ | 	SND_TIMER_CLASS_CARD,		/**< card timer */ | ||||||
| 	SND_TIMER_CLASS_PCM = SNDRV_TIMER_CLASS_PCM,		/**< PCM timer */ | 	SND_TIMER_CLASS_PCM,		/**< PCM timer */ | ||||||
| 	SND_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_LAST,		/**< last timer */ | 	SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM,	/**< last timer */ | ||||||
| } snd_timer_class_t; | } snd_timer_class_t; | ||||||
| 
 | 
 | ||||||
| /** timer slave class */ | /** timer slave class */ | ||||||
| typedef enum _snd_timer_slave_class { | typedef enum _snd_timer_slave_class { | ||||||
| 	SND_TIMER_SCLASS_NONE = SNDRV_TIMER_SCLASS_NONE,		/**< none */ | 	SND_TIMER_SCLASS_NONE = 0,		/**< none */ | ||||||
| 	SND_TIMER_SCLASS_APPLICATION = SNDRV_TIMER_SCLASS_APPLICATION,	/**< for internal use */ | 	SND_TIMER_SCLASS_APPLICATION,		/**< for internal use */ | ||||||
| 	SND_TIMER_SCLASS_SEQUENCER = SNDRV_TIMER_SCLASS_SEQUENCER,	/**< sequencer timer */ | 	SND_TIMER_SCLASS_SEQUENCER,		/**< sequencer timer */ | ||||||
| 	SND_TIMER_SCLASS_OSS_SEQUENCER = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /**< OSS sequencer timer */ | 	SND_TIMER_SCLASS_OSS_SEQUENCER,		/**< OSS sequencer timer */ | ||||||
| 	SND_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_LAST,		/**< last slave timer */ | 	SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER,	/**< last slave timer */ | ||||||
| } snd_timer_slave_class_t; | } snd_timer_slave_class_t; | ||||||
| 
 | 
 | ||||||
| /** global timer - system */ | /** global timer - system */ | ||||||
| #define SND_TIMER_GLOBAL_SYSTEM SNDRV_TIMER_GLOBAL_SYSTEM | #define SND_TIMER_GLOBAL_SYSTEM 0 | ||||||
| /** global timer - RTC */ | /** global timer - RTC */ | ||||||
| #define SND_TIMER_GLOBAL_RTC SNDRV_TIMER_GLOBAL_RTC | #define SND_TIMER_GLOBAL_RTC 	1 | ||||||
| 
 | 
 | ||||||
| /** timer open mode flag - nonblock */ | /** timer open mode flag - nonblock */ | ||||||
| #define SND_TIMER_OPEN_NONBLOCK		1 | #define SND_TIMER_OPEN_NONBLOCK		1 | ||||||
|  | @ -57,7 +57,7 @@ typedef enum _snd_timer_slave_class { | ||||||
| /** timer handle type */ | /** timer handle type */ | ||||||
| typedef enum _snd_timer_type { | typedef enum _snd_timer_type { | ||||||
| 	/** Kernel level HwDep */ | 	/** Kernel level HwDep */ | ||||||
| 	SND_TIMER_TYPE_HW, | 	SND_TIMER_TYPE_HW = 0, | ||||||
| 	/** Shared memory client timer (not yet implemented) */ | 	/** Shared memory client timer (not yet implemented) */ | ||||||
| 	SND_TIMER_TYPE_SHM, | 	SND_TIMER_TYPE_SHM, | ||||||
| 	/** INET client timer (not yet implemented) */ | 	/** INET client timer (not yet implemented) */ | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ enum snd_pcm_plug_route_policy { | ||||||
| 	PLUG_ROUTE_POLICY_NONE, | 	PLUG_ROUTE_POLICY_NONE, | ||||||
| 	PLUG_ROUTE_POLICY_DEFAULT, | 	PLUG_ROUTE_POLICY_DEFAULT, | ||||||
| 	PLUG_ROUTE_POLICY_COPY, | 	PLUG_ROUTE_POLICY_COPY, | ||||||
| 	PLUG_ROUTE_POLICY_SUM, | 	PLUG_ROUTE_POLICY_AVERAGE, | ||||||
| 	PLUG_ROUTE_POLICY_DUP, | 	PLUG_ROUTE_POLICY_DUP, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | @ -263,10 +263,12 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm | ||||||
| 		if (rpolicy == PLUG_ROUTE_POLICY_DEFAULT) { | 		if (rpolicy == PLUG_ROUTE_POLICY_DEFAULT) { | ||||||
| 			rpolicy = PLUG_ROUTE_POLICY_COPY; | 			rpolicy = PLUG_ROUTE_POLICY_COPY; | ||||||
| 			if (pcm->stream == SND_PCM_STREAM_CAPTURE && clt->channels == 1) | 			if (pcm->stream == SND_PCM_STREAM_CAPTURE && clt->channels == 1) | ||||||
| 				rpolicy = PLUG_ROUTE_POLICY_SUM; | 				rpolicy = PLUG_ROUTE_POLICY_AVERAGE; | ||||||
|  | 			if (pcm->stream == SND_PCM_STREAM_PLAYBACK && slv->channels == 1) | ||||||
|  | 				rpolicy = PLUG_ROUTE_POLICY_AVERAGE; | ||||||
| 		} | 		} | ||||||
| 		switch (rpolicy) { | 		switch (rpolicy) { | ||||||
| 		case PLUG_ROUTE_POLICY_SUM: | 		case PLUG_ROUTE_POLICY_AVERAGE: | ||||||
| 		case PLUG_ROUTE_POLICY_DUP: | 		case PLUG_ROUTE_POLICY_DUP: | ||||||
| 			if (clt->channels > slv->channels) { | 			if (clt->channels > slv->channels) { | ||||||
| 				n = clt->channels; | 				n = clt->channels; | ||||||
|  | @ -275,7 +277,7 @@ static int snd_pcm_plug_change_channels(snd_pcm_t *pcm, snd_pcm_t **new, snd_pcm | ||||||
| 			} | 			} | ||||||
| 			while (n-- > 0) { | 			while (n-- > 0) { | ||||||
| 				snd_pcm_route_ttable_entry_t v = FULL; | 				snd_pcm_route_ttable_entry_t v = FULL; | ||||||
| 				if (rpolicy == PLUG_ROUTE_POLICY_SUM) { | 				if (rpolicy == PLUG_ROUTE_POLICY_AVERAGE) { | ||||||
| 					if (pcm->stream == SND_PCM_STREAM_PLAYBACK && | 					if (pcm->stream == SND_PCM_STREAM_PLAYBACK && | ||||||
| 					    clt->channels > slv->channels) { | 					    clt->channels > slv->channels) { | ||||||
| 						int srcs = clt->channels / slv->channels; | 						int srcs = clt->channels / slv->channels; | ||||||
|  | @ -822,8 +824,8 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name, | ||||||
| 				SNDERR("Table is defined, route policy is ignored"); | 				SNDERR("Table is defined, route policy is ignored"); | ||||||
| 			if (!strcmp(str, "default")) | 			if (!strcmp(str, "default")) | ||||||
| 				route_policy = PLUG_ROUTE_POLICY_DEFAULT; | 				route_policy = PLUG_ROUTE_POLICY_DEFAULT; | ||||||
| 			else if (!strcmp(str, "sum")) | 			else if (!strcmp(str, "average")) | ||||||
| 				route_policy = PLUG_ROUTE_POLICY_SUM; | 				route_policy = PLUG_ROUTE_POLICY_AVERAGE; | ||||||
| 			else if (!strcmp(str, "copy")) | 			else if (!strcmp(str, "copy")) | ||||||
| 				route_policy = PLUG_ROUTE_POLICY_COPY; | 				route_policy = PLUG_ROUTE_POLICY_COPY; | ||||||
| 			else if (!strcmp(str, "duplicate")) | 			else if (!strcmp(str, "duplicate")) | ||||||
|  |  | ||||||
|  | @ -902,7 +902,7 @@ int snd_seq_port_info_get_port(const snd_seq_port_info_t *info) | ||||||
| const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info) | const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->addr; | 	return (snd_seq_addr_t *)&info->addr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1034,7 +1034,7 @@ void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port) | ||||||
| void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr) | void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	info->addr = *addr; | 	info->addr = *(struct sndrv_seq_addr *)addr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1308,7 +1308,7 @@ void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_po | ||||||
| const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info) | const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->sender; | 	return (snd_seq_addr_t *)&info->sender; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1319,7 +1319,7 @@ const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subsc | ||||||
| const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info) | const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->dest; | 	return (snd_seq_addr_t *)&info->dest; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1559,7 +1559,7 @@ int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info) | ||||||
| const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info) | const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->root; | 	return (snd_seq_addr_t *)&info->root; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1603,7 +1603,7 @@ int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info) | ||||||
| const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info) | const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->addr; | 	return (snd_seq_addr_t *)&info->addr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -1680,7 +1680,7 @@ void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port) | ||||||
| void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr) | void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	info->root = *addr; | 	info->root = *(struct sndrv_seq_addr *)addr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -2104,7 +2104,7 @@ snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_statu | ||||||
| const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info) | const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->time; | 	return (snd_seq_real_time_t *)&info->time; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -2893,7 +2893,7 @@ int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info) | ||||||
| const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info) | const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->time; | 	return (snd_seq_timestamp_t *)&info->time; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -2904,7 +2904,7 @@ const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_e | ||||||
| const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info) | const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->dest; | 	return (snd_seq_addr_t *)&info->dest; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -2970,7 +2970,7 @@ void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue) | ||||||
| void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time) | void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	info->time = *time; | 	info->time = *(union sndrv_seq_timestamp *)time; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -2981,7 +2981,7 @@ void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq | ||||||
| void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr) | void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	info->dest = *addr; | 	info->dest = *(struct sndrv_seq_addr *)addr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -3020,13 +3020,13 @@ void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag) | ||||||
| 
 | 
 | ||||||
| /* compare timestamp between events */ | /* compare timestamp between events */ | ||||||
| /* return 1 if a >= b; otherwise return 0 */ | /* return 1 if a >= b; otherwise return 0 */ | ||||||
| static inline int snd_seq_compare_tick_time(sndrv_seq_tick_time_t *a, sndrv_seq_tick_time_t *b) | static inline int snd_seq_compare_tick_time(snd_seq_tick_time_t *a, snd_seq_tick_time_t *b) | ||||||
| { | { | ||||||
| 	/* compare ticks */ | 	/* compare ticks */ | ||||||
| 	return (*a >= *b); | 	return (*a >= *b); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static inline int snd_seq_compare_real_time(struct sndrv_seq_real_time *a, struct sndrv_seq_real_time *b) | static inline int snd_seq_compare_real_time(snd_seq_real_time_t *a, snd_seq_real_time_t *b) | ||||||
| { | { | ||||||
| 	/* compare real time */ | 	/* compare real time */ | ||||||
| 	if (a->tv_sec > b->tv_sec) | 	if (a->tv_sec > b->tv_sec) | ||||||
|  | @ -3055,17 +3055,17 @@ static int remove_match(snd_seq_remove_events_t *info, snd_seq_event_t *ev) | ||||||
| 	} | 	} | ||||||
| 	if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_AFTER) { | 	if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_AFTER) { | ||||||
| 		if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) | 		if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) | ||||||
| 			res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); | 			res = snd_seq_compare_tick_time(&ev->time.tick, (snd_seq_tick_time_t *)&info->time.tick); | ||||||
| 		else | 		else | ||||||
| 			res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); | 			res = snd_seq_compare_real_time(&ev->time.time, (snd_seq_real_time_t *)&info->time.time); | ||||||
| 		if (!res) | 		if (!res) | ||||||
| 			return 0; | 			return 0; | ||||||
| 	} | 	} | ||||||
| 	if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_BEFORE) { | 	if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_BEFORE) { | ||||||
| 		if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) | 		if (info->remove_mode & SNDRV_SEQ_REMOVE_TIME_TICK) | ||||||
| 			res = snd_seq_compare_tick_time(&ev->time.tick, &info->time.tick); | 			res = snd_seq_compare_tick_time(&ev->time.tick, (snd_seq_tick_time_t *)&info->time.tick); | ||||||
| 		else | 		else | ||||||
| 			res = snd_seq_compare_real_time(&ev->time.time, &info->time.time); | 			res = snd_seq_compare_real_time(&ev->time.time, (snd_seq_real_time_t *)&info->time.time); | ||||||
| 		if (res) | 		if (res) | ||||||
| 			return 0; | 			return 0; | ||||||
| 	} | 	} | ||||||
|  | @ -3411,7 +3411,7 @@ void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *sr | ||||||
| const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info) | const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->id.instr; | 	return (snd_seq_instr_t *)&info->id.instr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -3488,7 +3488,7 @@ const char *snd_instr_header_get_format(const snd_instr_header_t *info) | ||||||
| const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info) | const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info) | ||||||
| { | { | ||||||
| 	assert(info); | 	assert(info); | ||||||
| 	return &info->data.data.alias; | 	return (snd_seq_instr_t *)&info->data.data.alias; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -3521,7 +3521,7 @@ int snd_instr_header_get_follow_alias(const snd_instr_header_t *info) | ||||||
| void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id) | void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id) | ||||||
| { | { | ||||||
| 	assert(info && id); | 	assert(info && id); | ||||||
| 	info->id.instr = *id; | 	info->id.instr = *(struct sndrv_seq_instr *)id; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  | @ -3598,7 +3598,7 @@ void snd_instr_header_set_format(snd_instr_header_t *info, const char *format) | ||||||
| void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr) | void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr) | ||||||
| { | { | ||||||
| 	assert(info && instr); | 	assert(info && instr); | ||||||
| 	info->data.data.alias = *instr; | 	info->data.data.alias = *(struct sndrv_seq_instr *)instr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /**
 | /**
 | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ | ||||||
|  * \date 2001 |  * \date 2001 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "../../include/asoundlib.h" | #include "local.h" | ||||||
| 
 | 
 | ||||||
| #ifndef DOC_HIDDEN | #ifndef DOC_HIDDEN | ||||||
| #define FIXED_EV(x)	(_SND_SEQ_TYPE(SND_SEQ_EVFLG_FIXED) | _SND_SEQ_TYPE(x)) | #define FIXED_EV(x)	(_SND_SEQ_TYPE(SND_SEQ_EVFLG_FIXED) | _SND_SEQ_TYPE(x)) | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| check_PROGRAMS=control mixer switches pause pcm pcmtest latency seq \ | check_PROGRAMS=control mixer switches pause pcm latency seq \ | ||||||
| 	       playmidi1 timer loopback rawmidi midiloop cardid | 	       playmidi1 timer loopback rawmidi midiloop cardid | ||||||
| 
 | 
 | ||||||
| control_LDADD=../src/libasound.la | control_LDADD=../src/libasound.la | ||||||
|  | @ -6,7 +6,6 @@ mixer_LDADD=../src/libasound.la | ||||||
| switches_LDADD=../src/libasound.la | switches_LDADD=../src/libasound.la | ||||||
| pause_LDADD=../src/libasound.la | pause_LDADD=../src/libasound.la | ||||||
| pcm_LDADD=../src/libasound.la | pcm_LDADD=../src/libasound.la | ||||||
| pcmtest_LDADD=../src/libasound.la |  | ||||||
| latency_LDADD=../src/libasound.la | latency_LDADD=../src/libasound.la | ||||||
| seq_LDADD=../src/libasound.la | seq_LDADD=../src/libasound.la | ||||||
| playmidi1_LDADD=../src/libasound.la | playmidi1_LDADD=../src/libasound.la | ||||||
|  |  | ||||||
							
								
								
									
										178
									
								
								test/pcmtest.c
									
										
									
									
									
								
							
							
						
						
									
										178
									
								
								test/pcmtest.c
									
										
									
									
									
								
							|  | @ -1,178 +0,0 @@ | ||||||
| #include <stdio.h> |  | ||||||
| #include <string.h> |  | ||||||
| #include "../include/asoundlib.h" |  | ||||||
| 
 |  | ||||||
| void info_channel(snd_pcm_t *handle, int channel, char *id) |  | ||||||
| { |  | ||||||
| 	snd_pcm_stream_info_t stream_info; |  | ||||||
| 	int err; |  | ||||||
| 	 |  | ||||||
| 	bzero(&stream_info, sizeof(stream_info)); |  | ||||||
| 	stream_info.channel = channel; |  | ||||||
| 	if ((err = snd_pcm_stream_info(handle, &stream_info))<0) { |  | ||||||
| 		fprintf(stderr, "channel info error: %s\n", snd_strerror(err)); |  | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| 	printf("%s INFO:\n", id); |  | ||||||
| 	printf("  subdevice      : %i\n", stream_info.subdevice); |  | ||||||
| 	printf("  subname        : '%s'\n", stream_info.subname); |  | ||||||
| 	printf("  channel        : %i\n", stream_info.channel); |  | ||||||
| 	printf("  mode           : "); |  | ||||||
| 	switch (stream_info.mode) { |  | ||||||
| 	case SND_PCM_MODE_FRAME: |  | ||||||
| 		printf("frame\n"); |  | ||||||
| 		break; |  | ||||||
| 	case SND_PCM_MODE_FRAGMENT: |  | ||||||
| 		printf("fragment\n"); |  | ||||||
| 		break; |  | ||||||
| 	default: |  | ||||||
| 		printf("unknown\n"); |  | ||||||
| 	} |  | ||||||
| 	printf("  sync           : 0x%x, 0x%x, 0x%x, 0x%x\n", |  | ||||||
| 			stream_info.sync.id32[0], |  | ||||||
| 			stream_info.sync.id32[1], |  | ||||||
| 			stream_info.sync.id32[2], |  | ||||||
| 			stream_info.sync.id32[3]); |  | ||||||
| 	printf("  flags          :"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_MMAP) |  | ||||||
| 		printf(" mmap"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_FRAME) |  | ||||||
| 		printf(" frame"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_FRAGMENT) |  | ||||||
| 		printf(" fragment"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_BATCH) |  | ||||||
| 		printf(" batch"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_INTERLEAVE) |  | ||||||
| 		printf(" interleave"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_NONINTERLEAVE) |  | ||||||
| 		printf(" noninterleave"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_BLOCK_TRANSFER) |  | ||||||
| 		printf(" block_transfer"); |  | ||||||
| 	if (stream_info.flags & SND_PCM_STREAM_INFO_OVERRANGE) |  | ||||||
| 		printf(" overrange"); |  | ||||||
| 	printf("\n"); |  | ||||||
| 	printf("  formats        :"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_MU_LAW) |  | ||||||
| 		printf(" mu-Law"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_A_LAW) |  | ||||||
| 		printf(" a-Law"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_IMA_ADPCM) |  | ||||||
| 		printf(" IMA-ADPCM"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U8) |  | ||||||
| 		printf(" U8"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S16_LE) |  | ||||||
| 		printf(" S16-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S16_BE) |  | ||||||
| 		printf(" S16-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S8) |  | ||||||
| 		printf(" S8"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U16_LE) |  | ||||||
| 		printf(" U16-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U16_BE) |  | ||||||
| 		printf(" U16-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_MPEG) |  | ||||||
| 		printf(" MPEG"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_GSM) |  | ||||||
| 		printf(" GSM"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S24_LE) |  | ||||||
| 		printf(" S24-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S24_BE) |  | ||||||
| 		printf(" S24-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U24_LE) |  | ||||||
| 		printf(" U24-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U24_BE) |  | ||||||
| 		printf(" U24-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S32_LE) |  | ||||||
| 		printf(" S32-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_S32_BE) |  | ||||||
| 		printf(" S32-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U32_LE) |  | ||||||
| 		printf(" U32-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_U32_BE) |  | ||||||
| 		printf(" U32-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_FLOAT) |  | ||||||
| 		printf(" Float"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_FLOAT64) |  | ||||||
| 		printf(" Float64"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_LE) |  | ||||||
| 		printf(" IEC958-LE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_IEC958_SUBFRAME_BE) |  | ||||||
| 		printf(" IEC958-BE"); |  | ||||||
| 	if (stream_info.formats & SND_PCM_FMTBIT_SPECIAL) |  | ||||||
| 		printf(" Special"); |  | ||||||
| 	printf("\n"); |  | ||||||
| 	printf("  rates          :"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_CONTINUOUS) |  | ||||||
| 		printf(" Continuous"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_KNOT) |  | ||||||
| 		printf(" Knot"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_8000) |  | ||||||
| 		printf(" 8000"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_11025) |  | ||||||
| 		printf(" 11025"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_16000) |  | ||||||
| 		printf(" 16000"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_22050) |  | ||||||
| 		printf(" 22050"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_32000) |  | ||||||
| 		printf(" 32000"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_44100) |  | ||||||
| 		printf(" 44100"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_48000) |  | ||||||
| 		printf(" 48000"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_88200) |  | ||||||
| 		printf(" 88200"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_96000) |  | ||||||
| 		printf(" 96000"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_176400) |  | ||||||
| 		printf(" 176400"); |  | ||||||
| 	if (stream_info.rates & SND_PCM_RATE_192000) |  | ||||||
| 		printf(" 192000"); |  | ||||||
| 	printf("\n"); |  | ||||||
| 	printf("  min_rate       : %i\n", stream_info.min_rate); |  | ||||||
| 	printf("  max_rate       : %i\n", stream_info.max_rate); |  | ||||||
| 	printf("  min_channels   : %i\n", stream_info.min_channels); |  | ||||||
| 	printf("  max_channels   : %i\n", stream_info.max_channels); |  | ||||||
| 	printf("  buffer_size    : %i\n", stream_info.buffer_size); |  | ||||||
| 	printf("  min_frag_size  : %i\n", stream_info.min_fragment_size); |  | ||||||
| 	printf("  max_frag_size  : %i\n", stream_info.max_fragment_size); |  | ||||||
| 	printf("  fragment_align : %i\n", stream_info.fragment_align); |  | ||||||
| 	printf("  fifo_size      : %i\n", stream_info.fifo_size); |  | ||||||
| 	printf("  mmap_size      : %li\n", stream_info.mmap_size); |  | ||||||
| 	printf("  mixer_device   : %i\n", stream_info.mixer_device); |  | ||||||
| 	printf("  mixer_eid      : '%s',%i,%i\n", stream_info.mixer_eid.name, stream_info.mixer_eid.index, stream_info.mixer_eid.type); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void info(void) |  | ||||||
| { |  | ||||||
| 	snd_pcm_t *handle; |  | ||||||
| 	snd_pcm_info_t info; |  | ||||||
| 	int err; |  | ||||||
| 
 |  | ||||||
| 	if ((err = snd_pcm_open(&handle, 0, 0, SND_PCM_OPEN_DUPLEX))<0) { |  | ||||||
| 		fprintf(stderr, "open error: %s\n", snd_strerror(err)); |  | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| 	if ((err = snd_pcm_info(handle, &info))<0) { |  | ||||||
| 		fprintf(stderr, "pcm info error: %s\n", snd_strerror(err)); |  | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| 	printf("INFO:\n"); |  | ||||||
| 	printf("  type      : 0x%x\n", info.type); |  | ||||||
| 	printf("  flags     : 0x%x\n", info.flags); |  | ||||||
| 	printf("  id        : '%s'\n", info.id); |  | ||||||
| 	printf("  name      : '%s'\n", info.name); |  | ||||||
| 	printf("  playback  : %i\n", info.playback); |  | ||||||
| 	printf("  capture   : %i\n", info.capture); |  | ||||||
| 	if (info.flags & SND_PCM_INFO_PLAYBACK) |  | ||||||
| 		info_channel(handle, SND_PCM_STREAM_PLAYBACK, "Playback"); |  | ||||||
| 	if (info.flags & SND_PCM_INFO_CAPTURE) |  | ||||||
| 		info_channel(handle, SND_PCM_STREAM_CAPTURE, "Capture"); |  | ||||||
| 	snd_pcm_close(handle); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| int main(void ) |  | ||||||
| { |  | ||||||
| 	info(); |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jaroslav Kysela
						Jaroslav Kysela