Alsa Config?

I am extremely skeptical why this works as is. According to

/proc/asound/card1/pcm1p$ cat info 
card: 1
device: 1
subdevice: 0
stream: PLAYBACK
id: ALC1150 Digital
name: ALC1150 Digital
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

my SPDIF device is card 1 device 1, right?

confirmed here by:

$ 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: 1/1
  Subdevice #0: subdevice #0

So why the heck do I have to specify
audio-device=alsa/iec958:CARD=Generic,DEV=0
in my mpv.conf? DEV=1 does not work!

This has been taken from:

$ 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
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

Ajout de alsa

Why do you need to deal with the low level ALSA settings?
It seems that the mpv media player has supported pipewire since 2022.

I would assume that mpv could use what you configure as your sound output in your desktop environment that sets up pipewire.

Because none of my players support fully AAC/AC3/A52/DTS audio passthrough to my home cinema: mpv, vlc, mpv flapak, vlc flatpak, totem. Only kodi does it 100% using pipewire as passthrough device.

Therefore if I’m not able to play an AAC file in 5.1 with each and every one of my players, then it should be something common to all that’s at fault. That’s what I want to determine, and fix.

Here’s one of the problematic file. Only kodi will passthrough the 6 channels to my home cinema. All other mentioned players will play it as stereo.

https://www2.iis.fraunhofer.de/AAC/multichannel.html

Thanks for the background! It has been a long time since I worked with linux audio. I worked on a gstreamer player many years ago.
I do remember that we use gstreamer from the command to test out stuff.

I think this is the current tool playbin that you may find useful to debug this issue.

From kodi you know that pipewire plus your hardware works.
Can you get playbin to also work?

But mpv via pipewire does not. Does that mean the problem is in mpv?
Might be worth asking mpv devs if the player knows how to do the passthru. And if it does how to configure it.

Thanks!

Will have a look at playbin.

BTW, don’t get me wrong, I know how to setup mpv for passthrough and it works very well for AC3:

$ flatpak run io.mpv.Mpv Videos/'AC3 Dolby Digital 5.1Ch Sound Test.avi'
 (+) Video --vid=1 (msmpeg4v3 576x432 29.970fps)
 (+) Audio --aid=1 (ac3 6ch 48000Hz)
AO: [alsa] 48000Hz stereo 2ch spdif-ac3
VO: [gpu] 576x432 yuv420p
$ cat /etc/mpv.conf
audio-device=alsa/iec958:CARD=Generic,DEV=0 
audio-spdif=ac3,dts,pcm
audio-channels=5.1

Besides it’s not only mpv that is unable to passthtough this very AAC file, vlc mplayer, and totem also fail!

UPDATE

So far, same with playbin, stereo output although it uses a different device: alsa_output.pci-0000_00_14.2.iec958-stereo (PULSE)

CORRECTION

Kodi uses PIPEWIRE:alsa_output.pci-0000_00_14.2.iec958-stereo.2|Audio interne Stéréo numérique (IEC958)