Difference between revisions of "Linux audio"

From Official Kodi Wiki
Jump to: navigation, search
m (PulseAudio v ALSA: why are we duplicating existing information? Perhaps instead we should have a alsa configuration page as well '))
Line 3: Line 3:
 
__NOTOC__
 
__NOTOC__
  
=PulseAudio v ALSA=
+
=PulseAudio vs ALSA=
  
 
Linux has two different audio systems, these are PulseAudio and Advanced Linux Sound Architecture (ALSA).
 
Linux has two different audio systems, these are PulseAudio and Advanced Linux Sound Architecture (ALSA).
Line 15: Line 15:
 
<br />
 
<br />
  
<big>'''When would I want PulseAudio?'''</big>
+
== PulseAudio FAQ ==
 +
<big> {{See also|PulseAudio#FAQ}}</big>
  
* You use your XBMC computer mainly as your Desktop when you don't run XBMC.
+
== Known issues ==
* You want other applications audio like Skype, youtube, browser mail notification in parallel with XBMC.
+
<big>{{see also| PulseAudio#Known_issues}}</big>
* 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)
 
 
 
<big>'''When would I want ALSA?'''</big>
 
 
 
* 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.
 
 
 
<big>'''Why can't I have both?'''</big>
 
* 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:
 
<pre>AE_SINK=ALSA xbmc</pre>
 
- Be warned as this might interfere with your Desktop sounds and PulseAudio!
 
 
 
<big>'''Known issues'''</big>
 
 
<br />
 
<br />
  
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.
 
<br />
 
 
=Configuring PulseAudio=
 
=Configuring PulseAudio=
 
When using PulseAudio some configuration at the OS level maybe necessary to get audio from XBMC.
 
When using PulseAudio some configuration at the OS level maybe necessary to get audio from XBMC.

Revision as of 08:28, 21 March 2014

Audio Table of Contents
General Audio Help: OS Configuration Help:


1 PulseAudio vs ALSA

Linux has two different audio systems, these are PulseAudio and Advanced Linux Sound Architecture (ALSA).

If you have a PC that is exclusively used for XBMC then using ALSA maybe the best solution, for more background refer to Advanced Linux Sound Architecture

If you have a PC runs many applications other than XBMC then using PulseAudio maybe the the best solution, for more background refer to PulseAudio

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

1.1 PulseAudio FAQ

1.2 Known issues


2 Configuring PulseAudio

When using PulseAudio some configuration at the OS level maybe necessary to get audio from XBMC.

For how to do this refer to PulseAudio

3 Hardware Vendor Specifics

3.1 AMD

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

3.1.1 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.

3.1.2 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)

3.2 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