summaryrefslogtreecommitdiffstats
path: root/Documentation/sound/alsa/hdspm.txt
blob: 7a67ff71a9f87eb3e7d5edc9086578525b4efd3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
Software Interface ALSA-DSP MADI Driver 

(translated from German, so no good English ;-), 
2004 - winfried ritsch



 Full functionality has been added to the driver. Since some of
 the Controls and startup-options  are ALSA-Standard and only the
 special Controls are described and discussed below.


 hardware functionality:

   
   Audio transmission:

     number of channels --  depends on transmission mode

		The number of channels chosen is from 1..Nmax. The reason to
		use for a lower number of channels is only resource allocation,
		since unused DMA channels are disabled and less memory is
		allocated. So also the throughput of the PCI system can be
		scaled. (Only important for low performance boards).

       Single Speed -- 1..64 channels 

		 (Note: Choosing the 56channel mode for transmission or as
		 receiver, only 56 are transmitted/received over the MADI, but
		 all 64 channels are available for the mixer, so channel count
		 for the driver)

       Double Speed -- 1..32 channels

		 Note: Choosing the 56-channel mode for
		 transmission/receive-mode , only 28 are transmitted/received
		 over the MADI, but all 32 channels are available for the mixer,
		 so channel count for the driver


       Quad Speed -- 1..16 channels 

		 Note: Choosing the 56-channel mode for
		 transmission/receive-mode , only 14 are transmitted/received
		 over the MADI, but all 16 channels are available for the mixer,
		 so channel count for the driver

     Format -- signed 32 Bit Little Endian (SNDRV_PCM_FMTBIT_S32_LE)

     Sample Rates --

       Single Speed -- 32000, 44100, 48000

       Double Speed -- 64000, 88200, 96000 (untested)

       Quad Speed -- 128000, 176400, 192000 (untested)

     access-mode -- MMAP (memory mapped), Not interleaved
     (PCM_NON-INTERLEAVED)

     buffer-sizes -- 64,128,256,512,1024,2048,8192 Samples

     fragments -- 2

     Hardware-pointer -- 2 Modi


		 The Card supports the readout of the actual Buffer-pointer,
		 where DMA reads/writes. Since of the bulk mode of PCI it is only
		 64 Byte accurate. SO it is not really usable for the
		 ALSA-mid-level functions (here the buffer-ID gives a better
		 result), but if MMAP is used by the application. Therefore it
		 can be configured at load-time with the parameter
		 precise-pointer.


		 (Hint: Experimenting I found that the pointer is maximum 64 to
		 large never to small. So if you subtract 64 you always have a
		 safe pointer for writing, which is used on this mode inside
		 ALSA. In theory now you can get now a latency as low as 16
		 Samples, which is a quarter of the interrupt possibilities.)

       Precise Pointer -- off
					interrupt used for pointer-calculation

       Precise Pointer -- on
					hardware pointer used.

   Controller:


	  Since DSP-MADI-Mixer has 8152 Fader, it does not make sense to
	  use the standard mixer-controls, since this would break most of
	  (especially graphic) ALSA-Mixer GUIs. So Mixer control has be
	  provided by a 2-dimensional controller using the
	  hwdep-interface. 

     Also all 128+256 Peak and RMS-Meter can be accessed via the
     hwdep-interface. Since it could be a performance problem always
     copying and converting Peak and RMS-Levels even if you just need
     one, I decided to export the hardware structure, so that of
     needed some driver-guru can implement a memory-mapping of mixer
     or peak-meters over ioctl, or also to do only copying and no
     conversion. A test-application shows the usage of the controller.

    Latency Controls --- not implemented !!!


	   Note: Within the windows-driver the latency is accessible of a
	   control-panel, but buffer-sizes are controlled with ALSA from
	   hwparams-calls and should not be changed in run-state, I did not
	   implement it here.


    System Clock -- suspended !!!!

        Name -- "System Clock Mode"

        Access -- Read Write

        Values -- "Master" "Slave"


		  !!!! This is a hardware-function but is in conflict with the
		  Clock-source controller, which is a kind of ALSA-standard. I
		  makes sense to set the card to a special mode (master at some
		  frequency or slave), since even not using an Audio-application
		  a studio should have working synchronisations setup. So use
		  Clock-source-controller instead !!!!

    Clock Source  

       Name -- "Sample Clock Source"

       Access -- Read Write

       Values -- "AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz",
       "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz",
       "Internal 96.0 kHz"

		 Choose between Master at a specific Frequency and so also the
		 Speed-mode or Slave (Autosync). Also see  "Preferred Sync Ref"


       !!!! This is no pure hardware function but was implemented by
       ALSA by some ALSA-drivers before, so I use it also. !!!


    Preferred Sync Ref

       Name -- "Preferred Sync Reference"

       Access -- Read Write

       Values -- "Word" "MADI"


		 Within the Auto-sync-Mode the preferred Sync Source can be
		 chosen. If it is not available another is used if possible.

		 Note: Since MADI has a much higher bit-rate than word-clock, the
		 card should synchronise better in MADI Mode. But since the
		 RME-PLL is very good, there are almost no problems with
		 word-clock too. I never found a difference.


    TX 64 channel --- 

       Name -- "TX 64 channels mode"

       Access -- Read Write

       Values -- 0 1

		 Using 64-channel-modus (1) or 56-channel-modus for
		 MADI-transmission (0).


		 Note: This control is for output only. Input-mode is detected
		 automatically from hardware sending MADI.


    Clear TMS ---

       Name -- "Clear Track Marker"

       Access -- Read Write

       Values -- 0 1


		 Don't use to lower 5 Audio-bits on AES as additional Bits.
        

    Safe Mode oder Auto Input --- 

       Name -- "Safe Mode"

       Access -- Read Write

       Values -- 0 1

       (default on)

		 If on (1), then if either the optical or coaxial connection
		 has a failure, there is a takeover to the working one, with no
		 sample failure. Its only useful if you use the second as a
		 backup connection.

    Input --- 

       Name -- "Input Select"

       Access -- Read Write

       Values -- optical coaxial


		 Choosing the Input, optical or coaxial. If Safe-mode is active,
		 this is the preferred Input.

-------------- Mixer ----------------------

    Mixer

       Name -- "Mixer"

       Access -- Read Write

       Values - <channel-number 0-127> <Value 0-65535>


		 Here as a first value the channel-index is taken to get/set the
		 corresponding mixer channel, where 0-63 are the input to output
		 fader and 64-127 the playback to outputs fader. Value 0
		 is channel muted 0 and 32768 an amplification of  1.

    Chn 1-64

       fast mixer for the ALSA-mixer utils. The diagonal of the
       mixer-matrix is implemented from playback to output.
       

    Line Out

       Name  -- "Line Out"

       Access -- Read Write

       Values -- 0 1

		 Switching on and off the analog out, which has nothing to do
		 with mixing or routing. the analog outs reflects channel 63,64.


--- information (only read access):
 
    Sample Rate

       Name -- "System Sample Rate"

       Access -- Read-only

		 getting the sample rate.


    External Rate measured

       Name -- "External Rate"

       Access -- Read only


		 Should be "Autosync Rate", but Name used is
		 ALSA-Scheme. External Sample frequency liked used on Autosync is
		 reported.


    MADI Sync Status

       Name -- "MADI Sync Lock Status"

       Access -- Read

       Values -- 0,1,2

       MADI-Input is 0=Unlocked, 1=Locked, or 2=Synced.


    Word Clock Sync Status

       Name -- "Word Clock Lock Status"

       Access -- Read

       Values -- 0,1,2

       Word Clock Input is 0=Unlocked, 1=Locked, or 2=Synced.

    AutoSync

       Name -- "AutoSync Reference"

       Access -- Read

       Values -- "WordClock", "MADI", "None"

		 Sync-Reference is either "WordClock", "MADI" or none.

   RX 64ch --- noch nicht implementiert

       MADI-Receiver is in 64 channel mode oder 56 channel mode.


   AB_inp   --- not tested 

		 Used input for Auto-Input.


   actual Buffer Position --- not implemented

	   !!! this is a ALSA internal function, so no control is used !!!



Calling Parameter:

   index int array (min = 1, max = 8), 
     "Index value for RME HDSPM interface." card-index within ALSA

     note: ALSA-standard

   id string array (min = 1, max = 8), 
     "ID string for RME HDSPM interface."

     note: ALSA-standard

   enable int array (min = 1, max = 8), 
     "Enable/disable specific HDSPM sound-cards."

     note: ALSA-standard

   precise_ptr int array (min = 1, max = 8), 
     "Enable precise pointer, or disable."

     note: Use only when the application supports this (which is a special case).

   line_outs_monitor int array (min = 1, max = 8), 
     "Send playback streams to analog outs by default."


	  note: each playback channel is mixed to the same numbered output
	  channel (routed). This is against the ALSA-convention, where all
	  channels have to be muted on after loading the driver, but was
	  used before on other cards, so i historically use it again)



   enable_monitor int array (min = 1, max = 8), 
     "Enable Analog Out on Channel 63/64 by default."

      note: here the analog output is enabled (but not routed).