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

LADSPA plugin programming for Linux audio crossovers
LADSPA plugin programming for Linux audio crossovers
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 14th May 2015, 04:35 AM   #1
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Default LADSPA plugin programming for Linux audio crossovers

I've recently become interested in trying to put together a Linux based computer for processing audio into different streams - a PC crossover.

This is a new direction for me, moving away from the DSP hardware solutions that I have been using for the last few years, but I have some experience in C/C++ programming and have found a few examples on the web of what is possible and these are very encouraging. I have an idea for a new way to PC based loudspeaker crossovers using my Active Crossover Designer tools (ACD).

I have discovered the LADSPA plugins that will, for instance, execute one of a number of filter blocks on a stream of digital data, for example a second order Butterworth highpass filter. This is way too specific of a filter implementation. I have been working with IIR DSP for awhile now and I'm quite familiar with IIR biquad coefficients. My crossover software, ACD, calculates the IIR biquad coefficients from more familiar filter descriptors and makes them available to the user. What I am looking to create is a new plugin that takes the biquad coefficients as input directly. The code for the plugins that I have looked just calculates the coefficients from other parameters, like the type of filter (second order high pass Butterworth) and one or more parameters (filter corner frequency and gain). My "generalized biquad" plugin would simply take the five (normalized form) coefficients as parameters and then would use them directly. These are the same five parameters that miniDSP uses, with a few sign changes, so miniDSP biquads could be imported as well.

Once this new plugin has been created, the doors are open to implementing a complete crossover in Linux using an approach like what is done here:
Digital Crossover/EQ with Open-Source Software: HOWTO | Richard's Stuff
Richard Taylor's efforts have paved the way, but his plugin set is very limited. Using the same approach, but with a generalized-biquad plugin that can implement any first or second order filter, would make Linux audio better suited for loudspeaker crossovers.

I'd like to chat privately with someone who has worked with LADSPA before, as well as ecasound, about some practical aspects of my approach. If that's you, please drop me a line.

Otherwise, I will try to post my progress here from time to time. I'd love to hear people's thoughts on all of this as well.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 14th May 2015 at 04:52 AM.
  Reply With Quote
Old 15th May 2015, 08:12 PM   #2
cogitech is offline cogitech  Canada
diyAudio Member
 
cogitech's Avatar
 
Join Date: Jan 2011
Location: Kamloops, BC
Sounds like a very worthwhile project.

Some things that I would focus on (if I had the skills to attempt such a project):

- Efficiency - If it can run on an RPi, it will be a big hit.

- Documentation - Not everyone is a genius; unless it is really dead simple to install and use, the documentation will be critical to its success.

- Interface - Not everyone can work with or understand biquads. The option of using a GUI at least similar to that of miniDSP would be a huge bonus.

- Multi-device output - The ability of the plugin to be configured to use 2 or more USB DACs as output devices would be absolutely freakin' awesome.

If attention is payed to these factors, I'd be very likely to willingly pay a decent sum of money for such a plugin. I suspect *many* others would feel the same way.

Last edited by cogitech; 15th May 2015 at 08:15 PM.
  Reply With Quote
Old 15th May 2015, 08:43 PM   #3
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Multi-device output - either the interfaces run synchronously, then you can easily use alsa pcm_multi plugin for creating virtual multichannel device. Or the interfaces are asynchronous (separate clocks) and you have to apply adaptive resampling http://lac.linuxaudio.org/2012/downl...ing-slides.pdf just like e.g. pulseaudio or jack plugins do.

GUI support - some people like coding the GUI, some people prefer digging deep into the actual internal functionality. IME the two groups are mostly exclusive. Writing a great CLI/library tool with someone else coding the GUI calling the CLI/library functions is a way to go.
  Reply With Quote
Old 16th May 2015, 07:39 PM   #4
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Quote:
Originally Posted by cogitech View Post
Sounds like a very worthwhile project.

Some things that I would focus on (if I had the skills to attempt such a project):

- Efficiency - If it can run on an RPi, it will be a big hit.

- Documentation - Not everyone is a genius; unless it is really dead simple to install and use, the documentation will be critical to its success.

- Interface - Not everyone can work with or understand biquads. The option of using a GUI at least similar to that of miniDSP would be a huge bonus.

- Multi-device output - The ability of the plugin to be configured to use 2 or more USB DACs as output devices would be absolutely freakin' awesome.

If attention is payed to these factors, I'd be very likely to willingly pay a decent sum of money for such a plugin. I suspect *many* others would feel the same way.
From what I have read about similar efforts you can implement a crossover on a Raspberry Pi. That is where I plan to experiment, initially at least. With the new Pi 2 out, there should be a little more computing power on tap.

As far as a simple and easy to use GUI - this isn't in my core competencies. If someone wants to work with me to implement a GUI control to set up and change the crossover settings they are welcome to contact me. Anyway I think the R-Pi would not be able to run both the crossover code and the GUI desktop at the same time anyway. My idea was to have text configuration files and run the Pi headless. It would become ready to process audio on boot up.

As far as multi-channel output, I don't think that multiple output devices is advised. These will never be well sync'd. Instead I hope to use the HDMI audio outputs and connect an audio extractor board to the Pi's output.

As you can tell, I am planning to try this on the Pi. But this should all work on hardware running Linux that is at least as, or more, powerful than the Pi (which is most everything else!). Like a small mini-PC running Linux. IF you are only running a crossover, that would be overkill.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 16th May 2015, 07:56 PM   #5
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
I have now done some coding based on Richard Taylor's work, adding routines to implement an IIR digital filter of first or second order when the transfer function coefficients are supplied by the user directly. This is the kind of low-level filter programming that miniDSP offers with its "advanced biquad programming" feature. Although such a filter would only work for digital audio in the sample rate for which the coefficients were calculated, the filter response is more flexible. For instance I can implement a filter with "optimized coefficients" like I discuss here:
Biquad Optimizer for IIR digital filters

Richard Taylor already coded a few filters that he used to implement the particular crossover he was working with. These include:
  • 2nd order highpass
  • 2nd order lowpass
  • 2nd order allpass
  • 1st order allpass
  • 2nd order high shelf
  • 2nd order low shelf
  • parametric EQ

This is a nice start, but you can't implement (for instance) a 3rd order crossover or a Cauer/Elliptical filter with only these filters.

To make the set of filters more complete for crossover work, I will add the following:
  • 1st order highpass
  • 1st order lowpass
  • 1st order shelf
  • biquadratic filter (e.g. for Linkwitz Transform)
  • 2nd order notch filter (including HP-notch and LP-notch forms)

With those filters added to the mix, it's essentially the same filters that are used in my Active Crossover Designer tools. The user could design the crossover using ACD and then implement is using the LADSPA plugins in software on a computer.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 16th May 2015, 09:53 PM   #6
jplesset is offline jplesset  United States
diyAudio Member
 
Join Date: Jan 2013
Location: Oregon City, Oregon
I've applied Richard's solution, using an old lapop and a 7.1 USB sound card. The standard MPD/Ecasound install came with a pretty broad range of filters beyond those that Richard coded, and I've used some of those, too.
I don't code, and don't have a RPi, but anything I can do to help I will do.
  Reply With Quote
Old 17th May 2015, 05:57 AM   #7
cmiu007 is offline cmiu007  Romania
diyAudio Member
 
Join Date: Feb 2013
Location: Bucharest
Quote:
Originally Posted by CharlieLaub View Post
Anyway I think the R-Pi would not be able to run both the crossover code and the GUI desktop at the same time anyway. My idea was to have text configuration files and run the Pi headless. It would become ready to process audio on boot up.
I think in better to think the GUI as a web service, as almost all linux audio distributions use it for direct remote control or maybe a client library is the way to go as it leaves GUI developers to choose whatever they prefer (native X, web, MS/OSX or even mobile apps apple or android). Look how mpd cilent is used to control the server.

How do you see input and output?

Like mpd and sox/brutefir? player -> pipe -> crossover -> alsa or as a module for jack or alsa?
  Reply With Quote
Old 18th May 2015, 05:06 AM   #8
Odal3 is offline Odal3  United States
diyAudio Member
 
Join Date: Aug 2014
I have been following the R Taylor's apprach as well which lead me down to read a lot about Linux audio and some of the good technical info provided by phofman and others. I havent fully got it to work because I have been searching for a global solution regardless of software program used (not just the mpd piping) - in other words, how to intersect all streams going via alsa (stdin?) and apply the ladspa filters via ecasound or other solutions. Interested to follow your progress.
  Reply With Quote
Old 18th May 2015, 07:06 AM   #9
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
alsa.opensrc.org

[SOLVED] Low- and high-pass filters in ALSA (with LADSPA)

the digital machine
  Reply With Quote
Old 18th May 2015, 02:41 PM   #10
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Huh?

I still have not seen anything that comprises all the filters that you could possibly use for a loudspeaker crossover. That is why I am developing my own plugin. Usage will be LADSPA_plugin >> ecasound filter chain >> ALSA interface. ALSA will interface with the player/streaming client on the local machine.

Most of this is pretty well spelled out in Richard Taylors web pages.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote

Reply


LADSPA plugin programming for Linux audio crossoversHide 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
Loaded .xml file for different miniDSP plugin and now the plugin doesn't work anymore keyser miniDSP 5 15th December 2011 01:38 AM
8 channel Linux audio with active crossovers oublie PC Based 7 21st February 2011 09:29 AM


New To Site? Need Help?

All times are GMT. The time now is 02:09 AM.


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