QNX Momentics DDK Audio Devices FortargetsrunningQNX Neutrino 6.3.0orlater 2004,QNXSoftwareSystemsLtd. QNXSoftwareSystemsLtd. 175TerenceMatthewsCrescent Kanata,Ontario K2M1W8 Canada Voice:+1613591-0931 Fax:+1613591-3579 Email:[email protected] Web:http://www.qnx.com/ 2001–2004,QNXSoftwareSystemsLtd.Allrightsreserved. Technicalsupportoptions To obtain technical support for any QNX product, visit the Technical Support section in the Support area on our website (www.qnx.com).You’llfindawiderangeofsupportoptions,includingourfreeweb-basedQNXDeveloper’sNetwork. QNX,Momentics,Neutrino,andPhotonareregisteredtrademarkstrademarksofQNXSoftwareSystemsLtd. Allothertrademarksandregisteredtrademarksbelongtotheirrespectiveowners. Contents About the Audio DDK xi Supportedfeatures xiii Assumptions xiv BuildingDDKs xiv 1 Evaluating Your Card 1 2 Organization of a Driver 5 TheQNXaudiosystemanddriver 7 DDKsourcecode 9 WritinganAudioHWDLL 11 Opaquedatatypes 11 Customdatatypes 12 ctrl init() 12 ctrl destroy() 14 Debugginganaudiodriver 15 3 Handling Analog Audio Data 17 Writingananalogmixer 19 Mixerelementsandroutes 19 Mixergroups 24 Codingthemixer 26 UsingastandardmixerDLL 31 Initialization 31 Testingthecode 33 May31,2004 Contents iii 2004,QNXSoftwareSystemsLtd. 4 Handling PCM Audio Data 35 What’saPCMdevice? 37 CreatingaPCMdevice 37 ado pcm create() 37 HowdoesthePCMstreamoperate? 39 5 API Reference 41 ado attach interrupt() 49 ado calloc() 51 ado card set longname() 53 ado card set shortname() 55 ado debug() 57 ado device mmap() 59 ado device munmap() 61 ado error() 63 ado free() 64 ado malloc() 66 ado memory dump() 68 ado mixer capture group create() 69 ado mixer create() 71 ado mixer dll() 73 ado mixer element accu1() 76 ado mixer element accu2() 78 ado mixer element accu3() 80 ado mixer element io() 83 ado mixer element mux1() 86 ado mixer element mux2() 89 ado mixer element notify() 92 ado mixer element pcm1() 94 ado mixer element pcm2() 96 ado mixer element route add() 98 ado mixer element sw1() 100 ado mixer element sw2() 103 iv Contents May31,2004 2004,QNXSoftwareSystemsLtd. ado mixer element sw3() 105 ado mixer element vol range max() 108 ado mixer element vol range min() 109 ado mixer element volume1() 110 ado mixer find element() 113 ado mixer find group() 115 ado mixer get context() 117 ado mixer get element instance data() 118 ado mixer lock() 120 ado mixer playback group create() 122 ado mixer set destroy func() 124 ado mixer set name() 126 ado mixer set reset func() 127 ado mixer switch new() 129 ado mixer unlock() 132 ado mutex destroy() 134 ado mutex init() 136 ado mutex lock() 138 ado mutex unlock() 140 ado pci 142 ado pci device() 144 ado pci release() 146 ado pcm cap t 147 ado pcm config t 150 ado pcm chn mixer() 153 ado pcm create() 155 ado pcm dma int size() 158 ado pcm format bit width() 159 ado pcm hw t 160 ado pcm subchn caps() 166 ado pcm subchn is channel() 168 ado pcm subchn mixer() 170 May31,2004 Contents v 2004,QNXSoftwareSystemsLtd. ado pcm subchn mixer create() 171 ado pcm subchn mixer destroy() 176 ado pcm sw mix() 177 ado realloc() 179 ado rwlock destroy() 181 ado rwlock init() 183 ado rwlock rdlock() 185 ado rwlock unlock() 187 ado rwlock wrlock() 189 ado shm alloc() 191 ado shm free() 193 ado shm mmap() 195 ado strdup() 197 dma interrupt() 199 A Supported Codecs 201 AudioCodec97(AC97) 203 DLLName 203 HeaderFile 203 ParameterStructure 203 SupportedDeviceControls 204 References 205 AK4531 206 DLLName 206 HeaderFile 206 ParameterStructure 206 SupportedDeviceControls 207 Reference 207 B Sample Mixer Source 209 Glossary 219 vi Contents May31,2004 2004,QNXSoftwareSystemsLtd. Index 223 May31,2004 Contents vii List of Figures DirectorystructureforaDDK. xvi HowthedriverfitsintotheQNXaudiosystem. 7 DirectorystructurefortheAudioDDK. 10 Asimplifiedcodecforananalogmixer. 20 Thegroupsinthesampleanalogmixer. 28 May31,2004 ListofFigures ix
Description: