Chrome with libcras on gPrecise

How to build and install cras and tell Chrome to use it on gooBuntu gPrecise.

Install prerequisites.
sudo apt-get install git libasound-dev libspeexdsp-dev libgtest-dev libtool automake libdbus-1-dev libudev-dev g++ ladspa-sdk libsndfile-dev
install libsbc 1.1 manually by downloading and compiling the tarball from http://www.bluez.org/sbc-11 (I couldn't find a package for Precise).

ini parser.
git clone https://github.com/ndevilla/iniparser.git
cd iniparser
make
sudo cp libiniparser.* /usr/local/lib
sudo cp src/dictionary.h src/iniparser.h /usr/local/include
sudo chmod 644 /usr/local/include/dictionary.h /usr/local/include/iniparser.h
sudo chmod 644 /usr/local/lib/libiniparser.a
sudo chmod 755 /usr/local/lib/libiniparser.so.0
gtest.
cd /usr/src/gtest
sudo apt-get install cmake
sudo cmake .
sudo make
sudo chmod 644 *.a
sudo cp *.a /usr/local/lib
Build/install cras.
git clone https://chromium.googlesource.com/chromiumos/third_party/adhd
cd adhd/cras
./git_prepare.sh
./configure --prefix=/usr
make -j33
sudo make install
mkdir /var/run/cras
chown $USER /var/run/cras
If you see some build errors on 'snd_pcm_chmap_query_t', it means that you need newer version of alsa-lib. 1.0.27 or higher is required to build cras.

Confiugre/build Chrome.
Follow instruction on wiki for getting and building chrome.
cd chromium/src
GYP_GENERATORS="ninja" ./build/gyp_chromium -Duse_cras=1
ninja -C out/Release chrome

Start cras and chrome.
cd adhd/cras
src/cras
cd chromium/src
./out/Release/chrome --use-cras
Comments