Here is my problem my laptop (Debian 8) is connected to my TV via HDMI, itself connected to my 5.1 home theater via SPDIF optical cable. And SPDIF only allow mono, stereo channels using PCM encoding or multi channels using Dolby format so DTS or AC-3 encoding.
My system correctly detects constraints:
cat /proc/asound/card0/eld#0.0
monitor_present 1
eld_valid 1
monitor_name LG TV
connection_type HDMI
eld_version [0x2] CEA-861D or below
edid_version [0x3] CEA-861-B, C or D
manufacture_id 0x6d1e
product_id 0x1
port_id 0x0
support_hdcp 0
support_ai 1
audio_sync_delay 0
speakers [0xffff] FL/FR LFE FC RL/RR RC FLC/FRC RLC/RRC FLW/FRW FLH/FRH TC FCH
sad_count 4
sad0_coding_type [0x1] LPCM
sad0_channels 2
sad0_rates [0x14e0] 32000 44100 48000 96000 192000
sad0_bits [0xe0000] 16 20 24
sad1_coding_type [0x2] AC-3
sad1_channels 6
sad1_rates [0xe0] 32000 44100 48000
sad1_max_bitrate 640000
sad2_coding_type [0xa] E-AC-3/DD+ (Dolby Digital Plus)
sad2_channels 6
sad2_rates [0xe0] 32000 44100 48000
sad3_coding_type [0x7] DTS
sad3_channels 6
sad3_rates [0xc0] 44100 48000
sad3_max_bitrate 1536000
I already looked on the net the majority of topics are really outdated at best 2012. I found a first solution, a52 alsa plugin but unfortunately I feel that it does not work or configs are not read by pulseaudio.
#####
# Description: Pour utiliser le plugin a52 d'alsa avec PulseAudio. Les valeurs par défaut sont channels 6 (valeurs possible 2,4,6), bitrate 448 kbit/s par défaut et fréquence échantillonnage 48000 Hz (44100 ou 48000 possible).
# A mettre dans ~/.asoundrc .
pcm.a52hdmi {
@args [CARD]
@args.CARD {
type string
default 0
}
type rate
slave {
pcm {
type a52
bitrate 640
rate 48000
channels 6
card $CARD
}
rate 48000 #nécessaire pour PulseAudio
}
}
I found a way to view my films using mpv it work because if I understand well it bypass pulseaudio.
mpv --fullscreen --speed=24000/25025 --hwdec=vaapi --deinterlace=yes --af scaletempo,lavcac3enc=tospdif=yes:bitrate=640:minch=2
But I really would like pulseaudio work itself in AC-3 or DTS to have 5.1 sound through SPDIF.