Vlsi VS1005 User manual

PUBLIC DOCUMENT
VS1005 VSOS AUDIO SUBSYSTEM
VS1005g
All information in this document is provided as-is without warranty. Features are
subject to change without notice.
Revision History
Rev. Date Author Description
3.57 2019-04-10 HH Minor corrections.
3.55b 2018-06-22 HH Added Noise Killer audio driver.
3.55a 2018-04-24 HH New features to Reverb Generator audio driver.
3.55 2018-04-05 HH Added Reverb Generator audio driver.
3.52 2018-01-22 HH Updated for VSOS 3.52.
3.42 2017-05-18 HH More S/PDIF drivers, FLAC Encoder, Pitch Shifter.
3.40 2016-11-03 HH Updated for VSOS 3.40.
3.30a 2016-07-14 HH Bug patch release for VSOS 3.30.
3.30 2016-06-22 HH Updated for VSOS 3.30.
1.03 2016-02-15 HH New AUXPLAY, fract. rates, updated AuOutput.
1.02 2016-01-27 HH Added AuOutput app and Slave Sync drivers.
1.01 2015-09-14 HH Corrections, e.g. Figure 8.
1.00 2015-09-04 HH Initial release.
Rev. 3.57 2019-04-10 Page 1(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
Contents
VS1005 VSOS Audio Subsystem Front Page 1
Table of Contents 2
1 Introduction 6
2 Disclaimer 7
3 Definitions 7
4 Overview 8
5 Requirements 9
6 The VS1005 VSOS Audio Subsystem 10
6.1 StandardAudio................................. 10
6.2 VSOS Audio Output Example Program . . . . . . . . . . . . . . . . . . . . 11
6.3 VSOS Audio Input/Output Example Program . . . . . . . . . . . . . . . . 12
7 Audio Drivers 13
7.1 General ..................................... 13
7.2 Analog Output DAC Audio Drivers . . . . . . . . . . . . . . . . . . . . . . 15
7.2.1 Driver AUODAC.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7.3 Analog Side Path Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . . 16
7.3.1 Driver AUOOSET.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.4 Analog Input ADC Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . 17
7.4.1 Driver AUIADC.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.5 I2SAudioDrivers................................ 19
7.5.1 Driver AUOI2SMA.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 19
7.5.2 Driver AUOI2SM.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.5.3 Driver AUOI2SS.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 20
7.5.4 Driver AUII2SM.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.5.5 Driver AUII2SS.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.5.6 Driver AUXI2SM.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.5.7 Driver AUXI2SS.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.6 S/PDIFAudioDrivers ............................. 22
7.6.1 Driver AUOSPDA.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.6.2 Driver AUISPD.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7.6.3 Driver AUXSPD.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7.6.4 Driver AUXSPD48.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 25
7.6.5 Driver AUOSP48S.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 25
7.6.6 Driver AUOSPD48.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 25
7.7 Slave Audio Input Synchronization Drivers . . . . . . . . . . . . . . . . . . 26
7.7.1 Driver AUXSYNCS.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 26
7.8 Audio Input to Output Copying Driver . . . . . . . . . . . . . . . . . . . . . 27
7.8.1 Driver AUXPLAY.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . 27
8 Audio Filter Drivers 28
Rev. 3.57 2019-04-10 Page 2(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
8.1 Equalizer Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.1 Driver FTOEQU.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.2 Control Program SETEQU.DL3 . . . . . . . . . . . . . . . . . . . . 30
8.2 DC Offset/AGC Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . . . 31
8.2.1 Driver FTIDCBL.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.2.2 Driver FTIAGC.DL3 . . . . . . . . . . . . . . . . . . . . . . . . . . 32
8.2.3 Control Program SETAGC.DL3 . . . . . . . . . . . . . . . . . . . . 32
8.3 Pitch Shifter / Speed Shifter Audio Drivers . . . . . . . . . . . . . . . . . . 33
8.3.1 DriverFTOPITCH ........................... 33
8.3.2 Control Program SETPITCH . . . . . . . . . . . . . . . . . . . . . 33
8.4 Reverb Generator Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . 34
8.4.1 DriverFTOREV............................. 34
8.4.2 DriverFTOREV23 ........................... 35
8.4.3 Control Program SETREV . . . . . . . . . . . . . . . . . . . . . . . 36
8.5 Noise Killer Audio Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.5.1 DriverFTINOISE............................ 39
8.5.2 Control Program SETNOISE . . . . . . . . . . . . . . . . . . . . . 39
9 Audio Control Programs 41
9.1 Control Program AUINPUT.DL3 . . . . . . . . . . . . . . . . . . . . . . . . 41
9.2 Control Program AUOUTPUT.DL3 . . . . . . . . . . . . . . . . . . . . . . 42
10 Configuration Examples 43
10.1 Minimal config.sys for Playback . . . . . . . . . . . . . . . . . . . . . . . . 43
10.2 config.sys for Playback with Bass/Treble Controls and I2S + S/PDIF Outputs 43
10.3 Basic config.sys for Recording . . . . . . . . . . . . . . . . . . . . . . . . 43
10.4 Versatile config.sys for Recording with AGC and I2S + S/PDIF Outputs . . 44
10.5 config.sys for Playback/Recording from I2S in Slave Mode, and Monitor-
ing to DAC with Automatic Synchronization . . . . . . . . . . . . . . . . . 44
10.6 Loading/Unloading Drivers Using the VSOS Shell . . . . . . . . . . . . . . 44
11 VSOS Audio ioctl() Controls 46
11.1ResettingaDriver ............................... 46
11.1.1IOCTL_RESTART ........................... 46
11.2 Controlling Sample Rate and Bit Width . . . . . . . . . . . . . . . . . . . . 47
11.2.1 IOCTL_AUDIO_SET_RATE_AND_BITS . . . . . . . . . . . . . . . 47
11.2.2 IOCTL_AUDIO_GET_IRATE, IOCTL_AUDIO_GET_ORATE . . . . 47
11.2.3 IOCTL_AUDIO_SET_IRATE, IOCTL_AUDIO_SET_ORATE . . . . 48
11.2.4 IOCTL_AUDIO_GET_BITS . . . . . . . . . . . . . . . . . . . . . . 48
11.2.5 IOCTL_AUDIO_SET_BITS . . . . . . . . . . . . . . . . . . . . . . 48
11.3 Controlling Audio Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
11.3.1 IOCTL_AUDIO_GET_INPUT_BUFFER_FILL . . . . . . . . . . . . 49
11.3.2 IOCTL_AUDIO_GET_INPUT_BUFFER_SIZE . . . . . . . . . . . . 49
11.3.3 IOCTL_AUDIO_SET_INPUT_BUFFER_SIZE . . . . . . . . . . . . 49
11.3.4 IOCTL_AUDIO_GET_OUTPUT_BUFFER_FREE . . . . . . . . . . 49
11.3.5 IOCTL_AUDIO_GET_OUTPUT_BUFFER_SIZE . . . . . . . . . . 50
11.3.6 IOCTL_AUDIO_GET_OUTPUT_BUFFER_SIZE . . . . . . . . . . 50
11.4VolumeControl................................. 51
Rev. 3.57 2019-04-10 Page 3(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
11.4.1 IOCTL_AUDIO_GET_VOLUME . . . . . . . . . . . . . . . . . . . . 51
11.4.2 IOCTL_AUDIO_SET_VOLUME . . . . . . . . . . . . . . . . . . . . 51
11.5 Miscellaneous Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
11.5.1 IOCTL_AUDIO_GET_SAMPLE_COUNTER . . . . . . . . . . . . . 52
11.5.2 IOCTL_AUDIO_GET_OVERFLOWS . . . . . . . . . . . . . . . . . 52
11.5.3 IOCTL_AUDIO_GET_UNDERFLOWS . . . . . . . . . . . . . . . . 52
11.5.4 IOCTL_AUDIO_SELECT_INPUT . . . . . . . . . . . . . . . . . . . 53
11.6 Fractional Sample Rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
12 Controlling Audio from VSOS Shell with UiMessages 55
12.1 Setting Volume anywhere from VSOS Shell . . . . . . . . . . . . . . . . . 55
12.2 Sending Equalizer Controls from VSOS Shell . . . . . . . . . . . . . . . . 55
13 Audio Decoders 56
13.1 Decoder Loop Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . 58
14 Audio Encoders 59
14.1 ENCVORB.DL3 - Ogg Vorbis Encoder . . . . . . . . . . . . . . . . . . . . 59
14.2 ENCMP3.DL3 - MP3 Encoder (VS1205 only) . . . . . . . . . . . . . . . . 59
14.3 ENCFLAC.DL3 - FLAC Encoder . . . . . . . . . . . . . . . . . . . . . . . 59
15 Latest Document Version Changes 60
16 Contact Information 62
Rev. 3.57 2019-04-10 Page 4(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
List of Figures
1 VS1005g playback (DA) audio paths . . . . . . . . . . . . . . . . . . . . . 13
2 VS1005g recording (AD, FM, etc) signal paths . . . . . . . . . . . . . . . 14
3 AUODAC.DL3 signal paths shown in bold brown .............. 15
4 AUOOSET.DL3 signal paths shown in bold brown ............. 16
5 AUIADC.DL3 selectable input signal paths shown in bold green for the
left channel, and bold brown for the right channel. Alternative RF audio
path shown in bold magenta ......................... 17
6 AUOI2SMA.DL3 audio path shown in bold brown ............. 19
7 AUOI2SM.DL3 audio path shown in bold brown .............. 20
8 AUII2SM.DL3 audio path shown in bold brown ............... 21
9 AUOSPDA.DL3 audio path shown in bold brown. Software driver con-
necting to the filterless sample rate converter (bold green) shown in bold
magenta .................................... 23
10 A filter input driver connects to the stdaudioin chain . . . . . . . . . . . . . 28
11 A filter output driver connects to the stdaudioout chain . . . . . . . . . . . 28
12 Audio with exaggerated DC offset . . . . . . . . . . . . . . . . . . . . . . . 31
13 AudiowithDCblocking ............................ 31
14 Reverb Generator FTOREV signal paths . . . . . . . . . . . . . . . . . . . 34
15 Reverb Generator FTOREV23 signal paths . . . . . . . . . . . . . . . . . 35
Rev. 3.57 2019-04-10 Page 5(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
1 Introduction
The VS1005 VSOS offers many, versatile audio drivers.
This document explains how to use the numerous drivers to your best advantage.
After the disclaimer and definitions in Chapters 2 and 3, an overview of the Audio sub-
system is given in Chapter 4, Overview, followed by requirements in Chapter 5, Require-
ments.
The VSOS audio subsystem is presented in Chapter 6, The VS1005 VSOS Audio Sub-
system.
The currently existing audio drivers are presented in Chapter 7, Audio Drivers, followed
by a presentation of the currently existing filters in Chapter 8, Audio Driver Filters, and
control programs in Chapter 9, Audio Control Programs,
Some examples on how to start audio drivers from config.txt or the VSOS Shell are
shown in Chapter 10, Configuration Examples.
Chapter 12 shows how to control some aspects on audio using UiMessages, even if the
program that is currently running doesn’t have any audio controls.
Audio Decoders are presented in Chapter 13, and Audio Encoders in Chapter 14.
The document ends with Chapter 15, Latest Document Version Changes, and Chap-
ter 16, Contact Information.
Rev. 3.57 2019-04-10 Page 6(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
2 Disclaimer
VLSI Solution makes everything it can to make this documentation as accurate as pos-
sible. However, no warranties or guarantees are given for the correctness of this docu-
mentation.
3 Definitions
DSP Digital Signal Processor.
I-mem Instruction Memory.
LSW Least Significant (16-bit) Word.
MSW Most Significant (16-bit) Word.
RISC Reduced Instruction Set Computer.
VS_DSP4VLSI Solution’s DSP core.
VSIDE VLSI Solution’s Integrated Development Environment.
VSOS VLSI Solution’s Operating System.
X-mem X Data Memory.
Y-mem Y Data Memory.
Rev. 3.57 2019-04-10 Page 7(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
4 Overview
The VSOS Audio Subsystem provides numerous drivers to handle the many audio In-
put/Output options of VS1005. The audio drivers can be controlled either with ioctl()
calls from the C language, or from VSOS Shell control program.
While instructions for how to use each audio driver are provided in the README.TXT
or documentation .PDF files of the drivers, this document will provide an overview of
the capabilities of the drivers. However, for details, refer to documentation of the audio
drivers themselves.
Rev. 3.57 2019-04-10 Page 8(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
5 Requirements
To test the audio drivers in this document, you need to have the following building blocks:
•VS1005g Developer Board. The VS1005g BreakOut Board should also work, but
these instructions have been tested with the DevBoard.
•Latest version of VSOS installed (at least v3.23, released 2015-09-04).
•USB cable between DevBoard and PC for uploading new software.
•If you want to use the VSOS Shell environment, you will also need:
–UART or USB->UART cable connected between DevBoard and PC for using
the UART interface. Data speed is 115200 bps, format is 8N1.
–Your favorite UART Terminal Emulation program installed on the PC. Read
the “VS1005 VSOS Shell” for further details.
When all of this is in order, you are ready to test the VSOS Audio Subystem.
Rev. 3.57 2019-04-10 Page 9(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
6 The VS1005 VSOS Audio Subsystem
As a default, VSOS offers a simple audio output driver that lets the user output 16-bit
mono or stereo audio to the VS1005 analog output pins LEFT and RIGHT, and control
the sample rate.
VSOS Audio makes it very easy to produce sound with its standard-C-like standard
audio interface (Chapter 6.1, Standard Audio). Instead of being forced to use audio-
specific I/O routines, audio looks just like files.
More complex audio operations and redirections can be done using the audio drivers,
described Chapter 7, Audio Drivers.
6.1 Standard Audio
VSOS offers the user a standard audio source and destination, although the audio
source is only activated if an appropriate audio input driver is loaded (Chapter 7). Called
stdaudioin and stdaudioout, standard audio file handles are to sound much like stdin
and stdout are to standard input and output in standard C. It is not allowed for the user
to close standard audio input or output files, but the user may modify their parameters.
By default, stdaudioout is connected to analog output pins LEFT and RIGHT, although
this can be changed with appropriate audio drivers.
Both standard audio input and output open in stereo, 16-bit, 48 kHz mode. These pa-
rameters can be changed by the user, with driver and hardware dependent limitations.
The user may use all standard read and write operations to read from and write to
standard audio. It is, however, required that fread() / fwrite() functions are used instead
of character-based operations like fgetc() and fprintf(). It is also recommended to handle
larger chunks of samples, like 32, at a time.
Stereo samples are stored in an interleaved fashion. In 32-bit mode, the least significant
word is stored first. This is the same as the native VSDSP 32-bit word order.
Audio sample buffer 16-bit word order
Audio format Word 0 Word 1 Word 2 Word 3
16-bit stereo Left 0 Right 0 Left 1 Right 1
32-bit stereo Left 0 LSW Left 0 MSW Right 0 LSW Right 0 MSW
Rev. 3.57 2019-04-10 Page 10(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
6.2 VSOS Audio Output Example Program
The following audio program example creates a low-intensity sine wave to the left chan-
nel, then outputs the samples.
#include <vo_stdio.h>
#include <stdlib.h>
#include <math.h>
#include <saturate.h>
#include <apploader.h>
#define SIN_TAB_SIZE 96
#define SIN_AMPLITUDE 1000 /* Max 32767 */
static const s_int16 __y sinTab[SIN_TAB_SIZE];
int main(void) {
// Remember to never allocate buffers from stack space. So, if you
// allocate the space inside your function, never forget "static"!
static s_int16 myBuf[2*SIN_TAB_SIZE];
int i;
/* Build sine table */
for (i=0; i<SIN_TAB_SIZE; i++) {
sinTab[i] = (s_int16)(sin(i*2.0*M_PI/SIN_TAB_SIZE)*SIN_AMPLITUDE);
}
while (1) {
// Clear buffer
memset(myBuf, 0, sizeof(myBuf));
// Create sine wave to the left channel.
for (i=0; i<SIN_TAB_SIZE; i++) {
myBuf[i*2] = sinTab[i];
}
// Write result
fwrite(myBuf, sizeof(s_int16), 2*SIN_TAB_SIZE, stdaudioout);
}
// Not really needed because there was a while(1) before
return EXIT_SUCCESS;
}
Rev. 3.57 2019-04-10 Page 11(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
6.3 VSOS Audio Input/Output Example Program
The following audio program reads audio from the default input, and sends it to the
default output, until the user pushes Ctrl-C in the VSOS Shell Environment.
#include <vo_stdio.h>
#include <apploader.h> // Contains LoadLibrary() and DropLibrary()
#include <consolestate.h>
#define BUFSIZE 128
ioresult main(char *parameters) {
static s_int16 myBuf[BUFSIZE];
if (!stdaudioin || !stdaudioout) {
printf("E: NO AUDIO IN OR OUT!\n");
return S_ERROR;
}
while (!(appFlags & APP_FLAG_QUIT)) { /* Until Ctrl-C is pushed */
fread(myBuf, sizeof(s_int16), BUFSIZE, stdaudioin);
fwrite(myBuf, sizeof(s_int16), BUFSIZE, stdaudioout);
}
return S_OK;
}
Rev. 3.57 2019-04-10 Page 12(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
7 Audio Drivers
VS1005g has multiple audio paths. This Chapter will explain which driver you will need
to attach each audio driver to your software.
7.1 General
Audio drivers are named using the following format:
AUdyyyyyz.DL3
where
Symbol Description
d Driver direction: I = input, O = output, X = Input+Output
yyyyy Driver name, max. 5 characters
z Optional M or S if e.g. I2S driver is Master or Slave
DAOSET_LEFT
DAOSET_RIGHT
DAC_LEFT
DAC_RIGHT
I2S_LEFT
I2S_RIGHT
SP_LDATA
SP_RDATA
24
24
24
24
24 24
24
24
24
DAC_VOL
32/16
SRC_CF
DAC +
output
drivers
I2S_CF
Analog
I2S_BCK,I2S_FRM
I2S_DO
SRC_LEFT
SRC_RIGHT
CBUF
RIGHT
LEFT
DAOSET_CF
DAC_SRC
Digital
RED: Pin
BLUE: Register
SPDIF_OUT
encoder
S/PDIF
24/16
sample rate
upconverter
upconverter
Sample rate
with filters
and hold
Sample
Filterless
down−
converter
Figure 1: VS1005g playback (DA) audio paths
Figure 1 shows the VS1005 hardware output audio paths. Most of these have a driver
controlling them.
Rev. 3.57 2019-04-10 Page 13(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
FMR
FML
Mono
Right
Left
AD_CF_DEC6SEL
AD_CF_DEC6ENA
ANA_CF3
_GAIN2
ANA_CF0
ANA_CF0
ANA_CF3
_GAIN1
ANA_CF0
ANA_CF0
I
Q
BLUE: Register or register bit(s)
RED: Pin
Digital
Analog and RF
18
18
AD_LEFT
DEC6_LEFT
DEC6_RIGHT
DIA1
LINE1_1
LINE2_1
LINE3_1
RF_N
RF_P
LINE1_2
LINE2_2
LINE3_2
LINE1_3 L
R6
18
18
SP_LDATA
SP_RDATA
24
24
SPDIF_IN
24
AD_CF_ADFS
ADENA
AD_CF_
AD1
S/PDIF
decoder
demod.
FM
DIA2
DIA3
VCO
AD_RIGHT
AD_MONO
24
24
24
24
24
AD_CF_ADFS
FM_CF_UAD3
AD_CF_
AD3ENA
AD3
AD_CF_
ADENA
AD2
MIC2N
MIC2P
MIC1P
MIC1N
FM_CF_UAD1
FM_CF_UAD2
AD23_FLP
AD_CF_
AD_CF_AD3FS
Figure 2: VS1005g recording (AD, FM, etc) signal paths
Figure 2 shows the VS1005 hardware input audio paths. Many of these have a driver
controlling them.
Rev. 3.57 2019-04-10 Page 14(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
7.2 Analog Output DAC Audio Drivers
7.2.1 Driver AUODAC.DL3
DAOSET_LEFT
DAOSET_RIGHT
DAC_LEFT
DAC_RIGHT
I2S_LEFT
I2S_RIGHT
SP_LDATA
SP_RDATA
24
24
24
24
24 24
24
24
24
DAC_VOL
32/16
SRC_CF
DAC +
output
drivers
I2S_CF
Analog
I2S_BCK,I2S_FRM
I2S_DO
SRC_LEFT
SRC_RIGHT
CBUF
RIGHT
LEFT
DAOSET_CF
DAC_SRC
Digital
SPDIF_OUT
encoder
S/PDIF
24/16
sample rate
upconverter
upconverter
Sample rate
with filters
and hold
Sample
Filterless
down−
converter
RED text: Pin
BLUE text: Register
Figure 3: AUODAC.DL3 signal paths shown in bold brown
Figure 3 shows the VS1005 high-quality, fully filtered analog output main audio path.
AUODAC.DL3 is the basic DAC output driver. It takes over the VSOS default driver
and offers a lot of funtionality over it, like 16-bit and 32-bit data transfers. It takes over
stdaudioout, so all software that writes to standard output will send audio to this driver.
The driver offers setting the sample rate with 1 Hz accuracy up to 96000 Hz. Audio
is upconverted to an extremely high rate of 6.144 MHz by a high-quality Sample rate
upconverter.
Playback volume can be set with 0.5 dB accuracy between full level volume (-0 dB) and
-127 dB.
Rev. 3.57 2019-04-10 Page 15(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
7.3 Analog Side Path Audio Drivers
7.3.1 Driver AUOOSET.DL3
DAOSET_LEFT
DAOSET_RIGHT
DAC_LEFT
DAC_RIGHT
I2S_LEFT
I2S_RIGHT
SP_LDATA
SP_RDATA
24
24
24
24
24 24
24
24
24
DAC_VOL
32/16
SRC_CF
DAC +
output
drivers
I2S_CF
Analog
I2S_BCK,I2S_FRM
I2S_DO
SRC_LEFT
SRC_RIGHT
CBUF
RIGHT
LEFT
DAOSET_CF
DAC_SRC
Digital
SPDIF_OUT
encoder
S/PDIF
24/16
sample rate
upconverter
upconverter
Sample rate
with filters
and hold
Sample
Filterless
down−
converter
RED text: Pin
BLUE text: Register
Figure 4: AUOOSET.DL3 signal paths shown in bold brown
Figure 4 shows the VS1005 analog output audio side path. This audio path is not filtered;
it is only put through a Sample and hold upconverter. As such, audible aliasing distortion
may be heard if low sample rates are used. This audio path is best suitable for different
kinds of alarm and effects sounds that may easily be independently overlayed on top of
the audio of the main audio path (see Chapter 7.2.1).
The sample rate of the side audio path is independent from the main audio path. While
it may be set to up to 192 kHz, all sample rates cannot be set accurately. While cer-
tain sample rates like 24, 48, and 96 kHz can be played accurately, some others, like
44.1 kHz, may have an up to 150 Hz error. While not a problem for effects sounds, this
may make accurate timing difficult.
Rev. 3.57 2019-04-10 Page 16(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
7.4 Analog Input ADC Audio Drivers
7.4.1 Driver AUIADC.DL3
FMR
FML
Mono
Right
Left
AD_CF_DEC6SEL
AD_CF_DEC6ENA
ANA_CF3
_GAIN2
ANA_CF0
ANA_CF0
ANA_CF3
_GAIN1
ANA_CF0
ANA_CF0
I
Q
Digital
Analog and RF
18
18
AD_LEFT
DEC6_LEFT
DEC6_RIGHT
DIA1
LINE1_1
LINE2_1
LINE3_1
RF_N
RF_P
LINE1_2
LINE2_2
LINE3_2
LINE1_3 L
R6
18
18
SP_LDATA
SP_RDATA
24
24
SPDIF_IN
24
AD_CF_ADFS
ADENA
AD_CF_
S/PDIF
decoder
demod.
FM
DIA2
DIA3
VCO
AD_RIGHT
AD_MONO
24
24
24
24
24
AD_CF_ADFS
FM_CF_UAD3
AD_CF_
AD3ENA
AD3
AD_CF_
ADENA
AD2
MIC2N
MIC2P
MIC1P
MIC1N
FM_CF_UAD1
FM_CF_UAD2
AD23_FLP
AD_CF_
BLUE text: Register or register bit(s)
RED text: Pin
AD1
AD_CF_AD3FS
Figure 5: AUIADC.DL3 selectable input signal paths shown in bold green for the left
channel, and bold brown for the right channel. Alternative RF audio path shown in
bold magenta
The AUIADC.DL3 driver lets the user select a stereo input from a multitude of analog
(and even some digital) sources. The sources used may be chosen at startup time, or
changed dynamically while the driver is running. Any brown source in Figure 5 may
be combined with any green source to form a stereo signal. However, if the magenta-
coloured RF input is selected, it takes over the whole stereo audio path.
Supported sample rates are 192, 96, 48, and 24 kHz. However, it is also possible to use
a high-quality down-by-6 decimator to create such sample rates as 32, 16, and 8 kHz.
When the decimator is selected, the driver automatically reads its samples from the
DEC6_LEFT/DEC6_RIGHT registers instead of the default AD_LEFT/AD_RIGHT.
Note that even if RF is selected for FM radio input, all of the FM hardware is not started
by the driver. So you will still need a dedicated FM Receiver program to e.g. tune the
FM radio. The only supported sample rate for the FM receiver is 32 kHz (using 192 kHz
main sample rate and putting the signal through the I/Q - FM demodulation - down-by-6
Rev. 3.57 2019-04-10 Page 17(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
decimator hardware).
Optionally, digital microphone inputs DIA1 and DIA2 may be used instead of the analog
inputs. The 1-bit signals in the megahertz domain from the microphones are fed to the
high-quality digital low-pass filtering path of VS1005.
On the VS1005 DevBoard, LINE1_1 and LINE1_3 are used as the default analog inputs.
On the VS1005 BreakOut Board, LINE1_1 and LINE1_2 are used.
The input can be controlled using the VSOS Shell environment using the AUINPUT
program (Chapter 9.1).
Rev. 3.57 2019-04-10 Page 18(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
7.5 I2S Audio Drivers
I2S Audio drivers allows for I2S operation in both master and slave mode. Whenever
possible, it is recommended to use master mode, because that way VS1005 has exact
control over the sample rate.
The sample rate and number of bits (16/32) may be controlled with ioctl() commands
IOCTL_AUDIO_SET_RATE_AND_BITS (recommended), IOCTL_AUDIO_SET_IRATE,
IOCTL_AUDIO_SET_ORATE, and IOCTL_AUDIO_SET_BITS. In master mode, sample
rates 24, 48, 96, and 192 kHz are supported.
In slave mode, the other end selects the sample rate, which is the same for both I2S
input and output. If the user wants to monitor audio using analog output, they need to
use the Slave Audio Input Synchronization Driver (Chapter 7.7).
With the exception of AUOI2SMA.DL3, all drivers connect to stdaudioin and/or stdau-
dioout if started with parameter “s”. Otherwise, the drivers need to be opened and
accessed manually.
7.5.1 Driver AUOI2SMA.DL3
DAOSET_LEFT
DAOSET_RIGHT
DAC_LEFT
DAC_RIGHT
I2S_LEFT
I2S_RIGHT
SP_LDATA
SP_RDATA
24
24
24
24
24 24
24
24
24
DAC_VOL
32/16
SRC_CF
DAC +
output
drivers
I2S_CF
Analog
I2S_BCK,I2S_FRM
I2S_DO
SRC_LEFT
SRC_RIGHT
CBUF
RIGHT
LEFT
DAOSET_CF
DAC_SRC
Digital
BLUE text: Register
SPDIF_OUT
encoder
S/PDIF
24/16
sample rate
upconverter
upconverter
Sample rate
with filters
and hold
Sample
Filterless
down−
converter
RED text: Pin
Figure 6: AUOI2SMA.DL3 audio path shown in bold brown
Figure 6 shows the automatic audio path activated by the driver. The driver copies the
sum of the DAC and DAOSET drivers, with volume applied to the DAC contents, and
sends them to I2S. To function, it needs a DAC (e.g. AUODAC.DL3) and/or DAOSET
(e.g. AUOOSET.DL3) driver to be installed.
Rev. 3.57 2019-04-10 Page 19(62)

HH
VS1005 VSOS AUDIO SUBSYSTEM VS1005g
The sample rate is set to a default of 96000 Hz / 32 bits. Anything played back through
VS1005’s analog audio path is converted to the target sample rate by VS1005 hardware.
7.5.2 Driver AUOI2SM.DL3
DAOSET_LEFT
DAOSET_RIGHT
DAC_LEFT
DAC_RIGHT
I2S_LEFT
I2S_RIGHT
SP_LDATA
SP_RDATA
24
24
24
24
24 24
24
24
24
DAC_VOL
32/16
SRC_CF
DAC +
output
drivers
I2S_CF
Analog
I2S_BCK,I2S_FRM
I2S_DO
SRC_LEFT
SRC_RIGHT
CBUF
RIGHT
LEFT
DAOSET_CF
DAC_SRC
Digital
SPDIF_OUT
encoder
S/PDIF
24/16
sample rate
upconverter
upconverter
Sample rate
with filters
and hold
Sample
Filterless
down−
converter
RED text: Pin
BLUE text: Register
Figure 7: AUOI2SM.DL3 audio path shown in bold brown
If you need to send independent audio to the DAC and I2S, using AUOI2SM.DL3 is
required. Note, however, that that driver can only support the basic master mode sample
rates (e.g. not 44100 Hz).
Figure 7 shows the manual audio path activated by the AUOI2SM.DL3 driver.
7.5.3 Driver AUOI2SS.DL3
The AUOI2SS.DL3 is otherwise similar to AUOI2SM.DL3 (Chapter 7.5.2), except that
the driver operates in slave mode.
In slave mode the user has no control over sample rate, so the audio cannot be fed
anywhere else except the I2S output without resynchronization. Currently there does
not exist a driver to synchronize I2S slave output with DAC output. Also there is no
driver to synchronize inputs with I2S slave output.
Rev. 3.57 2019-04-10 Page 20(62)
This manual suits for next models
1
Table of contents