libspu for PC<BR>(Sound Tool Library)
Sound Artist Tools

libspu for PC
(Sound Tool Library)

Overview

libspu for PC is composed of a library and device driver for creating an original tool using DTL-H800 board on PC/AT.

libspu for PC version 1.0 corresponds with libspu for PlayStation version 3.7. Most of the APIs for PlayStation can be used in libspu for PC version 1.0, however, some functions are unavailable because there are some hardware limitations (Refer to the Restrictions). Please note that there are some differences between version 3.7 and the latest version (version 4.1). The differences between version 3.7 and version 4.1 are listed in the Appendix.

libspu for PC needs the DTL-H800 version 3.0 or later. Note the version of your DTL-H800, which is written on the board. If there is no indication, your board is version 1.0 .


This document does not include the explanations about libspu APIs themselves. Please refer to the library overview and library reference manual in PlayStation Runtime Library for the explanations.

This document includes the description about version 1.0.

^1 Contents

This package is composed of the following directories.

        library	-		library itselfi.dll, .lib, .hj
        driver	-  Win95	DTL-H800 Driver for Windows95
        	-  WinNT	DTL-H800 Driver for Windows NT
        
        sample	-  bin   	Sample Code Execution Method (vagPrev)
        	-  source 	Sample Code Source (project for VisualC++ 5.0)
        
        doc	-		English Document
        

Installation

Please install DTL-H800 and libspu for PC as follows.

^1 Windows 95

  1. Insert the DTL-H800 into PCI slot and turn on the PC. Note whether or not the PC has PCI-PCI bridge. Originally, the number of PCI slot is up to 4, but some PC can extend slots up to over 5 using PCI-PCI bridge. Currently, the DTL-H800 board inserted into the slot which has been extended using the bridge is not recognized by the device driver. In the case, insert the board into the slot which is the closest to the motherboard.
  2. When windows95 recognizes the board correctly, device driver wizard starts automatically. Press "Browse" button and specify the directory including the device driver (SPUH800D.vxd). If the message, "The file Spud.dll on DTL-H800_INSATALL_DISK could not be found" is displayed, press "Browse" button then specify the directory including "Spud.dll" (library directory).
  3. Start "system" in control panel and click the tab, "device manager". If Sound Artist Board has been recognized in "other devices" group, it means it is operating correctly.


^2 Windows NT

  1. Insert the DTL-H800 into PCI slot and turn on the PC. Note whether or not the PC has PCI-PCI bridge. Originally, the number of PCI slot is up to 4, but some PC can extend slots up to over 5 using PCI-PCI bridge. Currently, the DTL-H800 board inserted into the slot which has been extended using the bridge is not recognized by the device driver. In the case, insert the board into the slot which is the closest to the motherboard.
  2. Copy the SPUH80NT.SYS to system32\drivers directory.
  3. Copy the Spu_NT.dll to system32 directory.
  4. Execute REGINI.EXE on MS-DOS window for registration. (EX. C:\>REGINI SPUH80NT.INI )
  5. Reboot the PC.

Sample Apprication

vagPrev is a simple "sample application" using libspu for PC, which can load and play a vag file.

^1 Functional Check

For functional check on Sound Artist Board, execute vagPrev.exe in sample/bin directory and load sample.vag data. The sound of trumpet tone will be output from the board if it operates correctly. (DTL-H800 has only one method for sound output, which is optical digital output. Use it with an audio equipment which has optical digital input.)

^2 Build

All the source codes of vagPrev are included in sample/source directory. The project file included in the directory is for Visual C++ 5.0. Since this project file refers libspu.h and Spud.lib in library directory by relative path, the paths for include file and library need to be set correctly in "project setting" if directory structure is changed.

Restrictions

Most of the API's (functions / structures) in libspu for PC can be used in the same manner as those in libspu for PlayStation are used. However, it has some restrictions as follows:

  1. libspu for PC version 1.0 is based on libspu for PlayStation version 3.7. Since libspu for PlayStation version 3.7 is not the latest version, new functions which have been added since the version are not reflected and the bugs in the version still exist. Refer to the Appendix for the details.
  2. DMA transfer functions cannot be used because of the hardware restrictions. Although it is possible to specify DMA transfer mode by SpuSetTransferMode(), in the case, actual operation is done in I/O transfer mode. Callback function related to DMA transfer cannot be used either.
  3. Any function for streaming has not been implemented.


SpuReadDecodeDataLoads SPU-decoded sound data to main memory.
SpuStInitInitializes SPU streaming.
SpuStQuitEnds SPU streaming.
SpuStTransferDoes pre-process for SPU streaming and starts SPU streaming.
SpuStSetPreparationFinishedCallbackSets callback function which is to be called after data transfer done in pre-process.
SpuStTransferPreparationFinishedCallbackSets callback function which is to be called after stream buffer transfer.
SpuStSetStreamFinishedCallbackSets callback function which is to be called after streaming process completed.


Appendix

libspu for PC version 1.0 is based on libspu for PlayStation version 3.7. The following is the list of the differences between version 3.7 and version 4.1.

^1 Bug on ADSR Setting

When ADSR attributes are set , each rate and mode value of ADSR need to be set at the same time. (i.e. the setting must be done by using single SpuSetVoiceAttr() function call.) The following code is a bad example which uses incorrect method. In this case, ADSR mode values are not reflected because ADSR mode values and ADSR rate values have been set by separate SpuSetVoiceAttr functions. Refer to the sample code, vagPrev, which uses the correct method.


        	s_attr.mask = ( SPU_VOICE_ADSR_AMODE |
        			SPU_VOICE_ADSR_SMODE |
        			SPU_VOICE_ADSR_RMODE
        			);
        	s_attr.s_mode       = SPU_VOICE_EXPDecN;	 /* Sustain curve */
        		:
        		:
        	SpuSetVoiceAttr (&s_attr);
        
        	s_attr.mask = ( SPU_VOICE_ADSR_AR |
        			SPU_VOICE_ADSR_DR |
        			SPU_VOICE_ADSR_SR |
        			SPU_VOICE_ADSR_RR |
        			SPU_VOICE_ADSR_SL
        			);
        	s_attr.ar = 0;	 /* Attack rate value */
        		:
        		:
        	SpuSetVoiceAttr (&s_attr);
        

^2 Functions With Different Arguments

SPU_BIT cannot be specified as the first argument of the following functions:
SpuSetNoiseVoice(), SpuSetPitchLFOVoice(), SpuSetReverbVoice()

^3 SpuGetCurrentEnvelope Left

SpuGetCurrentEnvelope() has been already deleted in the latest version. We recommend using SpuGetVoiceEnvelope() .
^TOP
Sound Artist Tools
Copyright (c) 1996-1998 Sony Computer Entertainment Inc. All Rights Reserved.