1*4882a593Smuzhiyun======================================= 2*4882a593SmuzhiyunSoftware Interface ALSA-DSP MADI Driver 3*4882a593Smuzhiyun======================================= 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun(translated from German, so no good English ;-), 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun2004 - winfried ritsch 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunFull functionality has been added to the driver. Since some of 11*4882a593Smuzhiyunthe Controls and startup-options are ALSA-Standard and only the 12*4882a593Smuzhiyunspecial Controls are described and discussed below. 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunHardware functionality 16*4882a593Smuzhiyun====================== 17*4882a593Smuzhiyun 18*4882a593SmuzhiyunAudio transmission 19*4882a593Smuzhiyun------------------ 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun* number of channels -- depends on transmission mode 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun The number of channels chosen is from 1..Nmax. The reason to 24*4882a593Smuzhiyun use for a lower number of channels is only resource allocation, 25*4882a593Smuzhiyun since unused DMA channels are disabled and less memory is 26*4882a593Smuzhiyun allocated. So also the throughput of the PCI system can be 27*4882a593Smuzhiyun scaled. (Only important for low performance boards). 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun* Single Speed -- 1..64 channels 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun.. note:: 32*4882a593Smuzhiyun (Note: Choosing the 56channel mode for transmission or as 33*4882a593Smuzhiyun receiver, only 56 are transmitted/received over the MADI, but 34*4882a593Smuzhiyun all 64 channels are available for the mixer, so channel count 35*4882a593Smuzhiyun for the driver) 36*4882a593Smuzhiyun 37*4882a593Smuzhiyun* Double Speed -- 1..32 channels 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun.. note:: 40*4882a593Smuzhiyun Note: Choosing the 56-channel mode for 41*4882a593Smuzhiyun transmission/receive-mode , only 28 are transmitted/received 42*4882a593Smuzhiyun over the MADI, but all 32 channels are available for the mixer, 43*4882a593Smuzhiyun so channel count for the driver 44*4882a593Smuzhiyun 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun* Quad Speed -- 1..16 channels 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun.. note:: 49*4882a593Smuzhiyun Choosing the 56-channel mode for 50*4882a593Smuzhiyun transmission/receive-mode , only 14 are transmitted/received 51*4882a593Smuzhiyun over the MADI, but all 16 channels are available for the mixer, 52*4882a593Smuzhiyun so channel count for the driver 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun* Format -- signed 32 Bit Little Endian (SNDRV_PCM_FMTBIT_S32_LE) 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun* Sample Rates -- 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun Single Speed -- 32000, 44100, 48000 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun Double Speed -- 64000, 88200, 96000 (untested) 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun Quad Speed -- 128000, 176400, 192000 (untested) 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun* access-mode -- MMAP (memory mapped), Not interleaved (PCM_NON-INTERLEAVED) 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun* buffer-sizes -- 64,128,256,512,1024,2048,8192 Samples 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun* fragments -- 2 69*4882a593Smuzhiyun 70*4882a593Smuzhiyun* Hardware-pointer -- 2 Modi 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun 73*4882a593Smuzhiyun The Card supports the readout of the actual Buffer-pointer, 74*4882a593Smuzhiyun where DMA reads/writes. Since of the bulk mode of PCI it is only 75*4882a593Smuzhiyun 64 Byte accurate. SO it is not really usable for the 76*4882a593Smuzhiyun ALSA-mid-level functions (here the buffer-ID gives a better 77*4882a593Smuzhiyun result), but if MMAP is used by the application. Therefore it 78*4882a593Smuzhiyun can be configured at load-time with the parameter 79*4882a593Smuzhiyun precise-pointer. 80*4882a593Smuzhiyun 81*4882a593Smuzhiyun 82*4882a593Smuzhiyun.. hint:: 83*4882a593Smuzhiyun (Hint: Experimenting I found that the pointer is maximum 64 to 84*4882a593Smuzhiyun large never to small. So if you subtract 64 you always have a 85*4882a593Smuzhiyun safe pointer for writing, which is used on this mode inside 86*4882a593Smuzhiyun ALSA. In theory now you can get now a latency as low as 16 87*4882a593Smuzhiyun Samples, which is a quarter of the interrupt possibilities.) 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun * Precise Pointer -- off 90*4882a593Smuzhiyun interrupt used for pointer-calculation 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun * Precise Pointer -- on 93*4882a593Smuzhiyun hardware pointer used. 94*4882a593Smuzhiyun 95*4882a593SmuzhiyunController 96*4882a593Smuzhiyun---------- 97*4882a593Smuzhiyun 98*4882a593SmuzhiyunSince DSP-MADI-Mixer has 8152 Fader, it does not make sense to 99*4882a593Smuzhiyunuse the standard mixer-controls, since this would break most of 100*4882a593Smuzhiyun(especially graphic) ALSA-Mixer GUIs. So Mixer control has be 101*4882a593Smuzhiyunprovided by a 2-dimensional controller using the 102*4882a593Smuzhiyunhwdep-interface. 103*4882a593Smuzhiyun 104*4882a593SmuzhiyunAlso all 128+256 Peak and RMS-Meter can be accessed via the 105*4882a593Smuzhiyunhwdep-interface. Since it could be a performance problem always 106*4882a593Smuzhiyuncopying and converting Peak and RMS-Levels even if you just need 107*4882a593Smuzhiyunone, I decided to export the hardware structure, so that of 108*4882a593Smuzhiyunneeded some driver-guru can implement a memory-mapping of mixer 109*4882a593Smuzhiyunor peak-meters over ioctl, or also to do only copying and no 110*4882a593Smuzhiyunconversion. A test-application shows the usage of the controller. 111*4882a593Smuzhiyun 112*4882a593Smuzhiyun* Latency Controls --- not implemented !!! 113*4882a593Smuzhiyun 114*4882a593Smuzhiyun.. note:: 115*4882a593Smuzhiyun Note: Within the windows-driver the latency is accessible of a 116*4882a593Smuzhiyun control-panel, but buffer-sizes are controlled with ALSA from 117*4882a593Smuzhiyun hwparams-calls and should not be changed in run-state, I did not 118*4882a593Smuzhiyun implement it here. 119*4882a593Smuzhiyun 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun* System Clock -- suspended !!!! 122*4882a593Smuzhiyun 123*4882a593Smuzhiyun * Name -- "System Clock Mode" 124*4882a593Smuzhiyun 125*4882a593Smuzhiyun * Access -- Read Write 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun * Values -- "Master" "Slave" 128*4882a593Smuzhiyun 129*4882a593Smuzhiyun.. note:: 130*4882a593Smuzhiyun !!!! This is a hardware-function but is in conflict with the 131*4882a593Smuzhiyun Clock-source controller, which is a kind of ALSA-standard. I 132*4882a593Smuzhiyun makes sense to set the card to a special mode (master at some 133*4882a593Smuzhiyun frequency or slave), since even not using an Audio-application 134*4882a593Smuzhiyun a studio should have working synchronisations setup. So use 135*4882a593Smuzhiyun Clock-source-controller instead !!!! 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun* Clock Source 138*4882a593Smuzhiyun 139*4882a593Smuzhiyun * Name -- "Sample Clock Source" 140*4882a593Smuzhiyun 141*4882a593Smuzhiyun * Access -- Read Write 142*4882a593Smuzhiyun 143*4882a593Smuzhiyun * Values -- "AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", 144*4882a593Smuzhiyun "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", 145*4882a593Smuzhiyun "Internal 96.0 kHz" 146*4882a593Smuzhiyun 147*4882a593Smuzhiyun Choose between Master at a specific Frequency and so also the 148*4882a593Smuzhiyun Speed-mode or Slave (Autosync). Also see "Preferred Sync Ref" 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun.. warning:: 151*4882a593Smuzhiyun !!!! This is no pure hardware function but was implemented by 152*4882a593Smuzhiyun ALSA by some ALSA-drivers before, so I use it also. !!! 153*4882a593Smuzhiyun 154*4882a593Smuzhiyun 155*4882a593Smuzhiyun* Preferred Sync Ref 156*4882a593Smuzhiyun 157*4882a593Smuzhiyun * Name -- "Preferred Sync Reference" 158*4882a593Smuzhiyun 159*4882a593Smuzhiyun * Access -- Read Write 160*4882a593Smuzhiyun 161*4882a593Smuzhiyun * Values -- "Word" "MADI" 162*4882a593Smuzhiyun 163*4882a593Smuzhiyun 164*4882a593Smuzhiyun Within the Auto-sync-Mode the preferred Sync Source can be 165*4882a593Smuzhiyun chosen. If it is not available another is used if possible. 166*4882a593Smuzhiyun 167*4882a593Smuzhiyun.. note:: 168*4882a593Smuzhiyun Note: Since MADI has a much higher bit-rate than word-clock, the 169*4882a593Smuzhiyun card should synchronise better in MADI Mode. But since the 170*4882a593Smuzhiyun RME-PLL is very good, there are almost no problems with 171*4882a593Smuzhiyun word-clock too. I never found a difference. 172*4882a593Smuzhiyun 173*4882a593Smuzhiyun 174*4882a593Smuzhiyun* TX 64 channel 175*4882a593Smuzhiyun 176*4882a593Smuzhiyun * Name -- "TX 64 channels mode" 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun * Access -- Read Write 179*4882a593Smuzhiyun 180*4882a593Smuzhiyun * Values -- 0 1 181*4882a593Smuzhiyun 182*4882a593Smuzhiyun Using 64-channel-modus (1) or 56-channel-modus for 183*4882a593Smuzhiyun MADI-transmission (0). 184*4882a593Smuzhiyun 185*4882a593Smuzhiyun 186*4882a593Smuzhiyun.. note:: 187*4882a593Smuzhiyun Note: This control is for output only. Input-mode is detected 188*4882a593Smuzhiyun automatically from hardware sending MADI. 189*4882a593Smuzhiyun 190*4882a593Smuzhiyun 191*4882a593Smuzhiyun* Clear TMS 192*4882a593Smuzhiyun 193*4882a593Smuzhiyun * Name -- "Clear Track Marker" 194*4882a593Smuzhiyun 195*4882a593Smuzhiyun * Access -- Read Write 196*4882a593Smuzhiyun 197*4882a593Smuzhiyun * Values -- 0 1 198*4882a593Smuzhiyun 199*4882a593Smuzhiyun 200*4882a593Smuzhiyun Don't use to lower 5 Audio-bits on AES as additional Bits. 201*4882a593Smuzhiyun 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun* Safe Mode oder Auto Input 204*4882a593Smuzhiyun 205*4882a593Smuzhiyun * Name -- "Safe Mode" 206*4882a593Smuzhiyun 207*4882a593Smuzhiyun * Access -- Read Write 208*4882a593Smuzhiyun 209*4882a593Smuzhiyun * Values -- 0 1 (default on) 210*4882a593Smuzhiyun 211*4882a593Smuzhiyun If on (1), then if either the optical or coaxial connection 212*4882a593Smuzhiyun has a failure, there is a takeover to the working one, with no 213*4882a593Smuzhiyun sample failure. Its only useful if you use the second as a 214*4882a593Smuzhiyun backup connection. 215*4882a593Smuzhiyun 216*4882a593Smuzhiyun* Input 217*4882a593Smuzhiyun 218*4882a593Smuzhiyun * Name -- "Input Select" 219*4882a593Smuzhiyun 220*4882a593Smuzhiyun * Access -- Read Write 221*4882a593Smuzhiyun 222*4882a593Smuzhiyun * Values -- optical coaxial 223*4882a593Smuzhiyun 224*4882a593Smuzhiyun 225*4882a593Smuzhiyun Choosing the Input, optical or coaxial. If Safe-mode is active, 226*4882a593Smuzhiyun this is the preferred Input. 227*4882a593Smuzhiyun 228*4882a593SmuzhiyunMixer 229*4882a593Smuzhiyun----- 230*4882a593Smuzhiyun 231*4882a593Smuzhiyun* Mixer 232*4882a593Smuzhiyun 233*4882a593Smuzhiyun * Name -- "Mixer" 234*4882a593Smuzhiyun 235*4882a593Smuzhiyun * Access -- Read Write 236*4882a593Smuzhiyun 237*4882a593Smuzhiyun * Values - <channel-number 0-127> <Value 0-65535> 238*4882a593Smuzhiyun 239*4882a593Smuzhiyun 240*4882a593Smuzhiyun Here as a first value the channel-index is taken to get/set the 241*4882a593Smuzhiyun corresponding mixer channel, where 0-63 are the input to output 242*4882a593Smuzhiyun fader and 64-127 the playback to outputs fader. Value 0 243*4882a593Smuzhiyun is channel muted 0 and 32768 an amplification of 1. 244*4882a593Smuzhiyun 245*4882a593Smuzhiyun* Chn 1-64 246*4882a593Smuzhiyun 247*4882a593Smuzhiyun fast mixer for the ALSA-mixer utils. The diagonal of the 248*4882a593Smuzhiyun mixer-matrix is implemented from playback to output. 249*4882a593Smuzhiyun 250*4882a593Smuzhiyun 251*4882a593Smuzhiyun* Line Out 252*4882a593Smuzhiyun 253*4882a593Smuzhiyun * Name -- "Line Out" 254*4882a593Smuzhiyun 255*4882a593Smuzhiyun * Access -- Read Write 256*4882a593Smuzhiyun 257*4882a593Smuzhiyun * Values -- 0 1 258*4882a593Smuzhiyun 259*4882a593Smuzhiyun Switching on and off the analog out, which has nothing to do 260*4882a593Smuzhiyun with mixing or routing. the analog outs reflects channel 63,64. 261*4882a593Smuzhiyun 262*4882a593Smuzhiyun 263*4882a593SmuzhiyunInformation (only read access) 264*4882a593Smuzhiyun------------------------------ 265*4882a593Smuzhiyun 266*4882a593Smuzhiyun* Sample Rate 267*4882a593Smuzhiyun 268*4882a593Smuzhiyun * Name -- "System Sample Rate" 269*4882a593Smuzhiyun 270*4882a593Smuzhiyun * Access -- Read-only 271*4882a593Smuzhiyun 272*4882a593Smuzhiyun getting the sample rate. 273*4882a593Smuzhiyun 274*4882a593Smuzhiyun 275*4882a593Smuzhiyun* External Rate measured 276*4882a593Smuzhiyun 277*4882a593Smuzhiyun * Name -- "External Rate" 278*4882a593Smuzhiyun 279*4882a593Smuzhiyun * Access -- Read only 280*4882a593Smuzhiyun 281*4882a593Smuzhiyun 282*4882a593Smuzhiyun Should be "Autosync Rate", but Name used is 283*4882a593Smuzhiyun ALSA-Scheme. External Sample frequency liked used on Autosync is 284*4882a593Smuzhiyun reported. 285*4882a593Smuzhiyun 286*4882a593Smuzhiyun 287*4882a593Smuzhiyun* MADI Sync Status 288*4882a593Smuzhiyun 289*4882a593Smuzhiyun * Name -- "MADI Sync Lock Status" 290*4882a593Smuzhiyun 291*4882a593Smuzhiyun * Access -- Read 292*4882a593Smuzhiyun 293*4882a593Smuzhiyun * Values -- 0,1,2 294*4882a593Smuzhiyun 295*4882a593Smuzhiyun MADI-Input is 0=Unlocked, 1=Locked, or 2=Synced. 296*4882a593Smuzhiyun 297*4882a593Smuzhiyun 298*4882a593Smuzhiyun* Word Clock Sync Status 299*4882a593Smuzhiyun 300*4882a593Smuzhiyun * Name -- "Word Clock Lock Status" 301*4882a593Smuzhiyun 302*4882a593Smuzhiyun * Access -- Read 303*4882a593Smuzhiyun 304*4882a593Smuzhiyun * Values -- 0,1,2 305*4882a593Smuzhiyun 306*4882a593Smuzhiyun Word Clock Input is 0=Unlocked, 1=Locked, or 2=Synced. 307*4882a593Smuzhiyun 308*4882a593Smuzhiyun* AutoSync 309*4882a593Smuzhiyun 310*4882a593Smuzhiyun * Name -- "AutoSync Reference" 311*4882a593Smuzhiyun 312*4882a593Smuzhiyun * Access -- Read 313*4882a593Smuzhiyun 314*4882a593Smuzhiyun * Values -- "WordClock", "MADI", "None" 315*4882a593Smuzhiyun 316*4882a593Smuzhiyun Sync-Reference is either "WordClock", "MADI" or none. 317*4882a593Smuzhiyun 318*4882a593Smuzhiyun* RX 64ch --- noch nicht implementiert 319*4882a593Smuzhiyun 320*4882a593Smuzhiyun MADI-Receiver is in 64 channel mode oder 56 channel mode. 321*4882a593Smuzhiyun 322*4882a593Smuzhiyun 323*4882a593Smuzhiyun* AB_inp --- not tested 324*4882a593Smuzhiyun 325*4882a593Smuzhiyun Used input for Auto-Input. 326*4882a593Smuzhiyun 327*4882a593Smuzhiyun 328*4882a593Smuzhiyun* actual Buffer Position --- not implemented 329*4882a593Smuzhiyun 330*4882a593Smuzhiyun !!! this is a ALSA internal function, so no control is used !!! 331*4882a593Smuzhiyun 332*4882a593Smuzhiyun 333*4882a593Smuzhiyun 334*4882a593SmuzhiyunCalling Parameter 335*4882a593Smuzhiyun================= 336*4882a593Smuzhiyun 337*4882a593Smuzhiyun* index int array (min = 1, max = 8) 338*4882a593Smuzhiyun 339*4882a593Smuzhiyun Index value for RME HDSPM interface. card-index within ALSA 340*4882a593Smuzhiyun 341*4882a593Smuzhiyun note: ALSA-standard 342*4882a593Smuzhiyun 343*4882a593Smuzhiyun* id string array (min = 1, max = 8) 344*4882a593Smuzhiyun 345*4882a593Smuzhiyun ID string for RME HDSPM interface. 346*4882a593Smuzhiyun 347*4882a593Smuzhiyun note: ALSA-standard 348*4882a593Smuzhiyun 349*4882a593Smuzhiyun* enable int array (min = 1, max = 8) 350*4882a593Smuzhiyun 351*4882a593Smuzhiyun Enable/disable specific HDSPM sound-cards. 352*4882a593Smuzhiyun 353*4882a593Smuzhiyun note: ALSA-standard 354*4882a593Smuzhiyun 355*4882a593Smuzhiyun* precise_ptr int array (min = 1, max = 8) 356*4882a593Smuzhiyun 357*4882a593Smuzhiyun Enable precise pointer, or disable. 358*4882a593Smuzhiyun 359*4882a593Smuzhiyun.. note:: 360*4882a593Smuzhiyun note: Use only when the application supports this (which is a special case). 361*4882a593Smuzhiyun 362*4882a593Smuzhiyun* line_outs_monitor int array (min = 1, max = 8) 363*4882a593Smuzhiyun 364*4882a593Smuzhiyun Send playback streams to analog outs by default. 365*4882a593Smuzhiyun 366*4882a593Smuzhiyun.. note:: 367*4882a593Smuzhiyun note: each playback channel is mixed to the same numbered output 368*4882a593Smuzhiyun channel (routed). This is against the ALSA-convention, where all 369*4882a593Smuzhiyun channels have to be muted on after loading the driver, but was 370*4882a593Smuzhiyun used before on other cards, so i historically use it again) 371*4882a593Smuzhiyun 372*4882a593Smuzhiyun 373*4882a593Smuzhiyun 374*4882a593Smuzhiyun* enable_monitor int array (min = 1, max = 8) 375*4882a593Smuzhiyun 376*4882a593Smuzhiyun Enable Analog Out on Channel 63/64 by default. 377*4882a593Smuzhiyun 378*4882a593Smuzhiyun.. note :: 379*4882a593Smuzhiyun note: here the analog output is enabled (but not routed). 380