AudioEngine: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>DDDamian
>Negge
(added GT520)
Line 251: Line 251:
| {{?}}
| {{?}}
| Ubuntu 12.04 LTS
| Ubuntu 12.04 LTS
|-
| Asus ENGT520
| GeForce GT 520
| GF119
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{Yes}}
| {{?}}
| {{Yes}}
| {{?}}
| 310.19
| {{No}}
| {{No}}
| '''HDMI'''
| '''Yamaha/HTR-4063'''
| Debian Wheezy
|-
|-
| Asus ENGTX560
| Asus ENGTX560

Revision as of 14:44, 29 December 2012

Template:Frodo

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!


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!

Features

Features of AE include
  • support for DTS-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


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.

GUI Settings

AE brings several new settings to the graphical user interface (GUI) as well as to advancedsettings.xml.

Settings -> System -> Audio output

Settings - Audio Output.png

Audio output
Allows you to tell xbmc about the type of connection to the audio equipment. Optical/Coax enables the passthrough of Dolby Digital and DTS to capable receivers. HDMI enables TrueHD, DTS-MA and multichannel LPCM. Note that this has nothing to do with your physical connection, but enables options below based on what that connection can utilize.
Speaker Configuration
select your physical speaker layout
Boost volume level on downmix
Boosts AC3 streams that have been mixed-down to 2 channels

- Dolby Digital (AC3) capable receiver
Select this option if your receiver is capable of decoding AC3 streams.
- 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.
- 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
device you use to play PCM or decoded audio such as mp3's and FLAC.
Passthrough output device
device you use to play encoded formats (those checked in "xyz capable receiver" above).

Play GUI sounds
Interface sounds. Select from never, only when playback stopped, or always.




Settings -> Music -> Playback
Here you can find the settings for ReplayGain and Cross-Fading music (gapless playback).

File:Music - Playback.png

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 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 tags for audioengine:

 <advancedsettings>
   <audio>
     <resample>0</resample>
     <forceDirectSound>0</forceDirectSound>
     <audiophile>0</audiophile>
     <audiosinkbufferdurationmsec>50</audiosinkbufferdurationmsec>
     <allowtranscode44100>0</allowtranscode44100>
     <streamsilence>0</streamsilence>
   </audio>
 </advancedsettings>

Default values are shown above in the code box - these values are used if that tag does not exist.

<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

Note: If a Driver Limitation prevents HD audio playback use {{Yes}} or {{No}} to mark this.
Similarly if the Hardware is incapable of HD audio use {{Yes}} or {{No}} to mark it accordingly.
Plug used to connect to your TV or Receiver e.g.HDMI - Optical - Analog
Receiver (type/model) e.g.TV LCD - Onkyo/Model

Feel free to update this list accordingly and add fields to table for other Audio types your hardware can or cant do. Please add your experience

Model Name GPU Code Name AC3 LPCM DTS DTS-MA DTS-HD TrueHD Dolby Digital Plus Video Driver Version Driver limitation HW Limitation Plug Reciever Operating System
Gigabyte GV-N560OC-1GI GeForce GTX 560 GF110/GF114 ? Yes ? Yes ? Yes ? 313.09 No ? ? ? OpenELEC 3.0
Asus EN210 GeForce 210 GT218 ? Yes ? Yes ? Yes No 302.17 No ? ? ? Ubuntu 12.04 LTS
Asus ENGT430 DC SL DI GeForce GT 430 GF108 ? Yes ? Yes ? Yes ? 295.59 No ? ? ? Ubuntu 12.04 LTS
Asus ENGT520 GeForce GT 520 GF119 Yes Yes Yes Yes ? Yes ? 310.19 No No HDMI Yamaha/HTR-4063 Debian Wheezy
Asus ENGTX560 GTX 560 TI GF110/GF114 ? Yes ? Yes ? Yes ? 304.43 No No ? ? Ubuntu 12.04 LTS
Palit GT640 GeForce GT 640 GK107 ? Yes ? Yes ? Yes ? 304.43 No No ? ? Ubuntu 12.04 LTS
AMD A4-3400 APU Radeon HD 6410D WinterPark/Sumo2 ? Yes ? ? ? Yes Testing 5.12.0.13 No No ? ? Windows 8 RTM
AMD A8-3870K APU Radeon HD 6550D BeaverCreek Yes No Yes No No No ? 12.1 Yes No ? ? Ubuntu 12.04 LTS
AMD A8-3870K APU Radeon HD 6550D BeaverCreek ? Yes ? Yes ? Yes ? 12.4 No No ? ? Windows 7 x64 Pro
Zotac GT430 Zone Edition GeForce GT 430 GF108 ? Yes ? Yes ? Yes ? 306.97 No ? ? ? Windows 7 x64 Pro
Asrock ION 330HT GeForce 9400M G G96a/G96b Yes Yes Yes No No No ? 304.64 No Yes HDMI TV/OTHER Ubuntu 12.04 LTS
AMD A4-2800K APU Radeon HD 6450M 6450M Yes Yes Yes Yes Yes Yes No 12.1 No No Template:HDMI Template:Denon Windows 7 x64 Pro

HD audio limitation of AMD fglrx in Linux

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.

OS Specific settings

To get AE working correctly you may have to adjust your OS settings accordingly.

See Windows Settings for AudioEngine This has detailed information on Windows OS settings

Intel Linux DTS-HD MA not working resolution. HD Audio on some Intel platforms requires Kernel 3.7 and newer or with a patch compiled in.

Attention talk.png DTS-HD MA forum thread discussion

Dual audio setup Linux

  • Dual audio possible settings: Very likely hardware and setup dependant
Attention talk.png Setting up dual audio forum thread discussion

Support

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:

Attention talk.png Main AE forum discussion thread
Attention talk.png Windows AE forum discussion thread
Attention talk.png Linux AE forum discussion thread


GitHub Development Branch (outside master)

See also