Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

How to split 7.1 HDMI audio to 4 stereo outs with ALSA
How to split 7.1 HDMI audio to 4 stereo outs with ALSA
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 1st October 2020, 01:01 PM   #1
turbur is offline turbur  Germany
diyAudio Member
 
Join Date: Oct 2020
Default How to split 7.1 HDMI audio to 4 stereo outs with ALSA

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
  Reply With Quote
Old 9th October 2020, 11:18 AM   #2
peterwag is offline peterwag
diyAudio Member
 
Join Date: Jun 2018
Maybe you could take a look at EQ APO. Rerouting of the 7.1 Surround Channels is implemented. With the Peace GUI it's no big deal.
  Reply With Quote
Old 9th October 2020, 02:04 PM   #3
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
peterwag: IIUC EQ APO is a windows application, it will not help in linux running on RPi.

turbur: Please post the verbose output of your final aplay command.
  Reply With Quote
Old 10th October 2020, 04:07 PM   #4
turbur is offline turbur  Germany
diyAudio Member
 
Join Date: Oct 2020
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
  Reply With Quote
Old 13th October 2020, 01:05 AM   #5
gordoste is offline gordoste
diyAudio Member
 
Join Date: Jul 2020
In the devices stereoX you are binding only one channel. The documentation (here) says:

Quote:
bindings {
N INT # Slave channel INT for client channel N
}
So I think you want the bindings:

Code:
stereo1:

bindings {
  0 0
  1 1
}

stereo2:

bindings {
  0 2
  1 3
}

etc.
HTH
  Reply to this post

Reply


How to split 7.1 HDMI audio to 4 stereo outs with ALSAHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ALSA Multiroom Audio TimCurtis PC Based 6 9th December 2019 08:51 PM
FS: Sony ES A/V receiver HDMI 2.0 HDCP 2.2 8 channel pre outs cbrunhaver Swap Meet 0 27th June 2016 10:23 PM
Best way to add stereo subwoofer pre-outs to existing DAC/preamp? bmwparts Analog Line Level 2 11th December 2014 11:47 PM
Media files growing exponentially, HDMI video and RCA stereo, two systems otto88 PC Based 36 23rd March 2013 06:57 PM
Stereo in/multiple Stereo outs Circuit MartinByrne Everything Else 3 7th May 2009 01:11 AM


New To Site? Need Help?

All times are GMT. The time now is 04:48 PM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki