I'm working on a Raspberry Pi home cinema setup that has an equalizer and a compressor already running successfully.
Now I want to add some sort of VU meter (this is all on a headless Pi) to assess the compression levels, both reduction as well as makeup.
I'm a beginner to ALSA. I thought it should be possible, since devices in ALSA can be freely chained together, to add two separate loopback devices into the chain, one before the compressor, and one after. Then record sound levels between them and calculate volume differences. Negative means compression, positive means makeup etc.
But I can't get it to work because ALSA is not easy to use by foot.
Below you find my current asound.conf. The two loopback devices are defined, but all wrong, so they're being bypassed at the moment.
How can I make it work?
Thank you!
pcm.!default{typeplug#link:slave.pcmplugequal;}ctl.!default{typehwcard0}###Equalizerctl.equal{typeequal;controls"/home/pi/.alsaequal.bin"}pcm.plugequal{typeequal;#link:#currentlybypassingloop1slave.pcm"plugcompressor";controls"/home/pi/.alsaequal.bin"}pcm.equal{typeplug;slave.pcmplugequal;}###Loopback1pcm.loopout1{typedmixipc_key328211#link:slave.pcm"plugcompressor"}pcm.loopin1{typedsnoopipc_key686592slave.pcm"hw:1,1,0"}pcm.loop1 { type plug slave { pcm { type asym playback.pcm "loopout1" capture.pcm "loopin1" } }}### Compressorctl.compressor { type equal; library "/usr/lib/ladspa/sc4m_1916.so"; module "sc4m";}pcm.plugcompressor { type equal; #link: # currently bypassing loop2 slave.pcm "plug:softvol"; library "/usr/lib/ladspa/sc4m_1916.so"; module "sc4m";}pcm.compressor { type plug; slave.pcm plugcompressor;}### Loopback 2pcm.loopout2 { type dmix ipc_key 219345 slave.pcm "hw:Loopback,0,0"}pcm.loopin2 { type dsnoop ipc_key 219346 slave.pcm "hw:Loopback,0,1"}pcm.loop2 { type plug slave { pcm { type asym playback.pcm "loopout2" capture.pcm "loopin2" } }}### Soft Volumepcm.softvol { type softvol slave { pcm "dmix" #redirect the output to dmix (instead of "hw:0,0") } control { name "PCM"#overridethePCMslidertosetthesoftvolvolumelevelgloba$card0}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I'm working on a Raspberry Pi home cinema setup that has an equalizer and a compressor already running successfully.
Now I want to add some sort of VU meter (this is all on a headless Pi) to assess the compression levels, both reduction as well as makeup.
I'm a beginner to ALSA. I thought it should be possible, since devices in ALSA can be freely chained together, to add two separate loopback devices into the chain, one before the compressor, and one after. Then record sound levels between them and calculate volume differences. Negative means compression, positive means makeup etc.
But I can't get it to work because ALSA is not easy to use by foot.
Below you find my current asound.conf. The two loopback devices are defined, but all wrong, so they're being bypassed at the moment.
How can I make it work?
Thank you!