Quality Audio Software Pipeline. Presenters Subhranil Choudhury, Rajendra C Turakani

Similar documents
Audio Controller i. Audio Controller

15: OS Scheduling and Buffering

Slow Motion Video. MediaTek Technology White Paper

Module 10 MULTIMEDIA SYNCHRONIZATION

Serial Digital Audio Routing Switchers?

Introducing Audio Signal Processing & Audio Coding. Dr Michael Mason Senior Manager, CE Technology Dolby Australia Pty Ltd

Product Technical Brief S3C2440X Series Rev 2.0, Oct. 2003

Module 12: I/O Systems

Real-Time Multimedia System Analysis: A Breeze in Linux. Whitepaper 1

Module 11: I/O Systems

Chapter 13: I/O Systems

DESCRIPTION FEATURES MULTISTREAM PCI SOUND CARDS 26 DECEMBER 2007 ASI6514, ASI6518

Synopsis of Basic VoIP Concepts

Project Title: Design and Implementation of IPTV System Project Supervisor: Dr. Khaled Fouad Elsayed

Input/Output Systems

Sounding Better Than Ever: High Quality Audio. Simon Forrest Connected Home Marketing

RT USB3000 Technical Description and User Manual. Revision 4.1.

An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal)

LabVIEW programming II

Chapter 13: I/O Systems

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

08 Sound. Multimedia Systems. Nature of Sound, Store Audio, Sound Editing, MIDI

CHAPTER 10: SOUND AND VIDEO EDITING

Introducing Audio Signal Processing & Audio Coding. Dr Michael Mason Snr Staff Eng., Team Lead (Applied Research) Dolby Australia Pty Ltd

CS 856 Latency in Communication Systems

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

The control of I/O devices is a major concern for OS designers

Data Transmission Definition Data Transmission Analog Transmission Digital Transmission

Product Information Sheet PDA14 2 Channel, 14-Bit Waveform Digitizer APPLICATIONS FEATURES OVERVIEW

Fundamental of Digital Media Design. Introduction to Audio

C. Zeitnitz December 2017 WaveIO Version 1.08 A Soundcard interface for LabView with WASAPI and ASIO support. C. Zeitnitz

WaveIO Version 1.02 A Soundcard interface for LabView with ASIO support

INPUT-OUTPUT ORGANIZATION

The Concept of Sample Rate. Digitized amplitude and time

Digidesign CoreAudio Driver Usage Guide

Module 12: I/O Systems

How to achieve low latency audio/video streaming over IP network?

Device-Functionality Progression

Chapter 12: I/O Systems. I/O Hardware

Digidesign CoreAudio Driver Usage Guide (Released and Qualified with Pro Tools 6.9 for HD and LE Systems on Mac OS X)

An evaluation tool for Wireless Digital Audio applications

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Introduction to LAN/WAN. Application Layer 4

A Predictable RTOS. Mantis Cheng Department of Computer Science University of Victoria

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Chapter 13: I/O Systems

2. System Interconnect Fabric for Memory-Mapped Interfaces

Computer Audio Setup Guide

RK3128 Technical Reference Manual Rev 1.0. Chapter 47 I2S 8-channel Overview Features

CODING METHOD FOR EMBEDDING AUDIO IN VIDEO STREAM. Harri Sorokin, Jari Koivusaari, Moncef Gabbouj, and Jarmo Takala

D Demonstration of disturbance recording functions for PQ monitoring

Product Technical Brief S3C2416 May 2008

Embedding Audio into your RX Application

Preferred Settings to Play all File Types with JRiver Media Engine 20 using a Windows 7 or 8 Computer

Chapter 5.5 Audio Programming

COMP 273 Winter asynchronous I/O April 5, 2012

THE STA013 AND STA015 MP3 DECODERS

I/O Systems. 04/16/2007 CSCI 315 Operating Systems Design 1

IP Video Phone on DM64x

Word Clock Select. 188 Digital I/O, Setup, and Utilities. Wordclock. 1. Use the [DIGITAL I/O] button to locate the DIGITAL I/O 1/5 page.

Upgrading to Pro Tools 6.9

Mytek FW DIO Card User Manual

About sounds and Animate CC

Welcome to this presentation of the STM32 direct memory access controller (DMA). It covers the main features of this module, which is widely used to

A490 Machine Vision and Computer Graphics

COMP asynchronous buses April 5, 2016

Pro Tools LE 7.1.2r2 on Mac for Pro Tools LE Systems on Mac OS X 10.4 ( Tiger ) Only

lecture 22 Input / Output (I/O) 4

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

Chapter 5 - Input / Output

Ref: Chap 12. Secondary Storage and I/O Systems. Applied Operating System Concepts 12.1

Lecture 2: September 9

16.2 Block Diagram dma interface Transmit FIFOs Transmitters surround audio output AHB BUS System Interface Clock Generator I2S BUS interrupt interfac

Ah- Ah- Piu Final Project Presentation

Live 7 Audio Fact Sheet

_APP B_549_10/31/06. Appendix B. Producing for Multimedia and the Web

Chapter 13: I/O Systems

Mobile Operating Systems Lesson 01 Operating System

Operating System Design Issues. I/O Management

User Manual. for ArcTrax UWP version

ARM processor organization

ECE 3055: Final Exam

Preferred Computer Settings for a PC using Windows 7 or 8 with JRiver Media Engine 20.xx

Owner s Manual DA-300USB D/A CONVERTER. Appendix. Contents. You can print more than one page of a PDF onto a single sheet of paper.

The von Neuman architecture characteristics are: Data and Instruction in same memory, memory contents addressable by location, execution in sequence.

Motion Control Computing Architectures for Ultra Precision Machines

The S6000 Family of Processors

Pro Tools Addendum. Version for LE Systems on Windows or Macintosh. Digidesign

STM32 Journal. In this Issue:

Pro Tools LE 7.0 on Macintosh for Pro Tools LE Systems on Mac OS X 10.4 ( Tiger ) Only

The LM49370 PCM/I 2 S Bridge

Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles

Announcement. Computer Architecture (CSC-3501) Lecture 23 (17 April 2008) Chapter 7 Objectives. 7.1 Introduction. 7.2 I/O and Performance

Comprehensive Design Review. Sync-In March 4, 2015

CSE398: Network Systems Design

Product Technical Brief S3C2413 Rev 2.2, Apr. 2006

Advanced Memory Organizations

Network Upgrade for the LINK DAC III

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION

WIFI VS BLUETOOTH Bluetooth. Wi-Fi.

Transcription:

Quality Audio Software Pipeline Presenters Subhranil Choudhury, Rajendra C Turakani 1

2 Agenda Scope is limited to Audio quality considerations in software audio pipeline Journey of Audio frame in a Multimedia system List of issues observed during audio processing Configuration and Usage Best practices

3 What is an audio frame? An audio frame is one audio sample For a stereo data one left channel and one right channel sample forms one frame Example One 16 bit left data + One 16 bit right sample = One 32 bit audio frame For multi-channel one sample from channels combined forms one audio frame

4 What is sampling rate? Rate at which audio data is sampled Number of samples per unit of time Audio data is generally sampled at 44.1KHz or 48KHz Voice data are sampled at 8KHz or 16KHz

5 Audio Capture Path Line in / MIC in Analog to Digital Processor Compressed In SD card/hard disk/ USB

6 Audio Playback Path From SD card/hard disk/usb Un-compressed Processor Digital to analog Speaker/Line-out

7 Journey of an Audio frame in a multi-media system ADC Serial Digita l Data De- Serial izer PARALLEL CPU COPY Encode Engine DMA/IRQ/ POLL BASED COPY Volati le MEM ORY APPLI CATI ON SD card/usb /Hard Disk DAC Serial Digita l Data Serial izer PARALLEL CPU COPY Decode Engine

8 Serial Data Protocols Serial Transfer Protocols Stereo Multi-channel I2S DSP(either left or right aligned) TDM AC97

9 Parallel Audio Transfer Polling Based DMA Parallel Data transfers Interrupt based DMA transfers are preferred other modes are CPU intensive and may impact real time performance.

10 Audio software pipeline - perspective In any multi-media system audio quality is one of the very first things that help the product stand out. Considerable precautions are taken in designing the audio hardware so that it does not introduce any noise or anomaly in the audio. So it becomes utmost important for the software developer to take care while he processes the audio.

11 Common issues in audio pipeline The following list brings out some of the very common audio quality concerns Audio Overrun More of concern in the audio capture path. Occurs if the hardware audio data capture rate is faster than the rate at which it is consumed by the software. Audio Under-run More of concern in the audio play-out path. Occurs if the audio data play-out rate is faster than the rate at which data is fed to the hardware by the software.

12 Common issues in audio pipeline contd. Clipping A form of wave form distortion Occurs when the ADC and DAC gains are set to a very high value

13 Issues observed in audio path contd. Incorrect sampling rate configuration Sampling rate configuration of the system does not match the desired audio data sampling rate. Faster or slower audio depending on whether the sample-rate configured is more or less than the required. Buffer width mismatch Significant mismatch in the driver and application buffer sizes increases the probability of audio under-runs and over-runs. Channel swap One channel data is swapped with the other channel data

14 Issues observed in audio path contd. Noise, glitches, breaks Causes: Software processing rate does not match with the hardware data rate Improper DMA configuration Noise included by the audio hardware Impacts: Audio quality degradation

15 Considerations for quality Audio Software Pipeline Serial Interface Modes: DSP Mode and I2S mode Shift register level overruns TDM and low latency configurations DMA configurations Sample Rate and Buffer Sizes Software resampling

Serial Interface Modes: DSP Mode and I2S mode 16 DSP mode and I2S mode are the two standard interfaces between Audio Codec and the Processor. These modes are used to transfer the digitized Audio data from the decoder to the processor while recording and vice versa while playback.

17 DSP Mode and I2S mode : Waveforms DSP Mode of transfer I2S Mode of transfer

DSP Mode and I2S mode : notable differences 18 DSP Mode One single sync pulse to determine the start for frame Bit clock can be much higher than required. The data would be sent as either left justified or right justified Higher bit clock may required faster DMA event generation if the serial port is not configured rightly I2S Mode Sync has 50% duty cycle. Its high during left channel data transfer and low during right channel data transfer Bit clock can be lower and may be equal to the no of bits to be transferred during the sync period. Due to slower clock we may get away with unoptimizations on serial port transfer.

19 DSP Mode: DMA optimizations DMA optimizations are necessary for DSP mode of transfers else the audio could look jittery owing to higher bit clock and the end user may hear click sounds once in a while. Transfer configuration that works perfectly fine for I2S mode of transfer should be reviewed if the mode of transfer is DSP. Following example illustrates one configuration optimization that is necessary.

20 DSP Mode: Configuration optimization Configuration 1 32 bit Stereo Audio No of frames: 1 Word Length: 32 Configuration 2 32 bit Stereo Audio No of frames: 2 Word Length: 16 32 bit word 16 bit word 16 bit word Clock Clock Frame Sync Frame Sync Data Data

21 DSP Mode: Best practices Minimize the number of frames Ideal case would be to have one single frame One frame per transfer This would also avoid DMA transfers within a sample Trigger at frame boundary This gives ample time to schedule DMA transfers Less loaded DMA higher bit clocks (up to 256 fs) result in higher rate of DMA transfers rates which causes higher load on DMA and may result in sample misses.

22 Sample rate - configuration Incorrect configuration of sample rate would lead to anomalies at capture and playback. Accuracy and Synchronization of clocks in streaming system is utmost necessary to achieve good quality audio. Inaccuracy in Sample rates at capture and playback could lead to Brakes in the audio Overruns and under runs at buffer Loss of Audio Video synchronization

23 Buffer size - configuration Buffer size configuration in the driver as well as application have to be decided based on The application that the system is catering to Sampling rate of the system OS scheduling time If one choses higher sampling rates and lower buffers sizes then definitely the system is prone to overruns and under-runs.

24 Buffer size Selection (20ms Buffer) 640 Bytes 1280 Bytes 8KHz 16KHz 44.1Khz 48KHz 3528 Bytes 3840 Bytes

25 TDM and low latency system - Requirements Very high data-rate Because of multi-channel the data rate is very high Very low latency This implies that the system buffer sizes have to be small enough. No capture over-run No capture sample miss Capture software should be fast enough to match with hardware data rate No playback under-runs No playback sample drop Playback software rate should be fast enough to match with the hardware rate

26 TDM and low latency system Configurations Buffer Management Multi level buffering Buffer management strategy needs to handle the condition of capture over-run and playout under-runs. DMA configurations Proper configuration of DMA for multiplexing and e- multiplexing of TDM data in the playout and capture path respectively OS scheduling OS threads catering to capture and playback should have higher priority so that they get scheduled at the right time intervals

27 Channel Swap Introduction The channel swap could have the following implications: Left channel data getting swapped with Right channel data in a stereo system channel positions being swapped in a multichannel audio configuration Channel swap could occur at the start of recording or playback or it could occur during recording or playback. The issue once started gets propagated throughout the entire span of operation.

Channel Swap Causes (Case I - Start of operation) 28 Processor audio serial port is enabled before the serial port DMA initializations DMA initializations take a few milliseconds to complete. Audio serial port and DMA are configured for 1 channel data transfer Data from the first channel would get over written if DMA transfers do not start in one channel time period In case of stereo data left data will get over-written by the right In case of multi-channel the first channel may get swapped with the channel number that arrives at a time equal to the time taken for the DMA to start

Channel Swap Causes (Case II - During operation) 29 DMA engine is heavily loaded or the audio DMA transfers do not have necessary priority to get scheduled at right intervals Audio data in the audio serial port shift-register gets missed The time DMA is scheduled for a data transfer, the audio data in the serial port shift-register might get over-written by the data from the next channel This kind of serial port shift register level over-runs are very hard to detect and they need some special techniques like enabling hardware interrupts from the serial port to CPU for over-run conditions.

30 Software Re-sampling: Considerations The audio hardware is hard wired to a fixed sampling rate Multiple applications requiring to receive and send data at rates other than the hardware rate Implementation of re-sampling in software then becomes necessary so that all the different applications can access the same hardware resource.

31 Software Re-sampling system schenario Capture Rate -> 8KHz Playback Rate -> 44.1KHz Hardware does not support different sampling frequencies for capture and playback over a single serial port Audio driver allows the first process (capture/playback) to configure the hardware sampling frequency. The other process respects the same and does up/down sampling to adjust to the user specified rate Here we need to configure the hardware to the higher sampling frequency and configure the other for software down-sampling.

32 Software Re-sampling Best Practices Hardware to be set to the highest of the two samples rates when capture and playback are at 2 different sample rates In audio frame works unnecessary software resampling to be avoided. Too many software re-samplers result in Increase in system load In turn results in capture and playout thread scheduling issues In turn results in capture overrun and playout underrun and sample drops Hence degrades the over-all system performance

33 DMA Configuration : Best Practices The audio data transfer from audio serial port shift register to memory using DMA has to be scheduled at right intervals. Failing to do so will result in samples misses in capture and sample drops in playback. To ensure this DMA configurations should take care of the following Highest priority for the audio DMA transfer queue No other high priority transfer scheduled in the same queue. Optimal DMA transfer configurations to Avoid too many interrupts for a single transfer Minimize the time for each transfer

34 DMA Configurations for TDM Best Practices DMA to be used for de-multiplexing the captured data and multiplexing the playback data CPU based multiplexing and de-multiplexing techniques hog the system. Optimal DMA configurations to be done Best option is to use a 3 dimensional DMA transfer technique to optimize the number of transfers and the number of interrupts.

35 Software Audio Pipeline: Key take away Glimpse at audio pipeline Typical issues observed during recording and playback Considerations while designing audio pipeline. Sneak into the real time issues Best practices to avoid typical audio issues Role of DMA configurations

Thank You Q&A 36