Raspberry Pi with Piano2.1 DAC DSP and Volumio2

Account Closed
Joined 2001
Those curves are for a specific set of drivers and construction. If you swap drivers there is no assurance you'll get the same performance without changing the EQ.
Huh?
I'm well aware of the drivers involved and the specific set of curves required.

The question is whether the designed curves can be exactly replicated with the available processing of the PCM5142. It seems like maybe they can, so that's a good development.

Dave.
 
I don't understand. Is this from measuring the response of the DACs? Where is the scaling problem ?

You alluded to it in another reply. It seems that the MiniDSP dev environment one can boost a signal (at least metaphorically in the GUI); in the PurePath environment one can only reduce it.
In SL's curves, there is a dramatic cut of 9.8dB right before output, I bet he's just manually cutting that to keep from clipping. Or maybe the MiniDSP software normalizes too, and that 9.8dB is just to account for the drivers efficiencies. Hard to know.

My concern is that the software is reducing each eq curve by a distinct amount, so all the curves are normalized, but at different rates, which means that they aren't proportional to SL's shapes. For example, he's got one eq boost of 16dB for frequencies below 1000hz, and another about 8db above 8000hz. But PurePath just scales them both; one a lot, one a little, and they both become cuts.


I tried manually scaling them all according to whichever is the greatest factor, then tried and "unscale" them at output, but that looks to be almost 30dB boost, and the blocks won't allow that. So all of these curves add up to a drastic reduction in volume, at least as it *seems*. I haven't been able to measure because I don't have a windows PC with a soundcard (using a Mac laptop with a vm for PurePath and ARTA, and have a linux box with lots of sound i/o)...

I'll have to borrow some equipment so I can measure. Does anyone have a link to a quick tutorial or what-not for measuring the electrical output of a device (not microphone and speakers yet; just hooking the DACs up to a soundcard)?

Don, do you know why in the PurePath environment there are blocks labeled "ROM" and some not? They appear to have the same help files... are the ROM ones perhaps hard-coded and therefore cheaper for the storage/processing?


Thanks for the help wrt negate and so on!
 
Right now, based on the files provided, he's at 33% resources on the woofer DAC and 50% resources on the full range DAC.
By using a single dac for left bass and left full range, you average out the resources usage.
Creating the file for the right channel only requires moving one connection between the input and the splitter.


It might even be possible to do a diff between both files, to check if that connection is a single register.
If so, you can generate the -1 file from the -0 file.
 
You alluded to it in another reply. It seems that the MiniDSP dev environment one can boost a signal (at least metaphorically in the GUI); in the PurePath environment one can only reduce it.
In SL's curves, there is a dramatic cut of 9.8dB right before output, I bet he's just manually cutting that to keep from clipping. Or maybe the MiniDSP software normalizes too, and that 9.8dB is just to account for the drivers efficiencies. Hard to know.

That's very likely if the internal number representation is fixed point or integer. I'm not familiar with the internal workings of the MiniDSP.

My concern is that the software is reducing each eq curve by a distinct amount, so all the curves are normalized, but at different rates, which means that they aren't proportional to SL's shapes. For example, he's got one eq boost of 16dB for frequencies below 1000hz, and another about 8db above 8000hz. But PurePath just scales them both; one a lot, one a little, and they both become cuts.


I tried manually scaling them all according to whichever is the greatest factor, then tried and "unscale" them at output, but that looks to be almost 30dB boost, and the blocks won't allow that. So all of these curves add up to a drastic reduction in volume, at least as it *seems*. I haven't been able to measure because I don't have a windows PC with a soundcard (using a Mac laptop with a vm for PurePath and ARTA, and have a linux box with lots of sound i/o)...

OK I think I understand. Do not manually use "scaling", just let the software control this. In the PEQ or other EQ biquad blocks you have the "gain" adjustment to boost or cut the signal. I see you already have used it, and in some cases the scaling may change but its not directly related to the gain (ie. 20db gain = 10x, but scaling is not 1/10th). I would consider the scaling an internal issue for the software. I have applied gain to EQ blocks and it works.

I'll have to borrow some equipment so I can measure. Does anyone have a link to a quick tutorial or what-not for measuring the electrical output of a device (not microphone and speakers yet; just hooking the DACs up to a soundcard)?

I have loaded REW on the Rpi and used a Umik-1 to measure the acoustic output of a speaker. It is easy to determine if the gains were being applied properly this way. Otherwise you need another soundcard with A/D inputs so REW has control over both I/O on the same platform. It might be possible to "play" a FR sweep file and analyse the output recording but I've never tried it.

Don, do you know why in the PurePath environment there are blocks labeled "ROM" and some not? They appear to have the same help files... are the ROM ones perhaps hard-coded and therefore cheaper for the storage/processing?


Thanks for the help wrt negate and so on!

Some program blocks can be held in ROM or RAM and coefficients are always in RAM. When you look at the resources tab you can see how much of a particular resource is being used. It only matters if you're running short of a resource.

Thanks for clearing up 2 issues. You have the same drivers and construction. You want the digital implementation.
 
By using a single dac for left bass and left full range, you average out the resources usage.
Creating the file for the right channel only requires moving one connection between the input and the splitter.


It might even be possible to do a diff between both files, to check if that connection is a single register.
If so, you can generate the -1 file from the -0 file.

That's true, you will get an average, and I've done it both ways. Something to consider when there is a large difference is the channel processing requirements. So far @mfeif is at 33/50% so its close, and you might get a more even 40% by rearranging the DAC assigments.
 
I haven't done that, tbh. I kinda gave up on this project. I feel like I was close, but I don't have the knowledge to take it to the final stage... I decided that rather than learn moderate-to-expert level signal processing and DSP stuff, I'd just buy a purpose-built device and finish my project.

I regret that a little, becaues I think the Piano sounds wonderful, but I was staring down weeks more of doing stuff out of my expertise.

So, some things that might help, if you want to keep working at it: even if you're using the Piano, the rPi still has a soundcard. You could loop it back into there and use one for outputs, one for "inputs". You could also use a separate computer to listen and send the output commands to the rPi over the network. Pulseaudio can make both of these possible, and I think it even has a tone gen module.

Don here is recommending using something called REW; I'm not familiar.

This is kinda my point above... even if I were to accomplish all of this, I would have a nagging suspicion "what if I did it wrong"? I simply don't have the expertise to know what the unknown-unknowns are.

I appreciate all the help I got in this forum, though.
 
Since I am using the piano 2.1, I have no more digital (or even analog) inputs.
How do you guys measure the effects of your dsp programming?
Do you use files with noise, specific frequencies etc.?
Are there measurement systems that generate flac (webradio) streams?

I use a USB mic (UMIK-1) and REW to measure the outputs. The setup is posted at Raspberry Pi with Piano2.1 DAC DSP and Volumio2

I have another SD card with Raspbian and REW installed. You can include Ecasound and Brutefir if you want, or just the embedded DSP. In either case its always worthwhile to measure the results.
 
I haven't done that, tbh. I kinda gave up on this project. I feel like I was close, but I don't have the knowledge to take it to the final stage... I decided that rather than learn moderate-to-expert level signal processing and DSP stuff, I'd just buy a purpose-built device and finish my project.

I regret that a little, becaues I think the Piano sounds wonderful, but I was staring down weeks more of doing stuff out of my expertise.

So, some things that might help, if you want to keep working at it: even if you're using the Piano, the rPi still has a soundcard. You could loop it back into there and use one for outputs, one for "inputs". You could also use a separate computer to listen and send the output commands to the rPi over the network. Pulseaudio can make both of these possible, and I think it even has a tone gen module.

Don here is recommending using something called REW; I'm not familiar.

This is kinda my point above... even if I were to accomplish all of this, I would have a nagging suspicion "what if I did it wrong"? I simply don't have the expertise to know what the unknown-unknowns are.

I appreciate all the help I got in this forum, though.

Yes, the Rpi configuration I use is a more complex setup than a purpose built device (aka minidsp). I wanted a networked player solution that could do more DSP including convolution.

If you keep the H/W there's always the option of trying it again in the future.
 
I use a USB mic (UMIK-1) and REW to measure the outputs. The setup is posted at Raspberry Pi with Piano2.1 DAC DSP and Volumio2

I have another SD card with Raspbian and REW installed. You can include Ecasound and Brutefir if you want, or just the embedded DSP. In either case its always worthwhile to measure the results.
Thanks, I will try to get this to work using my antimode-2 with mic instead of the umik1.
The goal is measuring what my dsp programs do, so I won't be using brutefirm et al.
 
Ecasound and Brutefir changes

I still run Ecasound and Brutefir underneath Volumio V2.834 and I've made a few configuration changes. This is a summary of what was done.

The Piano2.1 HAT covers the tiny RPI board WiFi antenna and limits its range and speed. So it was replaced by a WiFi dongle with 3.5dBi antenna. These are cheap (<$20), have great range and provide 300Mbps (radio connection) which is enough for my needs.

I now keep the Piano2.1 as card#2 so Volumio's controls are unaffected. The loopback card# for Ecasound and Brutefir are now placed after the Piano2.1. I use Volumio's NAS library, Spotify and Webradio. I ended up sampling at 44K1 because I could not get the Spotify daemon to accept a rate change even through it uses SOX. I prefer 48K because it has lower jitter on the RPI.

Ecasound is running 12 * IIR PEQ's that do minor adjustments to flatten the FR. Brutefir runs a 1K tap phase correction to make the LR4 XO min phase. The CPU runs at 58C in a closed plastic box and the load is shown in the pic below.


The Raspbian configuration changes are :

Code:
 # 
# ======================================================
#  file =  /etc/modules

i2c-dev
# enable loopbacks for Ecasound, Brutefir
snd-aloop


# ======================================================
# file = /etc/modprobe.d/alsa-base.conf

# add after this line :  "options snd-usb-audio nrpacks=1"
# keeps the piano2.1 as card #2 for volumio and its Alsa controls intact for Volumio
options snd_aloop enable=1,1,1 index=3,4,5 id=EcaLoop,BfLoop,TestLoop 


# ======================================================
# file = /etc/rc.local

# start brutefir and load its config file
# brutefir
cd /home/brutefir
brutefir /home/brutefir/brutefir_config &

# ecasound must start in quiet mode "-q" so no terminal is opened
cd /home/ecasound
 ./ecasound_config.sh &
# or execute this simple command to test the connections
# /usr/bin/ecasound -q -B:rt -b:256 -f:s32_le,2,44100 -i:alsahw,3,1 -o:alsahw,4,0 &
cd /home/volumio


# =====================================================
# file = /etc/spopd.conf

[sox]
output_type = alsa
output_name = plughw:3,0			# Spotify output needs to go to EcaLoop now
effects = rate 44100				# playback conversion


# ====================================================
# file = /etc/mpd.conf
# you can also set these from Volumio, but it will overwrite this file
resampler {      
  		plugin "soxr"
  		quality "high"
  		threads "1"
}

# commment out volumio's output direct to Piano2.1
#audio_output {
#		type		"alsa"
#		name		"alsa"
#		device		"hw:2,0"			# check card with "aplay -l"
#		dop			"no"
#		format      "44100:32:2"		# seems to fail if this is 24b
#}

# add volumio output to the Ecasound Loopback
audio_output {
		type		"alsa"
		name		"EcaLoop"
		device		"hw:3,0"			# check card with "aplay -l"
		dop			"no"
		format      "44100:32:2"		# 
}

# ========================================================

# file = /home
# create sub directories [brutefir, ecasound claub, rtaylor]
# these dir also contain files, specified as we go
# make sure to "sudo chmod 755 dir_name" to set the dir permissions
# change owner ("sudo chown volumio brutefir") and group ("sudo chgrp volumio brutefir") to Volumio


The additional tools required are :

Code:
# other tools required

# we need htop to view CPU loading, update packages as well to find htop
"sudo apt-get update && sudo apt-get install htop"

#Get alsa drivers and utilities
sudo apt-get install alsa-base alsa-utils alsa-tools libasound2-plugins

# Get ecasound
sudo apt-get install ecasound

# Get brutefir
sudo apt-get install brutefir

# get ladspa
 sudo apt-get install -y ladspa-sdk

# If you want the filters from Richard Taylor
"sudo apt-get install build-essential"
"sudo apt-get install cmake"
- and you need to compile it
	- build instructions in the taylor pdf (repeated here)
	- you need the LADSPA sdk, from previous step
	- Unpack the source tarball: tar xfz rt-plugins-x.x.x.tar.gz )
	- Enter the build folder: "cd rt-plugins-x.x.x/build/"
	- Run cmake: "cmake .."
	- Maybe edit the Makefile (you probably don't need to)
	- Compile the code: "make"
	- Install the plugins in default /usr/local/lib/ladspa: "sudo make install"   
- I like to keep all the LADSPA plugins in one spot (default) so move them	
	- "sudo cp /usr/local/lib/ladspa/*.so  /usr/lib/ladspa/


.
 

Attachments

  • DSCN8117r.jpg
    DSCN8117r.jpg
    98.6 KB · Views: 304
  • htop-cpu-usage-3.jpg
    htop-cpu-usage-3.jpg
    380.3 KB · Views: 303
[book=]%[/book]Hello, I realise this is a dormant thread, but it contains so much useful info!

Having said that, after reading every document I could find on the Allo site as well as this whole thread, I still can’t find the info I’m looking for about the default config of the Piano 2.1.

When you get it out of the box, it’s said to be set up for 2.1 usage, but:

  • Does this mean RCA outs 3+4 both output the same, low-passed signal?
  • The LPF cutoff freq is selectable, but is it a "standard" 24dB/octave slope?
  • Is there a (selectable) HPF on the main L+R channels?
  • If so, is it 12dB/octave like on most AVRs (to suit sealed main speakers)?

I can see that @DonVK has created filters very close to what I’m looking for on p10 of this thread, so perhaps the defaults don’t matter.

I’m wondering though, does anyone know whether these alternative firmware files can still be loaded using Volumio 3 on an RPi 4? The latest versions tested seem to be 2.8 on an RPi 3….

Thanks in advance for any input.
 
Last edited:
Firmware required...
https://github.com/allocom/piano-firmware/archive/master.zip

Works fine with MoOde...
Installing Firmware for Allo Piano 2.1 Dac

Possibly the kernel bug that plagued Allo...
Piano 2.1 + Moode 6.6+ - DAC Support - Audiophile Style

Perhaps Volumio does not use a recent kernel incorporating the fix ?

From the Allo documents..
Piano 2.1 DAC can work in Dual mode (Dual Mono & Dual Stereo) and Subwoofer
mode (2.0, 2.1 & 2.2).
Dual Stereo: Double stereo output. Sound is out on both set of connectors, No filtration.
Dual Mono: Double Mono Output. Sound is out on 1 connector of each set (Left & Sub Right), No filtration.
2.2: High frequency sound is passed to Right & Left connectors and low frequency sound is passed to Sub Right & Sub Left connectors. Crossover frequency can be selected. This mode works with DSP firmware files.
2.1: High frequency sound is passed to Right & Left connectors and low frequency sound (mono) is passed to Sub Left connectors. Crossover frequency can be selected. This mode also works with DSP firmware files.
2.0: Stereo output. Sound is passed on Right & Left connectors, No filtration. All these settings are controlled via ALSA tools; alsamixer or amixer

Allo tech manual for 2.1
https://www.amazon.com/clouddrive/s...gLAIuZcY8YfVWFOU0G?ref_=cd_ph_share_link_copy
 
Last edited:
@Drone7 - thanks for posting that.

@Arctophile - no problem to wake the thread.


The stock firmware is as Drone7 states. I have the design files from Allo and checked them :
Raspberry Pi with Piano2.1 DAC DSP and Volumio2

The stock filters (LP+HP) are implemented as BW2 * BW2 = LR4 (24dB/oct) and the sub outputs are stereo as well.

I use the latest Volumio 2.907 on a RPI-3B and it uses stock Piano firmware v1.2 (circa 2017). I can't comment on the RPI-4 or its kernel changes.

The filters on P10 are for a sealed woofer and a BR sub. What did you need that was different ?
 
Thanks @DonVK, glad you're still following this thread.

My mains are ported and my subs are sealed. Using both subs in opposite corners produces flatter in-room response, but planning to run them in mono I think if possible.

From research I've been able to do, it seems I can't really know for sure which slopes I'll need without several more measurements. My system is about to change with the Pi and a new amp, so will measure after I get it all set up (family permitting, we're still locked down here in Aus).

Oh and I think after some experimentation with REW sim I need about a 9ms delay for closer sub, but not sure about delay using both subs at once. Phase matching gives me a headache with all the variables involved....

EDIT: occurs to me that perhaps I should try LR4 on the subs and no HPF initially - would it be possible to create a firmware like that please?
 
Last edited:
I would agree with mono subs, there little point to stereo subs when the wavelength is so long.

If your woofers are sealed they will behave naturally like BW2 HP and the subs could also use BW2 LP. Small power bump that you're unlikely to hear it.

That makes sense, lots of systems just let the mains roll off naturally (no filteR), so even a BW2 on the subs would match. I seem to think (its been awhile :) ) that I even tried that as well. I'll check.

Just checked my TI GDE license and it still works :)