hwdep.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /**
  2. * \file include/hwdep.h
  3. * \brief Application interface library for the ALSA driver
  4. * \author Jaroslav Kysela <perex@perex.cz>
  5. * \author Abramo Bagnara <abramo@alsa-project.org>
  6. * \author Takashi Iwai <tiwai@suse.de>
  7. * \date 1998-2001
  8. *
  9. * Application interface library for the ALSA driver
  10. */
  11. /*
  12. * This library is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU Lesser General Public License as
  14. * published by the Free Software Foundation; either version 2.1 of
  15. * the License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Lesser General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Lesser General Public
  23. * License along with this library; if not, write to the Free Software
  24. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  25. *
  26. */
  27. #ifndef __ALSA_HWDEP_H
  28. #define __ALSA_HWDEP_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /**
  33. * \defgroup HwDep Hardware Dependant Interface
  34. * The Hardware Dependant Interface.
  35. * \{
  36. */
  37. /** dlsym version for interface entry callback */
  38. #define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_001
  39. /** HwDep information container */
  40. typedef struct _snd_hwdep_info snd_hwdep_info_t;
  41. /** HwDep DSP status container */
  42. typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
  43. /** HwDep DSP image container */
  44. typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
  45. /** HwDep interface */
  46. typedef enum _snd_hwdep_iface {
  47. SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */
  48. SND_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */
  49. SND_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */
  50. SND_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */
  51. SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */
  52. SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */
  53. SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */
  54. SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */
  55. SND_HWDEP_IFACE_VX, /**< Digigram VX cards */
  56. SND_HWDEP_IFACE_MIXART, /**< Digigram miXart cards */
  57. SND_HWDEP_IFACE_USX2Y, /**< Tascam US122, US224 & US428 usb */
  58. SND_HWDEP_IFACE_EMUX_WAVETABLE, /**< EmuX wavetable */
  59. SND_HWDEP_IFACE_BLUETOOTH, /**< Bluetooth audio */
  60. SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */
  61. SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */
  62. SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */
  63. SND_HWDEP_IFACE_HDA, /**< HD-audio */
  64. SND_HWDEP_IFACE_USB_STREAM, /**< direct access to usb stream */
  65. SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */
  66. SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */
  67. SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */
  68. SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */
  69. SND_HWDEP_IFACE_FW_DIGI00X, /* Digidesign Digi 002/003 family */
  70. SND_HWDEP_IFACE_FW_TASCAM, /* TASCAM FireWire series */
  71. SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_TASCAM /**< last known hwdep interface */
  72. } snd_hwdep_iface_t;
  73. /** open for reading */
  74. #define SND_HWDEP_OPEN_READ (O_RDONLY)
  75. /** open for writing */
  76. #define SND_HWDEP_OPEN_WRITE (O_WRONLY)
  77. /** open for reading and writing */
  78. #define SND_HWDEP_OPEN_DUPLEX (O_RDWR)
  79. /** open mode flag: open in nonblock mode */
  80. #define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK)
  81. /** HwDep handle type */
  82. typedef enum _snd_hwdep_type {
  83. /** Kernel level HwDep */
  84. SND_HWDEP_TYPE_HW,
  85. /** Shared memory client HwDep (not yet implemented) */
  86. SND_HWDEP_TYPE_SHM,
  87. /** INET client HwDep (not yet implemented) */
  88. SND_HWDEP_TYPE_INET
  89. } snd_hwdep_type_t;
  90. /** HwDep handle */
  91. typedef struct _snd_hwdep snd_hwdep_t;
  92. int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode);
  93. int snd_hwdep_close(snd_hwdep_t *hwdep);
  94. int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space);
  95. int snd_hwdep_poll_descriptors_count(snd_hwdep_t *hwdep);
  96. int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents);
  97. int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock);
  98. int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info);
  99. int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status);
  100. int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block);
  101. int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg);
  102. ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size);
  103. ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size);
  104. size_t snd_hwdep_info_sizeof(void);
  105. /** allocate #snd_hwdep_info_t container on stack */
  106. #define snd_hwdep_info_alloca(ptr) __snd_alloca(ptr, snd_hwdep_info)
  107. int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr);
  108. void snd_hwdep_info_free(snd_hwdep_info_t *obj);
  109. void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src);
  110. unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj);
  111. int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj);
  112. const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj);
  113. const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj);
  114. snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj);
  115. void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val);
  116. size_t snd_hwdep_dsp_status_sizeof(void);
  117. /** allocate #snd_hwdep_dsp_status_t container on stack */
  118. #define snd_hwdep_dsp_status_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_status)
  119. int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr);
  120. void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj);
  121. void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src);
  122. unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj);
  123. const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj);
  124. unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj);
  125. unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj);
  126. unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj);
  127. size_t snd_hwdep_dsp_image_sizeof(void);
  128. /** allocate #snd_hwdep_dsp_image_t container on stack */
  129. #define snd_hwdep_dsp_image_alloca(ptr) __snd_alloca(ptr, snd_hwdep_dsp_image)
  130. int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr);
  131. void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj);
  132. void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src);
  133. unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj);
  134. const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj);
  135. const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj);
  136. size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj);
  137. void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int _index);
  138. void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name);
  139. void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer);
  140. void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length);
  141. /** \} */
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145. #endif /* __ALSA_HWDEP_H */