Linux Mint + KXStudio Audio Production setup

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Level 1
Level 1
Posts: 5
Joined: Sat Sep 20, 2014 2:16 am

Linux Mint + KXStudio Audio Production setup

Post by asbak »

Here's a tutorial I wrote on getting LM17 working with KXStudio, jackd, low-latency kernel, wine-rt and some other audio applications and hardware.

Mint 17 + KXStudio + Audio Related installation HOWTO


Linux Mint + KXStudio HOWTO v0.0.3


1. Choosing a Linux OS
2. Choosing an audio base distribution / repository
3. Audio Hardware

4. Basic Computer Hardware Requirements
5. Basic OS Configuration required in order to get audio related hardware and software to work
6. A list of current and still in development basic audio software building blocks

7. Linux Mint customisation Instructions
7.1.1 Performance tuning for Wine & WineASIO
7.1.2 Using chrt to alter the scheduling policy and priority of the wineserver process
7.2 Stress testing Carla in order to locate issues and improve system performance

8. KXStudio installation instructions
9. Jackd installation instructions
10. Setting up the audio interface in jackd
11. Disabling Pulseaudio (if required)

12. KXStudio Usage & HOWTO
12.1 Cadence - danboid's manual
12.2 Carla
12.3 Catia
12.4 Claudia
12.5 Distrho plugins for KXStudio (related project)
12.6 Using jalv to load a single lv2 instrument
12.7 xxxxxxxxxxx

13. Installing audio packages and plugins from Ubuntu or KXStudio Repositories
13.1 ALSA Modular Synth

14. Installing additional audio packages and plugins
14.1 Installing Linuxsampler
14.2 Installing X42
More here ... /
14.3 Semantic plugins
14.4 Infamous plugins
14.5 Qmidinet
14.6 Jackass
14.7 Additional Plugins
14.8 Yet Moar Plugins
14.9 AMS (ALSA Modular Synth) Plugins
14.10 Aeolus Pipe Organ
14.11 Denemo (Lilypond GUI)

15. Plugins available for Linux
15.1 List of plugs from Fedora Jam ... _Utilities

16. The names and locations of important and oft used logfiles for diagnostic purposes
17. The names and locations of important audio related configuration files
17.1 Jackd, Cadence, ALSA, Pulseaudio

18. KXStudio usage examples
18.1 Using Rosegarden Sequencer & Carla to play MIDI files to a Fluid R3 virtual GM soundmodule
18.2 Continuation of 18.1 + addition of Guitarix for guitar signal processing

19. Misc useful Audio Related Guides
19.1 Jack networking tutorial by tangerine: ... 818#p55283
19.2 Wine & WineRT notes by tangerine: ... 47&t=12832

20. Known issues, bugs, missing or desired features
20.1 Carla & MIDI Omni (Currently MIDI channels cannot be muted inside Carla when using a soundfont plugin such as Fluid R3, adding per channel MIDI mute is being considered)
20.2 Cadence not always starting jack (possible jackdbus issue?)

21. Issues / Bugs
21.1 Linux Mint OS Problems
21.2 apt / dpkg packager issues
21.3 Audio Application Problems
21.3.1 Rakarrack Distortion Problem in version 0.6.1
21.4 Spyware issues

22. Additional Music Software of interest
22.1 Nootka Guitar Training
22.2 Lilypond Scoring http://lilypond.or
22.3 Denemo Scoring
22.4 Puredata Extended Installation on LM17
22.5 Ingen

23. Hardware Hacking
23.1 Linux Audio on USB TV Stick devices
23.2 Linux Mint on a Macbook + USB Flash Drive
23.3 Running multiple audiocards in Jackd

24. Tips and Tricks
24.1 Festige and startup scripts

25. TBD


1. For this HOWTO Linux Mint is being used because it's developed on a mature codebase (Debian / Ubuntu) which has a lot going for it, it is user friendly and afaik is not crammed with spyware and proprietary developments as is increasingly becoming the case with Ubuntu. There are alternatives like Arch Linux. I'm not familiar with it and hence cannot provide Arch specific information. (If any Arch users would like to write it up I'll happily add it)

2. Two of the main distros out there which work well are AVLinux and KXStudio.
AVLinux is developed on a Debian platform and released as a full distribution. KXStudio is Ubuntu based and released as a full distribution. The aim of this particular HOWTO is to "roll one's own" using Linux Mint + adding the KXStudio Environment to it.

3. Audio Hardware.

There's a (somewhat lacking in details?) list of audio hardware for Linux listed at the ALSA project.

From personal experience an Edirol UA-25 appears to work (audio & MIDI) with Jackd. A Behringer UMC404 also appears to work (audio & MIDI). I've not made a serious attempt to use the Behringer at higher samplerates (> 48000) and I haven't done extensive testing with it. On my slow computer it experiences the occasional xrun during normal usage and clicking around but so far, so good.

If you have any experience with other audio devices, please confirm whether audio / MIDI works under jack and I'll add them to the list.

Carefully consider what soundcard will best suit your needs. Audio Device support under Linux is unfortunately not as good as under Windows and OSX. Pay attention to what sample rates are supported and whether the soundcard will function at 24bit which gives a wider dynamic range.

4. Basic Hardware requirements.

A reasonably modern PC with at least 4GB of RAM.
One of your biggest enemies under Linux + Jack is xruns. In order to keep these to a minimum you want a suitable audio interface, the fastest disk drive you can afford (7200 rpm or a SSD) to speed up system IO and you should then also look at whether your system's performance can be improved via system tuning. Mounting partitions with the "noatime" setting may or may not slightly improve disk IO.

5. Basic OS Requirements

In this case we're using Linux Mint 17. You should preferably use the 64bit version. The 32bit version appears to be suffering from some small glitches which were probably introduced by Ubuntu. (dropcaches issues, slowdowns during updates etc).

6. Basic Software Components:

Rosegarden, Ardour, KXStudio software suite, Jackd, Wine-rt, Denemo / Lilypond (scoring), Audacity, Rackarrak, Guitarix, Linuxsampler and many more.

7. Mint Customisation
Standard Linux distributions don't come with Jackd (essential for responsive, low latency audio) or lowlatency kernels and these need to be added. A realtime kernel used to be available but it appears to have since been superceded by the lowlatency kernel for various technical and maintenance reasons. As far as I know one can install different versions of the lowlatency kernel on one's system. Personally I'd stick to using the latest stable release versions.

Installing jack
*NOTE, before running this you may also rather want to look at the installing KXStudio section where I've used jackd2 instead. Afaik falkTX uses jackd1

Before running this first determine whether you're planning on using jack1 or jack2

Code: Select all

apt-get install jackd jackd1 pulseaudio-module-jack a2jmidid qjackctl
Installing the lowlatency kernel

The lazy way

Code: Select all

sudo apt-get install linux-lowlatency
The manual way

Download the required .deb files from here, try sticking to the kernels for your particular release version of Ubuntu (14.04 for example) or else you may run into complications down the road.

Download the latest stable versions of:
(You'll have to substitute the 32bit versions for the amd64.deb files if you're using a 32bit installation)

linux-headers____all.deb (for both 32-bit and 64-bit)
linux-headers____amd64.deb (64-bit)
linux-image______amd64.deb (64-bit)

Installation order (IMPORTANT, follow this order only)

1. linux-headers____all.deb
2. linux-headers____amd64.deb
3. linux-image______amd64.deb

#dpkg -i linux-headers____all.deb
#dpkg -i linux-headers____amd64.deb
#dpkg -i linux-image______amd64.deb

Install all these packages without rebooting.

Update the GRUB bootloader (in case this wasn't already done)

Code: Select all

Reboot computer

Code: Select all

shutdown -r now
Check the kernel after the reboot

Code: Select all

uname -a
It should show that a lowlatency kernel has been installed.

In case you wanted to remove the newly installed kernel identify the relevant packages

Code: Select all

dpkg --get-selections | grep linux-headers
dpkg --get-selections | grep linux-image
and remove them (as root user or use sudo)

Code: Select all

apt-get remove --purge linux-headers____all.deb  linux-headers____amd64.deb  linux-image______amd64.deb

Further tweaks

1 - add your username to the audio group and disk group

Code: Select all

sudo usermod -a -G audio `whoami`
sudo usermod -a -G disk `whoami`
2 - add these values to /etc/security/limits.conf

Run these as root user or use sudo
*replace "username" with your own user

Code: Select all

echo "@audio - rtprio 90" >> /etc/security/limits.conf
echo "@audio - memlock unlimited" >> /etc/security/limits.conf
echo "username        soft    nofile           100000" >> /etc/security/limits.conf
echo "username        hard    nofile           100000" >> /etc/security/limits.conf
3 - Check the audio.conf file

cat /etc/security/limits.d/audio.conf

In case the entry doesn't exist, add it

Code: Select all

echo "@audio   -  rtprio     90" >> /etc/security/limits.d/audio.conf
echo "@audio   -  memlock    unlimited" >> /etc/security/limits.d/audio.conf 
4 - /etc/pam.d/common-session

Add this line

Code: Select all

echo "session required" >> /etc/pam.d/common-session
Test and check the above with the commands

Code: Select all

ulimit -n
ulimit -a
cat /proc/sys/fs/file-max 
5 - To set your CPU to performance mode

To reduce xruns use performance mode instead of the ondemand setting

Code: Select all

echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
Repeat this depending on how many cpu cores your system has.
Alternatively, there are other ways to change your CPU Frequency either via a taskbar widget or some kind of startup script.

6 - Ensure that realtime priority is set to a high value ie > 85 in Cadence or Qjackctl

7 - Experiment with setting the soundcard Periods to 3

8 - Try setting the CPU Scheduler Policy to FIFO and priority to a high value > 90 (Experiment)

7.1.1 Performance tuning for Wine and WineASIO

It can be a challenge to prevent xruns when running Windows VST instruments in Carla. Here are some things to check and set to improve the situation
In order to get better Wine performance for Windows VST plugins you should use wine-rt (realtime). In order to get this installed you'll need to remove previous wine versions which may already be present on your system.

Check what's installed

Code: Select all

dpkg --get-selections | grep wine
locate libwine
Search for the wine-rt packages

Code: Select all

apt-cache search wine-rt
How to uninstall previous wine versions for example wine1.7 and wine1.7-i386

Code: Select all

dpkg -r wine1.7 wine1.7-i386
Check what's installed

Code: Select all

dpkg --get-selections | grep wine
If the wine1.7 and wine1.7-i386 packages are marked as "deinstall" you can get rid of this by doing

Code: Select all

apt-get --purge remove wine1.7
apt-get --purge remove wine1.7-i386
If this still fails to get rid of them try this
List packages in "deinstall" state

Code: Select all

dpkg --get-selections | grep deinstall | cut -f1
Remove deinstall packages with

Code: Select all

dpkg --purge `dpkg --get-selections | grep deinstall | cut -f1`
You may as well update your system at this point

Code: Select all

apt-get update
Install wine-rt

Code: Select all

apt-get install wine-rt winetricks
If you didn't remove wine1.7 as outlined above apt will warn that wine1.7 and wine1.7-i386 will be removed.
The installation may fail on Debian if previous wine versions weren't first removed.

Check what wine versions are now installed

Code: Select all

dpkg --get-selections | grep wine
It should show wine-rt installed

Another potential tweak to improve performance is via this method described by tangerine
1. Wine performance for real-time audio is possible to improve by increasing priority of the "wineserver" process. You can do this directly from the System Monitor, right-clicking on "wineserver", choosing "Set Priority" and then switching CPU Scheduler to "FIFO". I went from ~92% DSP load with peaks causing xruns every few seconds to stable 77%, no variation, no peaks, no xruns. ... 47&t=12832

7.1.2 Using chrt to alter the scheduling policy and priority of the wineserver process

In an attempt to reduce xruns and boost wineserver performance we're going to bump it to a higher scheduling priority and make use of the FIFO scheduling policy instead.

View wineserver's current settings

Run as your userid

Code: Select all

chrt -p `ps -ef | grep wineserve[r] | awk '{print $2}'`
pid 3103's current scheduling policy: SCHED_OTHER
pid 3103's current scheduling priority: 0
Let's change SCHED_OTHER to SCHED_FIFO and priority to 95 (You'll have to experiment with priority values)

Code: Select all

sudo chrt -f -p 95 `ps -ef | grep wineserve[r] | awk '{print $2}'`

Code: Select all

chrt -p `ps -ef | grep wineserve[r] | awk '{print $2}'`
pid 3103's current scheduling policy: SCHED_FIFO
pid 3103's current scheduling priority: 95
Check whether or not this reduces xruns on your system.
In case you wanted to set wineserver back to its original values

Code: Select all

chrt -o -p 0  `ps -ef | grep wineserve[r] | awk '{print $2}'`

Changing the scheduler policy and priority has not fully resolved xrun issues on my system so your mileage may vary.
Here are some settings for reasonable results I've been able to achieve with Synth1 VST + Wine-RT. The odd xrun still occurs and the system is not stable enough for live use of Windows VST's.

Jack Realtime Priority 85 (you can vary this number)
Sample Rate 48000
Buffer 256
Periods 3
WineASIO buffer size setting in *Cadence 256
CPU Scaling set to Performance
wineserver scheduling policy set to SCHED_FIFO and scheduling priority set to 99

*I'm experiencing mixed results on my particular system using Cadence. You could use Qjackctl or start jackd from the command line as an alternative, in case needed.

Further info on wine-rt
What is it?
2 The Wine-RT patch allows programs that use windows' concept of thread priority to gain similar functionality under linux. It maps windows priority levels to linux scheduling policies. THREAD_PRIORITY_ABOVE_NORMAL, THREAD_PRIORITY_HIGHEST and THREAD_PRIORITY_TIME_CRITICAL levels which are made to run as linux SCHED_FIFO threads at priority levels that are defined by the WINERT variable. THREAD_PRIORITY_NORMAL threads are run as normal linux threads (as all threads are without the patch), and the priorities below normal (THREAD_PRIORITY_BELOW_NORMAL, THREAD_PRIORITY_LOWEST) are run as SCHED_BATCH. THREAD_PRIORITY_IDLE threads are run as SCHED_IDLE.
3 Windows' concept of priority classes is not implemented at all.
5 Please note that threads running SCHED_FIFO might hang your entire system, so please exercise caution!
7 How does it work?
8 When a windows program asks for a thread to be run at a higher priority, Wine will ask the linux system to schedule it as a SCHED_FIFO thread, which means that the tread will keep on executing until it has either finished, voluntarily yields execution or gets preempted by a higher priority SCHED_FIFO thread. This is already done by many linux audio applications, to ensure less xruns on lower buffer sizes. With Wine-RT, the same thing can be done for Wine applications.
10 How to use it?
11 The Wine-RT functionality is not enabled by default. Instead it is controlled by 2 environment variables "WINE_RT" and "WINE_SRV_RT".
13 The "WINE_RT" variable has 2 purposes, it has to be set in order to activate the patch, and it determines the priority of the SCHED_FIFO threads, Its value can be set from 1 to your system's rtprio max value minus 10, as set in limits.conf or limits.d/audio.conf. (In Debian, Ubuntu and KXStudio this value is 99). THREAD_PRIORITY_ABOVE_NORMAL threads will run at this priority level, THREAD_PRIORITY_HIGHEST threads at this level + 5, and THREAD_PRIORITY_TIME_CRITICAL threads at this level + 10.
15 WINE_SRV_RT makes the wineserver main thread run SCHED_FIFO. Valid values range from 1 to your system's rtprio max value.
17 We can set these variables in 2 simple ways.
18 First one is using a terminal with "exports", like this:
19 export WINE_RT=#
20 export WINE_SRV_RT=#
21 wine <app>
23 or just prefix your application with 'env VARIABLE=value', like this:
24 env WINE_RT=# WINE_SRV_RT=# wine <app>
26 A recommended starting point might be "env WINE_RT=15 WINE_SRV_RT=10 wine appname.exe". ... ME.WINE-RT

7.2 Stress testing Carla in order to locate issues and improve system performance

It's useful to conduct load tests on system components in order to show up previously hidden issues which impact system performance.
One simple but effective test (at least, it is effective on my low powered system) is to run Obxd in Carla and to select the 006_BzPAD_Bright Wave patch.
(Refer to section 12.6 dealing with Obxd and jalv and follow the URL's listed there to obtain and install the Obxd patch bank)

The 006 Bright Wave patch appears to be a resource killer and xrun instigator whilst the other patches aren't as aggressive.

Checklist of possible causes

- #1 Check Cadence and whether the CPU Scaling Governor has been set to Performance Mode. Ondemand mode = xrun hell. This problem may not manifest itself under lighter load conditions but sooner or later you'll probably run into it.
- #2 Check your Soundcard settings and experiment with different Sample Rates, Buffer Sizes and Periods
- #3 use "top" to determine whether any processes are actively chewing up your system resources
- #4 Disable Wifi (this can sometimes cause issues)
- #5 Check that Realtime priority in Cadence or Qjackctl is set to > 85
- #6 .................

8. KXStudio Installation on Mint 17

Perform this as root user or use the sudo method (I don't bother, just sudo su - and perform the required maintenance work).

Full KXStudio Installation on Mint 17

Code: Select all

apt-get -y install software-properties-common wget
add-apt-repository -y ppa:kxstudio-debian/kxstudio
apt-get update && apt-get upgrade
apt-get -y install kxstudio-repos
apt-get update
apt-get -y install libjack-jackd2-0 qjackctl
apt-get -y install jackd2 
apt-get -y install kxstudio-desktop-base
apt-get -y install kxstudio-meta-all
apt-get update && apt-get upgrade
After installing KXStudio you can run the KXStudio Configuration tool at Menu/Administration/KXstudio Welcome to update settings.

9. JACKD installation
Refer to section 7 and 8

To list available audio devices


Code: Select all

aplay -l
Result example
card 2: UMC404 [BEHRINGER UMC404], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Code: Select all

arecord -l

Code: Select all

cat /proc/asound/cards
2 [UMC404 ]: USB-Audio - BEHRINGER UMC404
BEHRINGER BEHRINGER UMC404 at usb-0000:00:12.2-4, high speed
Starting jackd from terminal example

Code: Select all

jackd -R -P85 -dalsa -dhw:2 -r48000 -p256 -n3 -Xraw
Starting jackd and ALSA to Jack Midi Bridge

Terminal 1

Code: Select all

jackd -R -P85 -dalsa -dhw:2 -r48000 -p256 -n3 -Xraw
Terminal 2

Code: Select all

In case you needed to stop jackdbus as your user

Code: Select all

kill -9 `ps -ef | grep jac[k]d | awk '{print $2}'`
kill -9 `ps -ef | grep jac[k]dbus | awk '{print $2}'`
Monitor the terminal window for xruns
JackEngine::XRun: client = audacious-jack_24145_000 was not finished, state = Triggered
JackAudioDriver::ProcessGraphAsyncMaster: Process error
In case xruns appear regularly you'll need to adjust your jackd settings to something more conservative. Also ensure that your cpu was set to performance mode.

Example: Achievable Jackd settings (no xruns) with an Edirol UA-25 + Core2Duo 2.4 Ghz laptop. Mp3 playback to jackd via Audacious test.

Code: Select all

jackd -R -P85 -dalsa -dhw:2 -r48000 -p128 -n3 -Xraw
Using ALSA driver USB-Audio running on card 2 - EDIROL UA-25 at usb-0000:00:1a.1-1, full speed
configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 24bit little-endian
No xruns.


Code: Select all

jackd -R -P85 -p16 -dalsa -dhw:2 -r48000 -p128 -n3 -Xraw
Using ALSA driver USB-Audio running on card 2 - BEHRINGER BEHRINGER UMC404 at usb-0000:00:1a.7-3, high speed
configuring for 48000Hz, period = 128 frames (2.7 ms), buffer = 3 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
No xruns.

10. Audio Hardware setup

UMC404 possible configuration settings in Cadence or Qjackctl

This seems to work relatively well

Samplerate 48000
Buffer 256
Periods 3
Realtime Priority 85

Remember to set the realtime priority in Qjackctl or on the Engine Tab of Cadence's settings to 85 (instead of the default 10)

The Edirol UA-25 should also work without major dramas or struggles using the default indicated devices in qjackctl or Cadence.
In order to have working MIDI controller input remember to select the ALSA Raw-MIDI driver.

11. Disabling / Enabling Pulseaudio (if required)

As your user

Code: Select all

pulseaudio --kill
pulseaudio --start
You may need to set the ~/.pulse/client.conf file's autospawn setting to no to prevent pulseaudio from restarting automatically.
autospawn = no

12. KXStudio usage and HOWTO

12.1 Cadence - danboid's manual

12.2 Carla
Carla is KXStudio's plugin host which can host a number of plugin formats including Windows (through Wine) & Linux Native VST's, DSSI, LADSPA, LV2, SF2, SFZ, GIG, and AU. Carla-wine has deprecated the use of FeSTige although there may be cases where FeSTige may still come in handy.
Although certain applications such as Ardour and Rosegarden can natively handle some (usually not all) of these plugin formats it may make more sense to leave plugin hosting to a third party such as Carla instead due to the difficulties involved in making plugins work in Ardour & Rosegarden. In some cases there's no choice since they don't support all the formats.

Carla provides a simulated instrument and effects unit rack environment as well as an audio and midi patchbay environment in which to collect, organise and connect supported virtual devices.

Basic Usage
Start jackd (manually, through qjackctl or Cadence)
Start Carla
Add the required plugin through the +Add Plugin button.
Click on the Patchbay tab to connect the devices' respective MIDI & Audio signal chains.
The paths to the various plugins can be set in Settings, Configure Carla, Paths
To scan for and update the list of available plugins, click the +Add Plugin button, click Refresh, under "Search for new", select all required types to search for, Click Start. Carla will now update its inventory. In case the process hangs, see on which plugin Carla has stopped processing. You probably want to move the offending package out of Carla's search area before attempting another scan. Once the scan is complete the inventory of devices will be updated and the Refresh screen can be closed.

Tick or untick the required device types, this can be useful to make the display less cluttered when searching for a specific device.
Double Click on the required device, this will add it to the rack.

Your virtual device is now loaded in the rack and you are not presented with a virtual 1U sized box.
- On the far left is the "Power" button to enable / disable the device. On the far right is a status LED which is lit when "on" and doesn't shine when "off".
- The "Gear" button is used to access the User Interface (if present) for the device.
- The "Spanner" button is used to access the Carla hosts's configurable settings for the device.

Control Section
- The Control section (MIDI Control) is useful for enabling or disabling MIDI control messages.
- By setting it to "N" it will disable incoming MIDI control messages which could be useful if you don't want your sequencer to re-adjust the Master Volume on the device every time you restart playback. (For example, when your midifiles have volume control change messages set at the beginning)
- Instrument Patches can sometimes also be loaded from this section but the patch loading implementation in Carla is currently not 100% complete for all devices. In some cases it will be available, in some cases it won't.
- You can filter certain kinds of MIDI events, for example piano aftertouch (this can produce annoying effects with certain piano samples which were incorrectly programmed to respond to aftertouch messages).
- MIDI Channel muting isn't currently available but falkTX is considering implementing it.

- The first LED (on the right hand side) shows control change activity when for example sliders or buttons on the virtual instrument or effects unit are manipulated.
- The second LED lights up red when midi activity (through an attached MIDI keyboard for example) is generated. It can also stay lit up solidly when you experience multiple xruns. (Meaning you'll need to correct soundcard issues in Qjackctl or Cadence)
- The third LED shows ..... (function currently unknown)
- The fourth LED indicates system power on / off state

The Patchbay TAB
The Patchbay section is where you make your virtual audio & MIDI connections.

Typical usage example #1
You are running Cadence to start jackd, you have also started the ALSA MIDI bridge (aj2mid?) in Cadence, you have then started Carla and loaded the Obxd synth.
You click on Patchbay and you're presented with the canvas environment in which to make your virtual connections.
You connect the midi_capture device (this represents your keyboard controller) to the Carla Obxd:events-in device in order to establish a MIDI link between your MIDI controller Keyboard, Soundcard, JACKD and your Virtual Instrument running in Carla's rack. (Hmmm... that does sound a tad ambiguous).
You connect the Carla Obxd:Audio Outputs to System (Jackd to your soundcard) playback1 and 2.
Click on the Plugins Tab again. Press keys on your MIDI controller. The second LED should light up red and you should be seeing activity in the bars next to the volume knob showing output levels.

Typical usage example #2
You're basically doing the same as above but you're also making use of Rosegarden Sequencer and you'd like to output MIDI instructions from Rosegarden for playback in a virtual GM soundmodule running in Carla.
For instrument, you'll need to load some kind of GM soundmodule. FluidR3 sf2 is useful for this. You may need to hunt for it on the Internet and install it in the soundfonts location so that Carla can detect it and add it to its inventory.
Once this has been loaded, you need to make use of the MIDI through interface in Rosegarden. Assign this to its MIDI hardware device. If you cannot find it, you probably didn't remember to start it when you started jack through Cadence. (ALSA Midi, Start ALSA Midi Bridge). In the Carla patchbay you'll need to select (capture): Midi Through and connect this to the Carla FluidR3 GM:events in MIDI Interface.
In order to get around the "loud volume" problem in Fluid R3 whenever you restart a song, set the MIDI Control Channel for Fluid R3 to "N" so that it blocks volume adjustment commands to the module.

Saving setups
- You can save the state of the device in Carla by clicking on the Spanner icon and clicking "save state". (May or may not always be available)
- You can save the state of the Carla Project by clicking on "Save As" in the taskbar. The setup you created can be reloaded by using Open or by clicking on the location displayed in the file browser displayed on the left of your screen. (Carla 2)

MIDI Stuck Notes problem
- Stop sequencer. Click Carla Panic button

12.3 Catia
Catia presents the same patch canvas framework as is available in Carla for making MIDI & Audio connections between devices and Jackd.
This is useful for connecting other audio applications (outside the scope of Carla) such as Linuxsampler to your MIDI and Audio Interfaces and jackd.

12.4 Claudia
[Currently clueless about it... if anybody has something to contribute I'd be happy to add it]

12.5 Distrho Project
This is a KXStudio sideproject aimed at collecting and providing virtual instrument and effects devices for use in KXStudio and related environments.
- Currently available plugins and ports

Installation instructions

Code: Select all

sudo apt-get install distrho-mini-series distrho-mverb distrho-nekobi distrho-prom distrho-plugin-ports
sudo apt-get install arctican-plugins dexed drowaudio-plugins juced-plugins klangfalter obxd pitcheddelay tal-plugins wolpertinger
sudo apt-get install easyssp lufsmeter luftikus

12.6 Using jalv to load a single device

You need to install jalv

Code: Select all

sudo apt-get install jalv lilv-utils
Example: Loading Obxd from a terminal window

Code: Select all

Source ... -jalv-gtk/
I use jalv.gtk (from Arch Linux package jalv) to run an individual LV2 plugin as a standalone program.
jalv.gtk is run from the command line. The basic syntax is:

jalv.gtk PLUGIN_URI

where PLUGIN_URI is a unique identifier for the plugin that can be found by using the lv2ls command:

$ lv2ls

To run Obxd, I enter the following:

$ jalv.gtk


The File menu has a Save option that saves the current state of the plugin. The user is prompted for a directory (folder) name; the specified directory is created with two files within it: manifest.ttl and state.ttl. The saved state can be restored when starting jalv.gtk from the command line by specifying the –load option (with two dashes). For example, I saved the state of Obxd as folder Obxd00 in my home directory and restored it like this:

$ jalv.gtk --load ~/Obxd00

The Presets menu has a Save Preset… option to save the current settings as a preset (by default, to directory ~/.lv2/). The remainder of the Presets menu lists the available presets for the current plugin. Presets saved in the current session are not available until jalv.gtk is restarted.

jalv.gtk automatically assigns a unique JACK name to each instance of the same plugin (e.g., Obxd, Obxd-01, Obxd-02).
To get the Obxd presets to show up in Carla and in jalv you'll need to extract them to ~/.lv2/obxd
You can then view them in the Window created by jalv or by using the Load State button in Carla's Device Editor.

13 Installing Audio Applications from Ubuntu or KXStudio Repositories

13.1 ALSA Modular Synth ... _Synthesis

Code: Select all

sudo apt-get install ams fomp mcp-plugins qmidiarp qmidinet qmidiroute

Also refer to section 14.9 for additional plugins

To use ALSA Modular Synth

type "ams" in the terminal to launch ams
For instant gratification sounds, load example_ams_demo.ams and connect ams's outputs to system to hear the audio output.

14. Installing additional music related software

14.1 Linuxsampler

Linuxsampler is a useful audio application which can be installed via KXStudio's repositories.

Alternatively it can be compiled manually. In case you needed to do this for some reason, here are some quick and dirty scripts to compile and install it. There may be issues with them, they may not fully work on your particular system. They seem to work on my Linux Mint 17 32bit system. Your mileage may vary. Don't just blindly execute these scripts. Read each script and check it to see if they will suit your needs & purposes and alter them if and where necessary.

I've divided the installation process into three scripts.
Script 1 installs the required dependencies.
Script 2 compiles libgig, without which Linuxsampler cannot be installed.
Script 3 installs libgig and compiles and installs Linuxsampler, the Qsampler Front-End, and Gigedit.

Copy and paste the contents into textfiles (called something like,, in vi or gedit, set the scripts to executable (chmod 755) and execute them as your local user.

Script 1

Code: Select all

#Install prerequisite packages for building linuxsampler, libgig, qsampler, gigedit on Linux Mint 17
sudo apt-get install subversion g++ debhelper pkg-config automake libtool fakeroot libsndfile1-dev doxygen uuid-dev lv2core lv2-dev bison libjack-jackd2-dev flex build-essential libqt4-dev liblscp-dev libx11-dev x11proto-core-dev intltool libgtkmm-2.4-dev xsltproc
Script 2

Code: Select all

#Clone sourcecode from subversion repository to local computer
#Install subversion if not already present with: sudo apt-get install subversion
#Obtain libgig, linuxsampler, qsampler, gigedit sources
svn co libgig
svn co linuxsampler
svn co qsampler
svn co gigedit
#Compile libgig first
cd libgig
dpkg-buildpackage -rfakeroot -b
cd ..
ls libgig-* libgig6* gigtools*
rm *.changes
echo "If you see 3 .deb files in the folder, proceed with installing them"
echo "Now proceed to script to install the libgig libraries and to compile and install Linuxsampler, Qsampler and Gigedit"
Script 3

Code: Select all

#Install previously compiled libgig.deb files.
#Compile Linuxsampler libraries and application
#Install Linuxsampler libraries and application
rm *.changes
sudo dpkg -i libgig6_3.*
sudo dpkg -i gigtools_3.*
sudo dpkg -i libgig-dev_3.3.*
cd linuxsampler
dpkg-buildpackage -rfakeroot -b
#echo "In case of parser error, run command make parser and repeat previous command"
cd ..
ls liblinuxsampler* linuxsampler_*
echo "If 3 debian files are present, continue"
rm *.changes
#Install the linuxsampler libraries and binary
sudo dpkg -i liblinuxsampler_1.*
sudo dpkg -i liblinuxsampler-dev*
sudo dpkg -i linuxsampler_1.*
#Compile Qsampler
cd qsampler
dpkg-buildpackage -rfakeroot -b
cd ..
#Compile Gigedit
cd gigedit
dpkg-buildpackage -rfakeroot -b
cd ..
rm *.changes
#Install Qsampler
sudo dpkg -i qsampler_0.2*
#Install Gigedit
sudo dpkg -i gigedit_0.2*
At this point Linuxsampler should be installed and you could try running Qsampler to see if it will start and connect to Linuxsampler.

Linuxsampler Configuration Issues
During Startup of Qsampler you may notice that it is unable to find the ladspa effects

In that case create a symlink to it
Run as root or sudo

Code: Select all

cd /usr/local/lib
ln -s /usr/lib/ladspa ladspa

14.2 Installing X42 Plugins

Code: Select all

apt-get install x42-plugins
14.3 Semantic Audio Plugins
Install with

Code: Select all

apt-get install safe-plugins
14.4 Infamous Plugins ... ster/tree/

14.5 Qmidinet

14.6 Jackass ... 24&t=12488
A VST plugin that provides JACK-MIDI support for VST hosts

14.7 Additional Plugins
LV2 Plugins
apt-get install artyfx
apt-get install calf-plugins
apt-get install invada-studio-plugins-lv2
apt-get install lv2fil
apt-get install swh-lv2
LADSPA Plugins
apt-get install fil-plugins
apt-get install swh-plugins
apt-get install tap-plugins
apt-get install rev-plugins

Code: Select all

sudo apt-get install fil-plugins swh-plugins tap-plugins rev-plugins artyfx calf-plugins invada-studio-plugins-lv2 lv2fil swh-lv2
14.8 Yet More Plugins

More Ladspa plugins
amb-plugins - ambisonics LADPSA plugins
autotalent - pitch correction LADSPA plugin
bs2b-ladspa - Bauer stereophonic-to-binaural DSP LADSPA plugin
cmt - LADSPA plugin collection
foo-plugins - Foo LADSPA plugins
g2reverb - reverb LADSPA plugin
holap - Holborn Audio Plugins
ladspa-foo-plugins - Sampo Savolainen's LADSPA plugins
leet-plugins - LEET LADSPA plugins
mcp-plugins - LADSPA plugins designed for Alsa Modular Synth
omins - collection of LADSPA plugins aimed at modular synthesizers
rev-plugins - reverb LADSPA plugin
rubberband-ladspa - LADSPA plugin for audio pitch-shifting
vocoder-ladspa - LADSPA Vocoder Plugin
vcf-plugins - VCF LADSPA plugins
wah-plugins - auto-wah LADSPA plugin
wasp-ladspa - WASP LADSPA plugin
zam-plugins - Collection of LV2 and LADSPA plugins

Code: Select all

sudo apt-get install amb-plugins autotalent bs2b-ladspa cmt foo-plugins g2reverb holap ladspa-foo-plugins leet-plugins mcp-plugins omins rev-plugins rubberband-ladspa vocoder-ladspa vcf-plugins wah-plugins wasp-ladspa zam-plugins
More LV2 Plugins
zam-plugins - Collection of LV2 and LADSPA plugins
mda-lv2 - Paul Kellett's MDA plugins ported to LV2
fomp - collection of LV2 audio plugins
safe-plugins - Semantic Audio Feature Extraction Plug-ins
cabbage-plugins-lv2 - csound development toolkit plugins (LV2)
midimsg-lv2 - set of plugins to transform midi output
beatslash-lv2 - A set of LV2 plugins to slash, repeat beats.
ams-lv2 - set of Voltage Controlled LV2 modules for Ingen
deteriorate-lv2 - set of LV2 plugins to deteriorate sound quality
teragonaudio-plugins - audio plugins from Teragon Audio
teragonaudio-plugins-lv2 - audio plugins from Teragon Audio (LV2)

Code: Select all

sudo apt-get install abgate eq10q zam-plugins mda-lv2 fomp safe-plugins cabbage-plugins-lv2 midimsg-lv2 beatslash-lv2 ams-lv2 deteriorate-lv2 teragonaudio-plugins teragonaudio-plugins-lv2

More VST Plugins
mda-vst - MDA VST plugins
dssi-vst - Adapter for VST an VSTi audio plugins
dssi-vst-bridge - Adapter for VST an VSTi audio plugins
cabbage-plugins-vst - csound development toolkit plugins (VST)
pizmidi-plugins - collection of cross-platform VST MIDI plugins
teragonaudio-plugins-vst - audio plugins from Teragon Audio (VST)
cabbage-plugins-extra-vst - csound development toolkit plugins (Extra, VST)

Code: Select all

sudo apt-get install mda-vst dssi-vst dssi-vst-bridge cabbage-plugins-vst pizmidi-plugins teragonaudio-plugins-vst cabbage-plugins-extra-vst
Audacious Plugin Collection

Code: Select all

sudo apt-get install audacious-plugins audacious-plugins-data
multimedia-audio-plugins - Audio processing plugins, synths and virtual instruments
multimedia-timestretching - Packages for stretching music and audio

Code: Select all

sudo apt-get install multimedia-audio-plugins multimedia-timestretching x42-plugins safe-plugins

More Synths

Code: Select all

sudo apt-get install fluidsynth-dssi setbfree so-synth-lv2 aeolus

KXStudio Related Packages (You probably don't need to install all of this, it should already be installed with KXStudio)
distrho-mini-series - DISTRHO Mini-Series
festige - GUI for fst and dssi-vst
kxstudio-meta-audio-plugins - KXStudio meta-packages - Audio plugins
kxstudio-meta-audio-plugins-dssi - KXStudio meta-packages - DSSI Audio plugins
kxstudio-meta-audio-plugins-ladspa - KXStudio meta-packages - LADSPA Audio plugins
kxstudio-meta-audio-plugins-lv2 - KXStudio meta-packages - LV2 Audio plugins
kxstudio-meta-audio-plugins-vamp - KXStudio meta-packages - Vamp Audio plugins
kxstudio-meta-audio-plugins-vst - KXStudio meta-packages - VST Audio plugins
tal-plugins-vst - Togu Audio Line Plugins (VST)
tal-plugins - Togu Audio Line Plugins
arctican-plugins - Arctican Plugins
distrho-plugin-ports - DISTHRO Plugin Ports
arctican-plugins-lv2 - Arctican Plugins (LV2)
drowaudio-plugins - dRowAudio Plugins
drowaudio-plugins-lv2 - dRowAudio Plugins (LV2)
juced-plugins-lv2 - Juced Plugins (LV2)
tal-plugins-lv2 - Togu Audio Line Plugins (LV2)
distrho-plugin-ports-lv2 - DISTHRO Plugin Ports (LV2)
arctican-plugins-vst - Arctican Plugins (VST)
drowaudio-plugins-vst - dRowAudio Plugins (VST)
juced-plugins-vst - Juced Plugins (VST)
distrho-plugin-ports-vst - DISTHRO Plugin Ports (VST)
juced-plugins - Juced Plugins

Code: Select all

apt-get install kxstudio-meta-audio-plugins kxstudio-meta-audio-plugins-dssi kxstudio-meta-audio-plugins-ladspa kxstudio-meta-audio-plugins-vamp kxstudio-meta-audio-plugins-vst kxstudio-meta-audio-plugins-lv2

14.9 AMS ALSA Modular Synth Plugins

amb-plugins (optional) - ambisonic plugins
blop (optional) - bandlimited oscillator plugins
caps (optional) - the C* audio plugins
cmt (optional) - Computer Music Toolkit plugins
fil-plugins (optional) - equaliser plugins
mcp-plugins (optional) - phaser, chorus and moog vcf plugins
pvoc (optional) - phase-vocoding plugins (appears to be missing?)
rev-plugins (optional) - reverb plugins
swh-plugins (optional) - Steve Harris plugins
tap-plugins (optional) - toms audio plugins
vco-plugins (optional) - oscillator plugins
wah-plugins (optional) - wah audio plugins

Code: Select all

sudo apt-get install amb-plugins blop caps cmt fil-plugins mcp-plugins rev-plugins swh-plugins tap-plugins vco-plugins wah-plugins qmidiarp qmidinet qmidiroute

14.10 Aeolus Pipe Organ


Code: Select all

sudo apt-get install aeolus
To run, jack mode

Code: Select all

aeolus -J
ALSA mode

Code: Select all

aeolus -A
Aeolus FAQ

How to start Aeolus on top of JACK
I always need to start Aeolus like aeolus -J. How can I make Aeolus to start automatically in JACK mode?

In your home directory, place a file named .aeolusrc (don't forget the leading dot). In this file, write all default command line arguments you'd like to use. A usual line reads like the following: -J -S /home/ce/.aeolus/stops
The option -J makes Aeolus running in JACK mode, while an -A would run it in ALSA mode.

How to pass the stops directory to Aeolus automatically
I have downloaded the stops and placed them in my home directory. Now I start Aeolus with the -S option to tell it where to find the stops, like the following: aeolus -S /home/ce/.aeolus/stops -J
Can I automate this?

Again the config file is the right place to save this persistently. In your home directory, you will find or place a file named .aeolusrc (don't forget the leading dot). In this file, write all default command line arguments you'd like to use. A usual line reads like the following:

-J -S /home/ce/.aeolus/stops

Can I switch stops via MIDI?
I'd like to build a console. Can I switch stops via MIDI?

Yes you can

There are a few things to consider when planning any scheme for external stop control. The MIDI messages as defined in the README support both those systems that maintain their own state and use 'set on' and 'set off' messages, and those that don't have any internal state and only use 'toggle' commands. This is intentional - I wanted a protocol that would permit all possible forms of external control.

The latter are the easiest to deal with. In this case, your stop switches do not show if a stop is 'on' or 'off', they are just pushbuttons that toggle the state of a stop. You need to see the Aeolus GUI to know if a stop is 'on' or 'off'. This also means you can still modify stops in the GUI, and you can still use the presets system built into Aeolus.

In case you would use stop switches that _do_ show the state of a stop, i.e. that have a visually distinct 'on' and 'off' state, you should not use the GUI nor the presets - the real state could be different from what your switches are showing. So in that case, if you want presets, they must be implemented by your external control system. There is currently no output from Aeolus that you could use to change the state of your stop buttons, either mechanically or e.g. by a light built into them.

Anyway, the protocol you use should either be the built-in one, or if it's different, you will need an external program to translate your commands to the form that Aeolus understands. There is *no way* I will ever build any other particular command set into Aeolus - there would be no end to all the possible variations I would need to support.

Translating MIDI commands and patching a such a translator in between your console and Aeolus is easy enough. If you have a particular stop control system in mind, I'd be happy to write the translator. But first you should be well aware of the consequences of your choice, and how you want to use it.

14.11 Denemo - Lilypond GUI for Scoring

The version of Denemo that installs via Ubuntu's repositories is ancient so rather obtain an update from their website. You can either use their provided binary which includes Lilypond or you can compile Denemo from scratch.

Using the provided Denemo binary package

Code: Select all

cd /home/`whoami`/Downloads
mkdir denemo
cd denemo
xz -d denemo-1.1.8-0.linux-x86.tar.xz
tar xvf denemo-1.1.8-0.linux-x86.tar
To run Denemo as your user

Code: Select all

cd denemo-1.1.8
Compiling Denemo 1.1.8

To compile Denemo you'll need the following libraries installed

Code: Select all

sudo apt-get install guile-1.8 guile-1.8-dev guile-2.0 guile-2.0-dev libaubio4 libaubio-dev libxml2 libxml2-dev librsvg2-dev libgtksourceview2.0-dev libevince-dev libgtksourceviewmm-3.0-dev fluidsynth libfluidsynth-dev librubberband-dev portaudio19-dev libfftw3-dev libportmidi-dev
Obtain latest version of Denemo (1.1.8 at the time of writing), extract, compile and install it

Code: Select all

tar xzvf denemo-1.1.8.tar.gz
cd denemo-1.1.8
sudo make install

17. Audio Configuration Files and Applications

17.1 Jackd, Cadence, ALSA, Pulseaudio

Jackd configuration file

CADENCE (KXStudio manager for jackd)


List of ALSA Devices

Saving ALSA Settings

Code: Select all

sudo alsactl store 0

*You may want to disable Pulseaudio during sessions by

Code: Select all

pulseaudio --kill
Restart Pulseaudio with

Code: Select all

pulseaudio --start

20. Known issues, bugs, missing or desired features

20.1 Carla & MIDI Omni (Currently MIDI channels cannot be muted inside Carla when using a soundfont plugin such as Fluid R3, adding per channel MIDI mute is being considered)

20.2 Cadence not always starting jack

This may be a one off specific to my setup only but I don't always succeed in starting jack via Cadence. It may be due to a jackdbus issue on my particular system. The simple workaround is to use Qjackctl or even better, the terminal and running jackd manually from there. In case you need ALSA to Jack MIDI through, run a2jmidid from a terminal. (ALSA MIDI Bridge in Cadence).

21. Issues / Bugs

21.1 Linux Mint OS Problems

Dropcaches issue

LM17 32bit appears to have a problem with caches, this problem may also be present in Ubuntu 14.04 32bit. Sometimes the problem manifests itself in slowdowns / issues when trying to update the system. Updates take forever to apply. One potential workaround is to drop memory caches through this command.

Code: Select all

sudo sync; sudo echo 3 > /proc/sys/vm/drop_caches
Available memory can then be displayed via:

Code: Select all

free -m
From this point system updates should complete quickly.

System slowdowns

Use gnome-system-monitor or top to find processes hogging CPU resources or memory usage. A laptop fan which spins up loudly can be an indicator of high CPU usage.

21.2 Package Management Problems

In case you're unable to update packages or you're experiencing other package related issues, try fixing with these commands

Code: Select all

apt-get install -f
dpkg --configure -a
In case of continuing problem with being unable to find KXStudio Repositories

from falkTX

Code: Select all

sudo rm -f /etc/apt/sources.list.d/*kxstudio*
sudo rm -rf /var/kxstudio/*
sudo apt-get purge kxstudio-repos
sudo apt-get update
sudo add-apt-repository ppa:kxstudio-debian/kxstudio # press enter when asked
sudo apt-get update
sudo apt-get install kxstudio-repos
sudo apt-get update

Package Installation error issues
These could be related to older libraries being present on the system. To resolve, here's an example from falkTX:

Code: Select all

sudo dpkg -r liblinuxsampler
sudo apt-get install -f
In case it still produces errors remove all the older libraries, for example liblinuxsampler-dev as well.

21.3 Audio Application Problems

21.3.1 Rakarrak Distortion Problem in v 0.6.1
A Rackarrak distortion problem and fix for version 0.6.1 is mentioned here:

The fix suggested by Musick

Code: Select all

rakarrack Waveshape Resampling:0
Put this code into your rakarrack config file ~/.fltk/
I have just found it (using KXStudio) and for me it is working! I think that it should work for all of you too.
Test this my friends and let me know the results.

21.4 Spyware issues

Whilst Linux has thankfully been less plagued by spyware than other OS's such as Windows & OSX it has unfortunately not remained immune.

Canonical / Ubuntu have aggressively been pushing to monetize their product (in case you wondered what that product is, it's not really Ubuntu, YOU are the one they sell) and as such have resorted to a number of underhanded methods at sneaking spyware into the OS followed by apologies, climb-downs and "selectable" opt in / out data collection settings which may or may not work reliably. Just the fact that it is even there is already a huge problem, even if it *may* be possible to turn it off.

Since Linux Mint is based on Ubuntu it's inevitable that it cannot remain completely unaffected even though (afaik) there's never been a conscious effort by LM to monetise the user as Canonical / Ubuntu, Apple, Microsoft, Facebook, Google etc are doing.

One of the nastiest examples of spyware code beginning to weasel its way into the Ubuntu ecosystem is zeitgeist. Unfortunately more and more applications (totem is one example) are beginning to make use of zeitgeist libraries so in order to rid one's self of this pestilence you sometimes end up having to remove what would otherwise have been useful applications.

What's the issue with zeitgeist you may ask? It is a log aggregator which aggressively pursues and logs all your activities and makes this data available to other applications "in order to enhance your user experience" (haha). Don't you just love how they always manage to invert reality and turn something which negatively affects you into something which supposedly benefits you.

The intellectually ungifted defend zeitgeist by saying that "it doesn't report back on your activities so it isn't spyware" but they miss the point. OTHER Applications MAY, CAN and DO report back aka snitch on your activities by forwarding your chatlogs, interests, activities and so forth back to Spy HQ and they do this after conveniently collecting the goods from guess where??? .... Zeitgeist.

Some people like to share every mundane and banal detail of their existence with the Universe. Great for them, but it sucks for the rest of us - most of whom aren't even aware of what's going on and are tricked into believing that it's an "innocent" and "normal" activity to be datamined, analysed, spied on and ultimately manipulated by the end users of this data such as Media Conglomerates, Corporations and Governments.

Zeitgeist is one example, there will surely be others so please report ANY known spyware and I'll be happy to add it to the Hall of Shame.

/rant over, move along and take your soma you Pr0les

To check your system for the presence of zeitgeist

Code: Select all

dpkg --get-selections | grep zeitgeist
Kill it with fire (replace the code at the bottom with the results you obtained above).

Code: Select all

apt-get remove --purge zeitgeist.x.x.x libzeitgeist.x.x.x

22.4 Puredata Extended Installation on LM17

To install Beta pd-extended (0.43.4 currently on Linux Mint 17)

Code: Select all

sudo add-apt-repository ppa:eighthave/pd-extended
sudo apt-get update
sudo apt-get install pd-extended
Alternatively a later version 0.44 can be installed from here

You may need to install lua5.1 first

Code: Select all

apt-get install lua5.1
Select your architecture version or locate a more compatible version from the URL above. ... -amd64.deb ... e-i386.deb

Code: Select all

dpkg -i Pd-0.44.0-extended-ubuntu-xxxxxx-xxxx.deb
The menu launcher may not work properly so you may need to fix this, alternatively create a new launcher for it or start pd-extended from a terminal.

23. Hardware Hacking
23.1 Linux Audio on USB TV Stick devices

Here's interesting news from Autostatic who has compiled Linux ⁺ Realtime Kernel to run on a RK3066.
What this means is that there's potential here to hack the RK3066 into an existing USB Soundcard's Box (if there's sufficient space) and have a cheapish headless (sans Keyboard, Video, Mouse) portable audiosystem to go. One could potentially control & configure it via a tablet or laptop. ... the-sequel ... sed-device

23.2 Linux Mint on a Macbook + USB Flash Drive
LM17 works on a early 2014 model Macbook although an extra Broadcom Wifi drivers package needs to be installed to get it working. (Phoronix Website has details about this).
LM17 can be run from a small USB3 drive like a Sandisk CZ43 or an Integral Fusion USB3. This way you don't need to overwrite anything on the local harddrive or reconfigure it for dual booting operations.

*Note - The USB Flash Disk IO Performance appears to be hopelessly inadequate to make use of jackd and the system suffers from xruns. A potential solution may be to load the OS into memory from the USB Flash drive as is done with Live distros. For low-latency work involving jackd running an installed OS from a USB Flash drive is unusable.


- When installing, create at least two partitions on the USB Flash Drive. One for / (root) and one for /home. This way your user data can easily be migrated or backed up.
- Don't use a swap partition or file in order to reduce disk writes to flash memory. You'll obviously need to have sufficient RAM available in order to best make use of this configuration.
- Use ext2 partitions. Avoid journalling partitions like ext3 and ext4 which causes the flash memory to wear out sooner due to heavy disk writes. It is possible to disable journalling on ext3 and ext4 but why bother when you could have just used ext2 from the beginning.
- Set drive mounts in /etc/fstab to noatime (to reduce disk writes which wear out the flash memory)

Create your Linux Mint installation USB Flash drive for LM17 with a tool like Yumi in Windows on any Windows PC. Alternatively, make your bootable installation drive another way. Once booted into the Live Linux Mint iso & installer you can plug in the flashdrive you intend to run LM17 from, partition it via gparted (for example, create /dev/sdb1 and /dev/sdb2) and install LM17 on it. Take care to select the correct destination device or remove any harddrives from the system before starting this process to prevent data loss and mistakes.

Remember to install GRUB to the destination USB Flash Drive bootsector while going through Mint's installion preparations, otherwise it won't boot. Make sure you can correctly identify the device. (/dev/sdb possibly, depending on your particular configuration)

Once you've created your bootable USB Flash drive containing your new LM17 installation you can plug it into the Macbook and start it.
When starting the Macbook, hold down the right control button, then click on the Windows Disk and the Macbook will boot from the USB Flash Drive into LM17.
You should also be able to move this USB Flash drive to a typical PC (which supports USB booting) and boot it into the same environment.

As noted at the beginning of the section this solution doesn't produce usable results for lowlatency work involving jackd. You'll be better off running AVLinux or similar as a Live Distro or alternatively you'll need to remaster Mint's installer.

23.3 Running Multiple Audio Cards in Jackd

See article here

24. Tips and Tricks
24.1 Festige Startup Scripts ... ipt#p42975
Last edited by asbak on Wed Sep 24, 2014 5:05 am, edited 2 times in total.
Level 1
Level 1
Posts: 5
Joined: Sat Sep 20, 2014 2:16 am

Re: Linux Mint + KXStudio Audio Production setup

Post by asbak »

Scripts to automate jack startup, set CPU to performance mode, disable pulseaudio and start carla + preset and guitarix example

Here's a Carla + Guitarix example of how you can quickly and easily startup your audio environment by running a script which prepares your environment and loads your audio applications. It depends on a series of scripts which are located in your /home/`whoami`/scripts folder. Create a scripts folder there or modify the scripts below to whatever path you intend to use for them.

Yes I realise there are already GUI environments and applications for this kind of thing but I've not had brilliant results with some of these tools. It could be due to idiosyncracies on my particular computers. I seem to be experiencing less xruns when running jackd from a terminal than from a front-end like qjackctl.

Run and watch how jackd magically starts up, the CPU is set to performance mode (you'll need to enter your sudo password at the prompt), Carla loads a preset and guitarix and a2jmidid start up.

You'll need to preconfigure Carla's preset and have set up Guitarix beforehand for this to work properly. Once that's been done all starts in seconds.

To stop, press CTRL-C in the terminal you ran from.
To stop jackd and restart pulseaudio run the script.

You'll need to modify the scripts depending on whether or not you have pulseaudio installed, what paths you use and so forth.

Code: Select all

#Set your CPU to Performance Mode instead of the default ondemand setting which leads to xruns in jack. Modify script for your particular CPU architecture and add additional cpu's if required below.
echo -n performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

Code: Select all

#Kill Pulseaudio
pulseaudio --kill
echo "Set CPU to Performance mode"
sudo /home/`whoami`/scripts/
#Start jackd. Modify values according to your soundcard's specifications.
#Options: -R = Realtime. -P = Priority. -d = hardware type. -d = your device. -p = ports. -r = Sample Rate. -p = Frames/Period. -n = Periods/Buffer. Typical values are 3 for USB cards and 2 for PCI cards. -X = MIDI driver.
#Obtain your device # by running "aplay -l"
jackd -R -P85 -dalsa -dhw:2 -p16 -r44100 -p128 -n3 -Xraw

Code: Select all

#Start Jack Audio, Carla, Guitarix and Alsa to Jack Midi Bridge
#These scripts will automatically set the CPU to performance mode
#Start jackd and stop pulseaudio
gnome-terminal -e /home/`whoami`/scripts/
#Start Carla and load the GM.carxp Carla rack. Replace preset with your own and modify path to your Carla presets accordingly. This example makes use of the Fluid R3 GM Soundfont.
sleep 3
carla /home/`whoami`/Music/GM.carxp & > /dev/null 2>&1
#Start Guitarix
sleep 2
guitarix &  > /dev/null 2>&1
sleep 2
#Start Alsa to Jack Midi Bridge
echo "To stop jackd and start pulseaudio, run the script."

Code: Select all

#Stop Jackd
kill `ps -ef | grep jac[k]d | awk '{print $2}'`
kill -9 `ps -ef | grep jac[k]dbus | awk '{print $2}'`
Alternatively, stop jackdbus with

Code: Select all

jack_control stop

Code: Select all

#Start pulseaudio
pulseaudio --start
sleep 4
echo "Confirm that jackd has been stopped and pulseaudio has been started."
ps -ef | grep jack[d]
ps -ef | grep pul[s]e
Level 1
Level 1
Posts: 5
Joined: Sat Sep 20, 2014 2:16 am

Re: Linux Mint + KXStudio Audio Production setup

Post by asbak »

Setting up zamaudio/zam-plugins with GUI's

Dependencies *WARNING* This is for Jackd1 only. Don't use if you have jackd2 installed.

Code: Select all

sudo apt-get install pkg-config libx11-dev libgl-dev liblo-dev libjack-dev
Dependencies *WARNING* This is for Jackd2 only

Code: Select all

sudo apt-get install pkg-config libx11-dev libgl-dev liblo-dev libjack-jackd2-dev

Make a folder where to compile plugins

Code: Select all

mkdir zamplugins
cd zamplugins
Clone Git

Code: Select all

git clone
cd zam-plugins
Compile plugins

Code: Select all

sudo make install
Plugins will install here
The lv2 plugins from this collection have GUI's. Do an add-plugin and refresh in Carla, then enter "zam" as search string and sort by "has GUI" to locate them.
Level 1
Level 1
Posts: 5
Joined: Sat Sep 20, 2014 2:16 am

Re: Linux Mint + KXStudio Audio Production setup

Post by asbak »

A very brief, basic and incomplete jack tutorial

In order to obtain low-latency sound under Linux the most widespread mechanism in use today is jack. It comes in two different flavours namely jackd1 and jackd2. My understanding is that the idea is to eventually merge jackd1 and jackd2 into a future jackd3 version but whether or not this happens is beyond my scope of knowledge on the topic.

Another jack related development is jackdbus which is used by certain audio tools and GUI tools instead of jackd. Jackdbus can be disabled in qjackctl's GUI but whether or not this has much effect on it is unclear, particularly if other applications may be making use of it. Jackdbus hasn't worked well for me as my computer tends to end up in a CPU runaway state caused by it. In order to get around this and other problems with processes which I don't fully understand I'm shunning jackdbus and jack-related GUI tools in favour of using jackd from a terminal window which makes things somewhat simpler to understand and configure once you are familiar with the requisite syntax and commands.

The idea is to prevent jackdbus from starting up in the first place. In case it loads automatically upon system boot (mine doesn't) you'll have to trace the source and disable it.
In case you find the jackdbus process running on your system

Code: Select all

ps -ef | grep jackdbus
you can stop it with

Code: Select all

jack_control stop
jack_control status should show it's in a stopped state

Code: Select all

jack_control status
Now you can start jackd (assuming it's not already running) with something like

Code: Select all

jackd -R -P85 -dalsa -dhw:2 -p16 -r44100 -p128 -n3 -Xraw
Adjust this as necessary for your particular circumstances.

In order to list available jack_ commands, type

Code: Select all

followed by a double tap on the TAB button.

Code: Select all

jack_alias                  jack_midisine
jack_bufsize                jack_monitor_client
jack_capture                jack_multiple_metro
jack_capture_gui            jack_net_master
jack_connect                jack_net_slave
jack_control                jack_netsource
jack_cpu                    jack_rec
jack_cpu_load               jack_samplerate
jack_disconnect             jack_server_control
jack_evmon                  jack_session_notify
jack_freewheel              jack_showtime
jack_iodelay                jack_simple_client
jack_latent_client          jack_simple_session_client
jack_load                   jack_test
jack_lsp                    jack_thru
jack_metro                  jack_transport
jack_midi_dump              jack_unload
jack_midi_latency_test      jack_wait
jack_midiseq                jack_zombie
In order to list what jack devices are available

Code: Select all

When you load a device or instrument (qsampler + linuxsampler for example), it will show up in the list of available devices.

List connected jack devices

Code: Select all

jack_lsp -c

Code: Select all

You can easily connect your MIDI keyboard to Linuxsampler and then connect Linuxsampler's 0 and 1 Audio Outputs (L + R) to the soundcard's playback audio channels.

Code: Select all

jack_connect system:midi_capture_1  LinuxSampler:midi_in_0
Result, notice that it now shows MIDI being connected between Linuxsampler and system:midi_capture_1

Code: Select all

jack_lsp -c

Connect Audio Channels

Code: Select all

jack_connect LinuxSampler:0 system:playback_1
jack_connect LinuxSampler:1 system:playback_2
Your MIDI Keyboard is now connected to Linuxsampler and Linuxsampler's audio outputs are now connected to your soundcard. This method will provide near-instant playing gratification if you added the commands to a script and automated your jack device patching in this way.
Level 1
Level 1
Posts: 1
Joined: Thu Oct 27, 2016 1:31 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by bkloimp »

Hi there mate. I was looking for what exactly you described here. Any chance for an updated version of how to turn your Mint Mate with kxstudio repos and apps for audio production?
Cheers, great post mate!
Level 1
Level 1
Posts: 2
Joined: Sat May 13, 2017 8:50 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by Timthenoob »

Has anyone creates a bootable version of this merger?
I am a nubie, this looks Greek to me, but I have tried out KXSTUDIO and loved most of it, and have Mint Cinnamon on my system and love it as well, I would love to merge them together, but I lack the skill to do this process with any confidence.
I would love to see a bootable USB flash drive or DVD version of this and would order it today if it were available.
Any help would be appreciated!
Tim the Noob
User avatar
Level 19
Level 19
Posts: 9092
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Linux Mint + KXStudio Audio Production setup

Post by jimallyn »

Their website says you can add their repositories to Ubuntu, so I assume you can also add them to Mint. Instructions here:

Let us know how it goes.

“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
Level 1
Level 1
Posts: 2
Joined: Sat May 13, 2017 8:50 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by Timthenoob »

Thanks, I'll have to give it a shot...
Would this go easier with Mint KDE?
I actually have a copy on the way anyways, I ordered a bundle last week that happens to have it, or does it really matter?
Level 3
Level 3
Posts: 169
Joined: Sat Oct 27, 2007 3:34 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by marcia »


I have been using linuxmint 17, 17.1, and now 17.3 cinnamon with kxstudio repos for quite awhile. It all works very well together for my audio
production needs. Besides this forum, is a terrific forum for kxstudio users and other linux os's doing audio/music work. The developer of kxstudio is on almost daily to help out with great answers and prompt fixes. I am amazed at his abilities. The kxstudio repos can work with ubuntu, ubuntustudio, linuxmint, debian,avlinux and others. I love using cadence and many other kxstudio tools. is another great site for info.

Hope this goes well for you.

User avatar
Level 1
Level 1
Posts: 10
Joined: Fri Dec 15, 2017 3:21 pm
Location: evant ,texas

Re: Linux Mint + KXStudio Audio Production setup

Post by BananaTech »

will this work for mint 18.3 xfce? if there are any differences i need to be aware of id like to make sure to be prepared
User avatar
Level 13
Level 13
Posts: 4978
Joined: Tue Jul 05, 2016 1:20 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by trytip »

is DEAD . anyone know if it's just temporary out of service of if they are gone forever?
User avatar
Level 1
Level 1
Posts: 24
Joined: Mon Oct 28, 2013 3:32 pm

Re: Linux Mint + KXStudio Audio Production setup

Post by greenpete »

trytip wrote:is DEAD . anyone know if it's just temporary out of service of if they are gone forever?
I've been wondering this too. It's been down for days.
Yesterday the website itself was down for me, I just got the default Apache success page. Today I get the site but it doesn't mention KXStudio at all.
I've scoured twitter and the web generally, but nothing...
Twud be good to know what's happening.

Looks like they got hacked and are trying to get things back online.
LinuxMint 18.2 64bit on an no brand ASrock - i5 - 12GB ram
Post Reply