Working asound.conf settings for multichannel hdmi playback on headless linux

Here are workarounds and settings I’ve found useful to get multichannel working out HDMI in plexamp

Pi3 (running raspberry pi os lite)

Edit the config.txt to include these lines

hdmi_force_hotplug=1

hdmi_force_edid_audio=1

hdmi_drive=2

change this line

dtoverlay=vc4-kms-v3d

to

dtoverlay=vc4-fkms-v3d

Copy and paste the below text to be your /etc/asound.conf

# Plexamp on Pi 3 - 5.1 HDMI with Center ↔ LFE swap

# Forces “Default” to be 6ch + remapped so Plexamp sends real 5.1

pcm.!default {

type plug

slave.pcm “remap51”

slave.channels 6 # ← THIS is what makes Plexamp see full 5.1 capability

}

pcm.remap51 {

type route

slave.pcm “hw:0,0” # the real multi-channel HDMI device

slave.channels 6

ttable {

0.0 1 # FL → FL

1.1 1 # FR → FR

2.3 1 # FC (input 2) → hardware FC (position 3)

3.2 1 # LFE (input 3) → hardware LFE (position 2)

4.4 1 # RL → RL

5.5 1 # RR → RR

}

}

HP EliteDesk 800G2 (running dietpi)

pcm.hdmi_raw {
type hw
card 0
device 3
}

pcm.routed8 {
type route
slave {
pcm “hdmi_raw”
channels 8
}
ttable {
0.0 1
1.1 1
2.4 1
3.5 1
4.6 1
5.7 1
6.6 0
7.7 0
}
}

pcm.!default {
type plug
slave.pcm “routed8”
slave.channels 8
}

ctl.!default {
type hw
card 0
}

I’ve not been having any luck with the Pi4 so far, but am hoping to crack that nut eventually.

Pi 4

Raspberry Pi Lite Bookworm

set hdmi to default with raspi-config

sudo nano /boot/firmware/config.txt

  1. Find the line that looks like this (it may be commented with #):

    text

    #dtoverlay=vc4-kms-v3d
    

    Change it to:

    text

    dtoverlay=vc4-fkms-v3d
    
  2. Add these lines at the end of the file (or uncomment if they exist):

    text

    hdmi_force_hotplug=1
    hdmi_drive=2
    hdmi_force_edid_audio=1
    
  3. Save (Ctrl+O → Enter → Ctrl+X), then reboot

I do not know if all those settings are valid or work in config, but this is what I did, so maybe with trial and error we can find some of the unnecessary.

sudo nano /etc/asound.conf

pcm.!default {
type plug
slave.pcm “remap51”
slave.channels 8
}

pcm.remap51 {
type route
slave.pcm “hw:0,0”
slave.channels 8
ttable {
0.0 1
1.1 1
2.4 1
3.5 1
4.2 1
5.3 1
6.6 0
7.7 0
}
}

ctl.!default {
type hw
card 0
}

save. reboot.

a headless plexamp install on the Pi4 set to output to default with stereo downmix disabled in both places (why are there 2 of these? this is poor practice - absolutely confusing to an end user who would reasonably expect this setting to take effect when set once) should work right now for 5.1 playback. I also set sampling rate to strict.

I don’t know what changed, but my Pi4 process here is no longer working. Digging a bit, but I’ll probably give up soon.

My Pi4 is still completely broken for plexamp, I am not sure what went wrong there.

Needed to spin up another HP mini PC, this time with debian, and the above configuration that worked on diet-pi on the PC didn’t work. This one below does.

pcm.routed8 {
type route
slave {
pcm {
type hw
card 0
device 3
}
channels 8
}
ttable {
0.0 1
1.1 1
2.4 1
3.5 1
4.6 1
5.7 1
6.6 0
7.7 0
}
}

pcm.!default {
type plug
slave.pcm “routed8”
slave.channels 8
}

ctl.!default {
type hw
card 0
}