Monday, May 26, 2008

Brutefir Volume Control

It has been awhile since I updated this blog. Well, there has been some busy time and I am working on a memory player based on Linux. Not easy, but I have heard it and the sound is just amazing. I am just trying to make it easier to run. One of the step I take is to prepare a volume control based on BruteFIR configuration file. It runs via CLI. Here you are

Go to "Go"
Add line

Vol=20 # Set initial volume
echo $Vol > /Vol.txt


Go to "Lircrc"
Add lines

begin
prog = iMON-PAD
button = Vol+
prog = irexec
repeat = 0
config = /usr/Volplus
end

begin
prog = iMON-PAD
button = Vol-
prog = irexec
repeat = 0
config = /usr/Volmin
end

Add file "Volplus"

v=`grep [0123456789] /Vol.txt`
tmp=`expr $v - 1`

if [ $tmp -lt 0]; then
tmp="0"
fi

lcd "Volume = -$tmp dB"
echo “cfoa 0 0 $tmp;cfoa 1 1 $tmp” nc localhost 3000 > /dev/null
echo $tmp > /Vol.txt

Add file "Volmin"

v=`grep [0123456789] /Vol.txt`
tmp=`expr $v + 1`

if [ $tmp -lt 0]; then
tmp="0"
fi

lcd "Volume = -$tmp dB"
echo “cfoa 0 0 $tmp;cfoa 1 1 $tmp” nc localhost 3000 > /dev/null
echo $tmp > /Vol.txt

Inside brutefir loading program add the following

echo " [32;1m(f4 44) by Uli Brueggemann and [0m"

schedtool -R -p 98 -e brutefir.orig -nodefault /audiovero/brutefir/f4corr44

bf_started = $(pidof brutefir.orig) # check for process id number

while [ -z"$bf_started"]; do # if zero then wait in loop
bf_started = $(pidof brutefir.orig) # check for process id number
done # end of while

echo "cfoa 0 0 20;cfoa 1 1 20" nc localhost 3000 > /dev/null

# Enable to stop script by Ctrl-c/Strg-c
sleep 3

This is working very well. Currently I still have the passive preamp connected and I can A/B test

1. Max BruteFir vol + Min passive vol

2. Min BruteFir vol + Max passive vol

I have found that setup 2 is not very good when the attenuation is too much.