IT WOOOOOOORKED!!!
edit: partially
N.B. I understand that most of the things I made (explained bellow) are totally wrong, but please don't judge me - I am total noob in this. I am just listing the things I made so it can help someone who understands the matter see what is wrong and how I can fix it.
After the last comments I tinkered with it again today.
What I did:
1. Created 90-alsa-restore.rules in /storage/.config/udev.rules.d with
mixer() {
parm=${4:-on}
amixer -c "$1" sset "$2" "$3" $parm >/dev/null 2>&1
amixer -c "$1" sset "$2" $parm >/dev/null 2>&1
}
(
. /etc/profile
progress "Setting up sound card"
if [ -f $HOME/.config/sound.conf ]; then
alsactl restore -f $HOME/.config/sound.conf
else
# set digital output mixer params
mixer $card 'IEC958' 100% on
mixer $card 'IEC958 Output' 100%
mixer $card 'IEC958 Coaxial' 100%
mixer $card 'IEC958 LiveDrive' 100%
mixer $card 'IEC958 Optical Raw' 100%
mixer $card 'SPDIF Out' 100%
mixer $card 'SPDIF Front' 100%
mixer $card 'SPDIF Rear' 100%
mixer $card 'SPDIF Center/LFE' 100%
mixer $card 'Master Digital' 100%
mixer $card 'Analog Front' 100%
mixer $card 'Analog Rear' 100%
mixer $card 'Analog Center/LFE' 100%
exit 0
)&
Display More
, but nothing changed... (except that in alsamixer everything is back to default) and then I started tinkering randomly.
2. Using this wiki and pulseaudio -D in order to be able to make changes (it does not work otherwise)
i was able to set the default device and output, then I created in /storage/.config/udev.rules.d 91-pulseaudio-custom.rules with
SUBSYSTEM!="sound", GOTO="pulseaudio_end"
ACTION!="change", GOTO="pulseaudio_end"
KERNEL!="card*", GOTO="pulseaudio_end"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x10de", ATTRS{device}=="0x0059", ENV{PULSE_PROFILE_SET}="custom-profile.conf"
LABEL="pulseaudio_end"
and in ~/.config/pulse-daemon.conf.d/custom-profile.conf added
[General]
auto-profiles = no
[Mapping iec958-stereo]
device-strings = iec958:%f
channel-map = left,right
paths-input = iec958-stereo-input
paths-output = iec958-stereo-output
priority = 5
[Mapping iec958-ac3-surround-51]
device-strings = a52:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
paths-output = iec958-stereo-output
priority = 3
direction = output
Profile output:output:iec958-stereo+input:analog-stereo]
description = Foobar
output-mappings = iec958-stereo
input-mappings = analog-stereo
Display More
Until this point nothing worked for the final goal (DD/DTS passthrough).
Then I tried one last time with autostart.sh in /storage/.config/ with
#!/bin/sh
pulseaudio -D
pulseaudio --system
pactl load-module module-udev-detect
pactl load-module module-alsa-sink device=dmix
pactl load-module module-alsa-source device=dsnoop
pactl load-module module-combine-sink sink_name=combined
pactl load-module module-allow-passthrough
(here I am pretty sure it is totally wrong, but... read on)
After reboot in Kodi there was audio device "PULSE Simultaneous biult-in audio output", which I choose, but the passthrough device was still NVidia IEC958 S/PDIF. Then I checked in guisettings.xml in /storage/.kodi/userdata and there the audio device was PULSE:combined and the passthrough one was ALSA:iec958...
After this I created advancedsettings.xml in /storage/.kodi/userdata with passthrough device PULSE:combined
<advancedsettings>
<setting id="audiooutput.ac3passthrough" default="true">true</setting>
<setting id="audiooutput.ac3transcode">true</setting>
<setting id="audiooutput.atempothreshold" default="true">2</setting>
<setting id="audiooutput.audiodevice">PULSE:combined</setting>
<setting id="audiooutput.channels" default="true">1</setting>
<setting id="audiooutput.config">3</setting>
<setting id="audiooutput.dtshdpassthrough" default="true">false</setting>
<setting id="audiooutput.dtspassthrough">true</setting>
<setting id="audiooutput.eac3passthrough" default="true">true</setting>
<setting id="audiooutput.guisoundmode" default="true">1</setting>
<setting id="audiooutput.maintainoriginalvolume" default="true">true</setting>
<setting id="audiooutput.passthrough">true</setting>
<setting id="audiooutput.passthroughdevice">PULSE:combined</setting>
<setting id="audiooutput.processquality" default="true">30</setting>
<setting id="audiooutput.samplerate" default="true">48000</setting>
<setting id="audiooutput.stereoupmix" default="true">false</setting>
<setting id="audiooutput.streamnoise">false</setting>
<setting id="audiooutput.streamsilence" default="true">1</setting>
<setting id="audiooutput.truehdpassthrough" default="true">false</setting>
<setting id="audiooutput.volumesteps" default="true">20</setting>
</advancedsettings>
Display More
Rebooted, changed the settings in alsamixer again (s/pdif unmute, s/pdif volume 0)
and... VOILA!!!
Started a DTS (and after that DTS-HD) movie and the AVR lit for DD/DTS digital signal...
Edit:
P.S. During the writing of this resume of the things I have done I checked to see if the signal is true passthrough... and it is NOT. I am able to change the volume in Kodi, but at least the AVR reads DD/DTS signal. When I switch off the passthrough, the AVR is back to PCM signal... Really strange!
The audio stream now is:
FL;FR;FC;LFE;SL;SR; ff-ac3 ; 32 bits; 48.000 Hz or FL;FR;FC;LFE;SL;SR; ff-dca; 32 bits; 48.000 Hz and the AVR lit for DD/DTS signal.
and before todays' changes when the passthrough was active without sound was raw;raw;rawraw;raw;raw; pt-dts; 8 bits; 48.000Hz and the AVR showed pcm (pro logic).
Perhaps new Log will help you understand what is wrong and what I made, or...?
HAPPY NEW YEAR TO ALL!!!