Audio in Embedded Linux Systems

Audio in Embedded Linux Systems

Audio in embedded Linux systems Audio in embedded Linux systems Free Electrons 1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Rights to copy © Copyright 2004-2009, Free Electrons [email protected] Document sources, updates and translations: http://free-electrons.com/docs/audio Corrections, suggestions, contributions and translations are welcome! Attribution ± ShareAlike 3.0 Latest update: Sep 15, 2009 You are free to copy, distribute, display, and perform the work to make derivative works to make commercial use of the work Under the following conditions Attribution. You must give the original author credit. Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode 2 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Scope of this training Audio in embedded Linux systems This training targets the development of audio-capable embedded Linux systems. Though it can be useful to playing or creating sound on GNU/Linux desktops, it is not meant to cover everything about audio on GNU/Linux. Linux 2.6 This training only targets new systems based on the Linux 2.6 kernel. This way, you leverage the most advanced technology and don©t learn about something getting obsolete. 3 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Contents (1) Introduction Advanced Linux Sound Glossary Architecture (ALSA) Audio codecs and file formats ALSA kernel drivers Kernel low latency requirements System perspective ALSA userspace interface System overview Sound servers 4 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Contents (2) Free Software audio Audio players for the embedded target Audio encoders Creating your own applications Miscellaneous Speech synthesis Audio distributions References 5 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Quick Glossary PCM: Pulse Code Modulation Digital audio encoding, representing the amplitude of a signal at uniform intervals. Codec: coder / decoder Program or device coding and / or decoding a data stream or a signal. MIDI: Musical Instrument Digital Interface. Standard to control electronic musical instruments. See http://wikipedia.org for details! 6 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Audio in embedded Linux systems Free Software Audio Audio codecs and file formats 7 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com MP3 MPEG-1 Audio Layer III The most popular. Users have lots from the Fraunhofer Society of files in this format. Lossy audio format Free Software encoders and decoders exist Bitrates from 32 to 320 kbit/s But relies on patented algorithms. Quality depends on the bitrate: Depending on which country you 128-192: good, 192-224: very sell to, you may have to pay for a good, 224-320: excellent license. Depends also pretty much on the Licenses can apply to encoding, encoder and on the source. decoding or even songs! Depends on the listener too! Ask for legal advice! See http://en.wikipedia.org/wiki/Mp3 for details 8 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com AAC Advanced Audio Coding Used on some on-line music stores MPEG-4 Audio (Apple iTunes) and portable players (Apple iPod). Standard format from the MPEG group: Dolby, Fraunhofer, AT&T, Also burdened by patents, like MP3. Sony, and Nokia License needed to encode and read this format. Lossy audio format Free Software decoders available. Designed to replace MP3. Consistently better audio quality Just one Free Software encoder than MP3 at lower bitrates. available (faac). Can be DRM encrypted (FairPlay). More details on http://en.wikipedia.org/wiki/Advanced_Audio_Coding 9 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com RealAudio From RealNetworks Free Software decoder available: http://realnetworks.com/ mplayer Mainly used for streaming, used by Lossy audio format a significant number of on-line Proprietary format media. Useful for mobile devices Designed for connecting to these media. very low bandwidth connections. Only proprietary encoders. Bitrates: 12 to 800 kbit/s RealNetworks encoder free of Now uses AAC at 128 kbit/s and charge only for personal use. more. Lossless format also supported More details on http://en.wikipedia.org/wiki/Real_Audio 10 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com WMA Windows Media Audio Now supported by more and more digital players and on-line music Microsoft proprietary, as a stores. Users may ask for WMA alternative to MP3 (patented by playing capability. somebody else) and now AAC. Lack of Free Software players Almost always encapsulated in an (except libavcodec) and Advanced Systems Format (ASF) encoders. file. Relies on patented algorithms. File extensions: asf or wma Licenses may apply to encoding, Supports constant and variable decoding or even songs, though MS bitrates, and lossless compression. is still very tolerant so far (to achieve Can be DRM encrypted. dominance). See http://en.wikipedia.org/wiki/WMA for details 11 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Ogg Vorbis From the Xiph foundation Growing in popularity. More and http://xiph.org/ more hardware players available. Ogg: container for multimedia Xiph.org releases libraries under a streams BSD-style license and GPL for tools. Vorbis: lossy audio format Various Free Software decoders Open, patent and royalty free! and encoders available. Supported by many proprietary players too. Bitrates from 45 to 500 kbit/s Variable bitrate Achieves better quality than MP3 at low bitrates. See for http://en.wikipedia.org/wiki/Ogg_vorbis details 12 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Ogg Speex From the Xiph foundation Constant or variable bitrate, http://www.speex.org/ from 2 to 44 kbit/s. Ogg: container Listen to samples on Usual file extension: .spx http://speex.org/samples/. Speex: lossy audio dedicated to Free Software encoder, speech encoding. decoders and applications available. Targets Voice over IP applications, voice mail Even supported by proprietary archival, audio books... tools (e.g. MS NetMeeting). Open, patent and royalty free! See http://en.wikipedia.org/wiki/Speex for details 13 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Flac http://flac.sourceforge.net/ Libraries available under a BSD- Supported by Xiph.org like license, and tools under the GPL. Lossless audio compression format Free Software players available. Compress audio files at no risk! Even starts to be supported by Preferred format for trading live hardware players. music on-line. Supports streaming. Ogg: also used as a container. Integer-only coder and decoder available. See http://en.wikipedia.org/wiki/FLAC for details 14 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Compression rate example comparison (1) Format / 64 kbit/s 128 kbit/s 192 kbit/s 256 kbit/s bitrate Wav 100.00% MP3 4.6% (22:1) 9.1% (11:1) 13.6% (7:1) 18.2% (5:1) (lame 3.96.1) Ogg Vorbis 4.3% (23:1) 8.5% (12:1) 12.7% (8:1) 17.7 % (6:1) (oggenc 1.0.1) Flac (flac 1.1.0) 56.30% bzip2 (1.0.2) 89.50% Source: Omara Portuondo, Flor de Amor (Cuban Salsa) 15 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Compression rate example comparison (2) Compression rate (same example) 120 100 Wav 80 MP3 Ogg Vorbis Flac 60 bzip2 40 20 0 64 kbit/s 128 kbit/s 192 kbit/s 256 kbit/s 16 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Audio in embedded Linux systems System perspective 17 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Traditional system architecture App1 App2 App3 User applications (concurrent access to resources) Sound driver devices (/dev) Linux kernel Sound drivers Hardware 18 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com OSS The Open Sound System http://www.4front-tech.com/oss.html Old sound card support system in Linux versions up to 2.4. Still used for some cards in 2.6 (porting to ALSA in progress). Originates from the Linux driver for the Sound Blaster 16 sound card. Extended to support other (often compatible) sound cards. Was also made available

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    97 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us