1. 	Overview
2. 	Hardware Description
3. 	How to program the card in Full Duplex mode
4. 	The 8-channel formats
5. 	PCI-ID and Revision-ID
6. 	Register and Control
7. 	F-Table
8. 	Speed
9. 	Example of a configuration dialog
10. 	Additional driver routines

1. 	Overview

The cards of the DIGI96 series are very similar among themselves. DIGI96 is the base model. The card consists of almost nothing else than a Xilinx FPGA 4010XL (later changed to XCS30XL), in which all relevant functions like PCI bus interface, audio module, memory access, input switch and SPDIF transmitter are realized. The transmitter is a complete digital interface that also allows to use Professional mode (AES/EBU), including calculated CRC and all Channel Status bits. For a higher compatibility the carrier's level is doubled in Professional mode by a balanced driven output transformer. Only the SPDIF receiver was designed using an ordinary Crystal CS8414 (later integrated into the XCS30XL). This chip delivers some useful information about the received signal at its F-pins, available in registers of the card. The VERF pin is connected to a LED at the bracket, thus working as error indicator.

DIGI96/8 is a DIGI96 plus an ADAT compatible circuit. The circuit maps the audio data as needed and realizes a Bitclock PLL. On the card the only difference to the DIGI96 is an additional VCO required for the ADAT (Bitclock) PLL.

DIGI96/8 PRO is a DIGI96/8 with additonal ouput of the audio data to a DA-converter, an AKM4321. The additional AES/EBU input is attached through a D-type connector (9 pin) and comes with a break out cable with XLR and RCA (cinch) connectors. The headphone output is buffered by an OP-amp, two different levels are switchable. The board offers connectors for Word Clock In and Out, for connection to the optional Word Clock Module (WCM) from RME.

The DIGIs are configured at boot up by the serial EPROM on the card. Thereafter no further configuration of the hardware is possible. The FPGA includes no DSP functions, loading of any kind of data is therefore not necessary.

All cards of the DIGI96 series were prepared for interrupt sharing from scratch (see bit 31/16). Interrupt sharing is successfully implemented into our Windows 95/98 and Windows NT 4.0 drivers.

2. Hardware Description

The 2x64 KB hardware ringbuffer is mirrored into the memory area of the PC. The base adress, which can be found in the PCI configuration area 10h, is set by BIOS or Windows 98 and is normally in the area 1 - 4 GByte. The control register, which has to be accessed through 32 bit routines only, resides directly on top of the buffer (Offset 0x20000). Read and write access on the control register have different meanings (see table below). An additional control register (only write access) resides at offset 0x20004.

Record and playback are completely independent of each other and have their own 64 KB data buffer. The playback buffer begins at offset 0, the record buffer at offset 64k. Record and playback independently request interrupts, which have to be confirmed each for their own. A playback interrupt is confirmed by a write access to offset 128k + 8, a record interrupt by a write access to offset 128k + 12. The control register tells which interrupt is active and has to be confirmed.

The pointer of record and playback buffer can be set using a special mechanism:

Playback:
Write access to adress 0x4YYYY,YYYY = position - 4 byte in the range 0-64 k

Record:
Write access to adress 0x5ZZZZ,ZZZZ = position - 4 byte in the range 0-64 k

So the reset of the pointers is done by write access to offset 0x4FFFC / 0x5FFFC.

When using multiple channels in asynchronous operation (different programs use the 8-channel mode at the same time) an erase routine for all already stopped tracks is necessary. Also a routine for filling the buffers with zeros when running empty is necessary.

3. How to program the card in Full Duplex mode

1. 	Set the desired format in the control register and reset the adress counters of playback and record buffer (alternative: store their actual positions)
2. 	Copy the first playback data to the begin of the playback buffer
3. 	Set both start bits
4. 	Wait for an interrupt; if one occurs determine the type (record/playback)
5. 	P/R: Ask for the actual position in the ring buffer; R: Jump to 7
6. 	Copy playback data into the buffer - return to 4.
7. 	Get the already recorded data - return to 4.

The driver decides how much data are copied ahead. As interrupts occur every 8 kB, we recommend to copy at least 16 kB for the first time, followed by 8 kB for every next interrupt. Thanks to the high transfer speed the hardware may be started already after 8 Kb.

To shorten the time until the start of a playback at very big buffer sizes it is also possible to begin playback immediately at the start of the copying process, because the data transfer is much faster than the output of the data at the card. In this case the first sample of the output might be wrong. Although this technique might be helpful in specific applications, it is not recommended in general.

4. The 8-channel formats

DIGI96/8 and 96/8 Pro's hardware allow to vbe operated in 2 different multichannel modes: the Multi Device and the Interleaved mode. Multi Device offers 4 synchronous stereo devices (common clock source). Interleave offers one 8-channel device including one solid data stream. Interleave Mode does not allow to use less than 8 channels in the hardware.

In Multi Device mode the hardware buffer consists of four 16 Kbyte ring buffers in series, in Interleave mode it is one 64 kB ring buffer.

Reading the control register can be done at two adresses (offset 0x20000 / 0x30000). Adress 0x20000 allows to read the position of the playback buffer, adress 0x30000 allows to read the position of the record buffer. All other bits except these are identical for all read accesses.

In Interleave mode the adress counter corresponds to the complete buffer (possible values = 0..65532), in 4 x stereo mode the actual position corresponds to only one track or one 16 Kbyte block (possible values = 0..16380). The lowest two bits of the position/adress are always zero, because the audio part of the hardware only accesses the memory in 32 bit. In 4 x stereo mode the highest two bit of the adress counter can be ignored.

In Multi Device mode an interrupt occurs after one (of 4) stereo tracks has played 8 KB, but in Interleave mode an interrupt is requested track independent after 8 KB transfer of data. The number of interrupts may be set 4 times higher through the ISEL bit. In Adat-Interleave Mode we strongly suggest NOT to use this mode (as this results in interrupts every 2 K of data, which equals one interrupt after 64/128 samples!).

Overview of all adresses:

Offset			R/W		Meaning

0x00000..0x0FFFF	R/W		playback buffer
0x10000..0x1FFFF	R/W		record buffer
0x20000		W		write to the control register
0x20004		W		write to the 33. control register
0x20008		W		confirm playback interrupt
0x2000C		W		confirm record interrupt
0x4YYYY		W		set playback position
0x5ZZZZ		W		set record position
0x20000		R		read playback position from control register 
0x30000		R		read record position from control register

5. 	PCI-ID and Revision-ID

There exist three cards with the vendor ID 10EE (Xilinx), that can be identified by their PCI device ID in the configuration area (Offset 2):

DIGI96 (DevID = 3FC0h): The functions of the DIGI96 card are used in all cards

DIGI96/8 (DevID = 3FC1h): Additional to the functions of the DIGI96 the Adat modes (Multi Device / Interleaved) are supported.

DIGI96/8 PRO (DevID = 3FC2h): Additional to the functions of the 96/8 all analog output functions are supported (routing/volume). Also XLR is added as input. The on board DA-converter should be reset using the PD-bit when changing from normal to double speed or vice versa. 

The PCI revision ID in the configuration area (Offset 08h) contains a version number:

Digi96 Series with 4010XL, first revision: 000

6. Register and Control

Write to the control register

Bit	Name	Description	
0	Start	Start of playback
	
1	Start_2	Start of record
	
3-2	gain_1..0	Digital level control of the D/A-converter:
00 = 0 dB, 01 = -6 dB, 10 = -12 dB, 11 = -18 dB
	
4	Mode24	Format of playback:
0 = 16 Bit, 1 = 32 Bit
	
5	Mode24_2	Format of record:
0 = 16 Bit, 1 = 32 Bit
	
6	BM	Format of Adat playback:
0 = Interleaved, 1 = 4 x Stereo
	
7	BM_2	Format of Adat record:
0 = Interleaved, 1 = 4 x Stereo
	
8	Adat	Format of playback:
0 = Stereo, 1 = Adat (8 Kanäle). Entspricht Option 'Force Adat'
	
10-9	freq_1..0	Format of playback:
01 = 32 kHz, 10 = 44,1 kHz, 11 = 48 kHz
	
11	DS	Format of playback:
Double sample rate (= 1)
	
12	PRO	Format of stereo playback:
0 = S/PDIF, 1 = AES/EBU
	
13	EMP	Format of playback:
0 = Emphasis off, 1 = Emphasis on
	
14	Sel	0 = direct through for all channels, 1 = normal playback
	
15	Master	Clock source for playback
0 = Clock Slave, 1 = Master Mode
	
16	PD	Power-Down-Bit of the D/A-converter:
When changing the DS-bit the DAC should be resetted shortly by this bit	

Bit	Name	Bescheibung	
18-17	inp_1..0	Choose input:
00 = optical, 01 = coaxial, 10 = internal, 11 = XLR
	
19-26	thru_0..7	Direct throughput of individual channels (bits set). In stereo mode only thru_0..1 will work
	
27	Dolby	Format for stereo playback:
Setting the Non-Audio-Bit in the Channel Status Data (=1)
	
29-28	monitor_1..0	Format for the Adat playback: Set the stereo track that will be played back from the D/A-converter (0..3)
	
30	ISEL	Interrupt setting: 0 = 8k (normal), 1 = 2k
	
31	IDIS	Interrupt-Disable-Bit (Disable record interrupt, needed for ASIO driver)

Additional register (Offset 0x20004)

0	wsel	Clock Source for playback is an external clock signal (Word Clock In), when this bit is set.

Notes:

PD
Please reset the DA-converter on the PRO after changing from normal to double speed or vice versa (short 1, then again 0). The reset should happen only in these cases, as it causes a short click at -50 dB on the analog output.

Bits 8-11
In AutoSync mode the hardware automatically uses the input sample rate to control the output. But the channel status data (sample rate, stereo/ADAT) will not change. Because of this a background timer routine is needed, which continuosly checks the input signal's format and sets the same on the output.

Read the control register

Bit 31 = irq (1)      set at active playback interrupt

Bit 30 = AutoSync 
Normal mode: Card in PLL-mode (1), else Quartz mode  (Master)(0)
Word Clock mode: Locked (1), Unlocked (0)

Bit 29 = F2 of the CS8414

Bit 28 = F1 of the CS8414

Bit 27 = F0 of the CS8414

F2..F0 can be used for a display of the input sample frequency. See chapter 7.

Bit 26 = ERF of the CS8414       1 = error, 0 = no error

Bit 25 - 24       constant '11'

Bit 23 = lock        1 = Adat PLL locked, 0 = no Adat signal present

Bit 22 -21=dev_id       Device-ID:
00 = DIGI96, 01 = DIGI96/8, 10 = DIGI96/8 PRO, 11 = DIGI96/8 PAD

Bit 20-18        constant '000'

Bit 17 = t_out    Internal Timer.
Meaning in Adat mode: 0 = sample rate < 46 kHz, 1 = sample rate > 46 kHz
Meaning in SPDIF mode: 0 = sample rate < 55 kHz, 1 = sample rate > 55 kHz

Bit 16 = irq (2)   set at active record interrupt

Bit 15-0 = audio_addr   actual position in the playback/record buffer

7. Frequency Table

Table of the frequency information available from the F-pins of the CS8414

F2	F1	F0	SF 8414	
0	0	0	Out of range	
0	0	1	-	
0	1	0	-	
0	1	1	96 kHz ± 4 %	
1	0	0	88,2 kHz ± 4 %	
1	0	1	48 kHz ± 4 %	
1	1	0	44,1 kHz ± 4 %	
1	1	1	32 kHz ± 4 %	

In Adat mode the actual sample frequency is available from bit 17. This bit tells whether its 44,1 or 48 kHz.

The CS8414 does not indicate 64 kHz, instead 'Out of range' is signaled. Because of this we implemented an additional frequency comparator into the hardware. This one is able to detect sample frequencies lower or higher as 55 kHz. When this information is combined with the 'Out of range' message, it's possible to display sample frequencies higher as 55 kHz as 64 kHz. The information needed is in bit 17 when SPDIF mode is active. The Windows driver displays:

Input SF	Display	
		
< 22,75 kHz	No Lock	
> 22,75 kHz	Out of Range	
> 30,74 kHz	32 kHz	
> 33,46 kHz	Out of Range	
> 42,80 kHz	44,1 kHz	
> 45,89 kHz	Out of Range	
> 46,35 kHz	48 kHz	
> 49,92 kHz	Out of Range	
> 54,96 kHz	64 kHz	
> 85,67 kHz	88,2 kHz	
> 91,87 kHz	96 kHz	

8. Speed

The PCI interface of the DIGI96 series does not work as busmaster, but reaches the theoretically maximum value possible for a non-busmaster operation and the corresponding CPU/board combination.

The values in the table below show the PCI bus transfer speed between PC and DIGI. They were measured with a test program for Windows 95/98, that writes and reads 100 times the complete hardware memory (128 kB SRAM) and stops the time needed for it. The program and the sourcecode (C++) are available upon request. When using operating systems that do not allow direct access to the hardware the test has to be implemented into the driver itself.

Pentium Pro and Pentium II processors do not reach the highest transfer rate as long as their internal Memory Type Range Registers are not set to the corresponding memory range. The PCI bursts will stop too early in this case. More informations plus an example program can be found in the german magazine c't, issue 10/96, page 124.

PC
CPU / Board / PCI Speed	STOSD	LODSD	MOVSD Write	MOVSD Read	
Pentium 200 MMX, Asus board with HX chipset, PCI 33 MHz	87,50 MB/s	13,14 MB/s	64,57 MB/s	11,95 MB/s	
same with PCI bus 37,5 MHz	98,70 MB/s	14,79 MB/s	66,47 MB/s	13,45 MB/s	
Pentium II 300, Asus board with LX chipset, PCI 33 MHz	37,93 MB/s	9,159 MB/s	37,88 MB/s	8,838 MB/s	
same after enabling the CPU's internal MTRR	131,6 MB/s	12,64 MB/s	131,6 MB/s	15,35 MB/s	
same with PCI bus 41,5 MHz 	164,7 MB/s	15,78 MB/s	164,3 MB/s	19,06 MB/s	

The length of the PCI burst gives the maximum transfer rate and does not only depend on the used chipset, but also on the used CPU. A 450 MHz CPU, clocked to 300 MHz will give lower values as a 300 MHz type, even when the 450 CPU is clocked at 450 MHz! But the difference (130 MB/s to 100 MB/s) does not make any difference with audio cards.

9. Example of a configuration dialog

The picture below shows the DIGI96/8 PRO settings dialog of the Windows 98 driver. Let's use this as example how to achieve maximum usability and full functionality in a simple and easy to understand way.

The settings dialog is divided into three rows of function blocks: Input, Output and Analog Output. At the bottom you'll find three status windows: Input, Output and Clock Mode.

Some options are not available with every card, the corresponding buttons are shown in grey (not in this picture as the PRO does it all).

Function block Input

In the area Input the user switches the desired input to active. As the XLR input is only available on the PRO card this entry is greyed out on the other cards. 'AutoSelect' switches every 0,5 s between all available inputs as long as no valid input signal is found. When the signal is interrupted the search starts again. The active input is shown in the second line of the status display. 'AutoSelect' is a background driver routine, that also runs when the settings dialog is closed.

'Check Input' is active by default. At the start of a recording the driver compares the desired format with the incoming signal. In case these do not match record is cancelled. This safety function is very useful and avoids - for example - recordings in 48 kHz of a 44,1 kHz signal. This recording would be played back with a wrong pitch. Because some users need full varipitch usage of the card this function can be disabled.

The button 'Set Defaults' resets all entries as follows: Input AutoSelect, Check Input on, Output Automatic, AutoSync on, Output Format Consumer, Emphasis off, Non-Audio Off. DIGI96/8 additional Force Adat off, DIGI96/8 PRO additional Track 1+2, Attenuation 0 dB.

The status window 'Input Status' consists of three lines. The first line displayes the actual mode (Stereo, Adat). The second the sample frequency at the active input (32 kHz, 44,1 kHz, 48 kHz, 64 kHz, 88,2 kHz, 96 kHz, No Lock, Out of Range). The third line shows the actual input (Optical, Coaxial, Internal, XLR, Searching; Searching is displayed as long as AutoSelect finds no valid input signal).

The status display is updated every 0,5 seconds, but only when the dialog box is opened and in the foreground. This is done by a foreground timer routine inside the driver. The search routine AutoSelect and the setting of the output channel status (format) in AutoSync mode is a background timer routine, else this won't work when the dialog is closed.

Function block Output

In the area 'Output' the monitoring behaviour of the card is defined. When 'Automatic' is activated the input data is fed to the output only in record mode. This equals the behaviour of a tape machine. 'Input' will always pass the data to the output for test and monitoring purposes. When setting 'Input' active it is very useful to step fast through the hardware's inputs to see and hear where a signal is present. For this realtime behaviour the sample frequency has to be checked after each change of the inputs, and the hardware has to be set to the new format.

When playing back data input monitoring is not possible (else the card would not work in Full Duplex mode). 'Play only' is an option for use with digital mixing desks. The input data is in no case fed to the output, thus avoiding feedbacks in record mode.

The DIGI96 series allows a track independent pass through of the input signal even at playback, which is very useful in Punch In/Out operation (bit 19-27). To use this mode the recording software has to send a special code, so that the driver activates 'direct through' in the moment when the user presses 'Punch In' in the software. With this the card will work like a usual tape machine, without delays. This feature is called 'Zero Latency Monitoring'.

In the area 'Output Format' the channel status can be changed from 'Consumer' to 'Professional'. 

In the area 'Output Options' the 'Emphasis' bit and the 'Non-Audio' bit (Dolby AC-3 channel status) can be set (this is no converter, it just sets the status bit in the digital audio stream!). With 'Force Adat' active the card is set to Multi Device mode (not DIGI96). This allows usual 2-channel software to access one of the 4 stereo devices and to send its data through the Adat interface.

With Windows 95/98 and NT 'Output Format', 'Output Options' and 'Clock Mode' are changeable during playback.

The status window 'Output Status' shows in the upper line the mode (Stereo, Adat), in the middle line the actual sample rate of the output (32 kHz, 44,1 kHz, 48 kHz, 64 kHz, 88,2 kHz, 96 kHz; of course here is no display of 'No Lock/Out of Range', as the output will switch to the quartz/Master mode in such a case).
 
The third line shows the actual clock mode of the output, thus where the clock comes from (Clock Master, Clock Slave, Word Clock). 'Clock Master' means quartz, 'Clock Slave' means input PLL. 'Word Clock' is only shown when 'Word Clock' is activated in the 'Clock Mode' area to the right, AND the card gets a LOCK signal (bit 30) from the WCM (Word Clock Module). This realizes a 'Word Clock active and locked' display.

Function block Analog Output

The area 'Track' allows to choose which stereo pair of the Adat signal is played back through the analog output. In SPDIF mode the setting has no function, as always the same two channels will be audible. The area 'Attenuation' allows to control the volume of the analog output.

The area 'Clock Mode' has no direct association to 'Analog Output', but it fits well into the settings dialog at this place. When 'AutoSync' is active the card always synchronizes to the input signal. If no valid signal is available at the input the hardware will automatically switch to internal clock (master) and uses the last valid sample frequency/outputstate. 'Master' activates the master mode, the output then always uses quartz clock (this allows loop cabling, directly In to Out at the card). 'Word Clock' is also a master mode, so the output is switched to master mode. But the driver will not activate the word clock (bit 0 wsel) until the WCM has locked itself to the external clock and signaled this to the DIGI. The driver gets the appropriate information from bit 30.

10. Additional driver routines

Input format 2/8 channels

The Windows 95 driver realizes an automatic adaptation to the input format SPDIF or Adat. When an Adat signal is present every usual 2-track software can start a record. The used stereo device determines which 2 channels out of the 8 Adat channels are recorded.

The Windows NT driver uses a different method, that proved not to be so user friendly. Here the input format is chosen by the choice of the record device. There is one record device for SPDIF and 4 (stereo) for Adat. With this an automatic adaption to the input signal is not possible, the user has to change the record device manually each time the format changes. Also problems with software may occur. For example when using Adat in multitrack software, and having one additional track unnoticed set to the SPDIF device, the start of a record isn't possible, an error message appears. Unfortunately this message won't tell the user the reason why the record isn't possible.

Clock Control

As opposed to the DIGI32, where the AutoSync mode was controlled by the hardware, the DIGI96 series has to be controlled by the driver. Following are some explanations to the functions that have to be programmed.

Master: The playback part always uses the quartz frequencies.

AutoSync: The playback part always uses the clock derived from the input. Exception: When starting a playback in AutoSync mode the driver first has to verify whether the sf at the input is identical to that of the playback that is gong to be started. If these are not identical the playback part MUST be switched to master mode, and the correct playback format has to be set. Else it may often happen that a file is played back in wrong speed.

In AutoSync mode the hardware automatically uses the input sample rate to control the output. But the channel status data (sample rate, stereo/ADAT) will not change. Because of this a background timer routine is needed, which continuosly checks the input signal's format and sets the same on the output (Bits 8-11).

Half/Double: The hardware includes a special circuit which allows to work in slave mode even at half/double times sample rate between input and output. Thus it is possible to start a playback at 48 kHz while a 96 kHz signal is present at the input, and staying in slave mode. The driver decides if this is allowed, and controls it simply by setting/unsetting the DS bit 11.

Input

The mode 'Input', described earlier in the chapter 'Output', can not work with this half/double technique. With active 'Input' monitoring the playback part MUST follow the sample frequency of the record part 1:1, else incorrect audio data would be passed from input to output, digital and analog monitoring wouldn't be possible! As soon as a playback is started half/double is allowed again, as playback always disables the input monitoring.

The half/double technology is a mighty function, but makes no sense in daily musical work. We implemented this technology to be able to do measurements of the behaviour in the double speed range. Actual digital measurement systems won't support sample rates higher than 48 kHz. But as the DIGI96 series includes a 'frequency devider' it is possible to measure the input jitter of a 96 kHz signal at the cards output using a 48 kHz measurement system. The deviations in the measurement results caused by dividing can be ignored.

The mixed mode technology of the DIGI96 series also allows jitter (and audio) measurements at Adat signals. As the Adat clock of the input is used to control the SPDIF output (slave mode active) a jitter measurement is possible using usual measurement systems.

Word Clock

When Word Clock is chosen from the user the driver first has to switch the card in master mode. But the driver will not activate the word clock (bit 0 wsel) until the WCM has locked itself to the external clock and signaled this to the DIGI. The driver gets the appropriate information from bit 30. It is to be noted that there is no measurement of the output sample rate. The playback format (that of the last file played back) sets the channel status information in the digital signal, and also the displayed sample frequency in the area 'Output Status'.

Erase

When using the stereo tracks independently in the Multi Device mode (asynchronous operation), and stopping one of the already started devices, the data of the corresponding buffer have to be erased. Otherwise the last data shortly before the stop will be played back as long as the other tracks are playing back data.

Synchronisation

The hardware should be started (using the startbit in the control register) not earlier as all opened devices are finally started (using waveOutWrite or waveInStart). This is true for record and playback devices. When the card is used by a software, all playback and record tracks start simultaneous as long as the software first opens, then starts all devices.

This results in two sync techniques: The DIGI96 achieves a sample aligned start of record and playback in Full Duplex mode. The DIGI96/8 and 96/8 Pro additional have all their stereo devices always synchronized to a simultaneous start.

End