• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Multichannel audio on a Pi will get a whole lot easier and cheaper!

gordoste

Member
Joined
Nov 19, 2023
Messages
34
Likes
32
I would recommend looking at this https://github.com/marcoevang/camilladsp-setrate
I don't use it myself as my input is always the same sample rate, but there is a thread on DIYaudio https://www.diyaudio.com/community/threads/sample-rate-switcher-for-camilladsp.403054/
This would allow you to turn off the resampling in PiCorePlayer and just have CDSP's async resampling.
However, I don't think this will make any real difference. Upsampling from one audio rate to a higher rate results in a mathematically identical signal if done properly. It just reduces the load on your PiCorePlayer.
Personally I would run everything on a single Pi, but you would need to use a loopback device.
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
I would recommend looking at this https://github.com/marcoevang/camilladsp-setrate
I don't use it myself as my input is always the same sample rate, but there is a thread on DIYaudio https://www.diyaudio.com/community/threads/sample-rate-switcher-for-camilladsp.403054/
This would allow you to turn off the resampling in PiCorePlayer and just have CDSP's async resampling.
However, I don't think this will make any real difference. Upsampling from one audio rate to a higher rate results in a mathematically identical signal if done properly. It just reduces the load on your PiCorePlayer.
Personally I would run everything on a single Pi, but you would need to use a loopback device.
Thank you, that could help me a lot.

Picoreplayer has its own Linux distro, i am not sure if there an stand alone version around so i cant use it at the same PI. Before i used squeezelite on the same PI with CDSP and Squeezeserver thats worked, but Picoreplayer has more usefull settings and use the same Squeezelite. Want to have an Display thats show me the aktuall Playing Musik.

But i want to switch between different I2S Streems into RPI5 and CDSP, like i wrote before, to have HDMI input, SPDIF, ASEbu and so on, so at this moment i guess i need this camilladsp-setrate.

And i want to be flexible in the future for different Mediaplayer software, if i want to test them, so i use an second PI for that, i have it laying around, so why not.

The Setup on CDSP will be massiv when i did all the work, at the End, i want to get an full aktiv 7.2 Surround Setup with FIR Crosover for all Speaker (8 Input and 16 Outputs i need for that). I use right now 2 Inputs and 6 Outs (2x 3way) and need already 8% Power of CDSP. At the moment i am not sure how far the Load will go.

So better to have CDSP on his own PI 5 with the SqeezeServer.

I have an Nas but the noise in the same room is to much for me ;) The PI's get passiv Cooling and be Silent.
I used both RPI5 EDATEC Enclousures for my RPI5 with SSD and it works great so far.

So i am stil in Prototyping the whole system and need lots to test. Befor i can make the Enclousures for the endgame DSP. ;)

I split the Enclousures in 2 One for the DC Power (DC 5V, 12V and 15V for RPI and MOTU and the Dacs i use for now), TFT Screen with HDMI IN and an 8 Chanel Relais Timed switchboard to aktivate all 9 Amps one by one remotly.
and one for the RPI'S, HDMI to i2s, HDMI switch, I2s Switch and so on.

I am not an Linux expert so every advice count :)

Thank you

Robert
 

Attachments

  • Both EDATEC on one RPI5 1.jpg
    Both EDATEC on one RPI5 1.jpg
    698.3 KB · Views: 23
  • Both EDATEC on one RPI5 2.jpg
    Both EDATEC on one RPI5 2.jpg
    232.6 KB · Views: 26
Last edited:

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,699
Likes
2,336
Thank you, that could help me a lot.

Picoreplayer has its own Linux distro, i am not sure if there an stand alone version around so i cant use it at the same PI. Before i used squeezelite on the same PI with CDSP and Squeezeserver thats worked, but Picoreplayer has more usefull settings and use the same Squeezelite. Want to have and Display thats show me the aktuall Playing Musik.

But i want to switch between different I2S Streems into RPI5 and CDSP, like i wrote before, to have HDMI input, SPDIF, ASEbu and so on, so at this moment i guess i need this camilladsp-setrate.

And i want to be flexible in the future for different Mediaplayer software, if i want to test them, so i use an second PI for that, i have it laying around, so why not.

The Setup on CDSP will be massiv when i did al the work, at the End i want to get an full aktiv 7.2 Surround Setup with FIR Crosover for all Speaker (8 Input and 16 Outputs i need for that). I use right now 2 Inputs and 6 Outs and need already 8% Power of CDSP. At the moment i am not sure how far the Load will go.

So better to have CDSP on his own PI 5 with the SqeezeServer.

I have an Nas but the noise in the same room is to much for me ;) The PI's get passiv Cooling and be Silent.
I used both RPI5 EDATEC Enclousures for my RPI5 with SSD and it works great so far.

So i am stil in Prototyping the whole system and need lots to test. Befor i can make the Enclousures for the endgame DSP. ;)

I am not an Linux expert so every advice count :)

Thank you

Robert
Two more possibilities for your consideration. Not necessarily better than what you have in mind, but in case you hit a roadblock:
1. Transform all those i2s sources to spdif and then use a spdif switch
2. Do the sample rate conversion outboard: as you already plan to use a i2s switch, you can add a rate conversion board and have a constant rate input to your raspberry pi
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
514
Likes
338
But i want to switch between different I2S Streems into RPI5 and CDSP, like i wrote before, to have HDMI input, SPDIF, ASEbu and so on, so at this moment i guess i need this camilladsp-setrate.
Slave I2S has no information about the current incoming samplerate. You need to know it somehow in advance and open the slave I2S capture device at that rate.

Theoretically CDSP could open the I2S device always at some fixed rate (the rate setup has no effect on I2S slave device), measure the incoming rate, and set the async resampler accordingly. But looking at the CDSP source I do not think the current CDSP does this. Also it takes some time to detect the sample rate change in CDSP so the switch would need some rather long muting period to avoid loud issues until the resampler gets tuned to the new samplerate.
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Slave I2S has no information about the current incoming samplerate. You need to know it somehow in advance and open the slave I2S capture device at that rate.

Theoretically CDSP could open the I2S device always at some fixed rate (the rate setup has no effect on I2S slave device), measure the incoming rate, and set the async resampler accordingly. But looking at the CDSP source I do not think the current CDSP does this. Also it takes some time to detect the sample rate change in CDSP so the switch would need some rather long muting period to avoid loud issues until the resampler gets tuned to the new samplerate.
so the CDSP-Setrate would not work on I2S Slave and i better looking for an SRC 8 Channel Solution right?
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Two more possibilities for your consideration. Not necessarily better than what you have in mind, but in case you hit a roadblock:
1. Transform all those i2s sources to spdif and then use a spdif switch
2. Do the sample rate conversion outboard: as you already plan to use a i2s switch, you can add a rate conversion board and have a constant rate input to your raspberry pi
I am looking already for an SRC Board but not easy to find one for 4 I2S Channels.

All i can find on DIY Market are stereo on's but they are cheep may be i can Syncronise 4 of them Multiply the Clock Lines out of the I2S to all 4 SRC Borads and use on each one I2S Stereo Datastream.

I am not sure if that works but may be the cheepest methode.
One Board cost around 15,77€

One Problem is to get the 4 SRC Chips in Master and slave Mode that they works Syncrone, with only one Crystal i guess.
The next Problem is CDSP Capabel to work with 211kHz on I2S input or the PI? I am need to look for the Datasheet.

Bought 4 of them on Amazon they already fixed to 96kHz out thats what i need ;)
https://www.amazon.de/-/en/dp/B0C3YTRXHL?psc=1&smid=A14J53JFJ69BIL&ref_=chk_typ_imgToDp

Or i build my own SRC PCB with this Chip and only one XO for all 4 chips on one Board, looks not that Complicated and dont need much other Chips on the PCB right?

I read the Datasheet off that CS8421, i can remove the XO Cristal on all 4 boards and put them in Slave state so they use the Cock vom Source on MCLK.
Now i need to find out if all sources provide an MCLK ;)

"MCLK can be supplied from a digital clock source, a crystal oscillator, or a fundamental mode crystal"

Now the "Bright Side of Life" can start when they arrive :) hope i get them syncrone!

Robert
 

Attachments

  • DIY 8 Channel SRC.jpg
    DIY 8 Channel SRC.jpg
    199.6 KB · Views: 29
Last edited:
  • Like
Reactions: MCH

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
514
Likes
338
so the CDSP-Setrate would not work on I2S Slave
Correct. CDSP-Setrate uses USB gadget as its input alsa device. The gadget alsa device offers a read-only Capture/Playback rate control which the CDSP-Setrate reads prior to opening the respective alsa device, to know at what rate to open it https://github.com/marcoevang/camil...87d80f93edc1dd11360a8e/setrate_alsa.c#L53-L80
and i better looking for an SRC 8 Channel Solution right?
That would be what e.g. AVRs typically use - integrated ASRCs on all inputs to allow single clock for their DSP and outputs.

Standard input circuits have the information about current samplerate (most SPDIF receivers measure the incoming signal against some fixed clock and store the result in their registers, HDMI chips read the samplerate info placed into the HDMI stream, USB receivers get the required rate from the USB hosts, etc.) It's just not transmitted over I2S and the information must be read from each chip individually, through some side channel.
 

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,699
Likes
2,336
I am looking already for an SRC Board but not easy to find one for 4 I2S Channels.

All i can find on DIY Market are stereo on's but they are cheep may be i can Syncronise 4 of them Multiply the Clock Lines out of the I2S to all 4 SRC Borads and use on each one I2S Stereo Datastream.

I am not sure if that works but may be the cheepest methode.
One Board cost around 15,77€

One Problem is to get the 4 SRC Chips in Master and slave Mode that they works Syncrone, with only one Crystal i guess.
The next Problem is CDSP Capabel to work with 211kHz on I2S input or the PI? I am need to look for the Datasheet.

Bought 4 of them on Amazon they already fixed to 96kHz out thats what i need ;)
https://www.amazon.de/-/en/dp/B0C3YTRXHL?psc=1&smid=A14J53JFJ69BIL&ref_=chk_typ_imgToDp

Or i build my own SRC PCB with this Chip and only one XO for all 4 chips on one Board, looks not that Complicated and dont need much other Chips on the PCB right?

I read the Datasheet off that CS8421, i can remove the XO Cristal on all 4 boards and put them in Slave state so they use the Cock vom Source on MCLK.
Now i need to find out if all sources provide an MCLK ;)

"MCLK can be supplied from a digital clock source, a crystal oscillator, or a fundamental mode crystal"

Now the "Bright Side of Life" can start when they arrive :) hope i get them syncrone!

Robert
Yes, some of these SRC chips can be daisy chained. If I were you I would think on building a single board with everything you need pre-rpi. Things can start getting convoluted very fast.
 

gordoste

Member
Joined
Nov 19, 2023
Messages
34
Likes
32
Have you looked at the MiniDSP Flex series? They will let you do all of this correction/filtering on a well-tested and stable platform. Of course, you are welcome to try the DIY route.
 

gordoste

Member
Joined
Nov 19, 2023
Messages
34
Likes
32
@phofman - I thought he could run the Rpi5 with CDSP+cdsp_setrate in gadget mode and connect it via USB to the RPi4 which is the source. Is that not feasible?
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Have you looked at the MiniDSP Flex series? They will let you do all of this correction/filtering on a well-tested and stable platform. Of course, you are welcome to try the DIY route.
Hello,
yes this was my first look to the Flex HTx i ordered already one but i realised thats an realy expensive not realy satisfied road to go so i canceled the Order ;)!!!! They dont alowed to use 96kHz and only 2000-4000 Taps per Channel (not enough for Crossover around 100Hz, for subwoofers) no Input PEQ also you need to pay extra 300€ per device for Dirac :( so no thats to expensive and not powerfull / flexible enough for my Project. 7.2 full aktiv System.

I use 16000taps per channel already and the artifakts at 110Hz with 96dB Crossofer are lower than 100dB thats what i want to have ;)
On RPI5 thats 8% Processingpower for 2x 3Way so at the end i have 5-7 2Way and 2 Subs i gues thats the right way to go for that.

May be an good soulution if you have 7.2 Passiv Speaker.

You need 2 of them to have 16 Channel ouput capabillity thats over 2400€ only for that!

An MOTU Ao24 cost only 1200€ and you got 24 Channels Symetric Outs

Forget to say you also need 2 of the Arcana Adapter thats also extracost around 500€

For my HDMI Board i dont need Arcana its works out of the Box ;)

And one Question would be still there how much differens in Timming between the two Flex you got on this way, they not synconised right?

Robert
 

Attachments

  • Flex HT Settup.jpg
    Flex HT Settup.jpg
    123 KB · Views: 23
Last edited:

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
Yes, some of these SRC chips can be daisy chained. If I were you I would think on building a single board with everything you need pre-rpi. Things can start getting convoluted very fast.
Yes i try first this 4 Boards i ordered to playing around with them and
if i build up my Amps and Speakers (till there i can switch the Samplingfreqeunzes Manualy) I will Start to Prototype an Hat with 4 I2S Inputs the Latches to switch between and the SRC's on that Hat for the first start. That would be cool to have.

But the last PCB i dit with Eagle is 8 Years ago i guess, so this will be grow slowly :( (But i have all Hardware i need to Prototype one, Signalanalyzer, Oscilloscope and so on )
May be with an little Arduino to Controll all, or thrue the Gpio of that PI but like i am told already i am not an Linux expert.

But first i want to listen my 5.2 Setup running ;)

Then I need first to read and test what i can do with The Gpios of an RPI never used this bevor :(

BTW I am retiered and Sick so i cant work 8 Hour a day but my Brain need something to do or i get Crazy at home Sitting around the whole day.

My Front setup already Done only need the Amp's to build now ;)

Robert
 

Attachments

  • Front Setup.jpg
    Front Setup.jpg
    584.9 KB · Views: 24
Last edited:

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
@phofman - I thought he could run the Rpi5 with CDSP+cdsp_setrate in gadget mode and connect it via USB to the RPi4 which is the source. Is that not feasible?
No i need to swith between the HDMI to I2s Board and the ASE / EBU Spdif input Board and so on so the RPI4 isn't the only Source i want to use, thats would be to easy ;)
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
@phofman - I thought he could run the Rpi5 with CDSP+cdsp_setrate in gadget mode and connect it via USB to the RPi4 which is the source. Is that not feasible?
Mevang from DIYAudio told me i need to test Setrate he was not sure if this works or not but the Input device need to be an Alsa controled Device may be if i use Plugw:CARD=GenericStereoAu,DEV=0 instead of hw:CARD=GenericStereoAu,DEV=0 for Capturedevice? But iam not an expert i could try it an see what happen, cost me only some time thtas all.
 

renne

Member
Joined
Feb 29, 2024
Messages
27
Likes
1
Yes i try first this 4 Boards i ordered to playing around with them and
if i build up my Amps and Speakers (till there i can switch the Samplingfreqeunzes Manualy) I will Start to Prototype an Hat with 4 I2S Inputs the Latches to switch between and the SRC's on that Hat for the first start. That would be cool to have.

But the last PCB i dit with Eagle is 8 Years ago i guess, so this will be grow slowly :( (But i have all Hardware i need to Prototype one, Signalanalyzer, Oscilloscope and so on )
May be with an little Arduino to Controll all, or thrue the Gpio of that PI but like i am told already i am not an Linux expert.

But first i want to listen my 5.2 Setup running ;)

Then I need first to read and test what i can do with The Gpios of an RPI never used this bevor :(

BTW I am retiered and Sick so i cant work 8 Hour a day but my Brain need something to do or i get Crazy at home Sitting around the whole day.

My Front setup already Done only need the Amp's to build now ;)

Robert
I like the idea of 4 I²S inputs as I want to use a KaamosTech ADC AK5572 for the measurement microphone and a turntable. Because of that the ASRC-PCB should have a bypass option. The interesting question here is if the 32-bit resolution of the ADC allows to omit pre-amps (KaamosTech uses U.FL coaxial cables for I²S).
It would also be great to be able to configure the ASRC settings and the latches with simple mechanical switches + LEDs for status.
As far as I understand the CS8421 ASRC is configured via resistors.
So I suggest to use inputs and outputs of the ASRC boards in I²S-slave mode by default and use 3 external switches
1.) Set output of the first CS8421 to I²S master or slave mode
2.) Set input of the first CS8421 to I²S master or slave mode
3.) Enable bypass mode
As output sampling rate I suggest 32-bit@96kHz because 32-bit provides enough resolution for a digital volume control with dumb 32-bit DACs. 48 kHz sampling rate causes ADC-artifacts because the high frequencies are not attenuated enough by the low-pass filters. I see no benefit in sampling rates above 96kHz. ;-)
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
514
Likes
338
IMO Mevang ment that his project would work if the I2S alsa devices were to "provide the required information" which is some alsa ctl element with current samplerate. That is not the case for the I2S driver device, unfortunately. The slaved I2S interface has no way of learning the current incoming samplerate.
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
IMO Mevang ment that his project would work if the I2S alsa devices were to "provide the required information" which is some alsa ctl element with current samplerate. That is not the case for the I2S driver device, unfortunately. The slaved I2S interface has no way of learning the current incoming samplerate.
Ok the way to go is ARSC and Point ;) I like to made an own Board but i read already this CS ARSC Chip is also EOL :( so you get them only this year and then they gone what i read on the CS Site.
 

Frunse

Active Member
Joined
Feb 21, 2024
Messages
133
Likes
20
I like the idea of 4 I²S inputs as I want to use a KaamosTech ADC AK5572 for the measurement microphone and a turntable. Because of that the ASRC-PCB should have a bypass option. The interesting question here is if the 32-bit resolution of the ADC allows to omit pre-amps (KaamosTech uses U.FL coaxial cables for I²S).
It would also be great to be able to configure the ASRC settings and the latches with simple mechanical switches + LEDs for status.
As far as I understand the CS8421 ASRC is configured via resistors.
So I suggest to use inputs and outputs of the ASRC boards in I²S-slave mode by default and use 3 external switches
1.) Set output of the first CS8421 to I²S master or slave mode
2.) Set input of the first CS8421 to I²S master or slave mode
3.) Enable bypass mode
As output sampling rate I suggest 32-bit@96kHz because 32-bit provides enough resolution for a digital volume control with dumb 32-bit DACs. 48 kHz sampling rate causes ADC-artifacts because the high frequencies are not attenuated enough by the low-pass filters. I see no benefit in sampling rates above 96kHz. ;-)
Yes if i build one i realy want to have the possebility to Configure it by switches. But i need to research on the right ARSC Chip because this is also EOL already :(
Make no sense to prototype an Board for an EOL Chip ;)

The ADC is interesting but i have AN Motu UL so i have 8 Analoge Inputs for now but if i switch it to an Motu Ao24 that becomes handy ;)

You wnt it to use with REW on Linux?
I got much trouble to use REW on the same RPI with Camilla, it works some hour but after i switched the setups on Camilla back and forward i got the wrong Timebase or so all mesurements got wrong Instead off between 100 and 2000Hz they went to 1000 to 20000Hz for the Middriver and all i was tried i cant get it runn right again, That made me realy confused so i went again to Windows PC and REW thats worked stable the whole rest of the day with no problems at all thrue the HDMI Input Board ;)

But i have still one I2S Input free on my Plan so who knows ;)

I am also not an Fan of 192 kHz its need much more Horspower to Filter on Crossower and i am not an Bat so 48Khz Analogue Bandwith is much more than needet i guess ;)

Robert
 
Last edited:

renne

Member
Joined
Feb 29, 2024
Messages
27
Likes
1
Yes if i build one i realy want to have the possebility to Configure it by switches. But i need to research on the right ARSC Chip because this is also EOL already :(
Make no sense to prototype an Board for an EOL Chip ;)
The ADC is interesting but i have AN Motu UL so i have 8 Analoge Inputs for now but if i switch it to an Motu Ao24 that becomes handy ;)

You wnt it to use with REW on Linux?
I got much trouble to use REW on the same RPI with Camilla, it works some hour but after i switched the setups on Camilla back and forward i got the wrong Timebase or so all mesurements got wrong Instead off between 100 and 2000Hz they went to 1000 to 20000Hz for the Middriver and all i was tried i cant get it runn right again, That made me realy confused so i went again to Windows PC and REW thats worked stable the whole rest of the day with no problems at all thrue the HDMI Input Board ;)

But i have still one I2S Input free on my Plan so who knows ;)

I am also not an Fan of 192 kHz its need much more Horspower to Filter on Crossower and i am not an Bat so 48Khz Analogue Bandwith is much more than needet i guess ;)

Robert
Yeah, the EOL is annoying. Especially with the simple resistor configuration capability.
CS8421 and AK4137EQ were the only 32-bit capable ASRCs I could find. Everything else seems to be 24-bit.

My idea was to route the I²S input of the RPi5 with the KaamosTech ADC AK5572 via the USB gadget driver to the PC and back to the I²S output of the RPi5 with the DACs.
That way the RPi5 works as a USB audio-interface and no GUI is needed on the RPI5. REW can run on the PC.

I'm no bat either. ;-)
My reason for 96khz-ADCs are the distortions by frequencies above 24kHz which are not fully suppressed by the physically non-flat low-pass filters in the input stage.
ADCs don't like analogue input frequencies above the sampling rates. 48kHz is fine after the ADC. ;-)
 
Top Bottom