Jack to work with SuperCollider in Linux

I am still quite new to Linux in general. I am learning a lot by just trying to use it, and trying not to move back to OSX just to do a simple task. So that this post might be for a person like me, who has struggled a lot on this ‘new’ way of patching sound in and out and configuring in a right way.
I have used Jack before in OSX when I was trying to do a virtual multichannel test, but there was a graphical interface, not at all complicated. There is also ‘system preference’ that OSX offers. When I change the soundcards, or using different inputs/outputs, I didn’t need to do much. But here, it might be a simple thing, but I was in panic.
So that I would like to share my experience if this can help anyone who is like me.

I have two different versions of linux that I am using in different laptop. 11.04/11.10.

Here I am focusing on 11.04, because 11.10 had less issues.

Jack versions and library installed : jackd, libjack-jackd2-dev, jackd2-firewire, jackd2, libjack-jack2-0, libasound2-plugins

First of all, I was at the first moment trying to use ‘qjackctl‘ that offers graphical user interface. But weiredly, the value that I have changed was not applied to the result.

Screenshot of qjackctl setup window

The default sample rate was set to 48000, and I wanted to change it into 44100. Even though I was doing it, it didn’t change.

Asking some people around, I found that pulsa audio can be the cause of issue, so I removed it and tried to use only ‘alsa.’

Jack setup

When I run scvim, I use a bash script in order to reduce any possible complications such as already-running-sclang. I saved it as ‘iscvim’ and fixed chmod to an exacutable, and put it into a path (i.g. /usr/local/bin.).

Here I include jack setup as well.

#!/bin/bash
cd ~
killall jackd
killall sclang
killall scsynth
killall scvim
killall sclangpipe_app
jackd -t 500 -d alsa -d hw:0 -r 44100 -p 1024 -s -S &
sleep 1
scvim

Here I set to use alsa as the driver, and device as hw:0, sample rate: 44100, period 1024, softmode and the last of -S is to cofigure card for 16bit. This configuration can differ from soundcard. I tried to use 32 bit, but my sound card only supports 32 bit-float. But this created problem with sc3, (creating distortion) and I assume that this is because of -float- (it could be supposed to be integer).

Check something like this when you run jack,

ALSA: final selected sample format for capture: 32bit float little-endian

or

ALSA: final selected sample format for capture: 16bit little-endian

In order to know what card you have;

cat /proc/asound/cards

In order to know what other configuration will be possible with your soundcard, use ‘jack_control,’ which shows you all possible options for your setup, and not difficult to use.

For Realtime Scheduling

This is followed by what ‘jack’ website suggests, and it works very well. (http://jackaudio.org/linux_rt_config)

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

Then fix as below.

# Provided by the jackd package.

#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19

So far, no issue when I am using SCVim, and I run Jack when I need to use it.  Hope this helps.

Happy 2012! Install Linux on your MacbookPro


My last project of the last year was to get ready as a linux user. All my setup in OSX was targeting toward ‘getting used to using terminal,’ and after all, I couldn’t wait to move to Linux.

Yeah. I have only Apple computers (PowerPC, MBP 4,1, MBP 8,1) , and after a long time as a Apple user, I feel very much tired of how the apple system becomes ‘closed.’

I know a lot of people might argue about this, but I would like to be able to configure my own environment that follows users’ preference, not something that a system offers for the users to fit into.

I though linux is perfect for that,  although after some time of struggling to install, and having a scary moment that I needed  to ‘open up’ my laptop, and now all my three old and new apple computers have both osx and linux!!! yay!!

Alright. so I would like to briefly talk about how I installed it, and what, and of course, everyone can find this from ubuntu forum with better detailed explanations. I deeply admire those people who give this document to everyone.

 Macbook pro 4,1 -> Ubuntu 11.10

For the Macbook pro 4,1; I installed Ubuntu 11.10 Oneiric Ocelot (http://cdimage.ubuntu.com/releases/11.10/release/) . Well, before I found this ‘mac’ specified version, I installed like… 5 different versions, and threw away all cds and dvds that I experimented.

So for you, this will be helpful. I downloaded ubuntu-11.10-desktop-amd64+mac.iso .

My CD room of the computer is broken. But i was able to install it with my usb stick. The thing is that Ubuntu forum explains how to install with USB. But somehow it was not working (failing to boot from there properly.) After a while of googling, I found this application for window. (yeah. I also have a window installed with VMware, this is just to do ‘online banking’ from Korean banks…!!)

This progam is called UFDISK. (download : http://goo.gl/UYitG)

You put your usb stick into the port, and run this. (backup all your files before) then you push ‘Auto run’ . Select your iso file, and run it. Then done!!

Then you need to install ‘ReFit’ (http://refit.sourceforge.net/)

After install, open the terminal and type

sudo sh /efi/refit/enable-always.sh

then you will see this when you boot,

you can select your usb to boot it.

Some remarks on Refit

When you first put your usb (or cd) and run REFit, you will see the login window that you can choose from where to boot. Before you choose, at the bottom part, there are some menus like shell script.. I don’t remember by heart right now, and choose the second one, and run. This will make everything suitable to boot. Then ‘shut down’ once, and then on next boot, choose your booting harddrive.

Make sure you are connected to internet (ethernet connection), and for more help, http://www.ubuntubuzz.com/2011/10/ubuntu-1110-in-macbook-pro.html

 Macbook pro 8,2 -> Ubuntu 11.04

here, I needed to have both CD, and USB in order to boot properly. Go here http://cdimage.ubuntu.com/releases/11.04/release/ download ubuntu-11.04-desktop-amd64+mac.iso

For the procedure for usb, please look up, and for burning CD, just to burn with DiskUtility on osx. (I have ‘lion’ installed)

Also you need REFit. (also look up for the explanation and download) On lion, I had a hard time for this to run. After few times of reinstalling, it was just working. I cannot explain what it was.. but it works!

Alright. Then put usb and CD together. when Refit login window, you will only see two linux install. Choose the first one, and run the install.

Make sure you check this site : https://help.ubuntu.com/community/MacBookPro8-1/Natty for more help and additional install.

 

Some remarks :

For ubuntu 11.10, I made two partitions for ubuntu, one as root(/), and one as /home. (except for swap disk) this was working fine. But on ubuntu 11.04, this was not working. (trouble on booting with Refit.) so do not make seperate partitions for your ubuntu. just make one, (again, except for swap disk)

 

Hope this helps. well, I had a hard time figuring out all. I might have missed some important part that I was struggling. Then I will update later on.

Now I have Ubuntu working with ‘awesome’ window manager. Good bye mouse!

 

**28.02.2012 updated:

If you have an issue with rEFit regarding OSX security setting, check this page. It will guide you the way.

http://sourceforge.net/tracker/?func=detail&aid=3488641&group_id=161917&atid=821764