A Django site.
June 22, 2008

John Anderson
sontek
sontek ( John M. Anderson )
» Achieve Zen with openSUSE 11.0 (i.e Get rid of pulse audio)

I’ve been having a lot of stability issues with openSUSE 11.0 lately and the majority of them boiled down to audio.

Here is a list of a few:

1. VLC required root to have audio, wtf?
2. Sound would crash after listening to any audio for an extended period of time (music, video, flash).
3. If my audio crashed, Firefox could not start up until I did rcalsasound restart
4. Some videos were slow/choppy.

So, you are probably asking, how did I fix all these issues?

zypper rm alsa-plugins-pulse
zypper addlock alsa-plugins-pulse

This removes the alsa plugin for pulse and locks it so it will never install again. Without the alsa plugin installed, the apps go back to using alsa directly. This has fixed every issue I’ve had with openSUSE 11.0 so far.

June 11, 2008

Hans Fugal
no nic
The Fugue :
» My Studio

Well, I've spent two days doing actual work in my studio and I can now confidently report my settings for the benefit of Linux-running MacBook users (and other related hoodlums).

I won't go into the detail that I did in the previous posts, most of which is still relevant.

I pass the option position_fix=3 to the module snd-hda-intel. I did this by creating /etc/modprobe.d/local, containing: options snd-hda-intel position_fix=3

then running sudo update-initramfs -uk all.

I set up my Gnome session to run QJackCtl, which is in turn configured to start JACK on startup. My JACK settings (from ~/.jackdrc) are: /usr/bin/jackd -R -t2000 -dalsa -dhw:0 -r48000 -p1024 -n2 -s

JACK is extremely stable. I've had 2, maybe 3 xruns through two days of work, and those were when starting up applications, not when actually using them.

Now, since we have only one audio device and JACK has monopolized it, and we want to hear other than JACK, we need more configuration. Here is my ~/.asoundrc:

# Set the default device to PulseAudio for all well-behaved ALSA applications
pcm.!default {
        type plug
        slave.pcm "pulse"
}
ctl.!default {
        type plug
        slave.pcm "pulse"
}

# This device can come in handy, but I mostly don't use it.
pcm.jack {
        type plug
        slave {
                pcm {
                        type jack
                        playback_ports {
                                0 alsa_pcm:playback_1
                                1 alsa_pcm:playback_2
                        }
                        capture_ports {
                                0 alsa_pcm:capture_1
                                1 alsa_pcm:capture_2
                        }
                }
                rate 48000
        }
}
ctl.jack {
        type hw
        card 0
}

# The acutal PulseAudio device
pcm.pulse {
        type pulse
}
ctl.pulse {
        type pulse
}

Now all well-behaved ALSA programs will use the default ALSA device, i.e. PulseAudio. PulseAudio needs to be configured now to use JACK. You'll need to get the pulseaudio-module-jack package, which probably means you'll need to build it yourself. I show you how to do that and how to configure PulseAudio in a previous post. Incidentally you need to do the same for libasound2-plugins if you want to use the JACK plugin for ALSA as in my asoundrc above.

Now we have a bit of a chicken and egg problem. PulseAudio starts when you log in, and so does JACK (by way of QJackCtl in your Gnome session). But PulseAudio will fail to start if JACK isn't already running. What's more, if you decided you wanted to restart JACK for whatever reason, you'd have to restart PulseAudio too. So here's how I solved it. I leave ESD enabled in the Gnome sound settings, knowing that it will fail to start (and I won't get the really cool Ubuntu Studio startup ditty, but oh well). It needs to be checked if you want Gnome to make nifty system sounds. Now, in QJackCtl setup, on the options tab, check the box for "Execute script after Startup" and put "pulseaudio -D" in the box. Now PulseAudio will start whenever JACK starts, and it will stop/crash/whatever whenever JACK stops.

Now, you need to install libflashsupport to get Flash working with PulseAudio. Even so you might find occasional sites that crash it.

That about covers it. If you do much work with audio applications using complicated JACK graphs, don't overlook the power of QJackCtl's patchbay, which will automatically hook things up. I have a patch that will connect Aeolus to system output 3&4 (headphones/external speakers), and hook my MIDI keyboard to Aeolus. So all I have to do is start Aeolus and pull some stops and I'm ready to play.

Which reminds me, there's still the annoying thing about JACK having 8 outputs (for surround sound) and the internal speakers are on outputs 1&2, and the headphone jack is outputs 3&4. If you're not getting sound from a JACK app and you think you should be, that's the first thing to check. Someday I plan to figure out the .asoundrc magic needed to set up JACK so that it's a regular stereo device sending sound to both the internal speakers and headphones. If you know how, please enlighten us in the comments. I know it can be done, I just haven't put in the time to figure it out and test it.

June 4, 2008

Hans Fugal
no nic
The Fugue :
» PulseAudio as a JACK Client

I spoke too soon about not being able to get PulseAudio working as a JACK client. I found this post that tells you how to do it.

The key I think is chmod -s `which pulseaudio`. I didn't have to start the JACK transport rolling, so that may be antiquated information. I did have to build some packages from source, though:

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

This creates a bunch of .debs, including pulseaudio-module-jack*.deb. I just installed them all, but you can probably just install the jack module deb. Make the changes permanent by putting them in ~/.pulse/default.pa or in /etc/pulse/default.pa and you're in business.

March 31, 2008

Kevin Kubasik
nonic
For Once I Oneder
» Sound problems in Ubuntu Hardy


So if your like me, you’ve been suffering through some painful sound problems in Ubuntu Hardy, apparently its a known kernel issue, so just sit tight. However, if your like me (or 90% of nerds) then you need some sort of music to code. A little digging revealed that I did not in fact have any of the alsa kernel modules installed for my current kernel. apt-get left me high and dry (also without an nvidia driver yet, but that’s an easy fix).

The simple remedy is to just build the alsa modules yourself, a pretty painless task. The problem is, if you want to have any hope of keeping your install halfway clean, then you need to get those files tracked by dpkg so we avoid conflicts when the modules are fixed. There’s a simple solution:

sudo apt-get install module-assistant
sudo m-a update
sudo m-a prepare
sudo m-a a-i alsa

This utilizes the handy module-assistant package to automatically build alsa for you. :) Reboot and enjoy!