CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.

May be it have been already told but it's now possible to have not the same device between stdin and sdtout?

Like, in a Raspberry, enter thanks to GPIO (I²S IN) then out on a USB DAC ?

Thanks
Yes you can use different devices for in and out. Spdif in on a hat and then out on a USB dac for example. But what do you mean with stdin/stdout?
If you use two independent devices you probably want to enable the asynchronous resampler to keep them from drifting apart.
 
Allright, my "hack" is working eventhrough the start parameters on squeezelite has to be tweaked for it to do "clicks and pops" as little as possible when samplerate is switching :)

I was looking in the sourcecode for squeezelite and it tells me i can do whatever i like so i put my work here for someone else to try it, and perhaps modify it to be right! (My hack is not coded the right way, but it's just working for me :eek:)

Code:
 *  Squeezelite - lightweight headless squeezebox emulator
 *
 *  (c) Adrian Smith 2012-2015, [email]triode1@btinternet.com[/email]
 *      Ralph Irving 2015-2017, [email]ralph_irving@hotmail.com[/email]
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
 *   -Control of Raspberry pi GPIO for amplifier power
 *   -Launch script on power status change from LMS

The version i was compiling is Squeezelite v1.9.7-1218
I changed some in output_alsa.c, and set the Makefile.rpi so that it would compile proberly.

Code:
	/*
	*	CamillaDSP engine integration START
	*/

	LOG_INFO("Player detected sample rate change ! %u", sample_rate);

	UNLOCK;

	if(sample_rate == 44100) system("python3 /home/tc/DSP_Engine/filters/exec_44100.py");
        if(sample_rate == 96000) system("python3 /home/tc/DSP_Engine/filters/exec_96000.py");
	if(sample_rate == 48000) system("python3 /home/tc/DSP_Engine/filters/exec_48000.py");
	if(sample_rate == 88200) system("python3 /home/tc/DSP_Engine/filters/exec_88200.py");
	if(sample_rate == 176400) system("python3 /home/tc/DSP_Engine/filters/exec_176400.py");
	if(sample_rate == 192000) system("python3 /home/tc/DSP_Engine/filters/exec_192000.py");
	if(sample_rate == 352800) system("python3 /home/tc/DSP_Engine/filters/exec_352800.py");
	if(sample_rate == 384000) system("python3 /home/tc/DSP_Engine/filters/exec_384000.py");


	LOG_INFO("Sample rate filter changed ! %u", sample_rate);

	/*
	*	CamillaDSP engine integration STOP
	*/

And close to the end i also changed the "dual" opening of alsa, i just put in an "!" in the code.
Code:
			// FIXME - some alsa hardware requires opening twice for a new sample rate to work
			// this is a workaround which should be removed
			if (!alsa.reopen) {
#if DSD
				alsa_open(output.device, output.current_sample_rate, output.buffer, output.period, output.outfmt);
#else
				alsa_open(output.device, output.current_sample_rate, output.buffer, output.period);
#endif
			}

The OS distribution i use is piCoreplayer on my RPI4, and python 3 has to be installed for it to work. The piCoreplayer is based on TinyCore Linux, which load everything in RAM at boot; so plugging the wallswitch when it's running don't harm anything because the SD card is not used after booting is done!!!.

I attached the files here i use, including the compiled squeezelite which runs on RPI4.

I will make a post at the slimserver forum, where squeezelite/piCoreplayer lives and link to this post.
LINK is here :: Digital signal processing is possible with piCoreplayer & squeezelite

Please feel free to delete/remove or burn whatever this post :)

Jesper.

Thanks for this Jesper. I am interested in giving Camilla a try on a RPI4. I have been using ConvoFS for a while running on my NAS for DRC. It works great but it doesn't support streaming. Like you I run LMS on the NAS. I am also currently using a RPI4 running PiCoreplayer but only using the Squeezelite portion of it to my USB DAC.

I have read many of your posts but what is the final flow of your system? Is it remote LMS > PiCoreplayer+Camilla > DAC? Does you custom Squeezelite replace the Squeezelite PiCoreplayer installs? Camilla can be installed and configured by SSH into the RPI4?
 
I have read many of your posts but what is the final flow of your system? Is it remote LMS > PiCoreplayer+Camilla > DAC? Does you custom Squeezelite replace the Squeezelite PiCoreplayer installs? Camilla can be installed and configured by SSH into the RPI4?

Hi.

Yes the flow is like this.
I compiled the CamillaDSP on another RPI4 with the Raspbian distro installed on it, mostly because i don't want to have all the compilestuff installed on my player rpi :p
And yes everything can be installed and configured by SSH.

If you need to have Camilla / Squeezelite switching samplerate on the fly like i do you also need some other stuff installed onto the piCoreplayer (websocket, python3 etc... etc...)
Let me know if you need this.


EDIT : Henrik have precompiled CamillaDSP for us here Release v0.3.1-alpha: Merge pull request #55 from HEnquist/cpaladjust * HEnquist/camilladsp * GitHub

Jesper.
 
Last edited:
Hi.

Yes the flow is like this.
I compiled the CamillaDSP on another RPI4 with the Raspbian distro installed on it, mostly because i don't want to have all the compilestuff installed on my player rpi :p
And yes everything can be installed and configured by SSH.

If you need to have Camilla / Squeezelite switching samplerate on the fly like i do you also need some other stuff installed onto the piCoreplayer (websocket, python3 etc... etc...)
Let me know if you need this.


EDIT : Henrik have precompiled CamillaDSP for us here Release v0.3.1-alpha: Merge pull request #55 from HEnquist/cpaladjust * HEnquist/camilladsp * GitHub

Jesper.

Thanks jesper! So is that pre complied version for rpi4? As an alternative to sample rate switching could all input content be upscaled to 192k?
 
wineds.

The ArmV7 version should be the version for the RPI(4).
I am writing as i wrote before a simple howto to setup CamillaDSP with piCorePlayer, without samplerate switching as this is more complicated thrust me ;)

Regarding the resampling to 192k is a great idea, and you can do it directly with CamillaDSP i'am sure (didn't try it through as mine CamillaDSP compiled version is one of the first one's Henrik released without these options)

Jesper.
 
Hello.

I have tried to write this simple howto, but it's not so easy :)
Anyway i think it's usefull for people which would like to try camilladsp on an RaspberryPi.

The file is in .docx but i renamed it to .docx.txt to upload it here, please rename to only contain .docx.

The startupscript CamillaDSP.sh i have provided among some other files in the .zip file here compressed
i changed this startup script, and i could not test it, but i think it should work.

Good luck :D

Jesper.
 

Attachments

  • HOWTO_PART_1.docx.txt
    55.4 KB · Views: 87
Hello.

I have tried to write this simple howto, but it's not so easy :)
Anyway i think it's usefull for people which would like to try camilladsp on an RaspberryPi.

The file is in .docx but i renamed it to .docx.txt to upload it here, please rename to only contain .docx.

The startupscript CamillaDSP.sh i have provided among some other files in the .zip file here compressed
i changed this startup script, and i could not test it, but i think it should work.

Good luck :D

Jesper.

I am trying this out. I think CamillaDSP.sh permissions needs to be changed to executable? Also after transferring files with WinSCP they don't stick after reboot unless I use sudo filetool.sh -b. So far I think I can get Camilla to start but I cannot see squeeze as an output option in the pcp web interface. I guess I didn't do nano /etc/asound.conf right?
 
Edit :

I changed asound.conf to this and now I can pcp will accept squeeze manually entered as output. But there doesn't seem to be any output to my USB DAC.

# Loopback device 0
pcm.squeeze {
type hw
card "Loopback"
device 0
format S32_LE
channels 2
}

# Loopback device 1
pcm.camilla_in {
type hw
card "Loopback"
device 1
format S32_LE
channels 2
}

# "sound_out" is the "real" hardware card (usbdac, soundcard etc...)
pcm.sound_out {
type hw
card 0
device 0
}

ctl.sound_out {
type hw
card 0
}
 
Very good! It would be great to publish this somewhere a bit more visible than hidden in an attachment on page 53 :)
The question is where it should go. I started making a nicer looking version of the readme here CamillaDSP
Should I include it there maybe?

Hi Henrik.

I'am opensource, so everyone can do whatever they like with my writings :D
I'll be honored if we could include some RPI instructions on the github, but we need to confirm things are working and already now i see that the portion about asound.conf isen't good enough. Also i forgot to write that the downloaded files (which also should be on github) have to be "chmod +x"'ed to be executable. -Also the importance of "sudo filetool.sh -b" have to be explained better.

So yes... files are your's and everybody elses :)

Jesper.
 
I am trying this out. I think CamillaDSP.sh permissions needs to be changed to executable? Also after transferring files with WinSCP they don't stick after reboot unless I use sudo filetool.sh -b. So far I think I can get Camilla to start but I cannot see squeeze as an output option in the pcp web interface. I guess I didn't do nano /etc/asound.conf right?

Hi wineds...

I forgot to write that one need's to do chmod +x on files downloaded, as they loose thoose bit's when transferred.
sudo filetool.sh -b do write the files you create or download into a compressed package, which get unpacket during reboot, but this is complicated and importance is just do it everytime you change stuff before shutting down or reboot or whatever.

Jesper.
 
Edit :

I changed asound.conf to this and now I can pcp will accept squeeze manually entered as output. But there doesn't seem to be any output to my USB DAC.

# Loopback device 0
pcm.squeeze {
type hw
card "Loopback"
device 0
format S32_LE
channels 2
}

# Loopback device 1
pcm.camilla_in {
type hw
card "Loopback"
device 1
format S32_LE
channels 2
}

# "sound_out" is the "real" hardware card (usbdac, soundcard etc...)
pcm.sound_out {
type hw
card 0
device 0
}

ctl.sound_out {
type hw
card 0
}

Good catch :)

You are supposed to enter squeeze manuelly on the output setting.
(If you write sound_out you just "bypass" camilladsp) but nevermind that now.

The asound.conf have to match the output (hardware) from the command aplay -l
Could you paste that output here perhaps?
Also you have to be sure that camilladsp is running.
Try to execute the command ps aux, when both squeezelite and camilladsp have been started. You should see lines telling you that camilladsp is running and that squeezelite is running to.

Jesper.