• Welcome to ASR. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Dynamic loudness compensation with miniDSP

I was expecting a standalone implementation of dynamic loudness. No PC or RaspberryPi calculations. Just using my PC as external device to implement filters, but then the MiniDSP would change the loudness automatically without any external device, just by knowing which is the general volume level.
 
@kifeep
I'm currently using my MiniDSP Flex to drive two speakers + 2 subs, with outputs 1+2 going to speakers and outputs 3+4 to subs. Using PEQ with Biquad programming based on measurements I took with corrections to target curve.

How can I do the automatic loudness compensation as presented here to be dynamic off of the current corrections I have loaded?

I've been able to now access the minidsp over the network by setting up the minidsp-rs daemon on the RPi that runs Volumio. And can also run commands locally, so any scripts I'll probably just install on the RPi. But I can access all the settings through the minidsp GUI on my Mac so that's nice. Don't need a WiFi bridge now.
 
Last edited:
@kifeep
I'm currently using my MiniDSP Flex to drive two speakers + 2 subs, with outputs 1+2 going to speakers and outputs 3+4 to subs. Using PEQ with Biquad programming based on measurements I took with corrections to target curve.

How can I do the automatic loudness compensation as presented here to be dynamic off of the current corrections I have loaded?
Not sure I understand what you're asking. In general, to use the script you'll need to reserve some filter slots (i.e not use them for your other corrections) and then configure the script to apply the loudness compensation filters to those slots.
 
Not sure I understand what you're asking. In general, to use the script you'll need to reserve some filter slots (i.e not use them for your other corrections) and then configure the script to apply the loudness compensation filters to those slots.
Well what I'm trying to say is that these filters I'm using are for RoomEQ. I'm assuming then that the script will just apply a standard filter that doesn't use the RoomEQ filter, correct?

Do you have a suggestion for ways I could create automatic loudness compensation with RoomEQ? Kind of exactly like how Dynamic EQ works on a Denon. It applies room correction as well as automatic loudness compensation.
 
Well what I'm trying to say is that these filters I'm using are for RoomEQ. I'm assuming then that the script will just apply a standard filter that doesn't use the RoomEQ filter, correct?

Do you have a suggestion for ways I could create automatic loudness compensation with RoomEQ? Kind of exactly like how Dynamic EQ works on a Denon. It applies room correction as well as automatic loudness compensation.
The script requires empty filter slots to apply the compensation. You’ll need to figure out for yourself how to get room eq to leave some unused.
 
The script requires empty filter slots to apply the compensation. You’ll need to figure out for yourself how to get room eq to leave some unused.
I'll try to apply the compensation to the input stage, will just need to figure out how to leave enough headroom.
 
@kifeep
Ok, finally have time to really dig into this and start implementing it. I modified the settings in the .py script as below. Goal is to have it write to Preset 3 (or 2 when zero-indexed), and only to the inputs. Input should work on the regular Flex I have. And I wanted the low shelf written to the first PEQ slot (0) and high shelf to the last PEQ slot (10).

Few things I'm unsure about. For peq_channels should I leave that as being 1-8 (with 0 and 9 reserved for low and high shelf)?

Also how can I tell it's actually adjusting settings on the minidsp? The log file in /logs is empty. And when I connect through the minidsp device console it doesn't appear to have changed the PEQ settings on the two input channels.




MINIDSP_SETTINGS = {
'flags': { # set flags for minidsp command line (e.g. 'force-kind', 'tcp', etc.)
'force-kind': 'flex', # Flex HT not supported natively
},
'console_port': 5333, # assuming minidsp daemon is running locally, what port does the device console$
'update_freq': 2.0, # how frequently to poll the minidsp (seconds) --> should be higher if connecti$
'connect_freq': 10.0, # how frequently to attempt reconnection (seconds) --> should be MUCH higher if$
}

LOUDNESS_SETTINGS = {
'peq_presets': 2, # which presets to apply loudness correction to (zero-indexed)
'peq_bank': 'input', # which bank of PEQ filters to adjust (only 'output' works on flexHT)
'peq_channels': [1,2,3,4,5,6,7,8], # which channels to apply filters to (zero indexed)
'reference': -5.0, # loudness reference output level
'max_gain': 10.0, # set to avoid input clipping at very low output levels
'Fs': 48000, # sample rate of minidsp device
'filters': {
'low-shelf': {
'enabled': True, # enable/disable low shelf filter
'Fc': 180.0, # center frequency for low shelf filter
'Q': 0.40, # Q for low shelf filter
'ratio': 0.50, # mutiply by amount below reference to determine gain for low shelf filter
'peq_slot': 0, # PEQ filter slot to use for low shelf filter (zero indexed)
},
'high-shelf': {
'enabled': True, # enable/disable high shelf filter
'Fc': 12000.0, # center frequency for high shelf filter
'Q': 0.66, # Q for high shelf filter
'ratio': 0.35, # mutiply by amount below reference to determine gain for high shelf filter
'peq_slot': 9, # PEQ filter slot to use for high shelf filter (zero indexed)
},
}
}
 
Last edited:
I'm away from my home computer atm, and can't refer to the full script, but in general:

Few things I'm unsure about. For peq_channels should I leave that as being 1-8 (with 0 and 9 reserved for low and high shelf)?
peq_channels is zero-indexed and refers to the channels present in peq_bank. So assuming your device has 2 input channels, this should probably be set to [0,1].

Also how can I tell it's actually adjusting settings on the minidsp? The log file in /logs is empty. And when I connect through the minidsp device console it doesn't appear to have changed the PEQ settings on the two input channels.
I don't understand why the log file would be empty. Stop and disable the service and try running the script directly from the command line (i.e. python path/to/minidsp_loudness.py). Don't mess with the service until you get it working on its own.

You'll never see the changes in device console because the PEQ settings in minidsp devices are write-only.
 
I'm away from my home computer atm, and can't refer to the full script, but in general:


peq_channels is zero-indexed and refers to the channels present in peq_bank. So assuming your device has 2 input channels, this should probably be set to [0,1].


I don't understand why the log file would be empty. Stop and disable the service and try running the script directly from the command line (i.e. python path/to/minidsp_loudness.py). Don't mess with the service until you get it working on its own.

You'll never see the changes in device console because the PEQ settings in minidsp devices are write-only.
Thanks. There were a few things I needed to fix. One was your tip and setting the channels to [0,1]

Second was that I had 'peq_presets': 2, and that needed to be 'peq_presets': [2], (currently only testing this on one preset slot that was unused).

I also needed to install a Python version of 3.10 or higher, as my RPi was running Python 3.7 which didn't support some of the syntax in your script. And lastly I needed to change the permissions for the logging directory/file so that the user volumio could write to the file.

Now it works, and I can hear the loudness adjustments! Great job man! And it works on the input channel. Now I finally have my high-end dedicated music setup just how I like it, loudness correction was the last piece missing from this.

One thing I am noticing is that at my default listening volume of -40dB as indicated on the miniDSP, I don't see the biquad values changing when I lower/raise the volume. It's not until I reach -33.5dB that the biquad values start to change. What can I do on my end to keep having this be recalculated well into lower volume levels (I don't often listen very loud)?
 
Thanks. There were a few things I needed to fix. One was your tip and setting the channels to [0,1]

Second was that I had 'peq_presets': 2, and that needed to be 'peq_presets': [2], (currently only testing this on one preset slot that was unused).

I also needed to install a Python version of 3.10 or higher, as my RPi was running Python 3.7 which didn't support some of the syntax in your script. And lastly I needed to change the permissions for the logging directory/file so that the user volumio could write to the file.

Now it works, and I can hear the loudness adjustments! Great job man! And it works on the input channel. Now I finally have my high-end dedicated music setup just how I like it, loudness correction was the last piece missing from this.

One thing I am noticing is that at my default listening volume of -40dB as indicated on the miniDSP, I don't see the biquad values changing when I lower/raise the volume. It's not until I reach -33.5dB that the biquad values start to change. What can I do on my end to keep having this be recalculated well into lower volume levels (I don't often listen very loud)?
As you turn the volume down, the script turns the bass and treble up, but it will never turn either up more than the setting in max_gain. You can try increasing that value, but you run the risk of digital clipping since the boost is applied before the volume knob. If you're regularly listening at -40, you may want to adjust the reference_level. Reference level is a bit of personal taste, but I would expect it to typically correspond to something between 70 and 85 dBSPL at the MLP.
 
Back
Top Bottom