Archive:Linux audio

From Official Kodi Wiki
Jump to navigation Jump to search

Template:Audionav

Linux Audio API's

Linux has two different audio systems, these are Pulseaudio and ALSA.

If you have a PC that is exclusively used for XBMC then using ALSA maybe the best solution.

If you have a PC runs many applications other than XBMC then using Pulseaudio maybe the the best solution.

To help you decide which is best for you these are the various use cases:

When would I want Pulseaudio?

  • You use your XBMC computer mainly as your Desktop when you don't run XBMC.
  • You want other applications audio like Skype, youtube, browser mail notification in parallel with XBMC.
  • You use xbmc in windowed mode as Desktop player
  • You use Pulseaudio as a network sink to stream Audio to other devices in your living room.
  • Passthrough is nice to have for you, but to be honest - you don't really need it.
  • Whenever you plugin your Bluetooth headset, xbmc audio will continue over this new device (when Default 'PULSE' device is chosen)

When would I want ALSA?

  • You use XBMC as your standalone media center.
  • You are highly interested in bitperfect exclusive audio output.
  • DTS-HD, TrueHD is something you use daily and is of high importance.
  • You don't need other applications that would access audio in parallel.

Why can't I have both?

  • Pulseaudio might hog your Audio device and you cannot open the ALSA device exclusively, since ALSA must be able to open the audio device exclusively in order to support the HD audio formats, therefore it must be decided which one to use.

Can I force ALSA, though I have pulseaudio installed and running and know that it will cause problems?

  • Yes, you can - start xbmc from terminal with:
AE_SINK=ALSA xbmc

- Be warned as this might interfere with your Desktop sounds and pulseaudio!

Known issues Whenever the Pulseaudio Sink is unloaded, the stream is completely destructed and created newly. This will reset the stream's volume to the internal xbmc volume. This is only an issue if you use "external volume", e.g. you use pavucontrol and change the stream volume via slider. This only affects the current running stream as xbmc gets no knowledge about it. Best is: use xbmc's internal volume or change the global volume only.

Hardware Vendor Specifics

AMD

For AMD GPU's there are two sets of drivers available, the AMD supplied binary fglrx drivers or the newer Radeon OSS drivers.

fglrx Drivers

The AMD fglrx drivers on Linux limit the number of real audio channels to 2.0, this only provides enough bandwidth for LPCM 2.0, DTS (5.1) and AC3 (5.1) and so HD audio (DTS-HD, TrueHD) is NOT possible on Linux for AMD GPU's using the fglrx drivers, further to this the fglrx drivers limit HDMI audio to a 48Khz sample rate however 96KHz is possible on SPDIF.

The AMD developers responsible for the fglrx drivers have failed to provide any updates or improvements to the XvBA hardware acceleration API that the drivers use for more than 2 years, meaning no AMD fglrx driver since 12.10 has been usable.

Radeon OSS Drivers

As a consequence of the lack of XvBA updates, XBMC's developers got in contact with the AMD OSS developers to see what could be done to improve AMD graphics in Linux, the result was the Radeon OSS drivers which have been developed to use the open source VDPAU API.

The Radeon OSS driver are now more feature rich and better performing than the fglrx ever were, amongst other things they are capable of allowing HD audio (DTS-HD, TrueHD) to be bitstreamed.

For more detail see forum thread Linux - Radeon OSS with vdpau (howto)

Intel GPU HD Audio

HD Audio on Intel SandyBridge & IvyBridge systems require a patch from Intel to be included within the kernel, Linux 3.7 and higher include this patch as standard. In addition modification to system files maybe required in order to get the HDMI audio working.

For more detail on the required Linux modifications see Intel Linux Modifications for HD Audio