Go Back   Home > Forums > >

PC Based Computer music servers, crossovers, and equalization

2-in, 8-out DSP platform using the Raspberry Pi + HATs
2-in, 8-out DSP platform using the Raspberry Pi + HATs
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
Old 4th March 2019, 06:25 PM   #11
skyunlimited is offline skyunlimited  Germany
diyAudio Member
 
Join Date: Aug 2009
Quote:
Originally Posted by CharlieLaub View Post
I was able to render eight channels of 24-bit, 192kHz audio through this board.
This is not working for me. My Pi could only do S16_LE via HDMI.

Code:
speaker-test -D hw:0,1 -c 8 --format S24_3LE
returns an error
Code:
Format S24_3LE is not supported...
I am using a Hifiberry Digi I/O card as input on a RPI 3B+ and a Wolfson Audio Card on a Single Core Pi.
  Reply With Quote
Old 4th March 2019, 06:30 PM   #12
korakinos is offline korakinos
diyAudio Member
 
Join Date: Mar 2019
Yeah, I was just trying jack first this morning because I have used it before. Now I know 8 channels work in principle, I'm happy to try to make it work without jack.

Quote:
Originally Posted by phofman View Post
Code:
aplay -v -D plughw:0,X -c 8 --dump-hw-params your.wav
For various X (0, 1, ...)

Please post output of aplay (incl. the verbose debug of what the plug plugin does + the hw params) when the command works.
It does (audibly)! :
Code:
pi@raspberrypi:~ $ aplay -v -D plughw:0,1 -c 8 --dump-hw-params 8_Channel_ID.wav 
Playing WAVE '8_Channel_ID.wav' : Signed 24 bit Little Endian in 3bytes, Rate 48000 Hz, Channels 8
HW Params of device "plughw:0,1":
--------------------
ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295)
PERIOD_TIME: (223 1486078)
PERIOD_SIZE: (0 4294967295)
PERIOD_BYTES: (0 4294967295)
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967294]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
--------------------
Plug PCM: Hardware PCM card 0 'bcm2835 ALSA' device 1 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 8
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 24
  buffer_size  : 10922
  period_size  : 2730
  period_time  : 56875
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 2730
  period_event : 0
  start_threshold  : 10922
  stop_threshold   : 10922
  silence_threshold: 0
  silence_size : 0
  boundary     : 1431568384
  appl_ptr     : 0
  hw_ptr       : 0

Quote:
Originally Posted by CharlieLaub View Post
Here is a simple test you can try.[]

Code:
pi@raspberrypi:~ $ speaker-test -Dhw:0,1 -c 8
While speaker-test is running, look at the file hw_params that corresponds to that card, device, and subdevice:
Code:
pi@raspberrypi:~ $ cat /proc/asound/card0/pcm1p
Works like a charm, very audibly. My output from both commands is exactly the same as yours.


Now to what doesn't yet work (without jack): Pure Data.

in Media->Audio Settings I can select one of two "Output Devices"
- bcm2835 ALSA (hardware)
- bcm2835 ALSA (plug-in)
Bot have their channel count set two 2 by default.

When I set the channel count to 8 for the "hardware" device, I get this output in the Pd window (note the last line):
Code:
input channels = 2, output channels = 8
input channels = 2, output channels = 8
audio buffer set to 25
ALSA input error (snd_pcm_open): No such file or directory
configuring sound output...
Sample width set to 2 bytes
ALSA: set output channels to 2
When I do the same for the "plug-in" device, I don't get that last line of "set output channels to 2", and the Sample Width is announced as 4 bytes.

Still, in both cases I cannot get audio out of any but the first two channels. The builtin Media->"Test Audio and Midi" patch appears to have 8 channels preprogrammed, but 3-8 are silent. Likewise, when I create an 8-channel output myself as [dac~ 1 2 3 4 5 6 7 8], I only get audible output when routing sound to the first two.

The line "ALSA input error (snd_pcm_open): No such file or directory" is presumably harmless, as it also shows up when I set the channel count back to two.


Quote:
Finally, you wanted to do some playback over all 8 channels but did not really say what you wanted to do exactly. Did you want to play surround sound audio (e.g. 7.1 channels) or upmix, implement a multichannel crossover, or something else?
I want to output and control three to four stereo signals for headphones. "control" in the sense that they must be able to start/stop/jump indepently of each other. This is going to be part of an interactive art installation also involving buttons and other elements, and actually 10 pairs of headphones. As 4 Raspberry Pis are already planned to play videos (without sound), I figured I could use them for audio playback as well.
  Reply With Quote
Old 4th March 2019, 06:31 PM   #13
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Use the aplay --dump-hw-params option to list all possible formats your soundcard supports. Sound devices often use S32_LE instead of the 3-byte S24_3LE

Code:
aplay -D hw:X --dump-hw-params /dev/zero
  Reply With Quote
Old 4th March 2019, 11:00 PM   #14
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Quote:
Originally Posted by phofman View Post
Use the aplay --dump-hw-params option to list all possible formats your soundcard supports. Sound devices often use S32_LE instead of the 3-byte S24_3LE

Code:
aplay -D hw:X --dump-hw-params /dev/zero
That is, in general, a pretty useful command to probe capabilities.

In this case, it's only going to echo back to us what we told the kernel that the SPDIF capabilities are when we edited the bcm2835-pcm.c file and recompiled the kernel.

I have encountered one program that, when you told it to use the format S24LE, was actually using the format S24_3LE and playback was successful. But when you explicitly told it to use S24_3LE it said that was an unknown or invalid format!
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 5th March 2019, 05:04 AM   #15
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by CharlieLaub View Post
I have encountered one program that, when you told it to use the format S24LE, was actually using the format S24_3LE and playback was successful. But when you explicitly told it to use S24_3LE it said that was an unknown or invalid format!
For alsa API the formats are just numerical constants (enums). That programs probably used wrong string name for that particular constant.
  Reply With Quote
Old 5th March 2019, 05:13 AM   #16
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by CharlieLaub View Post
In this case, it's only going to echo back to us what we told the kernel that the SPDIF capabilities are when we edited the bcm2835-pcm.c file and recompiled the kernel.
Very true. But what if incomplete capabilities were added, the module was rewritten by a new version from updated package, it was never re-loaded etc. etc. Plus it is good if users learn how to inspect details about their system. People keep asking about capabilities of their sound devices constantly and unfortunately very few know how to find out. Let's let them explore the beauty of open linux :-) In windows they would never obtain such low-level yet very important information
  Reply With Quote
Old 5th March 2019, 04:20 PM   #17
DarpMalone is offline DarpMalone  Canada
diyAudio Member
 
DarpMalone's Avatar
 
Join Date: Sep 2008
Location: Toronto
2-in, 8-out DSP platform using the Raspberry Pi + HATs
Default No kernel directory created

Quote:
Originally Posted by Now, while still in your home directory, get the kernel sources.
[CODE
git clone --depth=1 GitHub - raspberrypi/linux: Kernel source tree for Raspberry Pi Foundation-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://www.raspberrypi.org/forum[/CODE]
This takes a little while. When completed you will have a new directory called "kernel" in your home directory.

Step 2: Create a helpful script file for editing the edit_bcm2835-pcm.c file:
cd into the kernel directory.
First, thanks for this tutorial Charlielaub. I have an 8 channel HDMI extractor that I'd love to try this with.

I guess I'm off to a bad start. I completed step 1 without errors but I don't have a kernel directory in my home dir. Any suggestions?

Code:
pi@raspberrypi:/home $ sudo git clone --depth=1 GitHub - raspberrypi/linux: Kernel source tree for Raspberry Pi Foundation-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://www.raspberrypi.org/forum
Cloning into 'linux'...
remote: Enumerating objects: 66087, done.
remote: Counting objects: 100% (66087/66087), done.
remote: Compressing objects: 100% (61063/61063), done.
remote: Total 66087 (delta 6233), reused 16093 (delta 4113), pack-reused 0
Receiving objects: 100% (66087/66087), 176.30 MiB | 7.23 MiB/s, done.
Resolving deltas: 100% (6233/6233), done.
Checking out files: 100% (62252/62252), done.
pi@raspberrypi:/home $ cd kernel
-bash: cd: kernel: No such file or directory
pi@raspberrypi:/home $ ls
linux  pi
  Reply With Quote
Old 5th March 2019, 04:45 PM   #18
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Quote:
Originally Posted by DarpMalone View Post
First, thanks for this tutorial Charlielaub. I have an 8 channel HDMI extractor that I'd love to try this with.

I guess I'm off to a bad start. I completed step 1 without errors but I don't have a kernel directory in my home dir. Any suggestions?

Code:
pi@raspberrypi:/home $ sudo git clone --depth=1 GitHub - raspberrypi/linux: Kernel source tree for Raspberry Pi Foundation-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://www.raspberrypi.org/forum
Cloning into 'linux'...
remote: Enumerating objects: 66087, done.
remote: Counting objects: 100% (66087/66087), done.
remote: Compressing objects: 100% (61063/61063), done.
remote: Total 66087 (delta 6233), reused 16093 (delta 4113), pack-reused 0
Receiving objects: 100% (66087/66087), 176.30 MiB | 7.23 MiB/s, done.
Resolving deltas: 100% (6233/6233), done.
Checking out files: 100% (62252/62252), done.
pi@raspberrypi:/home $ cd kernel
-bash: cd: kernel: No such file or directory
pi@raspberrypi:/home $ ls
linux  pi
Ah, sorry, the directory that is created is call "linux" not "kernel"... I sent in a report and asked a mod to make corrections since I can no longer edit the post.

Thanks for bringing this to my attention!

-Charlie
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 5th March 2019 at 04:59 PM.
  Reply With Quote
Old 5th March 2019, 07:25 PM   #19
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Looks like one of the mods has fixed the mistakes in the text of post#3 for me. Thanks mods!
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 20th April 2019, 02:07 PM   #20
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
UPDATE:

I finally tested out the Pi with both the SupTronics HDMI audio extractor and the HiFiBerry DAC+ADC HAT and both work as advertised. The kernel was modified and recompiled as described earlier in this thread, which brought the revision up to 4.19.23-v7+ under which the DAC+ADC HAT was supported. For info on the HiFiBerry HAT, see this post:
very HQ stereo analog audio input for Raspberry Pi - any options?
and subsequent posts in that thread.

I can run high quality audio into the Pi (2 channels) where I can do DSP and then have TEN output channels (8 on the HDMI HAT and 2 on the DAC+ADC HAT). This can comprise a nice DSP processor for DIY use with relatively good performance specs. The total cost was about $160 for the Pi and the two HATs. Since I have a bunch of 60W/90W@8R/4R Class AB amp modules at my disposal I might put all of it together into a case to create a multichannel DSP powered AMP...
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote

Reply


2-in, 8-out DSP platform using the Raspberry Pi + HATsHide this!Advertise here!
Thread Tools

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
ES9018K2M, ES9028Q2M, 9038Q2M DSD/I2S DAC HATs for Raspberry Pi iancanada PC Based 925 5th December 2020 02:15 PM
Odroid, BBB, Raspberry Pi or MarsBoard, which platform to use for building a DYI SBT Eeerni Digital Line Level 8 12th October 2019 08:53 AM
Interest survey: Cow Town Audio Fest - Calgary, 2019 (cowboy hats optional) tomchr Clubs & Events 14 22nd October 2018 02:11 AM
Hats off to Mr Pass, encouragement to new members Russellc Pass Labs 10 17th May 2015 09:23 AM
Hats make better bass? xstephanx Subwoofers 11 9th February 2005 11:59 AM


New To Site? Need Help?

All times are GMT. The time now is 10:33 AM.


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