Kodi Community Forum

Full Version: 5.1 and 2.0, or: no 5.1 on Live TV
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm getting crazy with the audio settings in Kodi (v18.1) and Linux Mint XFCE (v19.1, PulseAudio).

My HTPC is connected to a modern Denon AVR by HDMI (only). Audio and Video output goes by the AVR.
I use Kodi for music (most FLAC, CD quality and also Hi-Res 48kHz/24 bit) and live TV (Tvheadend).
I want as many decoding work on my AVR and so I'd like to use Passthrough mode. I made the settings like described in the Wiki.

My problem: I don't get 5.1 signal for Live TV ("A1 TV", HD channels) on shows with 5.1 (Dolby, AC3). The output is only 2.0 stereo!
My profile in PulseAudio is "hdmi-stereo+input:analog-stereo". This has to be used for passthru.

If I change my profile to "hdmi-surround+input:analog-stereo" I get correct surround sound (Multichannel).
The big problem in this case is, that also stereo music (2.0) will be in 5.1, i.e. also on the surround channels I get full signals and this is waste.

I always want the native signal as passthru: 2.0 for my music (I only have stereo music) and 5.1 for Live TV (if the show is in 5.1, otherwise only 2.0 or whatever is broadcasted).
Shouldn't this be possible and the most common way in case of a modern AVR?

Is the only way of doing it so to change the profile in PulseAudio every time? This cannot be a proper way.

P.S.: Since I also have Hi-Res audio (by now only 48 kHz) I've changed my /etc/pulse/daemon.conf. This is working fine (with my profile "hdmi-stereo+input:analog-stereo"): CD-FLAC will be played with 44.1 kHz (without resampling), Hi-Res-FLAC will be played with 48 kHz.
default-sample-format = s24le
default-sample-rate = 44100
alternate-sample-rate = 48000

P.S. 2: I looked to several other thread but I don't get a solution. The thread No passthru on live TV with Krypton disturbs me but even with no passthru it should be possible to get 5.1 on Live TV.
Quote:The big problem in this case is, that also stereo music (2.0) will be in 5.1, i.e. also on the surround channels I get full signals and this is waste.

Please check your server configuration: https://manpages.debian.org/experimental....5.en.html 
Quote:remixing-use-all-sink-channels= If enabled, use all sink channels when remixing. Otherwise, remix to the minimal set of sink channels needed to reproduce all of the source channels. (This has no effect on LFE remixing.) Defaults to yes.

You have to set it to "no". This is available with pulseaudio version 11 which any recent distribution ships. See also kodi's implementation: https://github.com/xbmc/xbmc/blob/master...E.cpp#L633

Edit: I hope your realize that this is a shortcoming of pulseaudio soundserver, if you use e.g. ALSA - this stuff works out of the box in combination with Best-Match.
Thank you!

Basically it works like it should: Stereo is in 2.0, Surround is in 5.1.
However, I have to set the PA-profile to "Digital Surround 5.1 (HDMI).

Even if this is working in principle, I'm not happy at all.
There are major impacts for me.
  1. I have to use the "Multichannel Mode" and cannot use the "Passthrough Mode". This is actually not what I want.
    I'd prefer to have as much decoding work on the AVR because it's a dedicated Hi-Fi device and it will do it best and also don't causes additional CPU load on my HTPC.
    Or in other words: I'm not sure if I get the best possible sound with this settings (independent of the "Resample quality" setting in Kodi).
  2. The signal for the AVR is always a 5.1 "Multi Ch In" (PCM 3/2/1), even if e.g. only 2.0 channels will be used for stereo music.
  3. The multichannel PCM signal impacts the Upmixing features of the (my) AVR!
The biggest impact for me are the consequences of the upmixing feature!
I often listen to stereo music with the Dolby Surround Upmixer (with Center Spread), especially late at night when I have to listen quite silent. With this upmixer I get a nice spatial sound, also on low volume level. Maybe this is not the way like other audio-purists will listen to music but it sounds very good for me on most of recordings when listening silently. I will not miss this sound.
But the upmixer is not working if the input signal is already a multichannel input, even if only 2 channels will be used. In this case the upmixer cannot up-mix the L and R channel to a spatial surround sound, because there might be data also on the other channels.
Therefore loosing this upmixing feature is unfortunately no proper solution for me.

Please note that this also impacts TV shows/movies in 2.0 (or mono), where it might be an appropriate way for many users to use an upmixer.

The consequence for me is that I cannot (will not) use the "Multichannel Mode" (by default) and so I still have no surround sound at Live TV. Sad
Currently I only see a solution on switching the PulseAudio profile, but this is not a smart solution.

The causing pain point seems to be that Pass-through is not available for Live TV. This is a great pity and I hope this will be changed soon.

P.S.: Also note that I'm using my HTPC not only for Kodi but also for other programs (browser, VLC, etc.) and so it's more or less mandatory to use also PulseAudio.
I cannot work around how pulseaudio works, only cope with it - therefore suspend it when you use kodi.
(2019-03-26, 09:27)fritsch Wrote: [ -> ]I cannot work around how pulseaudio works, only cope with it - therefore suspend it when you use kodi.

I tried to use Kodi without PulseAudio but it didn't work. I don't know what the problem is because basically it should work. Maybe I did something wrong.
However, this is not a practicable way for me, because I use my PC in parallel also for other applications (e.g. Firefox, which need PulseAudio).

Also other possible workarounds, like additional analog connection, are not a feasible option (for me), because my onboard-DAC is not really good and it need to switch manually on the AVR.

The only feasible workaround for me seems to be the possibility to switch the PulseAudio-profile directly out of Kodi (automatically).

The real solution would be to bring back pass-through for PVR. It worked quite well in the past (as I can read in other posts) and I'm not the only one who miss this feature.
You can bring it easily back.

Set Speakers to 2.0, Enable AC3, Enable Dolby Transcoding _and_ enable "Sync Playback to Display".
(2019-03-26, 16:47)fritsch Wrote: [ -> ]You can bring it easily back.

Set Speakers to 2.0, Enable AC3, Enable Dolby Transcoding _and_ enable "Sync Playback to Display".

It's not working!
With activated AC3 transcoding I get no sound at all. My AVR (Denon AVR-X2400H) says audio signal "unknown" (in German: "unbekannt").

With activated "Sync playback to display" also live TV is not running smooth: It takes a very long time to start the playback (up to 1 minute) and the video hangs every few seconds.
Please note also the description for this setting: "won't use passthrough audio in this case". This is exactly the opposite what I want.

It also makes no difference if I use "Built-in Audio Digital Stereo (HDMI)" or the "Default Output Device" (also with "Number of channels" set to "2.0").
Please note also that the description of AC3 transcoding is a little bit confusing here, at least in this context.





~$ pactl list sinks
1) In combination with Sync Playback to Display, audio will, whenever PCM Audio is set to 2.0 channels and Dolby-Transcoding is enabled and stream is > 2 channels, encode the stream to Dolby AC3, so that SPDIF users (which PA passthrough users are) can output multichannel or others that have a hard time to use plain ALSA, and so on. It's an edge-case
2) Needs a long time to start <- cannot reproduce, don't see your Debug Log
3) works perfectly fine for me. LiveTV 1080i50 / 576i50 via pulse audio and transcoded AC3.

I don't see your Debug Log - therefore cannot

Here is mine, where you see watching of 5.1 LiveTV with AC3-Transcoding output.
I zapped around a bit, until I found Sixx HD with 5.1 Track, finally I watched a movie (DTS-HD), which also was properly transcoded to AC3.


My AVR: Denon X1300W.

Start reading: Line 4251 (Sixx HD) and 7307 for Tron.

Works out of the box I'd say.
(2019-03-26, 18:17)fritsch Wrote: [ -> ]1) ... audio will ... encode the stream to Dolby AC3, so that SPDIF users (which PA passthrough users are) can output multichannel ...
To this a few words.
  • "encode the stream to Dolby AC3": basically there should be no new encode because the audio-stream is already AC3
  • "so that SPDIF users (which PA passthrough users are)": I don't use S/PDIF. I just use HDMI (only). Nevertheless, Passthrough should also work for HDMI.

I did two tests (with "Sync playback to display"). In each test I switched to ORF eins HD first and then to ServusTV HD.

The first test was done with audio device "Built-in Audio Digital Stereo (HDMI)". The video streams started quickly and run OK, but I had no sound.

The second test was done with the default audio device. The video stream for the first channel didn't started and I cancelled it. The second channel started OK (but with delay) but then it stuttered. Also here I had no sound.

P.S.: See line 209 for the audio device used. I don't know what the difference between these two audio devices is. Shouldn't it be the same? However, only for the default device I can set the number of channels in Kodi (see screenshots above).
Eureka! (?)

I guess I found the problem (it's a remark at Wiki: PulseAudio / 5 Audiophile Pulse User).
It seems that it was the configuration for Hi-Res audio, i.e. the 24 bit "default-sample-format".
I've deactivated the settings I did before for Hi-Res Audio (24 bit/48 kHz; see my initial post). So the default sample-format, s16le, will (must) be used (whereas 44.1 kHz and also 48 kHz are available).

Now everything seems to be like I want it.
Music is PCM 2.0 (depending on the sampling rate of my FLAC's: 44.1 or 48 kHz) and I can use upmixers on the AVR.
TV with AC-3 5.1 is "Dolby Digital" (3/2/.1) and TV with [Dolby] 2.0 is PCM 2.0 (of course, I can also use the upmixers here).
No everything is (more or less) like it should be.
The disadvantage now is, that I don't get full benefit of 24 bit Hi-Res audio, because sample-format s16le will be used.

I've also disabled "Sync playback to display" again, because it seems to have no effect (for me/for this case). (!?)
So the description of this setting looks strange to me.

I also have to notice that AC-3 (5.1 and 2.0) is in 48 kHz (now), since I've "Limit sampling rate (kHz)" at 48.0 (mainly for my 48 kHz Hi-Res FLAC's).
This means that the description for this setting is not correct at all for me, because it's also used for HDMI and "Optimized" Output configuration.

Finally it seems good for me but I will not buy Hi-Res music any more (if I can't get full benefit).
However, it's not as easy as it should (could) be, to have all the settings correct in Kodi and also PulseAudio.
It's a pit, that it's not possible to have pass-through also with 24 or 32 bit sampling format.