USB SPBLinux Stick

1. Setting up USB SPBLinux Stick – Initial Setup

After you have paid for your (((Acourate))), you will get the Acourate software and the BruteFIR in a USB stick. It is a SPBLinux OS with BruteFIR preinstalled by Uli and this will be the heart of your system.

Here are some of the initial steps to set it up.

Download rmprepusb, http://www.rmprepusb.com

After download and installation you have to follow 6 steps (it is assumed that the stick is inserted and shown by the system):

  1. MAX

  2. Definition of stick name

  3. Boot option Syslinux bootable

  4. FAT32 with bigger size sticks (common tody), boot as HDD

  5. no copy

  6. Button ‘Prepare Stick’

Window RMPARTUSB… = ok (please check again if the right drive is selected, e.g. drive = D:\)

Window ERASE DRIVE = ok

Window Choose syslinux option = No

Window Choose syslinux install folder = 3 + ok

Window OK to execute syslinux..exe = ok

After that there should be the file ldlinux.sys on the stick.

Copy all the existing files of the zip package onto the stick .

However, depending on your setup, you will need to make some adjustment. Be familiar with shell script, it will come into handy.

spbcfg

This is a configuration file the denotes some global setting of the OS and you will need to change snd according to the sound card you have. I have RME PCIe AES32, so I need to set

snd=snd-hdspm

you will also need to set the keys and language

keys=us

lng=us

The following is the full script for this file

#snd=snd-rme9652

snd=snd-hdspm

# access from outside disabled:

#

# allow/deny ftp, telnet, ssh access: yes/no

ftp=no

telnet=no

ssh=no

#

#net:config=1

#net:config=d

# addresses for net config 1 and 2:

#net:addr=192.168.1.1

#net:addr2=192.168.185.45

#

#

#keys= us or ge or sg or ru

keys=us

#language setting (used in mc user menu: F2)

#lng= us or ge

lng=us

startprog=echo

#startarg0=

#

#

addons:subdir=basics

addons:nouse=directfb

Start up

The system starts by looking up the file “go”. It is a shell script that instructs a number of script to run.

Typically, it looks like this

#!/bin/sh


echo 4096 > /proc/sys/dev/rtc/max-user-freq

echo 5 > /proc/sys/vm/laptop_mode

echo 1 > /proc/sys/kernel/sched_compat_yield


lcd " Ackcheng" "Nice to see you!"

sleep 5

lcd "Initializing" "Sound Card"


# Soundcard RME PCIe AES32

#RME AES32 initially with a default sample rate at 44.1KHz, in order

#to avoid error, we need to initiate the sound card with hdspae1

#first. hdspaes then instruct the sound card to do external clocking


hdspae1

sleep 3

hdspaes


# Start Script

r

Hdspae1 contains the following lines and is placed under the start folder

# sample clock source is autosync

#numid=2,iface=MIXER,name='Sample Clock Source'

# ; type=ENUMERATED,access=rw------,values=1,items=10

# ; Item #0 'AutoSync'

# ; Item #1 'Internal 32.0 kHz'

# ; Item #2 'Internal 44.1 kHz'

# ; Item #3 'Internal 48.0 kHz'

# ; Item #4 'Internal 64.0 kHz'

# ; Item #5 'Internal 88.2 kHz'

# ; Item #6 'Internal 96.0 kHz'

# ; Item #7 'Internal 128.0 kHz'

# ; Item #8 'Internal 176.4 kHz'

# ; Item #9 'Internal 192.0 kHz'

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 9 >> /alsa_report

Hdspaes contains the following lines and is placed under the start folder

######################

# Soundcard settings #

######################

# Dr. Ulrich Brueggemann 2007/04/04

#

# Info:

# alsa 1.0.14

# RME HDSPM AES32 I/O

# driver: snd=snd-hdspm

# digital: hw: 0

# input digital: channels: 16/0,1;

# output digital: channels: 16/0,1,2,3,4,5;

# sample: S24_4LE;

#

# Remark:

# hdspm will report the settings in file alsa_report

# in the root folder. If there are errors in the file hpsdm

# has to be corrected. This may happen with changes of soundcard

# revision or firmware. Then

# amixer contents > /contents

# allows to check for new settings in the file contents.

#

#************************************

#

#Clear Track Marker set to off

#numid=13,iface=MIXER,name='Clear Track Marker'

# ; type=BOOLEAN,access=rw------,values=1

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Clear Track Marker' off > /alsa_report

# Line Out is switched off, we run digital

#numid=9,iface=MIXER,name='Line Out'

# ; type=BOOLEAN,access=rw------,values=1

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Line Out' off >> /alsa_report

# normally we run without emphasis, see RME HDSP manual

#numid=10,iface=MIXER,name='Emphasis'

# ; type=BOOLEAN,access=rw------,values=1

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Emphasis' off >> /alsa_report

#Non audio set to off

#numid=11,iface=MIXER,name='Non Audio'

# ; type=BOOLEAN,access=rw------,values=1

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Non Audio' off >> /alsa_report

# professional bit, see RME HDSP manual

#numid=12,iface=MIXER,name='Professional'

# ; type=BOOLEAN,access=rw------,values=1

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Professional' on >> /alsa_report

#Double Speed Wire Mode set to single wire

#numid=14,iface=MIXER,name='Double Speed Wire Mode'

# ; type=ENUMERATED,access=rw------,values=1,items=2

# ; Item #0 'Single'

# ; Item #1 'Double'

#-------------------------------------------------------------

#amixer -c 0 cset iface=MIXER,name='Double Speed Wire Mode' 0 >> /alsa_report

#Quad Speed Wire Mode set to single wire

#numid=15,iface=MIXER,name='Quad Speed Wire Mode'

# ; type=ENUMERATED,access=rw------,values=1,items=3

# ; Item #0 'Single'

# ; Item #1 'Double'

# ; Item #2 'Quad'

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Quad Speed Wire Mode' 0 >> /alsa_report

#numid=6,iface=MIXER,name='System Sample Rate'

# ; type=INTEGER,access=r-------,values=1,min=0,max=0,step=0

# : values=44100

#-------------------------------------------------------------

#amixer -c 0 cset numid=6 192000 >> /alsa_report

#numid=5,iface=MIXER,name='AutoSync Reference'

# ; type=ENUMERATED,access=r-------,values=1,items=10

# ; Item #0 'WordClock'

# ; Item #1 'AES1'

# ; Item #2 'AES2'

# ; Item #3 'AES3'

# ; Item #4 'AES4'

# ; Item #5 'AES5'

# ; Item #6 'AES6'

# ; Item #7 'AES7'

# ; Item #8 'AES8'

# ; Item #9 'None'

#-------------------------------------------------------------

#amixer -c 0 cset iface=MIXER,name='AutoSync Reference' 0 >> /alsa_report

# Sync reference is set to Word

#numid=4,iface=MIXER,name='Preferred Sync Reference'

# ; type=ENUMERATED,access=rw------,values=1,items=9

# ; Item #0 'Word'

# ; Item #1 'AES1'

# ; Item #2 'AES2'

# ; Item #3 'AES3'

# ; Item #4 'AES4'

# ; Item #5 'AES5'

# ; Item #6 'AES6'

# ; Item #7 'AES7'

# ; Item #8 'AES8'

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Preferred Sync Reference' 0 >> /alsa_report

# sample clock source is autosync

#numid=2,iface=MIXER,name='Sample Clock Source'

# ; type=ENUMERATED,access=rw------,values=1,items=10

# ; Item #0 'AutoSync'

# ; Item #1 'Internal 32.0 kHz'

# ; Item #2 'Internal 44.1 kHz'

# ; Item #3 'Internal 48.0 kHz'

# ; Item #4 'Internal 64.0 kHz'

# ; Item #5 'Internal 88.2 kHz'

# ; Item #6 'Internal 96.0 kHz'

# ; Item #7 'Internal 128.0 kHz'

# ; Item #8 'Internal 176.4 kHz'

# ; Item #9 'Internal 192.0 kHz'

#-------------------------------------------------------------

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 0 >> /alsa_report

#numid=3,iface=MIXER,name='System Clock Mode'

# ; type=ENUMERATED,access=r-------,values=1,items=2

# ; Item #0 'Master'

# ; Item #1 'Slave'

#-------------------------------------------------------------

#amixer -c 0 cset iface=MIXER,name='System Clock Mode' 1 >> /alsa_report

#***********************

# Channel Connections *

#***********************

# 32768 = 0 dB

#numid=24,iface=MIXER,name='Chn',index=1

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=25,iface=MIXER,name='Chn',index=2

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=26,iface=MIXER,name='Chn',index=3

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=27,iface=MIXER,name='Chn',index=4

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=28,iface=MIXER,name='Chn',index=5

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=29,iface=MIXER,name='Chn',index=6

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=30,iface=MIXER,name='Chn',index=7

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=31,iface=MIXER,name='Chn',index=8

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=32,iface=MIXER,name='Chn',index=9

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=33,iface=MIXER,name='Chn',index=10

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=34,iface=MIXER,name='Chn',index=11

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=35,iface=MIXER,name='Chn',index=12

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=36,iface=MIXER,name='Chn',index=13

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=37,iface=MIXER,name='Chn',index=14

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=38,iface=MIXER,name='Chn',index=15

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#numid=39,iface=MIXER,name='Chn',index=16

# ; type=INTEGER,access=rw------,values=1,min=0,max=65536,step=1

#-------------------------------------------------------------

amixer -c 0 cset numid=24 32768 >> /alsa_report

amixer -c 0 cset numid=25 32768 >> /alsa_report

amixer -c 0 cset numid=26 32768 >> /alsa_report

amixer -c 0 cset numid=27 32768 >> /alsa_report

amixer -c 0 cset numid=28 32768 >> /alsa_report

amixer -c 0 cset numid=29 32768 >> /alsa_report

amixer -c 0 cset numid=30 32768 >> /alsa_report

amixer -c 0 cset numid=31 32768 >> /alsa_report

amixer -c 0 cset numid=32 32768 >> /alsa_report

amixer -c 0 cset numid=33 32768 >> /alsa_report

amixer -c 0 cset numid=34 32768 >> /alsa_report

amixer -c 0 cset numid=35 32768 >> /alsa_report

amixer -c 0 cset numid=36 32768 >> /alsa_report

amixer -c 0 cset numid=37 32768 >> /alsa_report

amixer -c 0 cset numid=38 32768 >> /alsa_report

amixer -c 0 cset numid=39 32768 >> /alsa_report

# please leave commented to disable mixer control

#numid=1,iface=HWDEP,name='Mixer'

# ; type=INTEGER,access=rw------,values=3,min=0,max=65535,step=1

#-------------------------------------------------------------

#amixer -c 0 cset numid=1 0,0,0 >> /alsa_report

#amixer -c 0 cset numid=1 1,1,0 >> /alsa_report

#amixer -c 0 cset numid=1 2,2,0 >> /alsa_report

#amixer -c 0 cset numid=1 3,3,0 >> /alsa_report

#amixer -c 0 cset numid=1 4,4,0 >> /alsa_report

#amixer -c 0 cset numid=1 5,5,0 >> /alsa_report

r contains the following lines and is placed under the start folder

#!/bin/sh

sleep 1

BfirStarted="xxxxx xxxxx xxxxx xxxxx xxxxx"

BfirStartStatus="x"

while true ; do

echo

echo

echo " [34;1mAudioVero[0m"

echo " [33;1m(((acourate)))[0m [33;1mR[0moom [33;1mC[0morrection 200[33;1m6[0m (44.1 kHz)"

echo "[32;1m(Filter TestA) by Dr. Ulrich Brueggemann and[0m"

schedtool -R -p 97 -e brutefir.rt -nodefault /audiovero/brutefir/dcorr192

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

sleep 3

done

2. Setting up USB SPBLinux Stick – Digital Volume Control

Many have a lot of comments about Digital volume control. However, if done right, digital volume control sounds far better than analog volume control, especially in terms of accurate tracking and channel matching. BruteFIR allows digital attenuation at 64 bit floating point calculation at any number of channels. Furthermore, this calculations are done with the general DSP with proper dithering, reducing error to minimal. In my experience, if you can limit the change in volume to <15dB, you have the best volume control in the world. Cics has but up some very interesting information about DVC here

Setting this up in BruteFIR is not that difficult. You can even remote control it with iMon. But it does involve a bit of shell programming. First, use the following command to get access to the LIRC setting

changebz2 /audiovero/spblinux/basics/lcdlirc.bz2

Then, locate the file “Lircrc”. This is the file the tells the computer which remote button is for what function. Once you exit from mc, you should also press yes to save the changes for it to function properly next time you load.

Add the following 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

These lines basically instruct the computer to run the Volplus and Volmin script when the corresponding button is pressed. Now you need to add Volplus and Volmin script in the /usr directory

Volplus

val1=`head -n1 /av`

val2=`tail -n1 /av`

v=`echo "lf" | nc localhost 3000|grep 'to outputs: 0/'|cut -d '/' -f2|cut -d "." -f1`

tmp=`expr $v - 1`

if [ $tmp -lt 0]; then

tmp=0

else

if [ $tmp -gt 15]; then

tmp=15

fi

fi

lcd “Volume = -$tmp dB”

echo "cfoa 0 0 $tmp;cfoa 1 1 $tmp;cfoa 2 2 $tmp;cfoa 3 3 $tmp;cfoa 4 4 $tmp;cfoa 5 5 $tmp;cfoa 6 6 $tmp;cfoa 7 7 $tmp;quit " | nc localhost 3000 > /dev/null

sleep 2

lcd "$val1" "$val2"

Volmin

val1=`head -n1 /av`

val2=`tail -n1 /av`

v=`echo "lf" | nc localhost 3000|grep 'to outputs: 0/'|cut -d '/' -f2|cut -d "." -f1`

tmp=`expr $v + 1`

if [ $tmp -lt 0]; then

tmp=0

else

if [ $tmp -gt 15]; then

tmp=15

fi

fi

lcd “Volume = -$tmp dB”

echo "cfoa 0 0 $tmp;cfoa 1 1 $tmp;cfoa 2 2 $tmp;cfoa 3 3 $tmp;cfoa 4 4 $tmp;cfoa 5 5 $tmp;cfoa 6 6 $tmp;cfoa 7 7 $tmp;quit " | nc localhost 3000 > /dev/null

sleep 2

lcd "$val1" "$val2"

On the r script, there are also some lines dedicated to set up the initial volume. Please see above.

3. Automatic samplerate convertion

Uli has created a nice script to allow this. But I have not tested this before.

#!/bin/sh

echo 4096 > /proc/sys/dev/rtc/max-user-freq

echo 5 > /proc/sys/vm/laptop_mode

echo 1 > /proc/sys/kernel/sched_compat_yield

/jstop > /dev/null 2> /dev/null #kill jconv *old*

# digital in, digital out, analog out

hdspadat

# define global variable samplerate

samplerate=""

# function to set sample rate

SETSAMPLERATE () {

samplerate=`amixer cget iface=MIXER,name='External Rate' | grep ": values" | cut -d= -f2-`

case "$samplerate" in

'1')

echo "Start CorSscript at 44.1 kHz"

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 2 >> /alsa_report #first set to detected samplerate

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 0 >> /alsa_report #then switch back to autosync

schedtool -R -p 97 -e brutefir.rt -nodefault /audiovero/brutefir/conf_44 &

;;

'2')

echo "Start CorSscript at 48 kHz"

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 3 >> /alsa_report #first set to detected samplerate

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 0 >> /alsa_report #then switch back to autosync

schedtool -R -p 97 -e brutefir.rt -nodefault /audiovero/brutefir/conf_48 &

;;

'4')

echo "Start CorSscript at 88.2 kHz"

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 5 >> /alsa_report #first set to detected samplerate

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 0 >> /alsa_report #then switch back to autosync

schedtool -R -p 97 -e brutefir.rt -nodefault /audiovero/brutefir/conf_88 &

;;

'5')

echo "Start CorSscript at 96 kHz"

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 6 >> /alsa_report #first set to detected samplerate

amixer -c 0 cset iface=MIXER,name='Sample Clock Source' 0 >> /alsa_report #then switch back to autosync

schedtool -R -p 97 -e brutefir.rt -nodefault /audiovero/brutefir/conf_96 &

;;

esac

}

# main loop

while true

do

sleep 1

samplerate_new=`amixer cget iface=MIXER,name='External Rate' | grep ": values" | cut -d= -f2-`

if [ "$samplerate_new" != "$samplerate" ] ; then

echo

echo

echo "New samplerate detected, is: "$samplerate_new

echo "Previous samplerate was:"$samplerate

killall brutefir.rt > /dev/null 2> /dev/null

SETSAMPLERATE

samplerate_new=`amixer cget iface=MIXER,name='External Rate' | grep ": values" | cut -d= -f2-`

echo "Ssamplerate is set to: "$samplerate_new

echo

fi

done