Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

CamillaDSP - a flexible linux IIR and FIR engine for crossovers, room correction etc.
CamillaDSP - a flexible linux IIR and FIR engine for crossovers, room correction etc.
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 Search this Thread
Old 22nd May 2020, 01:19 PM   #421
jiiteepee is offline jiiteepee  Finland
diyAudio Member
 
Join Date: Mar 2007
Quote:
Originally Posted by TNT View Post
Multiplying biquad sets for different Fs seem to be a tedious work. Is there any chance of automation once say a set is done for 44,1? Maybe it's not possible within Camilla?

//
Code:
//Convert biquad coefficients for 44.1kHz to selected fs using BLT (won't work for tweaked 
//ones):

// z-plane to s-plane
d0 = b0 + b1 + b2;
d1 = 2.0 * (b0 - b2);
d2 = b0 - b1 + b2;
c0 = 1.0 + a1 + a2;
c1 = 2.0 * (1.0 - a2);
c2 = 1.0 - a1 + a2;

r = fs/44100; // scaling 

// s-plane to z-plane (BLT)
invc = 1.0/(c0 + r * (c1 + r * c2));
b0 = (d0 + r * (d1 + r * d2)) * invc;
b1 = 2.0 * (d0 - r^2 * d2) * invc;
b2 = (d0 - r*(d1 - r * d2)) * invc;
a1 = 2.0 * (c0 - r^2 * c2) * invc;
a2 = (c0 - r * (c1 - r * c2)) * invc;

Last edited by jiiteepee; 22nd May 2020 at 01:22 PM. Reason: fixed typo in code
  Reply With Quote
Old 22nd May 2020, 07:30 PM   #422
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by TNT View Post
Multiplying biquad sets for different Fs seem to be a tedious work. Is there any chance of automation once say a set is done for 44,1? Maybe it's not possible within Camilla?

//
If you can use the built in filter types, then the coefficient are calculated automatically for the active sample rate. If you can't, then is there maybe a filter type I'm missing? I't pretty simple to add more, as long as there are some equations to get the biquad coeffs.
  Reply With Quote
Old 22nd May 2020, 07:34 PM   #423
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by fluid View Post

Henrik, when you said before you can add as many filters as you like does that mean you can add one convolver filter after another or chained with PEQ or biquads inbetween?

I think this is what Jesper wants to do, run two convolution filters chained together one after the other
This is possible! You can add any filters you want, in any order you want.

So yes you could have a pipeline consisting of a FIR prefilter, then some BiQuads, followed by another FIR, and at the end some final tweaking with more BiQuads.

You can also mix filtering and mixer steps freely.
  Reply With Quote
Old 22nd May 2020, 07:35 PM   #424
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by hochopeper View Post
I've been daydreaming about a web user interface for camillaDSP- I haven't had time to start writing anything yet though but it's good to understand different use-cases to see how they are (or aren't) catered for in a user interface.
Sounds nice! Looking forward to reading more about this
  Reply With Quote
Old 22nd May 2020, 08:01 PM   #425
lykkedk is offline lykkedk  Denmark
diyAudio Member
 
lykkedk's Avatar
 
Join Date: Dec 2002
Location: Denmark, Fredericia
Quote:
Originally Posted by HenrikEnquist View Post
This is possible! You can add any filters you want, in any order you want.

So yes you could have a pipeline consisting of a FIR prefilter, then some BiQuads, followed by another FIR, and at the end some final tweaking with more BiQuads.

You can also mix filtering and mixer steps freely.
... Henrik it's perfect...

I will try this out very soon; i didn't think it was possible to have more than one pair of fir's (i don't know why i was thinking that ?), that's the reason i was using BiQuads as prefilter, but it's more easy for me to make fir's for that!

fluid is along with others a very big help for me in my learning progress about DSP, everyone is so helpfull at these forum's, thanks all

Ohh something Henrik, i was told that a lot of convolvers do have some "normalize" function, is it something worth consider as a future option perhaps?

I did come a very long way now. I now have a functional streamer/player, which is capable of switching .yml filters (switching samplerates from 44100 to 192000) on the fly through the websocket and my hacked squeezelite player.

Jesper.
__________________
DCG3 Dual DCSTB, AK4490 Dual SuperDAC
AlephJ Mimi! http://www.diyaudio.com/forums/pass-...mimi-mini.html
  Reply With Quote
Old 22nd May 2020, 10:04 PM   #426
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by lykkedk View Post

Ohh something Henrik, i was told that a lot of convolvers do have some "normalize" function, is it something worth consider as a future option perhaps?

I did come a very long way now. I now have a functional streamer/player, which is capable of switching .yml filters (switching samplerates from 44100 to 192000) on the fly through the websocket and my hacked squeezelite player.

Jesper.
I think that (and please correct me if I'm wrong) normalization is used for reverb filters and such, when you don't want the loudness to change when you enable/disable a filter. I don't think this is very useful here, feels like there is a very big risk of causing lots of clipping. But sure, if someone brings a good argument to include it I'll consider it

Really neat that you got the rate switching working. Bra jobbat / godt arbejde!! I think this could be interesting for many people.
Did you get any feeling for if your changes to squeezelite have any chance of becoming standard features?
  Reply With Quote
Old 22nd May 2020, 10:23 PM   #427
fluid is offline fluid  Australia
diyAudio Member
 
Join Date: Jan 2009
Jriver has it in it's convolution engine and it allows to not be concerned over the level of the impulse filter being too low or too high, so it actually prevents clipping in their implementation.

Jrivers use is targeted at speaker tuning not reverb. I find it very useful

CamillaDSP - a flexible linux IIR and FIR engine for crossovers, room correction etc.-jriver-conv-jpg
Attached Images
File Type: jpg Jriver Conv.jpg (48.6 KB, 184 views)
  Reply With Quote
Old 23rd May 2020, 04:30 AM   #428
lykkedk is offline lykkedk  Denmark
diyAudio Member
 
lykkedk's Avatar
 
Join Date: Dec 2002
Location: Denmark, Fredericia
Default WARNING off topic, sry.

Quote:
Really neat that you got the rate switching working. Bra jobbat / godt arbejde!! I think this could be interesting for many people.
Did you get any feeling for if your changes to squeezelite have any chance of becoming standard features?
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 )

Code:
 *  Squeezelite - lightweight headless squeezebox emulator
 *
 *  (c) Adrian Smith 2012-2015, triode1@btinternet.com
 *      Ralph Irving 2015-2017, ralph_irving@hotmail.com
 *
 * 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.
Attached Files
File Type: zip Hacked_squeezelite.zip (74.3 KB, 1 views)
__________________
DCG3 Dual DCSTB, AK4490 Dual SuperDAC
AlephJ Mimi! http://www.diyaudio.com/forums/pass-...mimi-mini.html

Last edited by lykkedk; 23rd May 2020 at 04:48 AM. Reason: Linking to slimserver forum!
  Reply With Quote
Old 23rd May 2020, 04:55 AM   #429
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Jesper, please would you consider forking the squeezelite repo on github GitHub - ralph-irving/squeezelite: Lightweight headless squeezebox player for Logitech Media Server and pushing your patch? That way everyone could use it easily and see the changes. Thanks for considering.
  Reply With Quote
Old 23rd May 2020, 05:03 AM   #430
lykkedk is offline lykkedk  Denmark
diyAudio Member
 
lykkedk's Avatar
 
Join Date: Dec 2002
Location: Denmark, Fredericia
Quote:
Originally Posted by phofman View Post
Jesper, please would you consider forking the squeezelite repo on github GitHub - ralph-irving/squeezelite: Lightweight headless squeezebox player for Logitech Media Server and pushing your patch? That way everyone could use it easily and see the changes. Thanks for considering.
Thanks Phofman, i know but my code is not right at all for this. -Therefore i linked my post here to slimserver forum where a lot of coders live; hoping that someone there would do it the right way; sry.. i'am not capable of coding it the right way.

Hope you understand.

Jesper.
__________________
DCG3 Dual DCSTB, AK4490 Dual SuperDAC
AlephJ Mimi! http://www.diyaudio.com/forums/pass-...mimi-mini.html
  Reply With Quote

Reply


CamillaDSP - a flexible linux IIR and FIR engine for crossovers, room correction etc.Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
The room correction or speaker correction? What can we do with dsp power now availabl Raimonds Full Range 233 28th January 2017 07:51 AM
Introducing OpenDRC, Open Digital Room Correction engine minidsp miniDSP 20 20th January 2016 05:37 PM
What the difference between dsp room correction eq and software correction erez1012 PC Based 0 10th March 2014 07:07 PM
AirPlay + room correction on Linux choongng PC Based 12 30th November 2012 02:50 PM
FS: DAC, room-correction, active crossovers, amp, speakers! taloyd Swap Meet 4 14th April 2009 03:16 PM


New To Site? Need Help?

All times are GMT. The time now is 05:29 AM.


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