REW with Software EQ

Discuss your workplace, instruments, amps, and any other gear.

Moderators: MattKingUSA, khz

User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

REW with Software EQ

Post by lilith »

As Room Equation Wizard does not use Jack, is there any way to use REW with a software Equalizer plugin to test the settings, i.e. if the signal becomes more linear with EQ on? I have KXStudio 14.04 running.
Musinux
Established Member
Posts: 59
Joined: Sun Jan 14, 2018 8:38 pm
Has thanked: 3 times
Been thanked: 3 times

Re: REW with Software EQ

Post by Musinux »

1. See http://www.jackaudio.org/faq/routing_alsa.html . Change your .asoundrc to the jack-bridge and REW can "see" your jackd.

2. If you have this running, and if you're brave enough, see https://www.ludd.ltu.se/~torger/brutefir.html , which let's you try eq changes in realtime (and much more)
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: REW with Software EQ

Post by CrocoDuck »

Musinux wrote: 2. If you have this running, and if you're brave enough, see https://www.ludd.ltu.se/~torger/brutefir.html , which let's you try eq changes in realtime (and much more)
That's pretty interesting! I did not know about that program. I reckon that if you export the impulse response of your room from REW, if it isn't too long, you can calculate an inverse of it and use that program to convolve it to your audio signals, thus (theoretically) compensating perfectly for your room acoustics.
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: REW with Software EQ

Post by funkmuscle »

CrocoDuck wrote:
Musinux wrote: 2. If you have this running, and if you're brave enough, see https://www.ludd.ltu.se/~torger/brutefir.html , which let's you try eq changes in realtime (and much more)
That's pretty interesting! I did not know about that program. I reckon that if you export the impulse response of your room from REW, if it isn't too long, you can calculate an inverse of it and use that program to convolve it to your audio signals, thus (theoretically) compensating perfectly for your room acoustics.
Croco, this ties into some of your theories..
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

Musinux wrote:1. See http://www.jackaudio.org/faq/routing_alsa.html . Change your .asoundrc to the jack-bridge and REW can "see" your jackd.

2. If you have this running, and if you're brave enough, see https://www.ludd.ltu.se/~torger/brutefir.html , which let's you try eq changes in realtime (and much more)
Thanks for your reply! My .asoundrc file looks like:

Code: Select all

# ------------------------------------------------------
# Custom asoundrc file for use with snd-aloop and JACK
#
# use it like this:
# env JACK_SAMPLE_RATE=44100 JACK_PERIOD_SIZE=1024 alsa_in (...)
#

# ------------------------------------------------------
# playback device
pcm.aloopPlayback {
  type dmix
  ipc_key 1
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,0"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# capture device
pcm.aloopCapture {
  type dsnoop
  ipc_key 2
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,0,1"
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 4096
  }
}

# duplex device
pcm.aloopDuplex {
  type asym
  playback.pcm "aloopPlayback"
  capture.pcm "aloopCapture"
}

# ------------------------------------------------------
# default device
pcm.!default {
  type plug
  slave.pcm "aloopDuplex"
}

# ------------------------------------------------------
# alsa_in -j alsa_in -dcloop -q 1
pcm.cloop {
  type dsnoop
  ipc_key 3
  ipc_key_add_uid true
  slave {
    pcm "hw:Loopback,1,0"
    channels 2
    format S32_LE
    rate {
      @func igetenv
      vars [ JACK_SAMPLE_RATE ]
      default 44100
    }
    period_size {
      @func igetenv
      vars [ JACK_PERIOD_SIZE ]
      default 1024
    }
    buffer_size 32768
  }
}

# ------------------------------------------------------
# alsa_out -j alsa_out -dploop -q 1
pcm.ploop {
  type plug
  slave.pcm "hw:Loopback,1,1"
}
What do I have to inlcude here that REW sees the input channel? BruteFIR looks pretty complicated, thanks for the tip.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: REW with Software EQ

Post by CrocoDuck »

lilith wrote:As Room Equation Wizard does not use Jack, is there any way to use REW with a software Equalizer plugin to test the settings, i.e. if the signal becomes more linear with EQ on?
Just for curiosity, I am not very familiar with REQ, but what can you export from REW? Can you export the whole impulse response in some way?
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

CrocoDuck wrote:
lilith wrote:As Room Equation Wizard does not use Jack, is there any way to use REW with a software Equalizer plugin to test the settings, i.e. if the signal becomes more linear with EQ on?
Just for curiosity, I am not very familiar with REQ, but what can you export from REW? Can you export the whole impulse response in some way?
You can export EQ settings as a file based on your measurement for various hardware or plugins (e.g. miniDSP). I was just interested in equalizing three frequencies on which I have have strong room modes (~40, 50 and 120 Hz). You can also show the correction settings as a table (frequency, Q-factor, damping) which you can use for any EQ (plugin or hardware) by setting the parameters by hand.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: REW with Software EQ

Post by CrocoDuck »

lilith wrote:
CrocoDuck wrote:
lilith wrote:As Room Equation Wizard does not use Jack, is there any way to use REW with a software Equalizer plugin to test the settings, i.e. if the signal becomes more linear with EQ on?
Just for curiosity, I am not very familiar with REQ, but what can you export from REW? Can you export the whole impulse response in some way?
You can export EQ settings as a file based on your measurement for various hardware or plugins (e.g. miniDSP). I was just interested in equalizing three frequencies on which I have have strong room modes (~40, 50 and 120 Hz). You can also show the correction settings as a table (frequency, Q-factor, damping) which you can use for any EQ (plugin or hardware) by setting the parameters by hand.
The feature list suggests that it is possible to export the measured impulse response as WAV. If you manage to do that, it would be fun to try to invert it and use the inverse in a convolution reverb. Octave can be used for that pretty easily. This should give you the highest degree of compensation for the transmission line you measured. This means that, if you put your head where the microphone was during the measurement, then the compensation will be not optimal as your Head Related Transfer Functions are not the mic response, but maybe it will work OK anyway, especially at low frequency I think.

If you have time to spare, try to give us your impulse response, if you figure out how to do it. I can try to calculate the inverse for you and we can give it a spin, and compare it with the EQ solution.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

CrocoDuck wrote:
lilith wrote:
CrocoDuck wrote:
Just for curiosity, I am not very familiar with REQ, but what can you export from REW? Can you export the whole impulse response in some way?
You can export EQ settings as a file based on your measurement for various hardware or plugins (e.g. miniDSP). I was just interested in equalizing three frequencies on which I have have strong room modes (~40, 50 and 120 Hz). You can also show the correction settings as a table (frequency, Q-factor, damping) which you can use for any EQ (plugin or hardware) by setting the parameters by hand.
The feature list suggests that it is possible to export the measured impulse response as WAV. If you manage to do that, it would be fun to try to invert it and use the inverse in a convolution reverb. Octave can be used for that pretty easily. This should give you the highest degree of compensation for the transmission line you measured. This means that, if you put your head where the microphone was during the measurement, then the compensation will be not optimal as your Head Related Transfer Functions are not the mic response, but maybe it will work OK anyway, especially at low frequency I think.

If you have time to spare, try to give us your impulse response, if you figure out how to do it. I can try to calculate the inverse for you and we can give it a spin, and compare it with the EQ solution.
That sounds interesting. What kind of convolution plugin can I use for that in Linux? I'll check how to do this in REW. Anyway ... My monitors (Neumann KH80) have in in-built room correction, however I'm still waiting for the control app which is always shifted. It should come out in summer 2018.
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: REW with Software EQ

Post by CrocoDuck »

lilith wrote:
That sounds interesting. What kind of convolution plugin can I use for that in Linux? I'll check how to do this in REW. Anyway ... My monitors (Neumann KH80) have in in-built room correction, however I'm still waiting for the control app which is always shifted. It should come out in summer 2018.
I don't really use convolution reverbs a lot, so I am probably missing out many. There is one in the LSP Plugins suite. I believe Guitarix has one too. I am pretty sure there is plenty of good ones around, perhaps other user will have others to suggest.
Musinux
Established Member
Posts: 59
Joined: Sun Jan 14, 2018 8:38 pm
Has thanked: 3 times
Been thanked: 3 times

Re: REW with Software EQ

Post by Musinux »

lilith wrote:[
What do I have to inlcude here that REW sees the input channel? BruteFIR looks pretty complicated, thanks for the tip.
Although I'm pretty sure you don't want to do it that way:


For this asoundrc, you have to load the snd-aloop module with

Code: Select all

sudo modprobe snd_aloop
or fill /etc/modprobe.d/sound.conf with

Code: Select all

options snd_aloop pcm_substreams=2 index=4
you can leave out the pcm_substreams and index options, but this is needed i.e. for consistent numbering of soundcards after reboots...

You have to point the !default device in .asoundrc (see below) to the loopback input device.

check with

Code: Select all

# playback devices
aplay -l 
# recording devices
arecord -l
# for advanced devices like hdmi
aplay -L
arecord -L
You'd have to route the physical in/outs to the loopback and out of it back to the physical in/outs.


To avoid timing issues and the unforseeable latency of alsa loopback in general, try it with the rather simple approach from the jack faq:

Code: Select all

pcm.!default {
    type plug
    slave { pcm "rawjack" }
}
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
 	description "JACK Audio Connection Kit"
    }
}
The !default entry ensures that after saving the .asoundrc everything uses the alsa->jack bridge.
Depending on your interface and setup, you only need to change the ports (system:playback_1...) to your channels.
Then in REW you just select the "default" device and that should be it.

If this doesn't work, you're probably missing some package named alsa-plugins or alsa-jack.

I know the faq mentions something about a more robust approach using the loopback method, this can be true for studio or recording stuff, but REW is "dumb" picking alsa devices, sample rates and such.

Btw, I have to use jack2 with REW when measuring since jack1 will kick REW because of timing issues.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

Musinux wrote:
lilith wrote:[
What do I have to inlcude here that REW sees the input channel? BruteFIR looks pretty complicated, thanks for the tip.
Although I'm pretty sure you don't want to do it that way:


For this asoundrc, you have to load the snd-aloop module with

Code: Select all

sudo modprobe snd_aloop
or fill /etc/modprobe.d/sound.conf with

Code: Select all

options snd_aloop pcm_substreams=2 index=4
you can leave out the pcm_substreams and index options, but this is needed i.e. for consistent numbering of soundcards after reboots...

You have to point the !default device in .asoundrc (see below) to the loopback input device.

check with

Code: Select all

# playback devices
aplay -l 
# recording devices
arecord -l
# for advanced devices like hdmi
aplay -L
arecord -L
You'd have to route the physical in/outs to the loopback and out of it back to the physical in/outs.


To avoid timing issues and the unforseeable latency of alsa loopback in general, try it with the rather simple approach from the jack faq:

Code: Select all

pcm.!default {
    type plug
    slave { pcm "rawjack" }
}
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
 	description "JACK Audio Connection Kit"
    }
}
The !default entry ensures that after saving the .asoundrc everything uses the alsa->jack bridge.
Depending on your interface and setup, you only need to change the ports (system:playback_1...) to your channels.
Then in REW you just select the "default" device and that should be it.

If this doesn't work, you're probably missing some package named alsa-plugins or alsa-jack.

I know the faq mentions something about a more robust approach using the loopback method, this can be true for studio or recording stuff, but REW is "dumb" picking alsa devices, sample rates and such.

Btw, I have to use jack2 with REW when measuring since jack1 will kick REW because of timing issues.
Hi,

thanks for your reply. Do I understand you correctly that method no. 2

Code: Select all

pcm.!default {
    type plug
    slave { pcm "rawjack" }
}
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
 	description "JACK Audio Connection Kit"
    }
}
is enough? I'll give it a trial as soon I find some time and do some reading first.
Musinux
Established Member
Posts: 59
Joined: Sun Jan 14, 2018 8:38 pm
Has thanked: 3 times
Been thanked: 3 times

Re: REW with Software EQ

Post by Musinux »

lilith wrote: is enough? I'll give it a trial as soon I find some time and do some reading first.
Yes, enough for room measurements with REW.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

Thanks!!! Just tested it and after some fiddling it works. I added the lines in .asoundrc
Then start Cadence, Jack and the alsa jack bridge.

Image

Then started REW and choose Default Device as output. After this a rawjack device appears in Catia and a EQ can be added in front of it.

Image
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: REW with Software EQ

Post by lilith »

edit: Working after reboot!


I wanted to use this again with an EQ to check the correction, but I don´t get it running anymore.
Added in -asoundrc again the following lines.

Code: Select all

pcm.!default {
    type plug
    slave { pcm "rawjack" }
}
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
}

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
    description "JACK Audio Connection Kit"
    }
}

Started Cadence, Jack and the Alsa bridge as I did last year. Started REW, choose Default Device, but no Jack Raw is coming up in Catia. ? I did the aplay test from JACK FAQ and that works, i.e.

Code: Select all

aplay -D pcm.jack ~/sound.wav
What else can I test to get this solved?
Post Reply