Kamil Figiela

Advanced channel mixing on Mac

In Audio, Mac on 28 August 2009 at 23:40

The thing I missed the most after switching to Mac was foobar2000 media player and it’s Channel Mixer plugin. The DSP lets you upmix 2.0 to 5.1 via various methods e.g. creating surround channels or simply copying front to rear, mixing left and right to center and redirecting bass to LFE. What is more there there is also speaker delay management which allows you to keep sound you hear from 6 speakers in same phase – it really makes a difference.

As I switched to the MacBook and Mac OS X of course, I had stereo only audio as I my speaker set doesn’t have optical input. Recently I bought cheap 5.1 USB sound card which works well with Leopard 10.5.8. Unfortunately, there was still 2.0 audio from iTunes – until I combined power of JackOSX and AU Lab

The solution

As I noted you will need AU Lab (comes with Xcode; can be found in /Developer/Applications/Audio) and JackOSX.

Audio device settings

You also have to configure your audio output device in Audio MIDI Setup (can be found in /Applications/Utilities). Simply select 6-channel output in Audio Output pane.

Audio MIDI Setup - Channel configuration

Audio MIDI Setup - Channel configuration

Then configure Configure Speakers and select 5.1 layout.

Audio MIDI Setup - Speakers layout

Audio MIDI Setup - Speakers layout

After this you can start JackPilot (in /Applications/Jack). Go to Preferences and set it like this:

JackPilot - Preferences

JackAudio configuration

Click start in Jack’s main window. If everything goes good you should have new audio device in your audio preferences – JackRouter – it should be selected as default output device.

AU Lab – first steps

Start AU Lab, create new document with 2 mono input channels and 6 mono output channels. This configuration gives you a lot of flexibility.

AU Lab - output channels

AU Lab - input channelsAU Lab - device selectionAfter you’re done you should see this:

AU Lab - document

Now double-click Output 1, a new dialog will appear. Rename channels – it will be convenient to know which-is-which. Order is Front Left, Front Right, Center, LFE, Left Surround, Right Surround. You can select channel by clicking it in the “matrix”. Rename input channels the same way.

AU Lab - audio outputs

AU Lab - audio outputs

Jack – routes

It’s time to play the music via AU Lab. To do it we have to reroute audio. After start JackPilot is routing audio directly to sound card. We need it to be routed through AU Lab processor. You can do it using JackPilot interface, but it’d be more convenient to do it with shell script.

#!/bin/bash
#save this as AULab.sh

/usr/local/bin/jack_connect "AU Lab:out1" "system:playback_1"
/usr/local/bin/jack_connect "AU Lab:out2" "system:playback_2"
/usr/local/bin/jack_connect "AU Lab:out3" "system:playback_3"
/usr/local/bin/jack_connect "AU Lab:out4" "system:playback_4"
/usr/local/bin/jack_connect "AU Lab:out5" "system:playback_5"
/usr/local/bin/jack_connect "AU Lab:out6" "system:playback_6"
#!/bin/bash
#save this as iTunes.sh

# disconnect iTunes from sound card
/usr/local/bin/jack_disconnect iTunes:out1 system:playback_1
/usr/local/bin/jack_disconnect iTunes:out2 system:playback_2
# plug iTunes to AU Lab
/usr/local/bin/jack_connect iTunes:out1 "AU Lab:in1"
/usr/local/bin/jack_connect iTunes:out2 "AU Lab:in2"

Set proper chmods and run scripts. Music from iTunes should go through AU Lab. You should hear only left speaker so far.

AU Lab – audio processing

Let’s come back to our AU Lab document. I assume that nothing gone wrong so far. Firstly we need right channel to work. By default it is routed to channel Left. Simply turn off routing from Right input to Left output by clicking digit 1 in Volume section of Right input channel and turn on digit 2 (routing to Right channel). Enable also routing from L to RL by clicking 5 in L input Volume section and from R to RR (number 6). Now we have quadraphony.

Now we want to provide C and LFE with mono. Simply route both L and R to both C and LFE. Then you have to turn the volume of C and LFE down, we don’t want overdrive. Remember to set a Low Pass Filter effect on LFE (cutoff frequency can be 150 Hz).

If you want to hear audio in the same phase you can use Delay effect. Note that delay you set here is not the time it takes sound waves reach you – to simplify: you should set highest delay to speaker which is nearest. I won’t cover details of delays, as I’m not an audiophile.

Final conclusion

Great! We have music surrounding us. I love to listen Riverside – Rapid Eye Movement this way! What next? AU Lab is very powerful tool, you can set different volume for every speaker. If sound card doesn’t allow to do that itself you can create 6 mono input/output configuration just to set the volume. If you want to do this remember to select proper speaker layout as we done at the beginning.

Leopard Snow support

AU Lab works well. You need to install new JackOSX – development versions work well in this scenario.

All comments are screened for appropriateness. Commenting is a privilege, not a right. Good comments will be cherished, bad comments will be deleted.

stomatolog kraków | typy sportowe | procesy inwestycyjne | proces inwestycyjny