ffmpeg -ac 1 -f alsa -i plughw:2 -filter_complex "compand=attacks=0:points=-30/-900|-20/-20|0/0|20/20" -f alsa plughw:2
I gave up trying to work out sox but ffmpeg seems to work
I think also the ALC/AGC of ffmeg is also much better than any other but does have latency.
ffmpeg -ac 1 -f alsa -i plughw:2 -filter:a loudnorm -f alsa plughw:2