Pulseaudio/ALSA/Kodi audio passthrough on 20.04

8,552

Solution 1

I can't answer your question exactly but I have a similar setup but running Pulseaudio with audio passthrough (DD & DTS) working fine on Kodi 18.6, I did not have to adjust or disable Pulseaudio. This is with 19.10 though as I have not yet upgraded my Kodi server to 20.04

But you could perhaps try this way on 20.04? My settings anyway in case they are of any help:

I installed Pulsaudio volume control GUI then within that:

Configuration Tab: I Chose profile "Digital Stereo (HDMI) Output" NOT any of the surround options.

Output Devices Tab: Click on Advanced and select all the encoding options your receiver supports.

Then in Kodi:

Settings - Player - Videos: Ensure "Sync playback to display" is DISABLED.

Settings - System - Audio:

Audio output device: "Default, Default Output Device (PULSEAUDIO)"

Number of channels: "5.1" (in my case)

Output configuration: "Best match"

Allow passthrough: Enabled And the relevant "capable reciever" settings enabled too.

Solution 2

Oliver, like you when I was using Ubuntu 18.04 I had two profiles. One which had Pulse disabled and one that did not using autospawn=no

That no longer works on 20.04 as far as I can tell but here is what does.

I created two scripts for turning Pulse OFF and ON [OFF so passthrough works in KODI]

first script named "pulseoff.sh"

#!/bin/bash
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service

second script named "pulseon.sh"

#!/bin/bash
systemctl --user start pulseaudio.socket
systemctl --user start pulseaudio.service

Scripts are on my Desktop so I opened my Desktop folder in Tilex and ran these commands to make them executable

~/Desktop$ chmod u+x pulseon.sh

~/Desktop$ chmod u+x pulseoff.sh

Now I just double click on the one I want to use and it asks me if I want to run it. You can toggle off and on at your hearts desire.

Share:
8,552

Related videos on Youtube

Oliver Braun
Author by

Oliver Braun

I completed my PhD in mathematics at RWTH university in Aachen, Germany, in September 2016. I am mainly interested in algebra and number theory. I no longer work in academia.

Updated on September 18, 2022

Comments

  • Oliver Braun
    Oliver Braun over 1 year

    I am using an Intel NUC linked to a Marantz audio-video-receiver via HDMI, which is then linked to my TV via HDMI also. I am running Kodi in order to use this setup as a media player.

    On Ubuntu 16.04 and 18.04 I had Pulseaudio disabled in order enable audio passthough from the NUC to the AVR, so that the AVR would be aware that I was feeding it a certain kind of audio signal, DTS say.

    I was using the setup described here https://kodi.wiki/view/PulseAudio/HOW-TO:_Disable_PulseAudio_and_use_ALSA_(without_removing_PulseAudio)_for_Ubuntu Short summary: I had /etc/pulse/client.conf adjusted in order to include

    autospawn = no
    

    After upgrading Ubuntu to 20.04 this option seems to no longer work, audio passthrough is disabled and the passthrough option is not available in Kodi's settings.

    I also tried to run

    KODI_AE_SINK=ALSA kodi
    

    but this didn't work either. While the passthrough option re-appeared with this command line option, the feature still doesn't work and/or the video playback sound is just static or crackling (depending on the choice of settings).

    So, my question is this: Is there any way to get Pulseaudio and ALSA to interplay as they did in the previous versions? I'm hoping to avoid having to downgrade to 18.04 in order to be able to use the audio passthrough feature again.

    • leu
      leu almost 4 years
      just to be sure: did you check the other client-conf-files mentioned in man pulse-client.conf: e.g. ~/.config/pulse/client.conf?
    • Oliver Braun
      Oliver Braun almost 4 years
      @leu Yes I did, should have mentioned that. I couldn't get it to work that way, either.
  • Oliver Braun
    Oliver Braun almost 4 years
    Wow, this worked perfectly. Thanks a lot, I'll accept your answer :)
  • codlord
    codlord almost 4 years
    Glad to help. Actually one addition which may be relevant: I actually made a slight mistake in the above in my setup anyway. My receiver supports AC3 (Dolby Digital) and DTS but NOT AAC multi-channel. With the settings above, if I play something with AAC multi-channel audio I get stereo. You have to set Kodi number of channels to 2 and then you can enable AAC to AC3 transcoding. It seems a bit "wrong" to set the channels to 2 but I guess when you are using passthough that's the correct way (as that then works with DD, DTS and other multi-channel AAC audio).