Japanese
PROGRAMMER'S GUIDEPCM/ADPCM playback library
BackForward
PCM/ADPCM playback library

2.Specifications


The specifications of this library are shown in the table below.

Table 2.1 Library specifications
 Item
 specification
 remarks
 sampling frequency
 up to 44.1kHz
 Quantization bit number
 8bit,16bit
 Number of channels
 monaural, stereo
 file format
 AIFF format
Specified ADPCM format1 )
CD-ROM XA Audio format2 )
SaturnPCM format 3)
PCM uncompressed
ADPCM compression
ADPCM compression
PCM uncompressed
 CD-ROM format
 For CD-ROM XA Audio format
Mode2Form2,
Otherwise Model or
Mode2Form1
 play mode
 Memory playback mode (playback data on memory)
File playback mode (read and play from CD)
Stream playback mode (read and play from CD)
Four)
Use file system
Use stream system
 function
 Branch playback, continuous playback, loop playback5 )
Multi playback (up to 4 videos can be played simultaneously)
Specify pause, pause, volume/pan
 Only one ADPCM
 Continuous playback time
 up to 1 hour
 Library used
 file system, stream system, DMA library,
ADPCM decompression library
Specify to link these at the same time as this library 6)
 CPU timer
Use of (FRT)
 This library uses the CPU timer (FRT) with a frequency division number of 128.
is. Initialize it only once within the PCM_Init function. A user
FRT initialization and settings on the side are prohibited.
It is possible to obtain the value using TIM_FRT_GET_16 etc.
 Using DMA
 CPU-DMA (channel 1), or
Uses SCU-DMA (channel 0).
 7)
 sound driver
The user must perform initial settings (68000 reset, sound driver transfer, etc.) in advance. This library issues commands related to PCM playback (PCM start, stop, parameter change). All commands to the sound driver are issued using the sound I/F library . See " SEGA Saturn Sound Driver 2.20 Programmer's Guide ".
 Allocating a buffer
 Work buffer: Work structure (approx. 530 bytes)
Extended work buffer: 2048byte
Ring buffer: Sector size *10 bytes ~
PCM buffer: 4096*2~4096*4sample/1ch
Pose processing work: 4096 samples ~ PCM buffer size
 fixed size
8) Only for SaturnPCM format
9)
Ten)
Required only when performing a pose
 CPU load
|After playback starts|
|Task function|
|CPU occupancy|
11)
 PCM uncompressed 44kHz stereo 16bit: 10%
PCM uncompressed 44kHz monaural 16bit: 6%
ADPCM compression 44kHz stereo 16bit: 33%
ADPCM compression 37.8kHz stereo 16bit: 29%
ADPCM compression 22kHz stereo 16bit: 17%
ADPCM compression 11kHz stereo 16bit: 8%
ADPCM compression 11kHz monaural 16bit: 4%
This is the value measured for all processing times, including data transfer from CD to work memory to sound memory, including decompression processing in the case of ADPCM.
 PCM_Task(Task
function) specifications
- Call at a frequency equal to or higher than the V blank interrupt frequency (1 time/16ms).
Maximum processing time for one task function
PCM uncompressed stereo 16bit: 15ms
PCM uncompressed monaural 16bit: 8ms
ADPCM compression stereo 16bit: 34ms
ADPCM compression monaural 16bit: 15ms
If you call it with appropriate frequency, the long processing time will only be once every few times.

1)
The specified ADPCM format corresponds to data output by CRC Research Institute's Audio Starck tool (AIFF → ADPCM conversion tool).

2)
CD-ROM XA Audio has 16bit PCM data compressed to 4bit ADPCM and has the following formats. For details, please refer to the CD-ROM XA standard document.
When playing CD-ROM XA Audio, only stream playback mode is available.

3) SaturnPCM format
SaturnPCM format files are created by converting AIFF files using the conversion tool AIF2SAP.
The characteristics of the SaturnPCM format are as follows.

*For details on how to use the SaturnPCM format, please refer to " 4.Programming Notes/Section (8) ".

Four)
There are two ways to use memory playback mode.
Resident playback:
Play small files with the entire file preloaded into memory
Sequential supply regeneration:
The data read by the user from the CD is sequentially supplied to the ring buffer and played back.

Five)
The loop playback function can only be used in memory playback mode (resident playback method) or file playback mode.

6)
Some functions may not be linked depending on the functions you use.
The ADPCM decompression library will not be linked unless you declare PCM_DeclareUseAdpcm to use ADPCM.
In memory playback mode, file systems and stream systems are not linked.
In file playback mode, the stream system is not linked.
In stream playback mode, both the file system and stream system are linked.

7)
The default setting is to transfer data from the CD block to the ring buffer using CPU-DMA (except for the SaturnPCM format. In the SaturnPCM format, the default setting is to use SCU-DMA to transfer data from the CD block to the sound memory. Masu).
The function PCM_SetTrModeCd allows you to specify program transfer, CPU-DMA, or SCU-DMA.

8)
Extended work buffers are only required when using the SaturnPCM format.
The SaturnPCM format uses an extended work buffer but does not require a ring buffer.

9)
When a user supplies data to the ring buffer during branch playback or memory playback, making the ring buffer large reduces the risk of interruptions.
The larger the value, the higher the safety for PCM playback, but the disadvantage is that the processing time for one task may be somewhat unstable.
If the entire file is prepared in memory for memory playback, specify its address and file size. In this case, it does not need to be an integral multiple of the sector size.

Ten)
PCM buffer size of 4096*2 [sample/1ch] is sufficient unless there is a special reason.
By increasing this value, playback may not be disrupted even if the task function cannot be called at the specified frequency.

11)
The definition of CPU load (CPU occupancy rate of the task function after playback starts) is shown below.
R=(100×Ttask)/Tplay
┌                                                                                  ┐
│ R    :CPU load[%]                                                                │
│ Ttask:Total processing time of PCM_Task from start of playback to end of playback│
│ Tplay:Playing time                                                               │
└                                                                                  ┘

BackForward
PROGRAMMER'S GUIDEPCM/ADPCM playback library
Copyright SEGA ENTERPRISES, LTD., 1997