Skip to content

Installation on Linux

pavhofman edited this page Jun 5, 2019 · 15 revisions

Installation For Octave 5.1 on Linux Ubuntu 18.04 Bionic/Linux Mint 19

The Measurement Chain

The measurement chain will have the following structure: Arta -> arta_loop [->] octave_loop -> mainPlay.m -> your soundcard playback -> DUT/calibration adapter -> your soundcard capture -> mainRec.m -> octave_loop [->] arta_loop -> Arta

Compiling Octave 5.1

  • Octave 5.1 still has no PPA deb package, must be compiled
  • However the compilation process is simple on Ubuntu Bionic
  • Add the newly compiled and installed octave to path
echo 'PATH=$PATH:/usr/local/OCTAVE/5.1.0/bin/' >> ~/.profile
  • Run bash again for the added path to take effect, check with
echo $PATH

Installing Required Octave Packages

  • Compile and test playrec.mex
  • Install required octave packages for the compensation. First install required header libraries and tools for compilation:
sudo apt-get install  libzmq5-dev libpq-dev units
  • Start octave (either commandline version or gui with octave --gui) and call in octave in the following order:
pkg install -forge -verbose general
pkg install -forge -verbose struct
pkg install -forge -verbose control
pkg install -forge -verbose miscellaneous
pkg install -forge -verbose zeromq
pkg install -forge -verbose io
pkg install -forge -verbose statistics
pkg install -forge -verbose optim
wget https://sourceforge.net/p/octave/package-releases/372/attachment/database-2.4.4.tar.gz

In octave:

pkg install -verbose database-2.4.4.tar.gz

Configuring Alsa Loop

  • Load snd-aloop module
sudo modprobe snd-aloop
  • Load the module permanently
sudo bash -c "echo snd-aloop >> /etc/modules-load.d/modules.conf"

Naming Loop Devices

  • Create local alsa config ~/.asoundrc
cat > ~/.asoundrc <<'_EOF'
pcm.octave_loop {
  type hw
  card "Loopback"
  device 0
  format S32_LE
  channels 2
}

pcm.arta_loop {
  type hw
  card "Loopback"
  device 1
  format S32_LE
  channels 2
}
_EOF

Disabling the Needed Sound Devices in Pulseaudio

Pulseaudio (PA) is very greedy and acquires (keeps open) any soundcard (including loopback cards) it finds. It does it randomly, causing weird complications. Fortunately PA can be told to ignore any soundcard.

  • Open the PA config screen (right-click on the speaker icon -> Settings or run pavucontrol (sudo aptitude install pavucontrol)
  • -> Hardware tab -> for your soundcard and the loopback cards set "Off" (or "Disable", always the last item of the selection).

Installing & Configuring Wine

  • Arta requires windows emulation layer Wine
  • Default wine configuration uses pulseaudio -> change to alsa
  • Default alsa driver offers only soundcards, no PCM devices -> configure register entries (for details see Wine Alsa Configuration)
sudo apt-get install winehq-stable winetricks
winetricks sound=alsa
wine reg ADD 'HKCU\Software\Wine\Drivers\winealsa.drv' /v ALSAOutputDevices /t REG_MULTI_SZ /d arta_loop
wine reg ADD 'HKCU\Software\Wine\Drivers\winealsa.drv' /v ALSAInputDevices /t REG_MULTI_SZ /d arta_loop

Installing, Configuring, and Checking Arta

Download Arta from Arta download page and run the installer in wine

cd ~
wget http://www.artalabs.hr/download/ArtaSetup192.exe
wine ArtaSetup192.exe
  • Run Arta from main menu
  • Check Arta with your soundcard: select your device for playback/capture, connect analog loop, start Arta generator and check arta spectrum
  • Setup your soundcard playback/capture levels and playback/capture ports (key 'M' (un)mutes, 'space' selects inputs):
alsamixer -c YOUR_CARD_ALSA_ID
  • When the soundcard is correctly configured, switch Arta devices to In: arta_loop, Out: arta_loop

Installing & Configuring the Compensation Tool

  • Clone github repo, copy compiled playrec.mex to the octave directory:
cd ~/work
git clone https://github.com/pavhofman/nonlinear-compensation.git
cp ~/work/playrec/playrec.mex ~/work/nonlinear-compensation/octave/

Configuring the Tool

  • Find Out Playrec IDs of Sound Devices:
cd ~/work/nonlinear-compensation/octave
octave mainListPlayrecDevs.m
  • From the list remember IDs of octave_loop and your HW soundcard devices and enter them into the config files copied from examples. The example config options are explained in their comments. Basically just configure playrec IDs for recording and playback devices for each direction. In most cases they will be the same for each direction, just swapped.

  • Note: xed is graphical Mint Mate editor, use any editor you like.

cp configRec.m.example configRec.m
cp configPlay.m.example configPlay.m
xed configRec.m
xed configPlay.m
You can’t perform that action at this time.