Windows audio architecture Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver.

Slides:



Advertisements
Similar presentations
4/1/2017 4:16 PM.
Advertisements

By: Russ Butler ECE4220 Spring 2012 Dr. DeSouza May 2, 2012.
CHAPTER 16 Audio © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –The fundamentals of sound – –DirectX Audio.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Conversion Between Video Compression Protocols Performed by: Dmitry Sezganov, Vitaly Spector Instructor: Stas Lapchev, Artyom Borzin Cooperated with:
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
1 PC Audio 2 Sound Card  An expansion board that enables a computer to receive, manipulate and output sounds.
Java Audio.
TCP/IP Protocol Suite 1 Chapter 25 Upon completion you will be able to: Multimedia Know the characteristics of the 3 types of services Understand the methods.
CHAPTER 9: Input / Output
1 I/O Management in Representative Operating Systems.
K. Salah 1 Chapter 28 VoIP or IP Telephony. K. Salah 2 VoIP Architecture and Protocols Uses one of the two multimedia protocols SIP (Session Initiation.
A Web Services Based Streaming Gateway for Heterogeneous A/V Collaboration Hasan Bulut Computer Science Department Indiana University.
Socket Programming -What is it ? -Why bother ?. Basic Interface for programming networks at transport level It is communication end point Used for inter.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
DVTS for Windows Keio University, Graduate School of Media and Governance WIDE Project Kazuhiro MISHIMA
Chapter 4: Threads. 4.2CSCI 380 Operating Systems Chapter 4: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux.
Developing WIA Drivers Byron Changuion Developer Windows Imaging Group Microsoft Corporation.
CHAPTER 9: Input / Output
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
Upgrade to Real Time Linux Target: A MATLAB-Based Graphical Control Environment Thesis Defense by Hai Xu CLEMSON U N I V E R S I T Y Department of Electrical.
ATA Miniport Nuts and Bolts
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
I/O Example: Disk Drives To access data: — seek: position head over the proper track (8 to 20 ms. avg.) — rotational latency: wait for desired sector (.5.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent University.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
1 © NOKIA FILENAMs.PPT/ DATE / NN Helsinki University of Technology Department of Electrical and Communications Engineering Jarkko Kneckt point to point.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - VIDEO. In this chapter How digital video differs from conventional analog video How digital video differs from.
Socket Models Different ways to manage your connections.
Chapter 2 Applications and Layered Architectures Sockets.
H.323, IP Multicast Conferencing, And TAPI 3.0 Don Ryan Development Lead Windows Networking And Communications Microsoft Corporation.
3.14 Work List IOC Core Channel Access. Changes to IOC Core Online add/delete of record instances Tool to support online add/delete OS independent layer.
Sound DirectMusic & DirectSound. DirectShow Video Formats DirectShow is an open architecture, it can support any format as long as there are filters to.
What Every Developer Should Know about the Kernel Dr. Michael L. Collard 1.
A Critical Analysis of the Windows mLAN Driver
Speech Processing and Recognition © Florida Institute of Technology Access audio data in real time and apply to speech recognition Final Exam Project By.
Updates and Common Questions Asked by Simulation Developers Peter Shier Architect Windows Devices and Storage Technologies
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
Silberschatz, Galvin and Gagne ©2009 Edited by Khoury, 2015 Operating System Concepts – 9 th Edition, Chapter 13: I/O Systems.
HAT development and experiment Kyoungae Kim, SNU Korea
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Operating System Concepts
LonWorks Introduction Hwayoung Chae.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Introduction to Operating Systems Concepts
What is DirectX? DirectX is built by Microsoft as a collection of API’s (Application Programming Interfaces) for the purpose of multimedia processing.
Chapter 3: Windows7 Part 5.
Network Controllable MP3 Player
Aurimas Jankauskas IT3gr.
Chapter 6 Input/Output Organization
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
CS501 Advanced Computer Architecture
Hands-On Microsoft Windows Server 2008
CS 286 Computer Organization and Architecture
Chapter 3: Windows7 Part 1.
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 5.
GEOMATIKA UNIVERSITY COLLEGE CHAPTER 2 OPERATING SYSTEM PRINCIPLES
Chapter 2: System Structures
Chapter 2: The Linux System Part 1
I/O Systems I/O Hardware Application I/O Interface
Chapter 3: Windows7 Part 2.
CS703 - Advanced Operating Systems
Today’s agenda Hardware architecture and runtime system
Embedded Operating Systems
Outline Operating System Organization Operating System Examples
Core Audio API Augustinas Žiliukas IT 3 grupė.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Windows audio architecture Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver IEEE 1394 Device Driver PCI CARD Driver ISA CARD Driver User Mode Kernel Mode Windows Components By Hardware Vendor Windows Driver Model – supported by Win 98, Win ME, Win 2K and Win XP – a single audio driver works for multiple Windows versions APIs – DirectSound – WinMM Kernel streaming – multiple audio streams can be played at the same time – SysAudio.SYS decides the optimal audio format and sample rate conversion – Kmixer.SYS performs the actual converting

WinMM API Simple, but – high latency – inability to take advantage of hardware acceleration – no easy way to implement features, e.g. 3-D positioning, effect processing Play audio – waveOutOpen(…) - open the output audio device – waveOutWrite(…) - write the waveform audio data – waveOutClose(…) - close the output audio device – need to use callback or polling to check the result Not very interesting to real-time applications

DirectSound API - over view Audio component of DirectX package – low latency – use hardware acceleration – direct access to sound device – support capturing sound Two programming interfaces – COM (Component Object Model) in C++ –.NET in C++, C#, Visual Basic, etc. Important objects – secondary buffers: write/read audio data – buffer cursors: point to current captured/played audio data – buffer notifications: send events when buffer cursors reach a position

DirectSound API - COM interfaces IDirectSound8 – CreateSoundBuffer( descriptor, bufferPointer, … ) create a sound buffer object to manage audio samples fields of descriptor – buffer size – audio format: commonly16 bits linear PCM – buffer features – SetCooperativeLevel( windowHandle, level ) set the priority of the sound buffer

DirectSound API - COM interfaces IDirectSoundBuffer8 – Lock( offset, size, addr1, size1, addr2, size2, flag ) ready all or part of the buffer for a data write and return pointers to which data can be written – Play( reserved, priority, flags ) cause the sound buffer to play, starting from the play cursor – Unlock( addr1, size1, addr2, size2 ) release a locked sound buffer – Stop() cause the sound buffer to stop playing

DirectSound API - COM interfaces IDirectSoundNotify8 – SetNotificationPositions( NumberOfNotifyStructure, ArrayofNotifyStructure ) set the notification positions; during playback, whenever the play cursor reaches one of the specified offsets, the associated event is signaled fields of NotifyStructure – buffer offset – notify event Sound capturing is similar

DirectSound API - code example 1. Streaming audio in an event-driven thread while (true) { DWORD r = WaitForSingleObject(event, INFINITE); // receives notification of refilling buffer if (r == WAIT_OBJECT_0) { Buffer.Lock(offset, size, &addr1, &size1, &addr2, &size2, 0); // copy audio to buffer addresses returned // by DirectSound // could be two addresses because of buffer // wrap-around memcpy(addr1, audio, size1); if (size2 != 0) { memcpy(addr2, left, size2); } Buffer.Unlock(addr1, size1, addr2, size2); } } // while

Windows audio architecture revisited Can we achieve lower latency? – kernel mixing introduces at least 30 ms of delay – kernel mixing is not necessary if I’m the only application generating audio streams – How about interacting with device drivers directly? Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver IEEE 1394 Device Driver PCI CARD Driver ISA CARD Driver User Mode Kernel Mode By Hardware Vendor Windows Components

DirectKS - the unofficial audio API Win MM Application DirectSound Application SysAudio.SYS Kmixer.SYS WinMM.DLLDSound.DLL Device Drive Container USB Device Driver IEEE 1394 Device Driver PCI CARD Driver ISA CARD Driver User Mode Kernel Mode DirectKS Application By Hardware Vendor Windows Components Pros – very low latency Cons – only one application can play sound at one time – applications need to handle audio format and sample rate conversion – might not work in future version of Windows

The next-generation Windows audio – None of the current audio interfaces satisfies real- time applications transition between user mode and kernel mode for each I/O request blocking upon completion of an I/O request CPU cycles for copying data – WaveRT (wave real-time) drivers in the next version of Windows - “Longhorn” data flow directly between the client and the audio hardware

Learn more – URLs overview – rary/en-us/dnwmt/html/audiooverview.asp Windows Driver Model (WDM) – dmaudio.mspx#wdm1 DirectKS – rectKS.mspx WaveRT – Tport.mspx

Audio library overview – Transmit audio over the internet use low latency audio APIs – DirectSound or DirectKS pluggable codecs – G.711, GSM, Speex, iLBC modular playout buffer integrated with rtplib++ – System Requirements Windows XP or Windows 2K DirectSound 9.x runtime libraries Visual C++ runtime libraries – Initialization: session.setUserName( ) session.setUserInfo(map ) session.setRemoteAddress(, ) session.setLocalAddress(, )

Audio library architecture SIP user agent Encoder Rtplib++ DirectSound/DirectKS Socket Decoder Playout buffer Audio tool GUI SIP user agent Encoder Rtplib++ DirectSound/DirectKS Socket Decoder Playout buffer Audio tool GUI Network

Audio library API – Initialization setUserName( name ) – set the local user name setRemoteAddress( host/IP, port ) – send audio to this address setLocalAddress( host/IP, port ) – receive audio from this address setPlayerAudioFormat( audioFormat ) – play audio in this format setCapturerAudioFormat( audioFormat ) – capture audio in this format

Audio library API – Initialization (Cont.) setEncoder( encoder ) – use this encoder to encode audio – encoder can be created by encoder = SpeexEncoder - create a Speex encoder instance encoder.setPayloadType( payLoadType ) - set RTP payload type encoder.setOutputAudioFormat( audioFormat ) - set the encoded format setDecoder( decoder ) – … (similar to encoder) – Start startReceiver()/startSender() – start to receive/send audio

Audio library delay – One-way mouth-to-ear delay measurement of audio library using DirectSound and DirectKS DirectKS shows close to 30 ms improvement over DirectSound