Sunday, May 17, 2009

Soundflower is Borked

In several previous posts I gave detailed instructions on how to use Soundflower with and other arcane audio mixing topics under MacOS X.

While these tricks sort of worked, I always had problems with audio after a while. I thought I'd be able to fix it with a change in buffer size or something similar, but I can't, and now I know why -- the problem seems to be isolated to Soundflower. Upgrading to the latest version, 1.4.3, doesn't fix the problems.

It seems that even running Soundflower on my wife's MacBook with no special hardware or audio applications -- just iTunes -- it is pretty easy to get Soundflower to go crazy. Set up the default audio output to be the two-channel Soundflower bus. Run Soundflowerbed and tell it to send the two-channel output to the built-in output. Now play some music. You'll probably have to play with some volumes using Audio MIDI Setup and iTunes.

On my wife's MacBook, plugging in a pair of headphones, which should just result in diverting the audio going through the speakers to the headphones, sends Soundflower into a tizzy -- I start hearing garbage through the headphones, the telltale "buzz" or stutter that tells me that it is playing one buffer of audio in a tight loop, and not getting any fresh audio streaming in. Setting the output to "None" and back to "Built-in Output" fixes the problem reliably.

On my Mac Pro, the problem is even worse -- I don't have to touch anything for the audio to become trash. Just letting iTunes run through my Apogee Ensemble via Soundflower results in the audio failing after a minute or two. Turning the Soundflower output off and back on seems to reliably fix the problem, but it's unusable when I have to fix it every couple of minutes; I can't do a live performance that way.

Interestingly enough, it seems to be just the monitoring of the Soundflower bus via Soundflowerbed that fails; ustream's meter shows the audio still going out.

There are some other issues but this one is a show-stopper. So unfortunately I can't recommend Soundflower for the time being, and I don't really have a workaround. If anyone knows of a similar tool that will give me an extra virtual audio bus that I can use to record or stream, I'd love to hear about it.

I've reported this issue to the developers, and I note that another user is also reporting trouble with the Ensemble. I don't think it is the Ensemble's fault, though, given the way the failure occurs on a stock MacBook. The developers do not seem to be responding to recent bug reports at present.

I'm about to install the 10.5.7 system update; we'll see if that improves the situation.

Soundflower is open source. About 8 years ago I worked on CoreAudio drivers for a commercial PCI-based audio interface, so in theory I should be able to dig into the Soundflower code base and, with luck, figure out what is happening and help fix it. In practice debugging this sort of thing could be a major time sink, and given that I'm already working more than full time and a parent, it seems unlikely that I can make any headway in that direction, but if I get some down time I'll see what I can do.


Unknown said...

Did you get this fixed?

My Mac Pro, with Apogee Duet connected makes Soundflower flip out after a few minutes just like with you.

Paul R. Potts said...

No, I have not gotten it fixed. I follow the updates and bug reports at the project page here:

It doesn't appear that a fix has been found yet, although several people are reporting similar bugs.

Take a look at issue #24. That issue is a little clogged up with confusing similar problems, but it has been marked as "accepted" by the developers. I also reported issue #44 which is simpler report of what is probably the same problem.

Much as I'd like to try building it and see what I can figure out myself, with 3 young children I just don't get nearly enough quiet time for projects like this.

Arūnas Baužys said...

The same problem with Soundflower to Apogee Duet

Unknown said...

I know this is old, but if you're still having issues this may help. I searched for hours trying to find a solution to this issue. A friend suggested an idea that he had been shown. Setup soundflower as a midi simultaneously with your regular output. Therefore instead of routing through soundflower for your output (which seems to cause the issue), it routes each as their own output. So far seems to be working on my recording meters without the overdrive static. Here is the how to on this.

Also, if you are looking for more control I found software from Prosoft that allows for audio adjustment using hear or individual app volume control through hear or soundbunny.

Hope this helps everyone!

~Epoch Dream Productions