Title: SAFIRE 4G Audio Tool Box
1SAFIRE 4G Audio Tool Box
- Concept - Architecture - Building blocks Demo
applications
2Introduction
- Target of the AudioToolBox demo bundle is to
- Present SAFIRE-4G framework and IDE/Y development
environment. - Present features of the new Y language.
- Present some under development Y features, such
as Dialog Magic. - Since both tools/Y language and demo are under
development, current limitations are - Demo is based on the IDE0.55/Y0.8 tool
version - Only one instance of different AudioToolBox
building blocks (FSMs) can be used per
application.
3Getting started
- Install IDE0.55, Y0.8 and DbgView
- Install AudioToolBox demo
- It will create new Y_atb user
- Open IDE as Y_atb user
- Open workspace Y_Atb and build it, selecting from
the menu build-gtall - Run demo applications (right click-gtRun)
- There are two application types (for details see
next slides) - Simple applications, without GUI interface
- Simple dialog applications, with basic GUI
interface - Run demo applications and enjoy!
4Audio Tool Box demo
5Basic projects
- Y_Common folder contains definitions of the
- Configuration structure types (ConfigATB_TP)
- Data interface signal list (Data_SL)
- Management interface signal list (MgtExt_SL)
- Y_FSMs folder contains
- Implementation of the different AudioToolBox
building blocks, such as AudioIn, Volume, etc.
6Simple applications projects
- Y_MgtFSMs folder contains implementation of the
- Management FSMs
- Y_App folder contains
- Implementation of the different AudioToolBox
simple demo applications - Names of the demo applications are self
explanatory - For example, App_AudInDelVolOut is
AudioIn-gtDelay-gtVolume-gtAudioOut
7Simple dialog applications projects
- Y_DlgFSMs folder contains implementation of the
- Management FSMs containing simple GUI dialogs
- Y_AppDlg folder contains
- Implementation of the different AudioToolBox
simple demo applications using GUI dialogs - Names of the demo applications are self
explanatory - For example, App_DtmfPiano demonstrates playing
DTMF tones
8Audio Tool Box demo
9Concept Architecture
- FSM based framework
- FSMs implemented in Y language, with built in
functions in C - Architecture with 4 building block FSM levels
- Management FSMs (configuration and application
control) - Top Level FSMs (audio data generators such as
AudioInput) - Middle Level FSMs (audio data processing such
as Volume) - Bottom Level FSMs (audio data receivers such as
WavWriter) - Bidirectional SIGNAL type interfaces (Data_SL)
with handshake for inter-FSM data communication - Bidirectional SIGNAL type interfaces (MgtExt_SL)
for management inter-FSM communication - STRING type interfaces for internal FSM
communication (from the other threads) - Signaling concept and signal flow are described
in more details and depicted on the next slides
10Interface types signal lists
- MgtExt_SL
- SIGNAL Configure( ANY Configuration)
- SIGNAL Start()
- SIGNAL Stop()
- SIGNAL Request( ANY RequestParam)
- SIGNAL Indication( ANY IndicationParam)
- Data_SL
- SIGNAL Act_Req()
- SIGNAL Act_Ind()
- SIGNAL Deact_Req()
- SIGNAL Deact_Ind()
- SIGNAL Data_Req( STRING PDU)
- SIGNAL Data_Ind( STRING PDU)
- STRING
- Data string
11Signaling MgtExt_SL concept
- Management Level Audio Tool Box FSMs
- Generate Start(), Stop(), Configure(
CONFIGURATION) and Request(REQUESTPARAM) signals - Receive Indication( INDICATIONPARAM) signal
- Top Level Audio Tool Box FSMs
- Receive Configure( CONFIGURATION) signal and
configure itself according to the received
configuration parameters - Receive Start() signal, open itself and generates
Act_Req() signal on the Data_SL interface (to
open/start data flow) - Receive Request( REQUESTPARAM) signal and
performed required action (for example, send
specified DTMF digit) - Receive Stop() signal, close itself and generates
Deact_Req() signal on the Data_SL interface (to
close/stop data flow) - Middle Level Audio Tool Box FSMs
- Receive Configure( CONFIGURATION) signal and
configure itself according to the received
configuration parameters - Bottom Level Audio Tool Box FSMs
- Receive Configure( CONFIGURATION) signal and
configure itself according to the received
configuration parameters - Generate Indication( INIDICATIONPARAM) signal, as
a result of some audio detection (for example
DTMF digit or silence is detected)
12Signaling Data_SL concept
- Top Level Audio Tool Box FSMs
- Generate Act_Req() and Deact_Req() signals
- Receive Act_Ind() and Deact_Ind() signals
- Generate Data_Req( PDU) signal containing PCM16
audio data in PDU - Signal Data_ind( PDU) currently not used (since
audio flow is unidirectional - Middle Level Audio Tool Box FSMs
- Directly forward Act_Req(), Deact_Req(),
Act_Ind() and Deact_Ind() signal between IN/OUT
DATA_SL gates - Receive Data_Req( PDU) signal from the IN gate,
process PDU and send signal with new PDU to the
OUT gate - Signal Data_ind( PDU) currently not used (since
audio flow is unidirectional) - Bottom Level Audio Tool Box FSMs
- Receive Act_Req() and Deact_Req() signals
- Generate Act_Ind() and Deact_Ind() signals
- Receive Data_Req( PDU) signal containing PCM16
audio data in PDU - Signal Data_ind( PDU) currently not used (since
audio flow is unidirectional)
13Signaling sequence (example 1)
14Signaling sequence (example 2)
15Implementation
- FSMs implemented in Y
- Additional functionality using C Built In
functions - For every FSM test pair FSM is implemented for
testing purposes
- Connected back-to-back on all FSM interfaces
- Provides minimal features for testing of the
basic FSM functionality - Send signals to the FSM under test
- Accept signals from the FSM under test and
displays them in DbgView window
16Audio Tool Box demo
17Main building blocks
- Top Level FSMs
- Input blocks (Data_SL 1 OUT, MgtExt_SL 1
IN) - Audio In
- Wav Reader
- DTMF Generator
- Bottom Level FSMs
- Output blocks (Data_SL 1 IN, MgtExt_SL 1
IN) - Audio Out
- Wav Writer
- Detector blocks (Data_SL 1 IN, MgtExt_SL 1
IN) - DTMF Detector
- Silence Detector
- Middle level FSMs
- Processing blocks (Data_SL 1 IN and 1 OUT, 1
MgtExt_SL IN) - Delay
- Volume
- Branch blocks (Data_SL N INs, Data_SL - M
OUTs)
18Audio In FSM
- Manage Audio input (microphone)
- Uses PCM 16-bit audio format for PDU
- Pumps audio data packet (Data_Req signal) every
20ms - Configuration info
- SEQUENCE
- NUMBER SamplesPerSec
- Config_Aud_T
19Wav Reader FSM
- Reading from input Wav file (A-Law, 8000 Hz,
64kbps, mono) - Pumps audio data packet (Data_Req signal) every
20ms - Format of the audio data output (PDU) should be
configured (ALAW or PCM16) - Configuration info
- SEQUENCE
- STRING FileName
- STRING Format
- Config_Wav_T
20DTMF Generator
- Use DTMF tone buffers
- 12 DTMF digits
- Configurable Sample Rate
- Configurable DTMF tone length (in 20ms
increments) - Generate audio data output (Data_Req signal)
- 16-bit PCM format for PDU
- Send DTMF Tone (N packets, on 20ms)
- Configuration info
- SEQUENCE
- NUMBER SamplesPerSec
- NUMBER Len20msIncr
- Config_DtmfGen_T
21Delay
- Receive (from IN gate) and send (to OUT gate)
Data_Req signals with PDU in PCM 16-bit format - Delay in 20ms intervals
- for DelayN, N 20ms actual delay
- Incoming audio packet (PDU of the Data_Req
signal) processing - Save received Mth packet (PDU) in Packets
buffer - Find (M-N)th packet (PDU) stored in Packets
buffer and send it - Configuration info
- SEQUENCE
- NUMBER Len20msIncr
- Config_Del_T
22Volume
- Receive (from IN gate) and send (to OUT gate)
Data_Req signals with PDU in PCM 16-bit format - Volume defined as MULTIPLIER / DIVIDER
- Incoming audio packet (PDU of the Data_Req
signal) processing - Every sample of the incoming packet (PDU)
multiplied by volume and stored as output sample - Send prepared output packet (PDU)
- Configuration info
- SEQUENCE
- NUMBER Multiplier
- NUMBER Divider
- Config_Vol_T
23Splitter
- Provide Data_SL interface (Data_In_G) branching
into two Data_SL interfaces (Data_OutA_G and
Data_OutB_G) - Receive any Data_SL signal input from Data_In_G
and forward it to two outputs (A and B) - Data_OutA_G
- Data_OutB_G
- Receive any Data_SL signal from one of the two
outputs (A and B) and forward it to - Data_In_G
24Mixer 1/2
- Provide merging of two Data_SL interfaces
(Data_InA_G, Data_InB_G) into one Data_SL
interface (Data_Out_G) - Expect audio packets (PDU of the Data_Req signal)
from both inputs (A and B) to be in PCM 16-bit
format and of the same size - A input (Data_InA_G) is master and any signal
received on it is directly forwarded to the
output Data_Out_G, and vice versa, with the
following exception - PDU of the Data_Req received on Data_InA_G is
added (sample by sample) to the stored PDU
(received from B, before) before forwarding to
the Data_Out_G
25Mixer 2/2
- B input (Data_InB_G) is slave and signals are not
forwarded to the Data_Out_G, in order to avoid
endless loops in case where it is used for
feedbacks such as Echo application) - PDU of the received Data_Req is just stored
(saved) - Received Act_Req() and Deact_Req() signals are
just remembered (mark is set) - Signals received for Data_Out_G are forwarded to
the slave input (Data_InB_G) only in some
situations - Received Act_Ind() or Deact_Ind() signal is
forwarded only when signal Act_Req() or
Deact_Ind() signal is received on the Data_InB_G
and marked, before
26Audio Out FSM
- Manage Audio output (sound card)
- Receives Data_Req signal, with PDU in audio
format PCM 16-bit - Configuration info
- SEQUENCE
- NUMBER SamplesPerSec
- Config_Aud_T
27Wav Writer FSM
- Writing to output Wav file (A-Law, 8000 Hz,
64kbps, mono) - Receives Data_Req signal with PDU in audio format
that should be configured (ALAW or PCM16) - Configuration info
- SEQUENCE
- STRING FileName
- STRING Format
- Config_Wav_T
28DTMF Detector
- Recive Data_Req signal, with PDU in PCM 16-bit
format - Process incoming audio packets (PDU of the
Data_Req signal) to detect DTMF digit using one
of the available functions (configured in compile
time) - Slow (using floating point)
- Fast (using integer math)
- Faster (using integer math and inline assembler)
- Generate Mgt_G signal gt Indication( DTMF digit)
- Configuration info
- SEQUENCE
- NUMBER SamplesPerSec
- NUMBER Threshold
- Config_DtmfDet_T
29Silence detector
- Receive Data_Req signal, with PDU in PCM 16-bit
audio format - Process incoming audio data packets (PDU of the
Data_Req signal) to detect silence - Generate Mgt_G signal gt Indication( Silence or
not) - Configuration info
- SEQUENCE
- NUMBER AllowedErrors
- NUMBER SilenceLevel
- Config_SilDet_T
30Audio Tool Box demo
31Simple Applications - concept
- No GUI interface
- Use management FSMs to implement application
level. (start/stop application and other actions
on internal FSM timers) - Configuration parameters should be changed in
management FSM Y code - Use DbgView window to display/check information
- Run DbgView with Print filter in order to
remove unnecessary debug info
32Simple Applications - Management
- Initiates actions using internal timers
- According to the initiated action, appropriate
management signal (MgtExt_SL) is generated and
sent to the Audio Tool Box FSM(s). - On the received management signal (MgtExt_SL)
from some Audio Tool Box FSM, result is displayed
in the DbgView window
33Simple Applications (1/3)
- App_AudInOut
- Uses MgtATB_1_FSM for management
- AudioIn -----gt AudioOut
- App_AudInVolOut
- Uses MgtATB_2_FSM for management
- AudioIn -----gt Volume -----gt AudioOut
- App_AudInDelVolOut
- Uses MgtATB_2_FSM for management
- AudioIn -----gt Delay -----gt Volume -----gt
AudioOut - App_WavRdWr
- Uses MgtATB_1_FSM for management
- WavRd -----gt WavWr
- App_AudInSplitAudOutWavWr
- Uses MgtATB_1_FSM for management
- AudioIn -----gt Splitter -----gt AudioOut
34Simple Applications (2/3)
- App_GenDtmfAudOut
- Uses MgtATB_1_FSM for management
- GenDtmf -----gt AudioOut
- App_GenDtmfDetDtmf
- Uses MgtATB_1_FSM for management
- GenDtmf -----gt DetDtmf
- App_GenDtmfDetSil
- Uses MgtATB_1_FSM for management
- GenDtmf -----gt DetSilence
- App_GenDtmfSplitDetDtmfSil
- Uses MgtATB_1_FSM for management
- DtmfGen -----gt Splitter -----gt DetSilence
- -----gt
DetDtmf
35Simple Applications (3/3)
- App_AudFunnyEcho
- Uses MgtATB_1_FSM for management
- AudioIn -----gt Mixer -----gt Splitter -----gt
AudioOut - -----gt
-----gt - lt---- Volume lt---- Delay
lt----- - lt
- App_DtmfSong
- Uses MgtATB_2_FSM for management
- GenDtmf -----gt AudioOut
36Audio Tool Box demo
- Simple dialog demo applications
37Simple Dialogs
- Implemented using Y Dialog Magic features
- Simple MENU
- About, about SAFIRE 4G
- Help, provides specific application details and
explanations - Exit, exit application
38Dialog Applications - Management
- Management FSMs incorporates required DIALOGs.
- User initiates actions using dialog buttons/menu
- According to the initiated action, appropriate
management signal (MgtExt_SL) is generated and
sent to the Audio Tool Box FSM(s). - On the received management signal (MgtExt_SL)
from some Audio Tool Box FSM, result is displayed
in the dialog
39Simple Dialog Applications
- SPEAKER (App_DlgSpeaker)
- Play with your voice, change volume and delay
- PLAYER (App_DlgPlayer)
- Play WAV file songs from our small collection
- RECORDER (App_DlgRecorder)
- Record your voice in WAV file
- ECHO (App_DlgEcho)
- Play with echo effect, change delay and volume of
the audio feedback - KARAOKE (App_DlgKaroke)
- Sing with music matrix, change volume of your
voice. - DTMF PIANO (App_DlgPiano)
- Play your own music using DTMF tones.
- Architecture (used Audio Tool Box building
blocks, connections) of every application is
depicted on the next slides.
401. SPEAKER (App_DlgSpeaker)
412. PLAYER (App_DlgPlayer)
423. RECORDER (App_DlgRecorder)
434. ECHO (App_DlgEcho)
445. KARAOKE (App_DlgKaraoke)
456. DTMF PIANO (App_DtmfPiano)