Raspberry Pi 5 DSP crossover music streamer

Has anyone gotten a Raspberry Pi 5 to work successfully as a DSP crossover music streamier?

I have a working DSP crossover streamer configuration on my Raspberry Pi 2B using Charlie Laub's ACDf filters. The OS is Bullseye 5.10.103-v7+. The 2-channel (stereo) audio stream from mplayer (using -ao alsa) is successfully split into multiple channels and processed by the filters in /etc/asound.conf and this outputs multi-channel PCM 96khz to my AV receiver via HDMI and the resulting sound quality is excellent in my 2.5 way speaker setup. The tweeters go tweet, the squawkers go squawk and the woofers go woof!.

With my new Raspberry Pi 5 running Bookworm 6.6.20+rpt-rpi-27172 I have not been as successful. With sudo raspi-config I have selected 1 PulseAudio (only other choice is 2 Pipewire) and audio output 0 vc4-hdmi-0. On the GUI desktop, I have the options for Stereo, 5.1 Surround, and 7.1 Surround. I have installed the ACDf filters in the (I believe) correct folders /usr/lib/ladspa and for good measure also /usr/local/lib/ladspa, and I have alsa configuration in /etc/asound.conf.

With 7.1 Surround selected on the Desktop:

In terminal
$ speaker-test -t wav -Dpulse -c 8

speaker-test 1.2.8

Playback device is pulse
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 24 to 262144
Period size range from 8 to 87382
Using max buffer size 262144
Periods = 4
was set period_size = 65536
was set buffer_size = 262144
0 - Front Left
4 - Center

giving sequential 8 channel audio output Front Left, Front Center, etc. to all 6 drivers in my system. The audio is mismatched with the drivers, but I had the same issue on the Raspberry Pi2 and corrected everything using the t-table in /etc/asound.conf.

In terminal
$ sudo speaker-test -t wav -Dpulse - c 8

speaker-test 1.2.8

Playback device is pulse
Stream parameters are 48000Hz, S16_LE, 1 channels
WAV file(s)
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Playback open error: -111,Connection refused


In terminal
$ sudo speaker-test -t wav -Ddefault -c 8

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
Broken configuration for playback: no configurations available: Invalid argument
Setting of hwparams failed: Invalid argument

Using the sudo causes the action to fail.

mplayer (using -ao alsa) now gives audio output to Front Left and Front Right channels only at 44.1khz which is the same 44.1khz as the internet radio stream indicating the resampling of /etc/asound.conf is being ignored.

mplayer (using -ao pulse) gives audio output to all channels at 44.1khz which indicates the resampling of /etc/asound.conf is being ignored. This is confirmed by turning off all the outputs in the t-table.

aplay -l reports the following.
** List of PLAYBACK Hardware Devices **
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

I know that PulseAudio is looking at the configurationi in /etc/asound.conf because I can comment out a formatting character such as #} and this will throw an error with mplayer. It just appears that the filters are being ignored by PulseAudio. Maybe the Pi5 OS being 64bit and the filters were written for 32bit has something to do with it?
 
I just downloaded the ACDf filters from Charlie's website, and did the usual extraction tar -xvf and then make and sudo make install... These filters have not been explicitly recompiled from 32bit to 64bit. I will try to figure out how to recompile.
 
No luck with 32bit Bookworm on the Raspberry Pi 5. No luck in loading filter modules as suggested. I get audio, but everything in /etc/asound.conf is being ignored. So full range to every channel instead of the crossover I have working with the Pi2.

On the Raspberry Pi2 running Bullseye the audio output of mplayer is routed to ALSA with -ao alsa in /etc/mplayer/mplayer.conf. Then /etc/asound.conf loads in the Ladspa filters and processes the audio, finally exporting to the proper channels (as identified with the t-table), using plughw. The new PulseAudio of the Raspberry Pi 5 is just disrupting all of this. I typically start mplayer with the following command $./rpmain (made executable by sudo chmod +x rpmain)

#!/bin/bash
mplayer -cache 8192 -volume 100 https://stream.radioparadise.com/flac


For other internet radio streams I just change the url.

Fallback option is to shift to camillaDSP, but so far I have not had much luck installing that either despite all the documentation. Can camillaDSP take input from mplayer as well?
 
Ok, so you’re looking to run the filters at kernel-level through ALSA rather than in a separate LADSPA host. I see that Charlie Laub recommends disabling output in the Pulse config, but that’s for a pathway in which ecasound hijacks the pulse input. It would help if you posted the full asound.conf you use, I suspect mplayer is just routing directly to the hardware output rather than sending data to the filter chain.
 
If no device is specified by mplayer, then it either uses its pulseaudio output directly (to pulseaudio), or its alsa output to device "default" (which in all pulseaudio-enabled distributions is internally also redirected to pulseaudio using the alsa plugin "pulse"). If a specific alsa device is to be used by mplayer, it must be specified with proper mplayer parameters. Also the corresponding hw card must be disabled in pulseaudio configuration to avoid PA using the device, blocking access to that device for other alsa clients.
 
Thanks for all the assistance. As requested see below for my /etc/asound.conf
Comparing to the reference asound.conf from charlesky, I don't have the pcm.TV-in so I can't use the alsa:noblock:device=XXXX without an error.

#This asound.conf work on Pi2 with Bullseye
defaults.pcm.rate_converter "speexrate_best"

pcm.!default {
type plug
slave {
pcm filtereq
rate 96000
}
}
ctl.!default {
type hw
card 0 #This is the default and it works correctly.
}
pcm.filtereq {
type ladspa
slave.pcm filtercross
path "/usr/lib/ladspa"
channels 8
plugins
{
# MAIN SOURCE SECTION.
# MUST HAVE AT LEAST ONE FILTER ACTIVE OR WILL NOT WORK!!!
# if adding EQ to the signal, it must be done in this section
0 { #This is the source the LEFT channel.
label ACDf
policy none
input.bindings.0 "Input"
output.bindings.0 "Output"
input { controls [24 0 -1 300 0.707 1] } # 2nd order low shelving filter
}
1 {
label ACDf
policy none
input.bindings.0 "Input"
output.bindings.0 "Output"
input { controls [24 0 -0.5 300 0.707 1] } # 2nd order low shelving filter
}
2 {
label ACDf
policy none
input.bindings.0 "Input"
output.bindings.0 "Output"
# Gain-1.5dB allows slight boost later if necessary.
input { controls [0 0 -1.5] } #gain block -1.5db
}
3 { #This is the source for the RIGHT channel.
label ACDf
policy none
input.bindings.1 "Input"
output.bindings.1 "Output"
input { controls [24 0 -1 300 0.707 1] } # 2nd order shelving filter
}
4 {
label ACDf
policy none
input.bindings.1 "Input"
output.bindings.1 "Output"
input { controls [24 0 -0.5 300 0.707 1] } # 2nd order shelving filter
}
5 {
label ACDf
policy none
input.bindings.1 "Input"
output.bindings.1 "Output"
input { controls [0 0 -1.5] } # gain block -1.5dB
}
}
}
#Crossover Section
pcm.filtercross { #crossover at 300hz and 2000hz
type ladspa
slave.pcm speaker
path "/usr/lib/ladspa"
channels 8
plugins
{
# WOOFER filters 0 - 3
0 {
label ACDf #lowpass for woofer output to channel2 LEFT WOOFER
policy none
input.bindings.0 "Input"
output.bindings.2 "Output"
input { controls [21 0 0 300 0.707 1] } #2nd order low pass 300hz
}
1 {
label ACDf #lowpass for woofer output to channel2 LEFT WOOFER
policy none
input.bindings.2 "Input"
output.bindings.2 "Output" #Final output to LEFT WOOFER
input { controls [21 0 0 300 0.707 1] } #2nd order low pass 300hz
}
2 {
label ACDf #lowpass for woofer output to channel3 RIGHT WOOFER
policy none
input.bindings.1 "Input"
output.bindings.3 "Output"
input { controls [21 0 0 300 0.707 1] } #2nd order low pass 300hz
}
3 {
label ACDf #low pass for woofer output to channel3 RIGHT WOOFER
policy none
input.bindings.3 "Input"
output.bindings.3 "Output" #Final output to RIGHT WOOFER
input { controls [21 0 0 300 0.707 1] } #2nd order low pass at 300hz
}
# TWEETER filters 4 - 7
4 {
label ACDf #1st order high pass1 left TWEETER
policy none
input.bindings.0 "Input"
output.bindings.4 "Output"
input { controls [22 0 0 2000 0.707 1] } #2nd order high pass
}
5 {
label ACDf #1st order high pass2 left TWEETER
policy none
input.bindings.4 "Input"
output.bindings.4 "Output" #Final output to left Tweeter
input { controls [22 0 -1.2 2000 0.707 1] } #2nd order high pass
}
6 {
label ACDf #1st order high pass1 right TWEETER
policy none
input.bindings.1 "Input"
output.bindings.5 "Output"
input { controls [22 0 0 2000 0.707 1] } #2nd order high pass
}
7 { label ACDf #1st order high pass2 right TWEETER
policy none
input.bindings.5 "Input"
output.bindings.5 "Output" #Final output to right Tweeter
input { controls [22 0 -1.2 2200 0.707 1] } #2nd order high pass
}
# MID filters 8 - 11
8 {
label ACDf #low pass 1 LEFT MID
policy none
input.bindings.0 "Input"
output.bindings.6 "Output"
input { controls [21 0 0 2000 0.707 1] } #2nd order low pass
}
9 {
label ACDf #low pass2 LEFT MID
policy none
input.bindings.6 "Input"
output.bindings.6 "Output" #Final output to left MID
input { controls [21 0 0 2000 0.707 1] } #2nd order low pass
}
10 {
label ACDf #low pass1 right MID
policy none
input.bindings.1 "Input"
output.bindings.7 "Output"
input { controls [21 0 0 2000 0.707 1] }#2nd order low pass
}
11 {
label ACDf #low pass2 right MID
policy none
input.bindings.7 "Input"
output.bindings.7 "Output" #Final output to right MID
input { controls [21 0 0 2000 0.707 1] } #2nd order low pass
}
}
}
pcm.speaker {
type plug
slave {
pcm "t-table"
channels 8
rate "unchanged"
}
}
pcm.t-table {
type route
slave {
pcm "hw:0,0" #this works correctly and should not need to be changed.
channels 8
}
ttable {
# these numbers map the inputs to the output speaker terminals.
# channel in.channel out on/off 0=off 1=on. AMP TERMINAL = SPEAKER DRIVER
# The filters work on the channel in. The channel out is matched to the Onkyo TX-SR605
# AV receiver. If a channel is turned off there should be no sound from that channel
0.2 0 # CENTER turned off always.
1.3 0 # LFE turned off always.
2.0 1 # FRONT LEFT = left woofer.
3.1 1 # FRONT RIGHT = right woofer
4.6 1 # REAR LEFT = left tweeter (4) is left tweet
5.7 1 # REAR RIGHT = right tweeter (5) is right tweet
6.4 1 # SURROUND LEFT = left mid (6) is the left mid
7.5 1 # SURROUND RIGHT = right mid (7) is the right mid
}
}
pcm.plughw.slave.rate = "unchanged";
 
Glad to see some fruitful use of my ACDf LADSPA plugins!

You might be running into format incompatibilities for the hdmi output or other sink(s) along the way. This may be due to how hdmi is written into the kernel for the OS and hardware, and that may have changed from one OS version to the next, etc. You have to do some sleuthing (unless you already did it). For this purpose you can use aplay (and arecord if anyone reading this is trying to get an alsa ADC to work properly) and then dumping out information. Use this command:

aplay -D [device] --dump-hw-params /dev/zero

NOTE: You get the device by running the command aplay -L (note the capital L here). This lists all the devices and modes for them separately, so the list is usually very long. Just scroll up to find the appropriate one.

The aplay command is trying to open the playback device specified, send zeros to it (you have to specify some source, so /dev/zero is typically used as a dummy source), and then the command returns the following type of info:

SUBFORMAT: STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295)
PERIOD_TIME: (11609 11610)
PERIOD_SIZE: (46 49864571)
PERIOD_BYTES: (23 4294967295)
PERIODS: (0 17344165)
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [92 797831566]
BUFFER_BYTES: [46 4294967295]
TICK_TIME: ALL
--------------------


The list is very useful to see what all the possible sample rates and formats the sink can use. Sometimes a range of acceptable values is listed, for example with the RATE, when only certain rates are allowed. Look at the fields SAMPLE_BITS, CHANNELS, and RATE for this info. When you do not use an acceptable set of parameters the device will fail on open and alsa will report an error. When you use speaker-test, without specifying certain parameters speaker-test will use its own defaults for those parameters and those may not necessarily match what the playback device can use. For example, the hdmi device may only accept a 24 bit format where speaker-test is trying to use 16 bits, etc. and there is not automatic conversion going on. You could try plughw to force that.
 
Here is the output from various commands.
I apologize for the length of all this, but perhaps it can be helpful

pifieb@raspberrypi:~/Downloads $ alsacap
* Scanning for playback devices *
Card 0, ID `vc4hdmi0', name `vc4-hdmi-0'
Device 0, ID `MAI PCM i2s-hifi-0', name `MAI PCM i2s-hifi-0', 1 subdevices (1 available)
2..8 channels, sampling rate 32000..192000 Hz
Sample formats: IEC958_SUBFRAME_LE
Subdevice 0, name `subdevice #0'
Card 1, ID `vc4hdmi1', name `vc4-hdmi-1'
Device 0, ID `MAI PCM i2s-hifi-0', name `MAI PCM i2s-hifi-0', 1 subdevices (1 available)
Error opening sound device for card 1, device 0: Unknown error 524. Skipping.

pifieb@raspberrypi:~ $ aplay -l
** List of PLAYBACK Hardware Devices **
card 0: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

pifieb@raspberrypi:~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault
Default Audio Device
lavrate
Rate Converter Plugin Using Libav/FFmpeg Library
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System
pulse
PulseAudio Sound Server
speex
Plugin using Speex DSP (resample, agc, denoise, echo, dereverb)
upmix
Plugin for channel upmix (4,6,8)
vdownmix
Plugin for channel downmix (stereo) with a simple spacialization
default
Playback/recording through the PulseAudio sound server
filtereq
filtercross
speaker
t-table
hw:CARD=vc4hdmi0,DEV=0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Direct hardware device without any conversions
plughw:CARD=vc4hdmi0,DEV=0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Hardware device with all software conversions
sysdefault:CARD=vc4hdmi0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi0,DEV=0
vc4-hdmi-0, MAI PCM i2s-hifi-0
HDMI Audio Output
dmix:CARD=vc4hdmi0,DEV=0
vc4-hdmi-0, MAI PCM i2s-hifi-0
Direct sample mixing device
usbstream:CARD=vc4hdmi0
vc4-hdmi-0
USB Stream Output
hw:CARD=vc4hdmi1,DEV=0
vc4-hdmi-1, MAI PCM i2s-hifi-0
Direct hardware device without any conversions
plughw:CARD=vc4hdmi1,DEV=0
vc4-hdmi-1, MAI PCM i2s-hifi-0
Hardware device with all software conversions
sysdefault:CARD=vc4hdmi1
vc4-hdmi-1, MAI PCM i2s-hifi-0
Default Audio Device
hdmi:CARD=vc4hdmi1,DEV=0
vc4-hdmi-1, MAI PCM i2s-hifi-0
HDMI Audio Output
dmix:CARD=vc4hdmi1,DEV=0
vc4-hdmi-1, MAI PCM i2s-hifi-0
Direct sample mixing device
usbstream:CARD=vc4hdmi1
vc4-hdmi-1
USB Stream Output

pifieb@raspberrypi:~ $ aplay -Ddefault --dump-hw-params /dev/zero
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "default":
--------------------
ACCESS: RW_INTERLEAVED
FORMAT: U8 S16_LE S16_BE S24_LE S24_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW S24_3LE S24_3BE
SUBFORMAT: STD
SAMPLE_BITS: [8 32]
FRAME_BITS: [8 1024]
CHANNELS: [1 32]
RATE: [1 384000]
PERIOD_TIME: (2 4294967295)
PERIOD_SIZE: [1 1398102)
PERIOD_BYTES: [128 1398102)
PERIODS: [3 1024]
BUFFER_TIME: (7 4294967295]
BUFFER_SIZE: [3 4194304]
BUFFER_BYTES: [384 4194304]
TICK_TIME: ALL
--------------------
^CAborted by signal Interrupt...
aplay: pcm_write:2127: write error: Interrupted system call
pifieb@raspberrypi:~ $


The results of command env
pifieb@raspberrypi:~ $ env
SHELL=/bin/bash
NO_AT_BRIDGE=1
PWD=/home/pifieb
LOGNAME=pifieb
XDG_SESSION_TYPE=tty
MOTD_SHOWN=pam
HOME=/home/pifieb
LANG=en_GB.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:eek:r=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:eek:w=34;42:st=37;44:ex=01;32:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.avif=01;35:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.webp=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:~=00;90:#=00;90:.bak=00;90:.old=00;90:.orig=00;90:.part=00;90:.rej=00;90:.swp=00;90:.tmp=00;90:.dpkg-dist=00;90:.dpkg-old=00;90:.ucf-dist=00;90:.ucf-new=00;90:.ucf-old=00;90:.rpmnew=00;90:.rpmorig=00;90:.rpmsave=00;90:
SSH_CONNECTION=2605:a601:a639:7000:e19a:5a82:7761:3b6e 53025 2605:a601:a639:7000:c169:ed5a:d118:ec9a 22
XDG_SESSION_CLASS=user
TERM=xterm
USER=pifieb
SHLVL=1
XDG_SESSION_ID=5
XDG_RUNTIME_DIR=/run/user/1000
SSH_CLIENT=2605:a601:a639:7000:e19a:5a82:7761:3b6e 53025 22
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
SSH_TTY=/dev/pts/0
OLDPWD=/home/pifieb/Downloads
LADSPA_PATH=/usr/local/lib/ladspa:/usr/lib/ladspa
TEXTDOMAIN=Linux-PAM
_=/usr/bin/env


I have not been successful getting export LADSP_PATH=/usr/local/lib/ladspa:/usr/lib/ladspa to work from a ./profile
I enter the command manually after every boot.
**************************************************
*end first section of this post *
***************************************************
 
post continued (finding out about the 20,000 char limit!)

active snippets from /boot/firmware/config.txt
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
dtparam=audio=on
camera_auto_detect=1
display_auto_detect=1
auto_initramfs=1
dtoverlay=vc4-kms-v3d
max_framebuffers=2
disable_fw_kms_setup=1
arm_64bit=1
disable_overscan=1
arm_boost=1


pulseaudio daemon is confirmed running by the following:

pifieb@raspberrypi:/etc/pulse $ pulseaudio -vv

I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
D: [pulseaudio] core-rtclock.c: Timer slack is set to 50 us.
I: [pulseaudio] core-util.c: Failed to acquire high-priority scheduling: Permission denied
I: [pulseaudio] main.c: This is PulseAudio 16.1
D: [pulseaudio] main.c: Compilation CFLAGS: Not yet supported on meson
D: [pulseaudio] main.c: Running on host: Linux aarch64 6.6.20+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07)
D: [pulseaudio] main.c: Found 4 CPUs.
I: [pulseaudio] main.c: Page size is 16384 bytes
D: [pulseaudio] main.c: Compiled with Valgrind support: no
D: [pulseaudio] main.c: Running in valgrind mode: no
D: [pulseaudio] main.c: Running in VM: no
D: [pulseaudio] main.c: Running from build tree: no
D: [pulseaudio] main.c: Optimized build: yes
D: [pulseaudio] main.c: All asserts enabled.
I: [pulseaudio] main.c: Machine ID is 45f746a08d0b4646bebf44037166c0fd.
I: [pulseaudio] main.c: Session ID is 4.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/pifieb/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib/pulse-16.1+dfsg1/modules.
I: [pulseaudio] main.c: Running in system mode: no
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.


I have the default modules loaded in PulseAudio

pifieb@raspberrypi:~ $ pacmd list-modules
23 module(s) loaded.
index: 0
name: <module-device-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the volume/mute state of devices"
module.version = "16.1"
index: 1
name: <module-stream-restore>
argument: <restore_device=false>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the volume/mute/device state of streams"
module.version = "16.1"
index: 2
name: <module-card-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore profile of cards"
module.version = "16.1"
index: 3
name: <module-augment-properties>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Augment the property sets of streams with additional static information"
module.version = "16.1"
index: 4
name: <module-switch-on-port-available>
argument: <>
used: -1
load once: yes
properties:
module.author = "David Henningsson"
module.description = "Switches ports and profiles when devices are plugged/unplugged"
module.version = "16.1"
index: 5
name: <module-udev-detect>
argument: <tsched=0>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Detect available audio hardware and load matching drivers"
module.version = "16.1"
index: 6
name: <module-alsa-card>
argument: <device_id="0" name="platform-107c701400.hdmi" card_name="alsa_card.platform-107c701400.hdmi" namereg_fail=false tsched=no fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1">
used: 0
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "ALSA Card"
module.version = "16.1"
index: 8
name: <module-bluetooth-policy>
argument: <>
used: -1
load once: yes
properties:
module.author = "Frédéric Dalleau, Pali Rohár"
module.description = "Policy module to make using bluetooth devices out-of-the-box easier"
module.version = "16.1"
index: 9
name: <module-bluetooth-discover>
argument: <autodetect_mtu=yes>
used: -1
load once: yes
properties:
module.author = "João Paulo Rechi Vita"
module.description = "Detect available Bluetooth daemon and load the corresponding discovery module"
module.version = "16.1"
index: 10
name: <module-bluez5-discover>
argument: <autodetect_mtu=yes>
used: -1
load once: yes
properties:
module.author = "João Paulo Rechi Vita"
module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"
module.version = "16.1"
index: 11
name: <module-native-protocol-unix>
argument: <>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Native protocol (UNIX sockets)"
module.version = "16.1"
index: 12
name: <module-default-device-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the default sink and source"
module.version = "16.1"
index: 13
name: <module-always-sink>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Always keeps at least one sink loaded even if it's a null one"
module.version = "16.1"
index: 14
name: <module-intended-roles>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically set device of streams based on intended roles of devices"
module.version = "16.1"
index: 15
name: <module-suspend-on-idle>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "When a sink/source is idle for too long, suspend it"
module.version = "16.1"
index: 16
name: <module-systemd-login>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Create a client for each login session of this user"
module.version = "16.1"
index: 17
name: <module-position-event-sounds>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."
module.version = "16.1"
index: 18
name: <module-role-cork>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Mute & cork streams with certain roles while others exist"
module.version = "16.1"
index: 19
name: <module-filter-heuristics>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Detect when various filters are desirable"
module.version = "16.1"
index: 20
name: <module-filter-apply>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Load filter sinks automatically when needed"
module.version = "16.1"
index: 21
name: <module-x11-publish>
argument: <display=:0 xauthority=/home/pifieb/.Xauthority>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "X11 credential publisher"
module.version = "16.1"
index: 22
name: <module-x11-cork-request>
argument: <display=:0 xauthority=/home/pifieb/.Xauthority>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Synthesize X11 media key events when cork/uncork is requested"
module.version = "16.1"
index: 23
name: <module-cli-protocol-unix>
argument: <>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Command line interface protocol (UNIX sockets)"
module.version = "16.1"

I have the default sinks in PulseAudio

pifieb@raspberrypi:~ $ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <alsa_output.platform-107c701400.hdmi.hdmi-surround71>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9000
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB, rear-left: 65536 / 100% / 0.00 dB, rear-right: 65536 / 100% / 0.00 dB, front-center: 65536 / 100% / 0.00 dB, lfe: 65536 / 100% / 0.00 dB, side-left: 65536 / 100% / 0.00 dB, side-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 8ch 44100Hz
channel map: front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
Surround 7.1
used by: 0
linked by: 0
fixed latency: 59.95 ms
card: 0 <alsa_card.platform-107c701400.hdmi>
module: 6
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "MAI PCM i2s-hifi-0"
alsa.id = "MAI PCM i2s-hifi-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "vc4-hdmi-0"
alsa.long_card_name = "vc4-hdmi-0"
alsa.driver_name = "vc4"
device.bus_path = "platform-107c701400.hdmi"
sysfs.path = "/devices/platform/soc/107c701400.hdmi/sound/card0"
device.form_factor = "internal"
device.string = "hdmi:0"
device.buffering.buffer_size = "42304"
device.buffering.fragment_size = "10576"
device.access_mode = "mmap"
device.profile.name = "hdmi-surround71"
device.profile.description = "Digital Surround 7.1 (HDMI)"
device.description = "Built-in Audio Digital Surround 7.1 (HDMI)"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "video-display"
device.product.name = "TX-SR605"
active port: <hdmi-output-0>

I have the default sources in PulseAudio

pifieb@raspberrypi:~ $ pacmd list-sources
1 source(s) available.
* index: 0
name: <alsa_output.platform-107c701400.hdmi.hdmi-surround71.monitor>
driver: <module-alsa-card.c>
flags: DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1000
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB, rear-left: 65536 / 100% / 0.00 dB, rear-right: 65536 / 100% / 0.00 dB, front-center: 65536 / 100% / 0.00 dB, lfe: 65536 / 100% / 0.00 dB, side-left: 65536 / 100% / 0.00 dB, side-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 8ch 44100Hz
channel map: front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
Surround 7.1
used by: 0
linked by: 0
fixed latency: 59.95 ms
monitor_of: 0
card: 0 <alsa_card.platform-107c701400.hdmi>
module: 6
properties:
device.description = "Monitor of Built-in Audio Digital Surround 7.1 (HDMI)"
device.class = "monitor"
alsa.card = "0"
alsa.card_name = "vc4-hdmi-0"
alsa.long_card_name = "vc4-hdmi-0"
alsa.driver_name = "vc4"
device.bus_path = "platform-107c701400.hdmi"
sysfs.path = "/devices/platform/soc/107c701400.hdmi/sound/card0"
device.form_factor = "internal"
device.string = "0"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"

I have the audio set for 7.1 surround on the desktop and I get audio from sequential channels when using speaker-test



pifieb@raspberrypi:~ $ speaker-test -t wav -Ddefault -c 8

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 24 to 262144
Period size range from 8 to 87382
Using max buffer size 262144
Periods = 4
was set period_size = 65536
was set buffer_size = 262144
0 - Front Left
4 - Center
1 - Front Right
7 - Side Right
3 - Rear Right
2 - Rear Left
6 - Side Left
5 - LFE
Time per period = 11.519223
0 - Front Left
4 - Center
^X^X 1 - Front Right
^C 7 - Side Right
Transfer failed: Bad address
pifieb@raspberrypi:~ $

However if I repeat the test as sudo I get errors as follows:

pifieb@raspberrypi:~ $ sudo speaker-test -t wav -Ddefault -c 8

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 8 channels
WAV file(s)
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
ALSA lib pcm_params.c:2226:(snd1_pcm_hw_refine_slave) Slave PCM not usable
Broken configuration for playback: no configurations available: Invalid argument
Setting of hwparams failed: Invalid argument

end of post
 
I noticed for your default device:
SAMPLE_BITS: [8 32]

So both 16 and 24 bits may not work. Try using 32 bit samples when sending audio to it.

Note that speaker-test cannot send 32 bit samples IIRC. You can try using SoX to create and send data in whatever format you want to try.

Could could try to add the S32_LE format to:
type plug
slave {
pcm filtereq
rate 96000
}
 
Of course it would help if I gave aplay something to work with LOL

pifieb@raspberrypi:~ $ aplay Pink.wav -v
Playing WAVE 'Pink.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16
buffer_size : 22050
period_size : 5512
period_time : 125000
tstamp_mode : NONE
tstamp_type : GETTIMEOFDAY
period_step : 1
avail_min : 5512
period_event : 0
start_threshold : 22050
stop_threshold : 22050
silence_threshold: 0
silence_size : 0
boundary : 6206523236469964800
^CAborted by signal Interrupt...
aplay: pcm_write:2127: write error: Interrupted system call