AudioEngine: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>UNiversal
m (→‎Hardware capabilities and reported to work: DTS-MA is really DTS-HD MA)
mNo edit summary
 
(102 intermediate revisions by 19 users not shown)
Line 1: Line 1:
{{frodo updated}}
{{mininav|[[Development]]{{l2|[[Audio]] }} }}
'''AudioEngine''' (or AE) refers to XBMC's new audio system, a two-year project spear-headed by [[gnif]] which is intended to be released in v12 (Frodo), and has been merged with master for user testing as of May 15th, 2012.
 
;Why a new audio subsystem?
 
It's been an accepted fact that the existing audio code was little-touched since the early days of XBMC, and was limited by the 16-bit architecture of the original Xbox and codecs available at the time. Dolby '''AC3''' and '''mp3''' (or earlier formats!) ruled the media codec world. Over time HTPC's became more mainstream, more powerful and better connected. '''Analog''' gave way to optical '''SPDIF''' connections, in turn replaced with '''HDMI'''. Processors, GPU's and media formats evolved at a steady pace.
 
With the growth of the HTPC and new formats like those made available with Bluray technology, the audio subsystem was under scrutiny as an area for improvement. Higher definition audio like multichannel '''FLAC''' was becoming a preferred standard for those demanding higher quality audio media. It was time for an update, and what an update!<br />
 
 
== History and Team ==
Early efforts at patching fixes and even an initial attempt at a completely new system fell by the wayside. The scope of the required changes and the complexity of the API made it a daunting task, especially for volunteer programmers working in their spare time.  This was compounded by the fact that XBMC runs on a wide range of hardware and operating systems.  Most of the developers focus on specific platforms or subsystems within the whole of XBMC. Any new system had to be platform-agnostic, cohesive and flexible.
 
In time, it became obvious the project was going to require a full re-write and replacement of the audio engine. Furthermore, XBMC's base of hardware and OS platforms continued to grow. The detailed specifications for the new audio formats were unknown, and of course the master code for XBMC was ever-changing.
 
In November of 2009 [[gnif]] decided to bite the proverbial bullet, and after extensive consultation with the team finalized the API or structure which was to become AE. Drawing in other developers as required, the massive project slowly took shape, and reached the ready-point for user tests a year later. The forum thread for those hardy beta-testers (thank you!) reached over 1,200 posts, and slowly but surely features were added and debugged, and system stability grew.
 
Over the next two years, thanks to the determination of [[gnif]] the core engines, decoders, encoders and utilities that make up '''AudioEngine''' became a reality, and other developers began to contribute to the core and especially the platform-specific sinks or output stages. Among those contributing were [[gimli]], [[fneufneu]], [[memphiz]], [[dddamian]], [[anssi]] and others.
 
There was a goal to have the new audio system ready for Eden 11.0, but there was just too much left to do. Many users were eagerly looking forward to it's inclusion, but stable releases must continue, and AE wasn't ready when the Eden feature-freeze went into effect. During this time the AE code-base was solidified, bugs tracked and squashed, features added and testing increased.
 
On May 15th 2012, [[AudioEngine]] was merged to master. Weighing in at over 22,000 lines of code, it represents one of the single biggest code-merges ever for XBMC. Now for the first time it is readily accessible for all the development team (and users!) to see, test and improve within the greater context of XBMC's master branch.


Team XBMC is proud to at last unveil '''AudioEngine''', bringing HD audio to XBMC!
'''AudioEngine''' or ('''AE''') refers to XBMC's new audio system.


== Features ==
== Features ==
AudioEngine replaces SDL and brings some of the external dependencies into XBMC, and wraps up all the different media types for mixing, samplerate conversion, format conversion, encoding, upmix, downmix, etc.
<br />
;Features of AE include:
;Features of AE include:
* ''support for DTS-MA / Dolby TrueHD Bluray formats''
* ''Support for DTS-HD MA / Dolby TrueHD Bluray formats''
* ''support for 24-bit and floating-point audio at up to 384,000hz''
* ''Support for 24-bit and floating-point audio at up to 384,000hz''
* ''mixing of all streams including GUI sounds even when transcoding audio''
* ''Mixing of all streams including GUI sounds even when transcoding audio''
* ''start-up enumeration of hardware audio devices and their capabilities with log output''
* ''Start-up enumeration of hardware audio devices and their capabilities with log output''
* ''bitstreaming support in [[PAPlayer]] (XBMC's music player)''
* ''Bitstreaming support in PAPlayer (XBMC's music player)''
* ''upmixing of stereo to full channel layout''
* ''Upmixing of stereo to full channel layout''
* ''tighter syncing of A/V streams''
* ''Tighter syncing of A/V streams''
* ''floating-point processing of audio''
* ''Floating-point processing of audio''
* ''24-bit and floating-point decoding/handling of mp3''
* ''24-bit and floating-point decoding/handling of mp3''
* ''full support for [[w:ReplayGain|ReplayGain]]''
* ''Full support for [[w:ReplayGain|ReplayGain]]''
* ''built-in sample-rate conversion and transcoding''
* ''Built-in sample-rate conversion and transcoding''
 
 
;Planned Features for upcoming AE releases:
* ''rules-based decisions for output formats based on hardware capabilities''
* ''a range of DSP's (digital signal processors) including headphone head-related transfer function processing, DRC (dynamic range compression), low-pass filtering for subs and an equalizer function''
* ''custom channel-mixing/mapping for up and downmixing''
 
 
It's still early days for AE. Bugs will be found, and new and exciting features added. If you want to give it a try just grab one of the [[nightly versions]] on one of XBMC's mirrors.


AudioEngine replaces SDL and brings some of the external dependencies into XBMC, and wraps up all the different media types for mixing, samplerate conversion, format conversion, encoding, upmix, downmix, etc.
It's still early days for AE. Bugs will be found, and new and exciting features added.


== GUI Settings ==
== Settings ==
AE brings several new settings to the graphical user interface (GUI) as well as to [[#Advanced settings|advancedsettings.xml]].
Audio settings can be found in the GUI at


;<big>{{highlight|Settings -> System -> Audio output|bordered=yes}}</big>
;<big>{{highlight|Settings -> System -> Audio output|bordered=yes}}</big>


[[File:Settings - Audio Output.png|800px]]
; '''Audio output'''
This allows you to tell XBMC about the type of connection to the audio equipment so it can set the available GUI options appropriately, in addition it tells XBMC the LPCM capabilities of the connection.
{{Note|This unrelated with telling XBMC where the audio is actually sent, this is done via '''Audio output device''' and '''Passthrough output device''' settings.}}
:'''- Analog:''' Disables all the "capable receiver" options for passthrough and allows multi-channel LPCM to be pass to a soundcard.
:{{note| Analog in this case does not mean a D/A conversion is done by XBMC, this setting purely enables the hand-off of the LPCM data to allow either a on-board soundcard or off-board USB soundcard to do the actual D/A conversion before sending audio to speaker outputs.}}
:'''- Optical/Coax:''' This enables the selection of the Dolby Digital and DTS capable receiver options and limits the output of LPCM to 2 channels. :
:{{note|If you want to transcode one format to another, for example DTS is not supported on your receiver but AC3 is, then select just AC3 however as the DTS is decoded to LPCM before being encoded again to AC3 then the resulting audio will be AC3 2.0 only due to the LPCM 2.0 limit imposed by selecting Optical/Coax, if you want a full 5.1 channel transcode you'll have to select the HDMI option even if you're not using a HDMI output.}}
:'''- HDMI:''' This enables all the capable receiver options, so in addition to what's available for Optical/Coax, TrueHD, DTS-MA and Multichannel LPCM capable receiver options are now selectable, in addition there is no limit on how LPCM is passed.
; '''Speaker Configuration'''
Select your physical speaker layout.
{{note| If connected to a TV then don't set higher than 2.0 as it's not likely that it'll will be supported, only set higher if it's known for sure that channel configuration is supported e.g. 5.1}}
; '''Boost volume level on downmix'''
Boosts AC3 streams that have been downmixed to 2 channels
; '''Output stereo to all speakers'''
This upmixes 2 channel stereo sources to what specified by the Speaker Configuration so audio is output on all speakers


----
== Supported Audio Formats for Passthrough ==


; '''- Dolby Digital (AC3) capable receiver'''
A summary of some of the supported formats within the AudioEngine
: Select this option if your receiver is capable of decoding AC3 streams.
:{{note|AAC is transcoded to AC3 when this option is checked. (AC3 capable receiver is required.)}}
; '''- DTS capable receiver'''
: Select this option if your receiver is capable of decoding DTS streams.
; '''- AAC capable receiver'''
: Select this option if your receiver is capable of decoding AAC streams.
:{{note|AAC receivers likely do not natively decode AAC in passthrough, likely shows up as LPCM. This is not a XBMC/AE limitation}}
; '''- MultiChannel LPCM capable receiver'''
: Select this option if your receiver is capable of decoding LPCM streams.
----
; '''- TrueHD capable receiver'''
: Select this option if your receiver is capable of decoding TrueHD streams.
; '''- DTS-HD capable receiver'''
: Select this option if your receiver is capable of decoding DTS-HD streams.
----
; '''Audio output device'''
This is the device you use to play LPCM or audio decoded by XBMC such as mp3's and FLAC. '''Note -''' If XBMC plays a file which has audio that the system does not support (thus the above capable receiver option is not selected e.g. DTS capable receiver is not selected) then it is either transcoded to a supported format or decoded and sent as LPCM, in both cases this will be the audio device used.
; '''Passthrough output device'''
This device you use to play the encoded formats, these are any of the formats checked above in the "capable receiver" options.
----
; '''Play GUI sounds'''
This sets how interface sounds are handled such as when navigating the menus, select from Never, Only when playback stopped, or Always.
----


{{redv|IMPORTANT NOTE:|
{| class="prettytable" style="text-align: center; color: black;"
The "'''capable receiver'''" options relate only to the '''passthrough''' of audio to another device such as an AVR, where that device must support decoding of the format. Before leaving any "'''capable receiver'''" option enabled check to make sure that both the playback device running XBMC (e.g. HTPC) and the connected device (e.g. AVR) both support that format.
 
If you have a "'''capable receiver'''" option enabled that your device does not support then this will result in poor playback of video typically with a very low frames-per-second and no audio, so for example if the '''TrueHD capable receiver''' option were enabled then make sure that the playback device can passthrough TrueHD and that the connected device can decode TrueHD, if either of the devices do not support TrueHD then the '''TrueHD capable receiver''' option '''MUST''' be left disabled.
 
For any format where the "capable receiver" option is not selected, XBMC will still playback any content containing those audio types, however instead of the audio being passed through, XBMC will decode audio and then send the audio in a compatible format.
 
If connected directly to a TV be aware that TV are not compatible with DTS, TrueHD or DTS-HD, typically the only encoded format a TV will be compatible with is AC3.}}
 
----
 
 
;<big>{{highlight|Settings -> Music -> Playback|bordered=yes}}</big>
 
:''Here you can find the settings for [[w:ReplayGain|ReplayGain]] and Cross-Fading music (gapless playback).''
 
[[File:Music - Playback.png|800px]]
; Play the next song automatically
: XBMC automatically plays the next item in the current folder. For example, in Files View: After a track has been played, XBMC would automatically play the next track in the same folder.
; Queue songs on selection
: When songs are added to a playlist they are queued instead of playback starting immediately.
----
; Replaygain volume adjustments
: When enabled, XBMC will read the Replay Gain information encoded in your audio files by a program such as [http://mp3gain.sourceforge.net/ MP3Gain] and normalize the sound levels accordingly. You have the option of either using track levels or album levels.
; PreAmp Level - Replay gained files
: level in dB - default is 89dB per standard - change with caution
; PreAmp Level - Non replay gained files (no RG data)
: level in dB - default is 89dB per standard - change with caution
; Avoid clipping on replay gained files
: reduce volume of the file if clipping is likely to occur
----
; Crossfade between songs
: Enabling this will cause the player to smoothly fade from one audio track to the next. You can set the amount of overlap of the tracks from 1-15 seconds.
; Crossfade between songs on the same album
: You have the option of only crossfading between songs on the same album or all.
----
; Visualization
: Determines which visualization will be displayed while listening to music. For more information, see [[Visualizations]].
 
== Advanced settings ==
Current [[advancedsettings.xml]] [[advancedsettings.xml#<audio>|tags]] for [[audioengine]]:
 
<syntaxhighlight lang="xml">
<advancedsettings>
  <audio>
    <resample>0</resample>
    <forceDirectSound>0</forceDirectSound>
    <audiophile>0</audiophile>
    <audiosinkbufferdurationmsec>50</audiosinkbufferdurationmsec>
    <allowtranscode44100>0</allowtranscode44100>
    <streamsilence>0</streamsilence>
  </audio>
</advancedsettings>
</syntaxhighlight>
 
''Default values are shown above in the code box - these values are used if that tag does not exist.''
 
{| class="wikitable"
| '''<resample>'''
| force resampling of audio at a given frequency e.g. 48000 = 48khz
|-
| '''<forceDirectSound>'''
| win-specific - will not use Wasapi API 0 = false, 1 = true
|-
| '''<audiophile>'''
| forces playback of original format, will not down/upmix next song to match current, not compatible with cross-fading 0 = false, 1 = true
|-
| '''<audiosinkbufferdurationmsec>'''
| win-specific, buffer time in msec, hard minimum of 50msec
|-
| '''<allowtranscode44100>'''
| allows 44100hz when trancoding for SPDIF devices 0=false, 1=true
|-
| '''<streamsilence>'''
| Forces original AE behaviour where an audio signal is constantly streamed to the audio device, even if silent. If '''1''' or '''true''', this prevents some receivers from losing the signal/source, and prevents sinks re-opening and possible receiver switching with each new stream after any silence. If '''0''' or '''false''', enables Eden-style releasing of the audio device so external players, programs and the system can access the audio device, i.e. prevents XBMC from hogging the audio device.
|}
 
== Hardware capabilities and reported to work ==
 
::{|class="wikitable" style="text-align: center; color: black;"
!colspan="9"|'''Legend - Templates - Formatting'''
|-
|{{Yes}}
|{{No}}
|{{NA}}
|{{?}}
| '''HDMI'''
| '''Optical'''
| '''Analog'''
| '''TV/Receiver/Brand'''
|-
|<nowiki>{{yes}}</nowiki>
|<nowiki>{{no}}</nowiki>
|<nowiki>{{NA}}</nowiki>
|<nowiki>{{?}}</nowiki>
|<nowiki>'''HDMI'''</nowiki>
|<nowiki>'''Optical'''</nowiki>
|<nowiki>'''Analog'''</nowiki>
|<nowiki>'''TV/Receiver/Brand'''</nowiki>
|}
 
{{note|'''Dolby Digital Plus''' a.k.a. '''DD+ or E-AC-3''' support is not enabled in AE (as of XBMC v12 RC3) and will not work properly. Just ask DDDamian ;)}}
 
Feel free to update this list accordingly and add fields to table for other Audio types your hardware can or cant do.
<big>'''''Please add your experience'''''</big>
{| class="wikitable" style="text-align: center; color: black;"
! '''Model Name'''
! '''GPU'''
! '''Code Name'''
! '''AC3'''
! '''LPCM'''
! '''DTS'''
! '''DTS-HD MA'''
! '''DTS-HD'''
! '''TrueHD'''
! '''Dolby Digital Plus'''
! '''Video Driver Version'''
! '''Driver limitation'''
! '''HW Limitation'''
! '''Plug'''
! '''Receiver'''
! '''Operating System'''
|-
| Gigabyte GV-N560OC-1GI
| GeForce GTX 560
| GF110/GF114
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{?}}
| {{Yes}}
| {{NA}}
| 313.09
| {{No}}
| {{No}}
| {{?}}
| {{?}}
| OpenELEC 3.0
|-
| Asus EN210
| GeForce 210
| GT218
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{No}}
| {{Yes}}
| {{NA}}
| 302.17
| {{No}}
| {{Yes}}
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
|-
| Asus ENGT430 DC SL DI
| GeForce GT 430
| GF108
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{NA}}
| 295.59
| {{No}}
| {{No}}
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
|-
|-
| Asus ENGT520
!rowspan="3" style="color:#000000; background-color:#DBDBDB;" | '''Audio Codec'''
| GeForce GT 520
!colspan="12" style="color:#000000; background-color:#DBDBDB;" | '''Audio Source'''
| GF119
!rowspan="3" style="color:#000000; background-color:#DBDBDB;" | '''XBMC Passthrough Setting'''
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{NA}}
| 310.19
| {{No}}
| {{No}}
| '''HDMI'''
| '''Yamaha/HTR-4063'''
| Debian Wheezy
|-
|-
| Asus ENGTX560
!colspan="3" style="color:#000000; background-color:#DBDBDB;" | '''HD DVD'''
| GTX 560 TI
!colspan="3" style="color:#000000; background-color:#DBDBDB;" | '''Blu-ray Disc'''
| GF110/GF114
!colspan="3" style="color:#000000; background-color:#DBDBDB;" | '''DVD-Video'''
| {{Yes}}
!colspan="3" style="color:#000000; background-color:#DBDBDB;" | '''DVD-Audio'''
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{NA}}
| 304.43
| {{No}}
| {{No}}
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
|-
|-
| Palit GT640
! style="color:#000000; background-color:#DBDBDB;"| Channels (max)
| GeForce GT 640
! style="color:#000000; background-color:#DBDBDB;"| Max bit rate
| GK107
! style="color:#000000; background-color:#DBDBDB;"| Sample rate (max)
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Channels (max)
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Max bit rate
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Sample rate (max)
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Channels (max)
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Max bit rate
| {{Yes}}
! style="color:#000000; background-color:#DBDBDB;"| Sample rate (max)
| {{NA}}
! style="color:#000000; background-color:#DBDBDB;"| Channels (max)
| 304.43
! style="color:#000000; background-color:#DBDBDB;"| Max bit rate
| {{No}}
! style="color:#000000; background-color:#DBDBDB;"| Sample rate (max)
| {{No}}
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
|-
|-
| AMD A4-3400 APU
| align="left"|'''Dolby Digital (AC-3)'''
| Radeon HD 6410D
| 5.1
| WinterPark/Sumo2
| 504 kbit/s
| {{Yes}}
| 48 kHz / 16 bit
| {{Yes}}
| 5.1
| {{Yes}}
| 640 kbit/s
| {{?}}
| 48 kHz / 16 bit
| {{?}}
| 5.1
| {{Yes}}
| 448 kbit/s
| {{NA}}
| 48 kHz / 16 bit
| 5.12.0.13
| 5.1
| {{No}}
| 448 kbit/s
| {{No}}
| 48 kHz / 16 bit
| {{?}}
| rowspan="2"| Dolby Digital (AC3) capable receiver
| {{?}}
| Windows 8 RTM
|-
|-
| AMD A8-3870K APU
| align="left"|'''Dolby Digital Plus (E-AC-3)'''
| Radeon HD 6550D
| 7.1
| BeaverCreek
| 3 Mbit/s
| {{Yes}}
| 48 kHz / 24 bit
| {{No}}
| 7.1
| {{Yes}}
| 1.7 Mbit/s
| {{No}}
| 48 kHz / 24 bit
| {{No}}
| colspan="6" {{NA}}
| {{No}}
| {{NA}}
| 12.1
| {{Yes}}
| {{No}}
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
|-
|-
| AMD A8-3870K APU
| align="left"|'''DTS'''
| Radeon HD 6550D
| 5.1 (Core)
| BeaverCreek
| 1536 kbit/s
| {{?}}
| 48 kHz / 24 bit
| {{Yes}}
| 5.1 (Core)
| {{?}}
| 1536 kbit/s
| {{Yes}}
| 48 kHz / 24 bit
| {{?}}
| 6.1
| {{Yes}}
| 768 kbit/s
| {{NA}}
| 48 kHz / 16 bit
| 12.4
| colspan="3" {{NA}}
| {{No}}
| rowspan="2"| DTS capable receiver
| {{No}}
| {{?}}
| {{?}}
| Windows 7 x64 Pro
|-
|-
| Zotac GT430 Zone Edition
| align="left"|'''DTS 24/96'''
| GeForce GT 430
| colspan="6" {{NA}}
| GF108
| 5.1
| {{Yes}}
| 1536 kbit/s
| {{Yes}}
| 96 kHz / 24-bit
| {{Yes}}
| 5.1
| {{Yes}}
| 1536 kbit/s
| {{?}}
| 96 kHz / 24-bit
| {{Yes}}
| {{NA}}
| 306.97
| {{No}}
| {{No}}
| {{?}}
| {{?}}
| Windows 7 x64 Pro
|-
|-
| Asrock ION 330HT
| align="left"|'''Linear PCM (LPCM)'''
| GeForce 9400M G
| 7.1
| G96a/G96b
| 27 Mbit/s
| {{Yes}}
| 192 kHz / 24 bit
| {{Yes}}
| 8.1
| {{Yes}}
| 27 Mbit/s
| {{No}}
| 192 kHz / 24 bit
| {{No}}
| 5.1
| {{No}}
| 6.1 Mbit/s
| {{NA}}
| 48 kHz / 16 bit
| 304.64
| 5.1
| {{No}}
| 6.1 Mbit/s
| {{Yes}}
| 96 kHz / 24 bit
| '''HDMI'''
| MultiChannel LPCM capable receiver
| '''TV/OTHER'''
| Ubuntu 12.04 LTS
|-
|-
| AMD A4-2800K APU
| align="left"|'''Dolby TrueHD'''
| Radeon HD 6450M
| 7.1
| Caicos
| 18 Mbit/s
| {{Yes}}
|192 kHz / 24 bit
| {{Yes}}
| 7.1
| {{Yes}}
| 18 Mbit/s
| {{Yes}}
| 192 kHz / 24 bit
| {{Yes}}
| colspan="6" {{NA}}
| {{Yes}}
| TrueHD capable receiver
| {{NA}}
| 12.1
| {{No}}
| {{No}}
| '''HDMI'''
| '''Denon'''
| Windows 7 x64 Pro
|-
|-
| Asus GT610-SL-1GD3-L
| align="left"|'''DTS-HD High Resolution Audio (HRA)'''
| Geforce GT610
| 7.1
| GF119
| 6 Mbit/s
| {{Yes}}
| 96 kHz / 24 bit
| {{Yes}}
| 7.1
| {{Yes}}
| 6 Mbit/s
| {{Yes}}
| 96 kHz / 24 bit
| {{Yes}}
| colspan="6" style=background:#FFC890 | N/A
| {{Yes}}
| rowspan="3"| DTS-HD capable receiver
| {{NA}}
| 310.19
| {{No}}
| {{No}}
| '''HDMI'''
| '''Onkyo TX-NR807'''
| Slackware 13.37
|-
|-
| Asus E45M1-I Deluxe
| align="left" rowspan="2"|'''DTS-HD Master Audio (MA)'''
| Radeon HD 6320
| 5.1
| Palm/Sumo/Wrestler
| 18 Mbit/s
| {{Yes}}
| 192 kHz / 24 bit
| {{Yes}}
| | 5.1
| {{Yes}}
| 18 Mbit/s
| {{No}}
| 192 kHz / 24 bit
| {{No}}
| colspan="6" {{NA}}
| {{No}}
| {{NA}}
| 12.10
| {{Yes}}
| {{No}}
| '''HDMI'''
| '''Denon AVR-3312'''
| OpenELEC 3.0 (RC 1)
|-
|-
| 7.1
| 18 Mbit/s
| 96 kHz / 24 bit
| 7.1
| 18 Mbit/s
| 96 kHz / 24 bit
| colspan="6" {{NA}}
|}
|}


== OS Specific Information ==
=== Test audio files ===
Below You can find a excellent range of flac test audio files stereo/multichannel and varied sample/bit rates and quality.


Each OS has differing requirements and limitations, in most cases these are due to the capabilities of the drivers available for each OS.
Click [http://www.2l.no/hires/ here] to download flac test files


===Linux===
Click [http://download.wavetlan.com/SVV/Media/HTTP/http-wma.html here] to download wma test files


====HD audio limitation of AMD fglrx in Linux ====
Click [http://www.testsounds.com/ here] to download various audio system test files
AMD on Linux can only do 2 real channels. This is enough for DTS (5.1) and AC3 (5.1) that decode 6 channels virtual over two real ones. But nothing more.
This is not a hardware, but a software (fglrx) limitation.


:'''Setting it up within XBMC:'''


Only enable AC3 and DTS in the Audio Settings. Keep LPCM, TrueHD, DTS-HD, AAC disabled. And don't check play stereo on all speakers, as it also won't work.
== History and Team ==
AudioEngine, AE for short was two-year project spear-headed by [[User:Gnif|Gnif]] which was released in v12 (Frodo), and was first merged with master for user testing as of May 15th, 2012.


====Intel====
=== Why write a new audio subsystem? ===
Linux TrueHD & DTS-HD MA not working resolution.


HD Audio on some Intel platforms requires Kernel 3.7 and newer or with a patch compiled in.
It's been an accepted fact that the existing audio code was little-touched since the early days of XBMC, and was limited by the 16-bit architecture of the original Xbox and codecs available at the time. Dolby AC3 and mp3 (or earlier formats!) ruled the media codec world. Over time HTPC's became more mainstream, more powerful and better connected. Analog connections gave way to optical SPDIF connections, which in turn were replaced with HDMI. Processors, GPU's and media formats evolved at a steady pace.
{{forum link2|[[forum:136555|DTS-HD MA forum thread discussion]]}}


====Dual audio setup Linux====
With the growth of the HTPC and new formats like those made available with Bluray technology, the audio subsystem was under scrutiny as an area for improvement. Higher definition audio like multichannel FLAC was becoming a preferred standard for those demanding higher quality audio media. It was time for an update, and what an update!
*Dual audio possible settings: Very likely hardware and setup dependant
{{forum link2|[[forum:145430|Setting up dual audio forum thread discussion]]}}


===Windows===
Early efforts at patching fixes and even an initial attempt at a completely new system fell by the wayside. The scope of the required changes and the complexity of the API made it a daunting task, especially for volunteer programmers working in their spare time.  This was compounded by the fact that XBMC runs on a wide range of hardware and operating systems.  Most of the developers focus on specific platforms or subsystems within the whole of XBMC. Any new system had to be platform-agnostic, cohesive and flexible.
For detailed information on Windows OS settings see '''[[Windows Settings for AudioEngine]]'''


<br />
In time, it became obvious the project was going to require a full re-write and replacement of the audio engine. Furthermore, XBMC's base of hardware and OS platforms continued to grow. The detailed specifications for the new audio formats were unknown, and of course the master code for XBMC was ever-changing.
 
=== Three years of work ===
In November of 2009 [[User:Gnif|Gnif]] decided to bite the proverbial bullet, and after extensive consultation with the team finalized the API or structure which was to become AE. Drawing in other developers as required, the massive project slowly took shape, and reached the ready-point for user tests a year later. The forum thread for those hardy beta-testers (thank you!) reached over 1,200 posts, and slowly but surely features were added and debugged, and system stability grew.
 
Over the next two years, thanks to the determination of [[User:Gnif|Gnif]] the core engines, decoders, encoders and utilities that make up AudioEngine became a reality, and other developers began to contribute to the core and especially the platform-specific sinks or output stages. Among those contributing were [[User:Gimli|Gimli]], [[User:Fneufneu|Fneufneu]], [[User:Memphiz|Memphiz]], [[User:Dddamian|Dddamian]], [[User:Anssi|Anssi]] and others.
 
There was a goal to have the new audio system ready for Eden 11.0, but there was just too much left to do. Many users were eagerly looking forward to it's inclusion, but stable releases must continue, and AE wasn't ready when the Eden feature-freeze went into effect. During this time the AE code-base was solidified, bugs tracked and squashed, features added and testing increased.
 
Finally, on May 15th 2012, AudioEngine was merged to master. Weighing in at over 22,000 lines of code, it represents one of the single biggest code-merges ever for XBMC. Now for the first time it is readily accessible for all the development team (and users!) to see, test and improve within the greater context of XBMC's master branch.


== Support ==
=== ActiveAE ===
The best place to get support for AE-related issues is the XBMC forum. Several threads exist - reading them will often answer any issues, and of course you can receive assistance there:
ActiveAE was a large rewrite of SoftAE and combined all platforms to one engine. Sinks are available for all platforms.
ActiveAE uses an active state machine pattern, with a separate high priority sink thread, that cares for underruns. ActiveAE is completely build upon ffmpeg, which is used for resampling, channel mapping and decoding. High performance SSE algorithms - already existent in the AEUtils - were fixed up and are used to do the final conversion into formats the sinks can accept. ActiveAE uses the ''float'' format internally and it is working bit-exact.


{{forum link2|[[forum:78289|Main AE forum discussion thread]]}}
A new feature is the upmix via AC3 transcoding support. On optical devices where only 2 pcm channels are available, we can now upmix to 5.1 by transcoding to ac3.
{{forum link2|[[forum:124600|Windows AE forum discussion thread]]}}
Another new feature is the PulseAudio sink for ActiveAE, which was merged into XBMC mainline on January 9th 2014 and enables Linux desktop users to use the PulseAudio system instead of ALSA, which was an often requested feature. See [[PulseAudio]]
{{forum link2|[[forum:128298|Linux AE forum discussion thread]]}}<br />


<big>'''[https://github.com/gnif/xbmc/tree/AE GitHub Development Branch (outside master)]'''</big>
ActiveAE has three build-in profiles: Best Match, Optimized and Fixed.
* ''Fixed'' takes care that all audio you will play is play in the very same data format. Your receiver does not need to switch modes.
* ''Best Match'' is what previously existed as the "audiophile" mode. Whenever a new video or music playback starts, the audio engine will select the best sink for that stream. By design ''Best Match'' and ''gapless'' playback are not compatible. If you rely on ''gapless'' playback, consider using ''Optimized'' instead.
* ''Optimized'' is something special, as it tries to reduce the reopening of sinks a lot. One example is live-TV where it switches between 5.1 to 2.0 during commercials. In order to  not open the device anew and loosing some (milliseconds of) audio, the 2.0 commercials are played with the already open 5.1 sink by muting the non existent channels.
The main developers of ActiveAE are [[User:Fernetmenta|Fernetmenta]] and [[User:Fritsch|Fritsch]].
{{frodo updated}}


[[Category:XBMC Manual]]
[[Category:Audio]]
[[Category:Development]]
[[Category:Development]]

Latest revision as of 05:10, 4 August 2020

Home icon grey.png   ▶ Development
▶ Audio
▶ AudioEngine

AudioEngine or (AE) refers to XBMC's new audio system.

Features

AudioEngine replaces SDL and brings some of the external dependencies into XBMC, and wraps up all the different media types for mixing, samplerate conversion, format conversion, encoding, upmix, downmix, etc.

Features of AE include
  • Support for DTS-HD MA / Dolby TrueHD Bluray formats
  • Support for 24-bit and floating-point audio at up to 384,000hz
  • Mixing of all streams including GUI sounds even when transcoding audio
  • Start-up enumeration of hardware audio devices and their capabilities with log output
  • Bitstreaming support in PAPlayer (XBMC's music player)
  • Upmixing of stereo to full channel layout
  • Tighter syncing of A/V streams
  • Floating-point processing of audio
  • 24-bit and floating-point decoding/handling of mp3
  • Full support for ReplayGain
  • Built-in sample-rate conversion and transcoding

It's still early days for AE. Bugs will be found, and new and exciting features added.

Settings

Audio settings can be found in the GUI at

Settings -> System -> Audio output


Supported Audio Formats for Passthrough

A summary of some of the supported formats within the AudioEngine

Audio Codec Audio Source XBMC Passthrough Setting
HD DVD Blu-ray Disc DVD-Video DVD-Audio
Channels (max) Max bit rate Sample rate (max) Channels (max) Max bit rate Sample rate (max) Channels (max) Max bit rate Sample rate (max) Channels (max) Max bit rate Sample rate (max)
Dolby Digital (AC-3) 5.1 504 kbit/s 48 kHz / 16 bit 5.1 640 kbit/s 48 kHz / 16 bit 5.1 448 kbit/s 48 kHz / 16 bit 5.1 448 kbit/s 48 kHz / 16 bit Dolby Digital (AC3) capable receiver
Dolby Digital Plus (E-AC-3) 7.1 3 Mbit/s 48 kHz / 24 bit 7.1 1.7 Mbit/s 48 kHz / 24 bit N/A
DTS 5.1 (Core) 1536 kbit/s 48 kHz / 24 bit 5.1 (Core) 1536 kbit/s 48 kHz / 24 bit 6.1 768 kbit/s 48 kHz / 16 bit N/A DTS capable receiver
DTS 24/96 N/A 5.1 1536 kbit/s 96 kHz / 24-bit 5.1 1536 kbit/s 96 kHz / 24-bit
Linear PCM (LPCM) 7.1 27 Mbit/s 192 kHz / 24 bit 8.1 27 Mbit/s 192 kHz / 24 bit 5.1 6.1 Mbit/s 48 kHz / 16 bit 5.1 6.1 Mbit/s 96 kHz / 24 bit MultiChannel LPCM capable receiver
Dolby TrueHD 7.1 18 Mbit/s 192 kHz / 24 bit 7.1 18 Mbit/s 192 kHz / 24 bit N/A TrueHD capable receiver
DTS-HD High Resolution Audio (HRA) 7.1 6 Mbit/s 96 kHz / 24 bit 7.1 6 Mbit/s 96 kHz / 24 bit N/A DTS-HD capable receiver
DTS-HD Master Audio (MA) 5.1 18 Mbit/s 192 kHz / 24 bit 5.1 18 Mbit/s 192 kHz / 24 bit N/A
7.1 18 Mbit/s 96 kHz / 24 bit 7.1 18 Mbit/s 96 kHz / 24 bit N/A

Test audio files

Below You can find a excellent range of flac test audio files stereo/multichannel and varied sample/bit rates and quality.

Click here to download flac test files

Click here to download wma test files

Click here to download various audio system test files


History and Team

AudioEngine, AE for short was two-year project spear-headed by Gnif which was released in v12 (Frodo), and was first merged with master for user testing as of May 15th, 2012.

Why write a new audio subsystem?

It's been an accepted fact that the existing audio code was little-touched since the early days of XBMC, and was limited by the 16-bit architecture of the original Xbox and codecs available at the time. Dolby AC3 and mp3 (or earlier formats!) ruled the media codec world. Over time HTPC's became more mainstream, more powerful and better connected. Analog connections gave way to optical SPDIF connections, which in turn were replaced with HDMI. Processors, GPU's and media formats evolved at a steady pace.

With the growth of the HTPC and new formats like those made available with Bluray technology, the audio subsystem was under scrutiny as an area for improvement. Higher definition audio like multichannel FLAC was becoming a preferred standard for those demanding higher quality audio media. It was time for an update, and what an update!

Early efforts at patching fixes and even an initial attempt at a completely new system fell by the wayside. The scope of the required changes and the complexity of the API made it a daunting task, especially for volunteer programmers working in their spare time. This was compounded by the fact that XBMC runs on a wide range of hardware and operating systems. Most of the developers focus on specific platforms or subsystems within the whole of XBMC. Any new system had to be platform-agnostic, cohesive and flexible.

In time, it became obvious the project was going to require a full re-write and replacement of the audio engine. Furthermore, XBMC's base of hardware and OS platforms continued to grow. The detailed specifications for the new audio formats were unknown, and of course the master code for XBMC was ever-changing.

Three years of work

In November of 2009 Gnif decided to bite the proverbial bullet, and after extensive consultation with the team finalized the API or structure which was to become AE. Drawing in other developers as required, the massive project slowly took shape, and reached the ready-point for user tests a year later. The forum thread for those hardy beta-testers (thank you!) reached over 1,200 posts, and slowly but surely features were added and debugged, and system stability grew.

Over the next two years, thanks to the determination of Gnif the core engines, decoders, encoders and utilities that make up AudioEngine became a reality, and other developers began to contribute to the core and especially the platform-specific sinks or output stages. Among those contributing were Gimli, Fneufneu, Memphiz, Dddamian, Anssi and others.

There was a goal to have the new audio system ready for Eden 11.0, but there was just too much left to do. Many users were eagerly looking forward to it's inclusion, but stable releases must continue, and AE wasn't ready when the Eden feature-freeze went into effect. During this time the AE code-base was solidified, bugs tracked and squashed, features added and testing increased.

Finally, on May 15th 2012, AudioEngine was merged to master. Weighing in at over 22,000 lines of code, it represents one of the single biggest code-merges ever for XBMC. Now for the first time it is readily accessible for all the development team (and users!) to see, test and improve within the greater context of XBMC's master branch.

ActiveAE

ActiveAE was a large rewrite of SoftAE and combined all platforms to one engine. Sinks are available for all platforms. ActiveAE uses an active state machine pattern, with a separate high priority sink thread, that cares for underruns. ActiveAE is completely build upon ffmpeg, which is used for resampling, channel mapping and decoding. High performance SSE algorithms - already existent in the AEUtils - were fixed up and are used to do the final conversion into formats the sinks can accept. ActiveAE uses the float format internally and it is working bit-exact.

A new feature is the upmix via AC3 transcoding support. On optical devices where only 2 pcm channels are available, we can now upmix to 5.1 by transcoding to ac3. Another new feature is the PulseAudio sink for ActiveAE, which was merged into XBMC mainline on January 9th 2014 and enables Linux desktop users to use the PulseAudio system instead of ALSA, which was an often requested feature. See PulseAudio

ActiveAE has three build-in profiles: Best Match, Optimized and Fixed.

  • Fixed takes care that all audio you will play is play in the very same data format. Your receiver does not need to switch modes.
  • Best Match is what previously existed as the "audiophile" mode. Whenever a new video or music playback starts, the audio engine will select the best sink for that stream. By design Best Match and gapless playback are not compatible. If you rely on gapless playback, consider using Optimized instead.
  • Optimized is something special, as it tries to reduce the reopening of sinks a lot. One example is live-TV where it switches between 5.1 to 2.0 during commercials. In order to not open the device anew and loosing some (milliseconds of) audio, the 2.0 commercials are played with the already open 5.1 sink by muting the non existent channels.

The main developers of ActiveAE are Fernetmenta and Fritsch.