2-in, 8-out DSP platform using the Raspberry Pi + HATs

To all the RPi folks out there:

I'm the deveolper of pulseaudio crossover rack.

What I would be interested in: What format does the HDMI output accept when running on an RPi in multi channel mode, please only reply if you have tested it yourself. Regarding big/little endianness: Does it matter on ARM regarding floats? What should be the preferred sample format for pulseaudio when running on an ARM processor? So far I recommended float32le for intel/amd-based machines... Does this hold true for ARM based machines? Please excuse my lack in knowledge of ARM architecture, I'm mostly a software guy, not a hardware guy...
 
To all the RPi folks out there:

I'm the deveolper of pulseaudio crossover rack.

What I would be interested in: What format does the HDMI output accept when running on an RPi in multi channel mode, please only reply if you have tested it yourself. Regarding big/little endianness: Does it matter on ARM regarding floats? What should be the preferred sample format for pulseaudio when running on an ARM processor? So far I recommended float32le for intel/amd-based machines... Does this hold true for ARM based machines? Please excuse my lack in knowledge of ARM architecture, I'm mostly a software guy, not a hardware guy...

Let me try to answer your questions. The HAT is an HDMI audio extractor and as such only supports LPCM. The chip on the board can support 16 or 24 bit audio only.

I am able to probe the supported formats using Gstreamer and some custom routines I wrote, and the supported formats are only S24LE (ALSA's S24_3LE) and S16LE on a Pi. The unit can also be used "standalone" on the HDMI output of any computer, with the same restrictions.

As for your other questions about enandianess, ARM, etc. I cannot say for sure. I am not a hardware guy either!
 
As stated in Post #9 of this Thread, Pi can only play S16_LE Format via HDMI after this Kernelmod.
I think there is no Pulseaudio Configuration for this Output.

Regards

Um, no, that is completely wrong. 24 bit playback works perfectly for 8 channels at 192kHz. I have verified this.

I do not know whether or not Pulse Audio supports this kind of playback or not. I use Gstreamer pipelines and send the audio to ALSA directly.
 
Code:
pi@raspberrypi:~ $ speaker-test -D hw:0,1 -c 8 -r192000 --format S16_LE

speaker-test 1.1.3

Wiedergabe-Gerät ist hw:0,1
Stream-Parameter sind 192000 Hz, S16_LE, 8 Kanäle
Verwende 16 Oktaven rosa Rauschen
Rate ist 192000 Hz (angefordert: 192000 Hz)
Puffergröße von 64 bis 16384
Periodengröße von 64 bis 16384
Verwende maximale Puffergröße 16384
Perioden = 4
gesetzt: period_size = 4096
gesetzt: buffer_size = 16384
 0 - Vorne links
 4 - Mitte
 1 - Vorne rechts
 7 - Seitlich rechts
 3 - Hinten rechts
 2 - Hinten links
 6 - Seitlich links
 5 - Bass
Zeit pro Periode = 23,828712
 0 - Vorne links
^C 4 - Mitte
 1 - Vorne rechts
 7 - Seitlich rechts
 3 - Hinten rechts
 2 - Hinten links
 6 - Seitlich links
 5 - Bass
Zeit pro Periode = 2,344407
pi@raspberrypi:~ $ speaker-test -D hw:0,1 -c 8 -r192000 --format S24_LE

speaker-test 1.1.3

Format S24_LE is not supported...
pi@raspberrypi:~ $ speaker-test -D hw:0,1 -c 8 -r192000 --format S32_LE

speaker-test 1.1.3

Wiedergabe-Gerät ist hw:0,1
Stream-Parameter sind 192000 Hz, S32_LE, 8 Kanäle
Verwende 16 Oktaven rosa Rauschen
Sample-Format nicht unterstützt: Das Argument ist ungültig
Fehler beim Setzen der Hardware-Parameter: Das Argument ist ungültig
pi@raspberrypi:~ $

This is the output of speaker-test.
 
I think that is because SPEAKER TEST does not support that format.

Instead, try using the command (suggested earlier in this thread by phofman):
Code:
aplay -D hw:x,y --dump-hw-params /dev/zero
Change "hw:x,y" to what ever hw assignment the HDMI extractor is given on your machine. I don't have a Pi powered up at the moment, so instead I am using an Intel machine running Ubuntu with the X6000 HDMI extractor connected to the HDMI output. When I run the command shown above I get:
Code:
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:1,3":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 256]
CHANNELS: [2 8]
RATE: [32000 192000]
PERIOD_TIME: (20 256000]
PERIOD_SIZE: [4 8192]
PERIOD_BYTES: [128 262144]
PERIODS: [2 32]
BUFFER_TIME: (41 512000]
BUFFER_SIZE: [8 16384]
BUFFER_BYTES: [128 65536]
TICK_TIME: ALL
--------------------
aplay: set_params:1299: Sample format non available
Available formats:
- S16_LE
- S32_LE
On this machine I do not need to edit the kernel. The device is natively supported.

When I edit the kernel module for the Raspberry Pi and recompile using the procedure earlier in this thread, I am telling the kernel what formats are possible with the HDMI output, so I would be very surprised if S24_3LE is not supported!

Try running the aplay diagnostic command above and see what the output looks like...
 
OK, now I am on the Pi with the modified kernel and the HDMI extractor connected externally (not as a HAT) to the HDMI output of the Pi (apart from the power source it operates the same either way):
Code:
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.23-v7+ #1 SMP Fri Feb 22 10:46:02 EST 2019 armv7l GNU/Linux

The HDMI output is hw:0,1 as seen here:
Code:
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 7/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

When I run the aplay diagnostic, I get the following output:
Code:
pi@raspberrypi:~ $ aplay -D hw:0,1 --dump-hw-params /dev/zero
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:0,1":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 24]
FRAME_BITS: [32 192]
CHANNELS: [2 8]
RATE: [44100 192000]
PERIOD_TIME: (223 1486078)
PERIOD_SIZE: [43 65536]
PERIOD_BYTES: [1024 262144]
PERIODS: [1 256]
BUFFER_TIME: (223 1486078)
BUFFER_SIZE: [43 65536]
BUFFER_BYTES: [1024 262144]
TICK_TIME: ALL
--------------------
aplay: set_params:1299: Sample format non available
Available formats:
- S16_LE
- S24_3LE

To verify that speaker-test does not work using S24_3LE, I ran:
Code:
pi@raspberrypi:~ $ speaker-test -D hw:0,1 -c 8 -r192000 --format S24_LE

speaker-test 1.1.3

Format S24_LE is not supported...

The problem is with speaker-test, not ALSA.
 
In any case, like I have mentioned before I used Gstreamer when I was checking out the HDMI extractor and figuring out what format to include in the kernel mod. These tests included playing a single tone sine wave or white noise at various rates and formats and checking each and every output channel by ear while sending audio data from Gstreamer to ALSA to the extractor.
 
On latest Raspbian Buster there is no need to modify the Kernel. Kernel 4.19.58-v7+ comes with full Multichannel support.

Code:
pi@raspberrypi:~ $ aplay -D hw:0,1 --dump-hw-params /dev/zero
Wiedergabe: Rohdaten '/dev/zero' : Unsigned 8 bit, Rate: 8000 Hz, mono
HW Params of device "hw:0,1":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: [32 128]
CHANNELS: [2 8]
RATE: [44100 192000]
PERIOD_TIME: [10000 743039)
PERIOD_SIZE: [441 32768]
PERIOD_BYTES: [1776 524288]
PERIODS: [1 75)
BUFFER_TIME: (2296 743039)
BUFFER_SIZE: [441 32768]
BUFFER_BYTES: [1764 131072]
TICK_TIME: ALL
--------------------
aplay: set_params:1339: Sample-Format nicht unterstützt
Available formats:
- S16_LE
 
Last edited:
On latest Raspbian Buster there is no need to modify the Kernel. Kernel 4.19.58-v7+ comes with full Multichannel support.

Code:
pi@raspberrypi:~ $ aplay -D hw:0,1 --dump-hw-params /dev/zero
Wiedergabe: Rohdaten '/dev/zero' : Unsigned 8 bit, Rate: 8000 Hz, mono
HW Params of device "hw:0,1":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: [32 128]
CHANNELS: [2 8]
RATE: [44100 192000]
PERIOD_TIME: [10000 743039)
PERIOD_SIZE: [441 32768]
PERIOD_BYTES: [1776 524288]
PERIODS: [1 75)
BUFFER_TIME: (2296 743039)
BUFFER_SIZE: [441 32768]
BUFFER_BYTES: [1764 131072]
TICK_TIME: ALL
--------------------
aplay: set_params:1339: Sample-Format nicht unterstützt
Available formats:
- S16_LE

Ah, that's great news! This has been on many people's wish list for a long time. Only 16 bit format is supported. Oh well you can't have it all.
 
Multichannel HDMI, finally, good news! There was/is a modified driver on github that enabled multichannel and 24 bit format on the pi. I think it just added s24_le after s16_le. Honestly, considering the minimal modifications that unlock this functionality, it is rather annoying it is not implemented sooner/from the start in Raspbian.
 
Multichannel HDMI, finally, good news! There was/is a modified driver on github that enabled multichannel and 24 bit format on the pi. I think it just added s24_le after s16_le. Honestly, considering the minimal modifications that unlock this functionality, it is rather annoying it is not implemented sooner/from the start in Raspbian.

Great news, only too bad that there are only two I2s channels (good enough for 4 channels output), which one of them isn't connected on the headers.
So I guess the only option is still just HDMI, which is a little tricky to convert (something with licenses etc, same story as 24bit USB2) or USB audio device.