2010
01.27

I thought I’d document what I did yesterday to get Internet DJ Console to work with Skype, partly for my benefit in case I need to get it working again, but also it should help with anyone having issues with Pulse and JACK.

I started out with a fresh install of Ubuntu Studio 9.10. Jack is configured out of the box and it has a Realtime kernel which helps with all sorts of technical things. If you wanna use JACK properly you need the RT kernel.

After I updated the system and installed the ubuntu-restricted-extras package I installed IDJC. It should work fine, Jack will stop pulse from accessing the soundcard midstream. What we are going to do is stop pulse accessing the sound card directly and route it through JACK instead. Pulse has JACK modules but they aren’t included in the Ubuntu build (Pulseaudio is officially supported but JACK is only community supported) so we will have to build the modules from source.

sudo apt-get build-dep pulseaudio
sudo apt-get source pulseaudio
sudo apt-get install libjack-dev

These lines will download all the dependencies you’ll need to build pulse, the source code itself, and the JACK development libraries so we can build the jack modules. Now change directory into the source code we downloaded.

cd pulseaudio(press TAB to complete)

Now we configure the build to include JACK stuff.

sudo ./configure –with-jack

We don’t need to compile the whole of pulse (I think), we just need the modules to make it work.

cd src/
sudo make module-jack-sink.la
sudo make module-jack-source.la

Now we move the modules into the main install.

sudo cp .libs/module-jack-sink.so /usr/lib/pulse-0.9.19/modules/
sudo cp .libs/module-jack-source.so /usr/lib/pulse-0.9.19/modules/

Next we need to make a config file which makes pulse use JACK when the JACK server is running.

cp /etc/pulse/default.pa ~/.pulse/pulsejack.pa
gedit ~/.pulse/pulsejack.pa

Now we edit this file with the following changes in red:

### Load audio drivers statically (it is probably better to not load
### these drivers manually, but instead use module-hal-detect –
### see below — for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device=”/dev/dsp” sink_name=output source_name=input
#load-module module-oss-mmap device=”/dev/dsp” sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
load-module module-jack-source
load-module module-jack-sink

### Automatically load driver modules depending on the hardware available
#.ifexists module-hal-detect.so
#load-module module-hal-detect
#.else
### Alternatively use the static hardware detection module (for systems that
### lack HAL support)
#load-module module-detect
#.endif

Save and exit. Next we need to stop pulse from automatically starting again when we kill it.

echo “autospawn = no” > ~/.pulse/client.conf

Now launch Jack control (AKA Jack audio connection kit). Click the Setup button and the  Options tab.

We are going to use the JACK control startup scripts to do the following: Kill pulse when we startup JACK control, once JACK is started we start pulse again with our new config, kill pulse again when we start to shutdown, then finally kill JACK and start pulse with the default settings. So fill in the following with these commands:

Execute Script on Startup: pulseaudio -k
Execute Script after Startup: pulseaudio -DnF ~/.pulse/pulsejack.pa
Execute Script on Shutdown: pulseaudio -k
Execute Script after Shutdown: killall jackd; pulse-session

Quit out of the Jack control and start it again. If you start the server and open the connect window you should see a pulseaudio sink and source as available connections and will be linked to the system ins and outs through JACK. Try starting up IDJC or any other JACK sound program, start some music playing and then play something else in Totem, they should play together.

NB: Not sure if this is just me, but I find that first time I start JACK I can’t hear anything. It looks like Pulse has muted the soundcard because when I exit and pulse restarts it is muted. If I turn up the volume and start JACK again everything works.

We can now pipe any sound pulse makes into IDJC via the connections window. For example, if you want to use Skype to have a live call on your radio show, connect front-left and front-right from the pulseaudio sink to the aux inputs on idjc-mx. Now if you click the aux button in IDJC, all the sound from pulse, including Skype, will be heard on the stream. IDJC has fancy voip mixing too but I haven’t played with it yet and it might be easier to just have them as aux. Your microphone should already be linked to the pulseaudio input so Skype can hear you, but if you want it to hear the music from the DJ Console, you need to link the outputs of IDJC into the pulse source.

Okay, that rambled a bit at the end, still playing with the setup here. Drawbacks are that you can’t link individual sources from pulse, so make sure you turn off your system sounds and don’t browse youtube when doing a voip call. With Skype maybe open-sourcing their interface someone might make a client with JACK support but until then this will do. And the upshot is that you can play sound from youtube or anything else from your desktop without having to mess up your playlist.

Once my liquidsoap/icecast server is up again I might talk about that setup. I’ve been working on a smooth transition between server playlist and local live stream.

Be Cing U!

Sources

http://sync-signal.com/2009/12/configuring-jack-and-pulseaudio-on-ubuntu-9-10/
http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=1163390

1 comment so far

Add Your Comment
  1. Worked like a charm on my 32 bit Ubuntu Studio 9.10 !!!
    I didn’t try it on the 10.04 64bit because I didn’t figure out yet how to convince my webcam to work …
    Only two things:
    -you forgot to put the space here sudo cp .libs/module-jack-source.so/usr/lib/pulse-0.9.19/modules/ between .so and /usr
    -jack will not start if in the ~/.pulse/client.conf file there are these ” in the autospawn = no text

    Well done for the rest !!!