Archive:Linux audio: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
mNo edit summary
 
(42 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Audionav}}


=Linux Audio API's=
<section begin="intro" />This page describes how to set up audio for Linux-based systems. Primarily, it covers how to setup Kodi when using either ALSA or PulseAudio.<section end="intro" />


==When would I want Pulseaudio?==
= PulseAudio vs ALSA =


* You use your XBMC computer mainly as your Desktop when you don't run XBMC.
Linux has two different audio systems, these are '''[[w:PulseAudio|PulseAudio]]''' and '''[[w:Advanced Linux Sound Architecture|Advanced Linux Sound Architecture (ALSA)]]'''.
* 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:==
If you have a PC that is exclusively used for Kodi then using ALSA maybe the best solution.


* You use XBMC as your standalone media center.
If you have a PC runs many applications other than Kodi then using PulseAudio maybe the the best solution.
* You are highly interested in bitperfect exclusive audio output.
<br />
* 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 FAQ ==
* Pulseaudio might hogg your Audio device and you cannot open the ALSA device exclusively, therefore we decided for one or the other.
To help you decide which is best for you:
{{See|PulseAudio#FAQ}}


Can I force ALSA, though I have pulseaudio installed and running and know that it will cause problems?
== Configuring PulseAudio ==
* Yes, you can - start xbmc from terminal with:
When using PulseAudio some configuration at the OS level maybe necessary to get audio from XBMC.
<pre>AE_SINK=ALSA xbmc</pre>
- Be warned as this might interfere with your Desktop sounds and pulseaudio!


== Known issues ==
For how to do this
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.
{{See|PulseAudio}}


= Hardware Vendor Specifics =
= Hardware Vendor Specifics =
Line 36: Line 27:
For AMD GPU's there are two sets of drivers available, the AMD supplied binary fglrx drivers or the newer Radeon OSS drivers.
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===
=== 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''' 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 fglrx drivers on Linux support TrueHD, LPCM 7.1 and DTS-HD starting with kernel 3.13.


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.
The AMD developers responsible for the fglrx drivers have failed to provide any updates or improvements to the XvBA hardware acceleration API which is for example used in the infamous xvba-va-driver. We suggest you disable hw decoding support and choose multithreaded Software Decoding in the Video -> Acceleration settings.


===Radeon OSS Drivers===
=== 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.  
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.
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 [http://forum.xbmc.org/showthread.php?tid=174854 Linux - Radeon OSS with vdpau (howto)]
For more detail see forum thread:
 
{{forum link2|[[forum:174854|Linux - Radeon OSS with vdpau (howto)]] Discussion and further information.}}<br />


== Intel GPU HD Audio ==
== 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.
Ubuntu 14.04 and therefore Xbmcbuntu v13 support HD Audio with intel hardware (IVB, SNB, HSW) out of the box you don't have to do any modifications to your system configuration. If and only if you are running a very old distribution, e.g. Ubuntu 12.04 that is shipped with an old kernel, those changes will break and harm your audio on a recent distributions, don't change your config files.


For more detail on the required Linux modifications see <big>'''[[Intel Linux Modifications for HD Audio]]'''</big>
== nVidia ION ==
See HOW-TO:Remap HDMI audio on Gen 1 ION - Linux for help on remapping HDMI audio channels.

Latest revision as of 06:02, 23 July 2020

This page describes how to set up audio for Linux-based systems. Primarily, it covers how to setup Kodi when using either ALSA or PulseAudio.

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 Kodi then using ALSA maybe the best solution.

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

PulseAudio FAQ

To help you decide which is best for you:

See: PulseAudio#FAQ

Configuring PulseAudio

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

For how to do this

See: PulseAudio

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 support TrueHD, LPCM 7.1 and DTS-HD starting with kernel 3.13.

The AMD developers responsible for the fglrx drivers have failed to provide any updates or improvements to the XvBA hardware acceleration API which is for example used in the infamous xvba-va-driver. We suggest you disable hw decoding support and choose multithreaded Software Decoding in the Video -> Acceleration settings.

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:

Attention talk.png Linux - Radeon OSS with vdpau (howto) Discussion and further information.


Intel GPU HD Audio

Ubuntu 14.04 and therefore Xbmcbuntu v13 support HD Audio with intel hardware (IVB, SNB, HSW) out of the box you don't have to do any modifications to your system configuration. If and only if you are running a very old distribution, e.g. Ubuntu 12.04 that is shipped with an old kernel, those changes will break and harm your audio on a recent distributions, don't change your config files.

nVidia ION

See HOW-TO:Remap HDMI audio on Gen 1 ION - Linux for help on remapping HDMI audio channels.