Artless idea for a 2way x-o

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
The idea i have in mind sounds quite simple, though i cannot implement it myself.
It is possible that my idea is complete bs, let me know if that is the case.

For outdoor 2way boomboxes i usually use opamp based crossovers:
The signal gets summed to mono, LR2, LR4 filters...nothing special, but still stuff that needs be designed, build, bought, carried around and so on.
It could be much easier if i had a mp3 playlist with all songs having ready-made channels: one channel carrying the highs, the other the lows.

I don't look for a dsp or any other real-time stuff.
I imagine an algorithm that needs the entry of a mp3 file and an x-o-point.
Filter steepness and a subsonic filter would be very satisfying, too.
It could pretty much do everything to a file that a dsp does in real-time.
The difference is that the rendered file is saved.

Is it possible to create a program like this?
Does something like this already exist?
 
There is already such a program (actually LOTS of them) - audio editing software.

Creating your pre-processed multi-channel MP3 file:
Since its free and I am very familiar with it, I would just use ecasound under Linux. Ecasound would read in the file, use LADSPA plugins to split up the 2-channel input into bands, and then write a new multi-channel MP3. It's very straightforward.

Playing back the multi-channel file:
You would need player software that can play a multichannel MP3 file and output the channels to a multichannel DAC. Again, lots of options assuming you eight (7.1 audio) channels or less. VLC and ecasound again come to mind.

The idea is a good one, however, I should point out that ecasound (for example) on a small single board computer (like a Raspberry Pi) can do this in real time, meaning there is no need to "pre-process" files. Even though you said that you were not interested in that, it's by far the better idea in my opinion because you do not have to limit yourself to "pre-processed" songs. Under linux you can use whatever player you like (or prefer) and output the (stereo) audio into the "input" side of an ALSA loopback, which is like an internal patch bay between two programs. Then use ecasound to read data in from the "output" side of the loopback, process it using LADSPA, and output it to your DAC. This is exactly what I do in my active loudspeaker projects. Ecasound and LADSPA work as your crossover. The only disadvantage I see is that the SBC that is running these programs requires its own power, and this might not be attractive for a mobile (boombox) solution as it is yet another device that needs power. You can run the Pi and other SBCs from e.g. LiPo batteries with some regulation, etc. and they should not be all that heavy although I do not have any experience with this myself.
 
Last edited:
With the help of god i'm going to have a lot more time two weeks from now.
Having a new project for the time after the period i'm going through right now is a big motivation.
I want to buy a PI 3 (~40 €), but i have no clue which are DAC's to consider.
I like it cheap....
Does anybody have a suggestion for me?
 
To get at least three channels I would use two USB DACS that run in USB adaptive mode (this keeps their playback synchronized). For example:

HiFimeDIY Sabre Tiny USB DAC, $39, limited to 16/48 playback
HiFimeDIY Sabre USB DAC ES9023 96kHz/24bit, $42, up to 24/96 playback
I own the two DACs above. Audio quality seems pretty good and they are quite small.

If you want to try something even less expensive from Ebay, two of these would work to get you started:
NEW PCM2706 + ES9023 fever level audio DAC sound card / decoder | eBay, $18, limited to 16/48 playback
I do not own this one personally, but I expect that it would work just fine for your purposes. You could start there and move up to something more expensive later, if you found it lacking in performance. I think it would be just fine for your system.
 
Oh no!
Now i spam my own thread...
I found lots of dac's and i don't know what to look for.
Some examples..
https://www.aliexpress.com/item/201...13.html?spm=2114.13010208.99999999.282.ASO7FV
https://www.aliexpress.com/item/201...38.html?spm=2114.13010208.99999999.290.ASO7FV
https://www.aliexpress.com/item/PCM...id=7b6d7c86-afa2-4dc3-a761-68b793d953c8&tpp=1
Is it good to have the power supply via the USB port?
I don't like the whole idea of changing to an analogue signal only to feed a class d amplifier.
On the other hand the options that the PI offers are too tempting.
 
The PCM2706 is both a USB receiver (adaptive mode) and a DAC in the same package. Both of these are needed for usb->analog audio. I find that the PCM2706 is a reliable USB RX, though limited in terms of sample rate (48kHz max) and bit depth (16 bits). One of the USB DACs I recommended uses this as the receiver and uses a better DAC (the ES9023) to generate the analog output.

The first two boards you linked to are I2S input. I don't recommend using a China I2S board unless you know what you are doing. The USB solution is simpler because it is plug and play under linux. No configuration changes or drivers are needed.

Class-D amplifiers are not the same as digital signals. You need an analog input unless you use an amp with digital input (like STA models). Most (95% or more) require analog input.
 
I've ordered the electronics, but it will take a few weeks until everything arrives.
As i am sick and not at work, so i try ecasound on my linux laptop (ubuntu 16.04).
It looks like i have installed everything properly (but i'm not 100% sure about that).
My onboard soundcard is
Code:
sysdefault:CARD=PCH
and the channels are
Code:
speaker-test -D sysdefault:CARD=PCH -c 2 -t wav
0 - Front Left
1 - Front Right

My goal is a mono signal and a crossover that outputs low freqs to c0 and high freqs to c1.

I've already managed to play an mp3 file via command line using ecasound:
Code:
ecasound -i:/home/buehgemeiste/mysong.mp3 -o:alsa,sysdefault:CARD=PCH

I try to follow those instructions:
Digital Crossover/EQ with Open-Source Software: HOWTO | Richard's Stuff

Now i'm not sure about the *.ecp files.
Where do they have to be stored?
How do i handle my two channels instead of the four channels in the example?
This leads to the question about how i can achive a mono signal.

What i tried is this:
I created a 'pre.ecp' with a low-freq-boost:
Code:
pre = -el:RTparaeq,10,100,1
And 'tweeter.ecp' and 'woofer.ecp':
Code:
tweeter = -el:RTlr4hipass,3000
Code:
woofer = -el:RTlr4lowpass,3000

I ran that command:
Code:
ecasound -z:mixmode,sum -x
-a:pre -i:/home/buehgemeiste/mysong.mp3 -pf:pre.ecp -o:loop,1
-a:woofer,tweeter -i:loop,1
-a:woofer -pf:woofer.ecp -chorder:1,0
-a:tweeter -pf:tweeter.ecp -chorder:0,1
-a:woofer,tweeter -f:16,4,44100 -o:alsa,sysdefault:CARD=PCH
The track starts playing, but the filters do not work.
I got this output:
Code:
(eca-chainsetup-parser) Enabling 'sum' mixmode.
(eca-chainsetup-parser) Truncating outputs (overwrite-mode).
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
Warning: type DBC_REQUIRE soft-assert 'formatted_string.empty() == false' failed at
 -> preset.cpp:155 [void PRESET::parse(const string&)]
(eca-chainsetup) Chainsetup "untitled-chainsetup"
(eca-chainsetup) "rtlowlatency" buffering mode selected.
(eca-chainsetup) Opened input
... "/home/buehgemeiste/mysong.mp3", mode "read". Format:
... s16_le, channels 2, srate 44100, interleaved (locked
... params).
(eca-chainsetup) NOTE: using existing audio parameters
... -f:f32_le,2,44100 for object 'loop' (tried to open with
... -f:s16_le,2,44100).
(eca-chainsetup) Opened input "loop", mode "read". Format:
... f32_le, channels 2, srate 44100, interleaved (locked
... params).
(eca-chainsetup) Opened input "loop", mode "read". Format:
... f32_le, channels 2, srate 44100, interleaved (locked
... params).
(audioio_alsa) Warning! Period-size differs from current
... client buffersize.
(eca-chainsetup) Opened output "alsa", mode "write". Format:
... s16_le, channels 4, srate 44100, interleaved.
- [ Connected chainsetup: "untitled-chainsetup" ] ------------
- [ Controller/Starting batch processing ] -------------------
- [ Engine - Driver start ] ----------------------------------
^C- [ Controller/Batch processing finished (0) ] ---------------
- [ Engine exiting ] -----------------------------------------
(eca-control-objects) Disconnecting chainsetup: 
... "untitled-chainsetup"

Is there any chance this works with my onboard soundcard?
If it is possible please tell me how i can achieve that.
 
The filters will not work unless LADSPA in installed. It's not part of ecasound. To install, do this:
Code:
sudo apt-get install ladspa-sdk
Then if you want to use Richard Taylor's filters (the ones that you showed in your ecp files), you need to install them as well. To install them, follow the info and instructions found here:
rt-plugins: LADSPA plugins for Active Loudspeakers

The ecp files can be in the same directory from which you are calling ecasound, or you can provide the full or a relative path and put them somewhere else in the filesystem.
 
Hi Charlie,
your example 5 provided enough for me to take the next step.
That example is more or less what i am looking for.
http://audio.claub.net/software/LADSPA/Implementing Crossovers Using Ecasound and LADSPA.txt
Learning curve is steep thanks to the great documentation you offer on your website.

A problem occurs after each reboot of the system.
Some step of the installation process has to done again each time.
I couldn't figure out which one it was.

What i need next is that all audio played on the laptop goes through that filter.

Looking forward to the rpi implementation it should work from system boot as a standard config of the system.
And i need to find a way of streaming audio through the pc from an external source.
I have no clue about that, so a hint would be very nice.
 
I try to route all the audio played on my laptop through the rt-filters.
Code:
aplay -L
outputs this:
Code:
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=PCH
    HDA Intel PCH, ALC255 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
dmix:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Direct sample mixing device
dmix:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample mixing device
dsnoop:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Direct sample snooping device
dsnoop:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct sample snooping device
hw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Direct hardware device without any conversions
hw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=PCH,DEV=0
    HDA Intel PCH, ALC255 Analog
    Hardware device with all software conversions
plughw:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 0
    Hardware device with all software conversions
Playing a single mp3 works like this for me:
Code:
...
... -i:mysong.mp3 ...
...
... -o:alsa,sysdefault:CARD=PCH
The only option that works with the mic-signals (leads to weird audio with the mic of the laptop) is to use 'pulse' as input:
Code:
...
... -i:alsa,pulse ...
...
... -o:alsa,sysdefault:CARD=PCH
But that only works with the mic and maybe with external audio through the mic-input, but i have not tested that.
All audio files do not play on the pc while running my filter.
None of the player sofware starts to play any track.
I'm stuck here and appreciate any help to solve this.
 
Running the filter will grab the output audio device.
Also reads like you have Pulseaudio installed.

1. Need an ALSA asound.conf that can either use a "PIPE" to call ECASOUND or use SND-ALOOP.
2. Test using APLAY or whatever with -Dplug:myalsadevice
3. Persuade pulseaudio to output to your device by default.
 
Thanks for your reply.
I'm a noob i don't get any bit of you write.

1. I have no file named asound.conf and don't know what to enter and where to store.
2. aplay -Dplug:myalsadevice says
Code:
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM alsadevice
aplay: main:722: Fehler beim Öffnen des Gerätes: Datei oder Verzeichnis nicht gefunden
3. I don't know how.
I found some tutorials in the web.
They all start with 'pacmd list-sources' or list-sink.
But my pc says that pulseaudio is not running.
 
Thanks for your reply.
I'm a noob i don't get any bit of you write.

1. I have no file named asound.conf and don't know what to enter and where to store.
2. aplay -Dplug:myalsadevice says
Code:
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM alsadevice
aplay: main:722: Fehler beim Öffnen des Gerätes: Datei oder Verzeichnis nicht gefunden
3. I don't know how.
I found some tutorials in the web.
They all start with 'pacmd list-sources' or list-sink.
But my pc says that pulseaudio is not running.

File asound.conf is used to configure ALSA devices and plugins. It's not required for the moment. (It would reside in "/etc" if it existed).

Where I wrote "myalsadevice" I meant substitute your own device. e.g. "front" or "surround40" or similar.

ALSA supports one "user/app" only, at a time unless configured to share audio devices. That's probably what's happening when you run the mic input command. It's expected behaviour.

I have used a Raspberry Pi as a filter in the past. I used the line-in of my USB soundcard as input. To see input sources, try "arecord -L" or "arecord -l". Microphone input would also be a very low level mono source (compared to a line-in which would be stronger and stereo).

I'm not (currently) familiar enough with Pulseaudio or Ecasound to state exactly what should work.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.