How to split 7.1 HDMI audio to 4 stereo outs with ALSA

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello,

for my multiroom project I want to split 7.1 HDMI channels into 4 stereo channels.

I use a pi 4 and a roline audio extractor. ROLINE HDMI 4K Audio Extraktor LPCM 7.1 - SECOMP GmbH

After "patching" the kernel I got 7.1 audio over HDMI. [Thanks to gordoste!] When I test it with:
Code:
speaker-test -c8 -t wave -D hw:0,0
I hear sound from every single speaker, even when aplay -l shows only 4 subdevices:

Code:
aplay -l
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
The last days I searched the whole web to find information about alsa and understand the configuration, but until now I`m not able understand it in detail.

So I hope, that someone could help me.

While I searched for information I have tested several configurations, for me this one looks very promising:

Code:
pcm_slave.eightchannels {
        pcm "hw:0,0"
        channels 8
}
pcm.stereo1 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 2 3 ]
        }
}
pcm.stereo2 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 4 5 ]
        }
}
pcm.stereo3 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 6 7 ]
        }
}
pcm.stereo4 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 0 1 ]
        }
}
... but sadly I get no sound on any of the four stereo channels when I test it with:

Code:
aplay -v -D stereo[1-4] /usr/share/sounds/alsa/Noise.wav


Any help would be greatly appreciated.

Thanks in advance

Guido
 
Hello phofman,

here is my aplay verbose output:

Code:
aplay -v -D stereo1 /usr/share/sounds/alsa/Noise.wav

Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 6000
  period_size  : 3000
  period_time  : 62500
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 3000
  period_event : 0
  start_threshold  : 6000
  stop_threshold   : 6000
  silence_threshold: 0
  silence_size : 0
  boundary     : 1572864000
Slave: Direct Share PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 6000
  period_size  : 3000
  period_time  : 62500
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 3000
  period_event : 0
  start_threshold  : 6000
  stop_threshold   : 6000
  silence_threshold: 0
  silence_size : 0
  boundary     : 1572864000
Hardware PCM card 0 'bcm2835 HDMI 1' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 8
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 8192
  period_size  : 3000
  period_time  : 62500
  tstamp_mode  : ENABLE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 3000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824
  appl_ptr     : 0
  hw_ptr       : 0

Thanks in adcance
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.