The audio architecture in android has to take care of many aspects such as supporting more hardware such as HDMI, earpiece, headset, speaker, mic, Bluetooth SCO, A2DP ectc, relat-time requirements and supporting different software like media player/recoder, VIOP application, SIP application and phone calls. OS Detailsĭirectly applies for Android 5.1 and lower May require few changes for Android 6.0 and Android 7.0. The below block diagram shows the audio architecture in Android.īefore we are going into platform specific details, let us see few basics of audio and its PCM terminologies which will be useful when developing a audio HAL for ALSA based audio devices. Basics of AudioĪn audio signal is a representation of sound, typically as an electrical voltage. Analog : Analog refers to audio recorded using methods that replicate the original sound waves.Īudio signals have frequencies in the audio frequency range of roughly 20 to 20,000 Hz (the limits of human hearing).Digital : Digital audio is recorded by taking samples of the original sound wave at a specified rate.Įxample: Human speech, sound from musical.Example : CDs, Mp3 filesĬonversion of Analog audio signals to digital audio is usually done by Pulse-code modulation (PCM). In the below image an analog sine wave is sampled and quantized for PCM and this process is called as modulation or analog-to-digital conversion (ADC). The reverse process is called demodulation or Digital-to-analog conversion (DAC). Here are few PCM Terminology and Concepts that are used in any audio device drivers. Samples: In PCM audio, both input or output are represented as samples. A single sample represents the amplitude of sound at a certain point in time. To represent a actual audio signal a lot of individual samples are needed. For example,in a DVD audio 44100 samples are taken every second. similarly for VOIP/SIP/telephone it is 8000 samples/sec and in CD it is 44100 samples/sec.Ĭhannels: An audio channel is an audio signal communications channel in a storage device, used in operations such as multi-track recording and sound reinforcement. MONO channel : It uses only one single signal to feed all the speaker.Ĭhannels are generally classified into two types.STEREO channels: It uses more than one (usually two) signals to feed different speakers with different signals.įrame: A frame represents exactly one sample.In case of mono channel sound, a frame is consists of single sample. Whereas in stereo(2 channel), each frame consists of two samples.įrame size: Frame size is the size in bytes of each frame. This too vary based on number of channels. For example,in mono, the frame size is one byte (8 bits ). Sample Rate or simply “Rate” is defined as the number of samples per second. PCM sound consists of a flow of sound frames.ĭata rate: Date rate is the number of bytes, which must be recorded or provided per second at a given frame size and rate. Period: Period is the time interval between each processing frames to the hardware. Period size: This is the size of each period in Hz. These concepts are very much useful when you working on Audio HAL for different hardware devices such HDMI audio, Bluetooth SCO audio devices etc. Audio ArchitectureĪndroid audio architecture defines how audio functionality is implemented and points to the relevant source code involved in the implementation. The application framework includes the app code, which uses the dia APIs to interact with audio hardware. For example, media player application, voice recorder application, SIP call application etc are the applications which are going to use audio hardware. The JNI code associated with dia calls lower level native code to access audio hardware. The native framework provides a native equivalent to the dia package, calling Binder IPC proxies to access the audio-specific services of the media server. Native framework code is located inīinder IPC proxies facilitate communication over process boundaries.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |