I always had problems with sound in linux, since the early 90s Back then, it took me months to get a sound out of the box. It was already overwhelmingly complex with OSS, then came ALSA, jack, pulseaudio, then pipewire each adding one more layer of complexity.
Key points are in bold.
I have a new Fedora install since Fedora 38 and tried to migrate my Debian ALSA config to Fedora for not to loose the dmix plugin it took me so much work and time to get working. Then I added config for a52 and dca that I found somewhere on the web. Never been able to play a single DTS/Dolby Digital sound though through the optical SPDIF passthrough using ALSA! It’s here I need your help.
I use VLC, MPV, mplayer and Kodi exclusively on that machine, as far as I know for movies and other 5.1 audio. I have a DTS/Dolby Digital home cinema connected via optical cable.
Never been able to get passthrough to work using ALSA as a result, no 5.1 audio on either VLC, MPV, mplayer or Kodi. (Kodi passthrough using pipewire works flawlessly. If team kodi could only stop enabling/disabling it because whereas it doesn’t work for some users; it works perfectly for me. As a result I need to play every single file 5.1 with Kodi wich is overkill).
System is F40 with pipewire and pipewire-pulse.
My MPV config:
$ cat ~/.config/mpv/mpv.conf
audio-spdif=ac3,dts
audio-channels=5.1
ao=alsa
I don’t show my VLC config because I use defaults. Following the recommendations on the web to get passthrough working only made the matter much worse and as a result, VLC was totally unusable.
My pipewire config:
$ cat ~/.config/wireplumber/wireplumber.conf.d/51-alsa.conf
monitor.alsa.rules = [
{
matches = [
{
node.name = "~alsa_output.*"
}
]
actions = {
update-props = {
iec958.codecs = [ "PCM", "DTS", "AC3" ]
}
}
}
]
My alsa config. Lines commented out don’t work, they are tests, therefore do not suggest anything identical:
$ cat /etc/asound.conf
#
# Place your global alsa-lib configuration here...
#
pcm.custom
{
type plug
slave
{
pcm "dmix:1,1"
}
}
ctl.custom
{
type hw
card Generic
}
pcm.!default pcm.custom
#defaults.pcm.iec958.pcm "iec958:CARD=Generic,DEV=1"
#pcm.!default pcm.spdif
#pcm.!default {
# type plug
# slave.pcm "spdif"
#}
#pcm.!default {
# type plug
# slave {
# pcm "spdif"
# rate 48000
# format S16_LE
# }
#}
#pcm.!default {
# type plug
# slave {
# pcm "iec958"
# }
#}
ctl.!default ctl.custom
pcm.a52 {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type a52
bitrate 448
channels 6
card $CARD
}
rate 48000
}
}
pcm.dca {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type dca
channels 6
card $CARD
}
rate 48000
}
}
#pcm.iec958 {
# type plug
# slave {
# pcm "hw:1,1"
# }
#}
Some details about my system:
$ LANG=C aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC1150 Analog [ALC1150 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC1150 Digital [ALC1150 Digital]
Subdevices: 0/1
Subdevice #0: subdevice #0
$ LANG=C aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
oss
Open Sound System
pipewire
PipeWire Sound Server
pulse
PulseAudio Sound Server
hdmi:CARD=HDMI,DEV=0
HDA ATI HDMI, HDMI 0
HDMI Audio Output
a52:CARD=HDMI
HDA ATI HDMI
Plugin to convert multichannel stream to A52 (AC3) bitstream
sysdefault:CARD=Generic
HD-Audio Generic, ALC1150 Analog
Default Audio Device
front:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
Front output / input
surround21:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Generic,DEV=0
HD-Audio Generic, ALC1150 Digital
IEC958 (S/PDIF) Digital Audio Output
a52:CARD=Generic
HD-Audio Generic
Plugin to convert multichannel stream to A52 (AC3) bitstream
a52:CARD=CX23885
Conexant CX23885
Plugin to convert multichannel stream to A52 (AC3) bitstream