Monthly Archives: September 2012

Fix Surround Sound 5.1 in Ubuntu 12.04

I had been battling on an off for a few months trying to get my surround sound working on my Ubuntu 12.04 / mythtv / s/pdif / amp setup. Today I finally cracked it with the help of various posts around the web.

The main problem was a missing module for ALSA. Under the Output tab on the Sound settings for Ubuntu it showed an option “Digital Output (S/PDIF)” but that would only play stereo. I was missing an output option for “Digital Surround 5.1 (IEC958/AC3)”

Configuring asound.conf
Add the following to /etc/asound.conf:


pcm.a52 {
@args [CARD]
@args.CARD {
type string
}
type rate
slave {
pcm {
type a52
bitrate 448
channels 6
card $CARD
}
rate 48000 #required somehow, otherwise nothing happens in PulseAudio
}
}

Install Dependencies:

sudo apt-get install libjack0
sudo apt-get build-dep libasound2-plugins
sudo apt-get install libavcodec-dev libavformat-dev

Get the asound2 sourcecode and build the plugin:

mkdir /tmp/asound
cd /tmp/asound
apt-get source libasound2-plugins
cd alsa-plugins-*
./configure
make

(source: https://help.ubuntu.com/community/DigitalAC-3Pulseaudio)

Running make gave me the following error:

xxx@server:/tmp/libasound2-test/alsa-plugins-1.0.25$ sudo make
make all-recursive
make[1]: Entering directory `/tmp/libasound2-test/alsa-plugins-1.0.25'
Making all in oss
make[2]: Entering directory `/tmp/libasound2-test/alsa-plugins-1.0.25/oss'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -I/usr/include/alsa -g -O2 -MT ctl_oss.lo -MD -MP -MF .deps/ctl_oss.Tpo -c -o ctl_oss.lo ctl_oss.c
../libtool: line 831: X--tag=CC: command not found
../libtool: line 864: libtool: ignoring unknown tag : command not found
../libtool: line 831: X--mode=compile: command not found
../libtool: line 997: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 998: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 1141: Xgcc: command not found
../libtool: line 1141: X-DHAVE_CONFIG_H: command not found
../libtool: line 1141: X-I.: command not found
../libtool: line 1141: X-I..: command not found
../libtool: line 1141: X-Wall: command not found
../libtool: line 1141: X-g: command not found
../libtool: line 1141: X-I/usr/include/alsa: No such file or directory
../libtool: line 1141: X-g: command not found
../libtool: line 1141: X-O2: command not found
../libtool: line 1141: X-MT: command not found
../libtool: line 1141: Xctl_oss.lo: command not found
../libtool: line 1141: X-MD: command not found
../libtool: line 1141: X-MP: command not found
../libtool: line 1141: X-MF: command not found
../libtool: line 1141: X.deps/ctl_oss.Tpo: No such file or directory
../libtool: line 1141: X-c: command not found
../libtool: line 1192: Xctl_oss.lo: command not found
../libtool: line 1197: libtool: compile: cannot determine name of library object from `': command not found
make[2]: *** [ctl_oss.lo] Error 1
make[2]: Leaving directory `/tmp/libasound2-test/alsa-plugins-1.0.25/oss'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/libasound2-test/alsa-plugins-1.0.25'
make: *** [all] Error 2

This was fixed by using libtoolize:

libtoolize --force --copy; aclocal; autoconf; automake; make

(source: http://geeklymusings.blogspot.ro/2009/04/libtool-problems-on-ubuntu.html)

Install the plugin

cd a52/.libs
sudo cp libasound_module_pcm_a52.la libasound_module_pcm_a52.so /usr/lib/`uname -i`-linux-gnu/alsa-lib/

Restart Services

sudo alsa reload
killall pulseaudio

Select correct device

pavucontrol

Under the Configuration tab Select "Digital Surround 5.1 (IEC958/AC3) Output + Analogue Stereo Input" as the Built-in Audio
Close
Now when you go to the Default Ubuntu Sound Settings Applet you should have an option for "Digital Surround 5.1 (IEC958/AC3)"
You can use the Test button to check that all channels are working.

For my reference I had to set my AMP to Auto mode under the digital inputs.

Under Mythtv Audio settings I selected: "ALSA:hw:CARD=Intel,DEV=1"

VMware ESXi CLI tools / commands

vmware cli tools install (ubuntu)

cd /opt
cp ~/Downloads/VMware-vSphere-CLI-4.1.0-254719.x86_64.tar.gz .
tar xvzf ./VMware-vSphere-CLI-4.1.0-254719.x86_64.tar.gz
sudo apt-get install perl-doc libssl-dev libxml-libxml-perl
sudo ./vmware-install.pl

Fix Server version unavailable at 'https://10.1.0.66:443/sdk/vimService.wsdl' at /usr/share/perl/5.12/VMware/VICommon.pm line 545, line 2.

export PERL_LWP_SSL_VERIFY_HOSTNAME=0

Not very secure but solves the problem.


vmware-cmd -l --server 10.1.0.66
Enter username: root
Enter password:

/vmfs/volumes/4fa92f7d-55696b26-5276-002655ff4b82/vm4/vm4.vmx
/vmfs/volumes/4fa92f7d-55696b26-5276-002655ff4b82/vm2/vm2.vmx
/vmfs/volumes/4fa92f7d-55696b26-5276-002655ff4b82/vm-zenoss/zenoss-3.2.1-1326-x86_64.vmx
/vmfs/volumes/4fa92f7d-55696b26-5276-002655ff4b82/vm1/vm1.vmx
/vmfs/volumes/4fa92f7d-55696b26-5276-002655ff4b82/vm3/vm3.vmx