English فارسی Suomi
Français Nederlands Translate

Campcaster 1.4

Campcaster: ConfiguringSoundcards

Configuring Audio Interfaces

Campcaster Studio works best if you have three stereo audio interfaces. The first stereo pair of outputs is used to preview files or playlists on your headphones, or studio monitor loudspeakers, as you 'cue' them. (In the old days, to 'cue' a vinyl record meant to put the stylus on the outer groove, so that the DJ could find the exact point when the music started. The audience is not meant to hear the cue output). The second stereo pair is for Live Mode playout to the broadcast mixer. The third stereo pair is for playout from the Scheduler, and is configured separately.

You can use internal soundcards, or external audio interfaces that connect to your computer via USB. Campcaster is designed for use with multiple hardware interfaces, but if you are using a single audio interface with sufficient channels, you can split it into several virtual interfaces using Dshare: http://alsa.opensrc.org/index.php/Dshare

If you only have one audio interface, you should configure this for Live Mode or Scheduler output, as shown below, depending on your requirements. You will not enjoy the benefit of being able to preview audio files or playlists independently with the cue device, but you can still monitor the playout as it is broadcast, using a mixer.

Configuring an internal soundcard

Make sure you are logged in to Campcaster Studio. In the Master Panel, click the Options button, then the tab labeled Sound. We must assign the correct audio interface names for our particular hardware here. 'Cue audio device' has a box showing the system's name for the audio interface that will play your preview. 'Live Mode audio device' is the name of the interface for your station's playout.

Options window Sound tab 

Using the ALSA soundcard drivers which are standard on GNU/Linux, audio interfaces are numbered from zero upwards. The first hardware card in the system is given the name:

 hw:0

Each item of audio hardware can sometimes have multiple devices, also numbered from zero upwards. The card number and device number are separated by a comma. Often, there's only one device per card, so the first card and the first device on that card is referred to as:  

hw:0,0

The default device on the internal soundcard in your computer is likely to be hw:0,0 so this is a probable setting for the Live Mode playout interface. If you have two internal soundcards, the first device on the second card would be:

hw:1,0

This is a probable setting for the 'Cue audio device' name. If instead you want to configure your first internal sound card as the preview interface, then you would enter hw:0,0 in the field that says 'Cue audio device'.

After you click the Apply button, a warning window will inform you that you need to restart Campcaster Studio and log in in once more:


Soundcard change requires restart

Configuring an external USB audio interface

After you plug in the external audio interface to your USB port and verify that it is powered on, open a terminal and enter the command:

$ aplay -l

The -l suffix on this command means 'list available audio devices':

The aplay -l command lists cards and devices 

You should see the external sound card listed, among others. For example:

card 1: External [SB Live! 24-bit External], device 0: USB Audio [USB Audio]

The text string 'SB Live! 24-bit External' helps us identify the audio interface by its model name. There are two other useful piece of information here; the card number and the device number. This external USB interface has only one device. In this instance, the card number is 1 and the device number is 0, so it is referred to by the system as:

hw:1,0

In the Sound tab, enter the appropriate card and device numbers for your system. External soundcards sometimes have a better signal to noise ratio than internal cards, so it might make sense to use the external device as the Live Mode playout interface. However, accidental removal of the USB cable will halt playout, of course. If this ever happens, reconnect the USB cable immediately, check that the interface has power, and restart the audio file currently being played out.

Configuring Scheduler output

To change the soundcard used for scheduled playout from the default of hw:0,0 you must edit a file called /etc/campcaster-scheduler.xml as follows:

$ sudo nano /etc/campcaster-scheduler.xml
You will have to enter your password. In that file, look for a value that reads:
<audioPlayer>
    <gstreamerPlayer audioDevice = "hw:0,0">
</audioPlayer>

Change the value hw:0,0 to the card and device number that you require. Then type Ctrl+O (hit the Ctrl key and the letter O key at the same time) to save the file, and Ctrl+X to quit the nano editor.

Digital audio outputs

Some audio interfaces have both analog outputs (line level) and digital audio outputs (such as S/PDIF), on the same card. To check which device has which number, we can use the aplay command again:

$ aplay -l
The terminal might display something like:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
Subdevices: 1/1 Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: AD198x Digital [AD198x Digital]
Subdevices: 1/1 Subdevice #0: subdevice #0
card 1: Aureon51MkII [Aureon5.1MkII], device 0: USB Audio [USB Audio]
Subdevices: 1/1

In this example, the internal soundcard (hw:0) is an Intel HDA, and the external USB card (hw:1) is an Aureon 5.1 MkII. On the internal Intel HDA card, two separate devices are listed. The first, hw:0,0 is shown as the analog output device, and the second, hw:0,1 is shown as the digital output device. Choosing the right card and device names will make sure that the audio signals are sent out via the correct interconnect cables to your broadcast mixer.

Disabling PulseAudio

Ubuntu and some other GNU/Linux distributions include an audio server called PulseAudio, which can interfere with Campcaster's use of multiple audio interfaces. To disable PulseAudio on your computer, edit its configuration file in a terminal:

$ sudo nano /etc/pulse/client.conf 
You will have to enter your password. Change the value:

; autospawn = yes

to:

autospawn = no

You need to remove the semicolon comment, as well as change the value 'yes' to 'no'. Next, copy the configuration file to your home directory:

$ cp /etc/pulse/client.conf ~/.pulse/client.conf

Then, enter the command:

$ sudo killall pulseaudio 

These steps should shut down PulseAudio, and prevent it from restarting later. Confirm that PulseAudio is no longer running with the command:

$ pgrep pulseaudio

This pgrep command should not return a process ID number if PulseAudio was stopped successfully.

If you find that PulseAudio restarts after a reboot, you have the option to remove the PulseAudio server and the ALSA plugins package from your system altogether:

$ sudo apt-get remove pulseaudio libasound2-plugins

Removing these packages from an Ubuntu system causes several other packages to be uninstalled, including ubuntu-desktop. After this package removal, you should reboot your system and confirm that your audio interfaces are still working as expected.

GNOME ALSA Mixer

You will find that the audio volume control applet will vanish from the Ubuntu taskbar when PulseAudio closes, because this applet requires PulseAudio to work. Instead, you can install an alternative volume mixer applet, which offers more direct access to the audio interface, with:

sudo apt-get install gnome-alsamixer

GNOME ALSA Mixer displays tabs for the different audio interfaces available on your computer.

GNOME ALSA Mixer 

You can rename these tabs with more easily-remembered labels such as 'Playout Interface' and 'Cue Interface' using the Edit -> Program Preferences menu item.

GNOME ALSA Mixer Preferences

These labels should be remembered the next time you start GNOME ALSA Mixer.


EDIT