GST cookbook/Trisquel6

From XiphWiki

Jump to: navigation, search

Trisquel Release 6.0 (toutatis) GStreamer Build Instructions
Tested on a Lenovo x201i by GChriss / 15-April-2013

Prepare live USB key as documented:
wget "http://cdimage.trisquel.info/trisquel-images/trisquel_6.0_amd64.iso.torrent"
transmission-gtk trisquel_6.0_amd64.iso.torrent &
dd if=/path/to/trisquel_6.0_amd64.iso of=/dev/sdX bs=8M
sync
cd /media/trisquel\ 6.0\ amd64/
md5sum -c md5sum.txt

Boot USB key in BIOS -> Install to disk -> Manual partition
Use a smaller '/' partition (~20GB), ~2GB swap space, the remainder as '/home', all primary partitions

Run through install prompts and reboot
Works out-of-box: backlight, suspend, audio, USB, 10/100 Ethernet, graphics acceleration, Atheros AR5418 Wireless Network Adapter (168c:0024 -- BIOS modification required)

Trisquel Menu -> System Settings -> Disable screensaver, screen dimming, suspend-on-lid-close, sound effects, window animations

Open Terminal:
sudo su

Get this stuff outta here...
/etc/init.d/apparmor stop
update-rc.d -f apparmor remove
apt-get --purge remove apparmor apparmor-utils libapparmor-perl libapparmor1 gnash libjack-jackd2-0 pidgin-data gstreamer0.10-tools gnome-app-install

apt-get update


echo "linux-image-generic hold" | dpkg --set-selections
(To undo: echo "linux-image-generic install" | dpkg --set-selections )
apt-get dist-upgrade

apt-get install fakeroot kernel-package libncurses5-dev libqt3-mt-dev bzip2 wget build-essential checkinstall autoconf libtool libglib2.0-dev bison flex libxml2-dev alsa-tools libasound2-dev vim mlocate libxv-dev libxmu-dev libxi-dev libsamplerate0-dev libsndfile1-dev git-core curl lm-sensors openssh-server iasl automake libsdl1.2-dev libgtk2.0-dev libglib2.0-dev libglade2-dev libffi-dev pciutils-dev cu sysfsutils mkvtoolnix mkvtoolnix-gui subversion cpuburn indicator-multiload indicator-cpufreq qt4-dev-tools intltool libjson0-dev libudev-dev libfftw3-dev libspeexdsp-dev gnome-doc-utils libgconf2-dev libv4l-dev libgnome-media-profiles-dev libgtkmm-3.0-dev libcanberra-gtk3-dev

chmod 0755 /usr/bin/cpufreq-selector

Create this file and add the line that follows:
vi /etc/modprobe.d/thinkpad_acpi.conf
options thinkpad_acpi fan_control=1

vi /etc/rc.local --> add the following:
chmod 666 /proc/acpi/ibm/fan

exit

indicator-multiload &


Optional but helpful step for realtime audio processing
sudo su
cd /usr/src
wget "http://linux-libre.fsfla.org/pub/linux-libre/releases/LATEST-3.8.N/linux-libre-3.8.6-gnu.tar.bz2"
tar -xvjf linux-libre-3.8.6-gnu.tar.bz2
cd linux-3.8.6/
cp /boot/config-3.2.0-38-generic .config
make oldconfig -> hold down enter key to accept defaults
make gconfig
'CONFIG_PREEMPT=y' + ALSA built as modules, 'CONFIG_HZ_100=y'
Consider adding Easycap: CONFIG_MEDIA_ANALOG_TV_SUPPORT=y + CONFIG_VIDEO_STK1160=m
CONCURRENCY_LEVEL=4 fakeroot make deb-pkg &>gsc_make-deb-pkg.log
dpkg -i ../*.deb


reboot and check for PREEMPT in 'uname -a':
Linux x201 3.8.6-gnu #1 SMP PREEMPT Sat Apr 13 02:07:48 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux


sudo su
mkdir -p /packages/openvideopro && mkdir -p /packages/openvideopro/lib && mkdir -p /packages/openvideopro/bin
mkdir -p /packages/openvideopro/lib/pkgconfig
chown -R gchriss:users /packages
exit
rm -Rf ~/.gstreamer-0.10
vi ~/.bashrc -> add the following:
export GST_PLUGIN_SYSTEM_PATH="/packages/openvideopro/lib"
export GST_PLUGIN_PATH="/packages/openvideopro/lib"
export PKG_CONFIG_PATH=/packages/openvideopro/lib/pkgconfig
export PATH=/packages/openvideopro/bin:$PATH


cd /packages
git clone git://repo.or.cz/nasm.git nasm_14april2013 && cd nasm_14april2013
./autogen.sh --no-configure &>gsc_autogen.log
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

YASM is optional:
cd /packages
git clone git://github.com/yasm/yasm.git yasm_14april2013 && cd yasm_14april2013
./autogen.sh --no-configure &>gsc_autogen.log
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages
git clone git://code.entropywave.com/git/orc.git orc_14april2013 && cd orc_14april2013
./autogen.sh &>gsc_autogen.log
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://jackaudio.org/downloads/jack-audio-connection-kit-0.121.3.tar.gz"
tar -xvzf jack-audio-connection-kit-0.121.3.tar.gz && cd jack-audio-connection-kit-0.121.3
./configure --enable-optimize --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

sudo su
vi /etc/security/limits.conf -> add the following line:
@audio - rtprio 99

vi /etc/security/limits.d/audio.conf -> create file with the following line:
@audio - rtprio 95
@audio - memlock unlimited

usermod -a -G audio gchriss --> subsitute 'gchriss' for your username
exit

At this point UI volume controls are missing/non-functional, but alsamixer works.
Build pulseaudio if needed, but otherwise optional:
rm -rf ~/.pulse* /tmp/.esd*
sudo -rf /tmp/pulse*
cd /packages && wget "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-3.0.tar.xz"
tar -xvJf pulseaudio-3.0.tar.xz
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/packages/openvideopro/lib64/pkgconfig ./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
sudo make install &>gsc_install.log
mkdir -p /packages/openvideopro/var/run/pulse && mkdir -p /packages/openvideopro/var/lib/pulse

Also optional:
cd /packages && wget "http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.10.36.tar.gz"
tar -xvzf gstreamer-0.10.36.tar.gz && cd gstreamer-0.10.36
make install &>gsc_install.log

Optional:
cd /packages && wget "http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-0.10.36.tar.gz"
tar -xvzf gst-plugins-base-0.10.36.tar.gz && cd gst-plugins-base-0.10.36
./configure --enable-orc --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

Optional:
cd /packages && wget "http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-0.10.31.tar.gz"
tar -xvzf gst-plugins-good-0.10.31.tar.gz && cd gst-plugins-good-0.10.31
See: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=9f2aa8d47f835ea155aaf635f618c0fc1ca87012
--> Remove line containing 'vbuffer.input' in 'sys/v4l2/gstv4l2bufferpool.c'
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/packages/openvideopro/lib64/pkgconfig ./configure --enable-experimental --enable-orc --prefix=/packages/openvideopro &>gsc_configure.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

Optional:
cd /packages && wget https://launchpad.net/gnome-media/main/2.91.2/+download/gnome-media-2.91.2.tar.bz2
tar -xvjf gnome-media-2.91.2.tar.bz2 && cd gnome-media-2.91.2
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log

TODO: Figure out how to rebuild UI volume controls (e.g., keyboard volume buttons)
TODO: The following builds but fails to connect to pulseaudio... debug needed?
git clone git://git.0pointer.de/pavucontrol pavucontrol_15april2013 && cd pavucontrol_15april2013
./bootstrap.sh &>gsc_bootstrap.log
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log

TODO: Rebuild Totem + PiTiVi

cd /packages && wget "http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz"
tar -xvzf libogg-1.3.0.tar.gz && cd libogg-1.3.0
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz"
tar -xvzf libvorbis-1.3.3.tar.gz && cd libvorbis-1.3.3/
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2"
tar -xvjf libtheora-1.1.1.tar.bz2 && cd libtheora-1.1.1
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_config.log
make install &>gsc_install.log

Open abrowser, download:
http://sourceforge.net/projects/libjpeg-turbo/files/1.2.90%20%281.3beta1%29/libjpeg-turbo-1.2.90.tar.gz/download
cd /packages && tar -xvzf libjpeg-turbo-1.2.90.tar.gz && cd libjpeg-turbo-1.2.90
./configure --prefix=/packages/openvideopro --with-jpeg8 &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://dl.matroska.org/downloads/libebml/libebml-1.2.2.tar.bz2"
tar -xvjf libebml-1.2.2.tar.bz2 && cd libebml-1.2.2
make -C make/linux install_staticlib install_headers prefix=/packages/openvideopro &>gsc_make.log

cd /packages && wget "http://dl.matroska.org/downloads/libmatroska/libmatroska-1.3.0.tar.bz2"
tar -xvjf libmatroska-1.3.0.tar.bz2 && cd libmatroska-1.3.0/
CXXFLAGS='-I/packages/openvideopro/include' make -C make/linux install_staticlib install_headers prefix=/packages/openvideopro &>gsc_make.log

cd /packages && wget "http://downloads.xiph.org/releases/libshout/libshout-2.3.1.tar.gz"
tar -xvzf libshout-2.3.1.tar.gz && cd libshout-2.3.1
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xz"
tar -xvJf glib-2.34.3.tar.xz && cd glib-2.34.3
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
'make check' failures are "OK"
make install &>gsc_install.log

cd /packages && wget "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.0.27.tar.bz2"
tar -xvjf alsa-lib-1.0.27.tar.bz2 && cd alsa-lib-1.0.27
./configure --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

cd /packages && wget "http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.0.6.tar.xz"
tar -xvJf gstreamer-1.0.6.tar.xz && cd gstreamer-1.0.6
./configure --enable-failing-tests --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make check &>gsc_check.log
make install &>gsc_install.log

cd /packages && wget "http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.0.6.tar.xz"
tar -xvJf gst-plugins-base-1.0.6.tar.xz && cd gst-plugins-base-1.0.6
./configure --enable-orc --prefix=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make check &>gsc_check.log
make install &>gsc_install.log

cd /packages && wget "http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.0.6.tar.xz"
tar -xvJf gst-plugins-good-1.0.6.tar.xz && cd gst-plugins-good-1.0.6
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/packages/openvideopro/lib64/pkgconfig ./configure --enable-experimental --enable-orc --prefix=/packages/openvideopro &>gsc_configure.log
make V=1 &>gsc_make.log
make install &>gsc_install.log

Optional but really helpful:
cd /packages && wget "http://downloads.sourceforge.net/qjackctl/qjackctl-0.3.10.tar.gz"
tar -xvzf qjackctl-0.3.10.tar.gz && cd qjackctl-0.3.10
./configure --prefix=/packages/openvideopro --with-jack=/packages/openvideopro &>gsc_config.log
make V=1 &>gsc_make.log
make install &>gsc_install.log



===
Create the following block entries for automatic execution @ user login
The first two entries are specific to managing Thinkpad-series laptops


gsc@host:~$ cat ~/.config/autostart/cpufreq-selector.desktop

[Desktop Entry]
Type=Application
Exec=sh -c "/usr/bin/cpufreq-selector -c 0 -g performance & /usr/bin/cpufreq-selector -c 1 -g performance & /usr/bin/cpufreq-selector -c 2 -g performance & /usr/bin/cpufreq-selector -c 3 -g performance"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=cpu-freq-selector
Name=cpufreq-selector
Comment[en_US]=Set 2.4GHz (x4)
Comment=Set 2.4GHz (x4)


gsc@host:~$ cat ~/.config/autostart/echo.desktop

[Desktop Entry]
Type=Application
Exec=sh -c "echo level 7 > /proc/acpi/ibm/fan"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Spin up x201i Fan
Name=Spin up x201i Fan
Comment[en_US]=Substitute 'disengaged' for '7' for max speed
Comment=Substitute 'disengaged' for '7' for max speed


gsc@host:~$ cat ~/.config/autostart/gnome-terminal.desktop

[Desktop Entry]
Type=Application
Exec=gnome-terminal
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=GNOME Terminal
Name=GNOME Terminal
Comment[en_US]=Just to get things started...
Comment=Just to get things started...


gsc@host:~$ cat ~/.config/autostart/qjackctl.desktop

[Desktop Entry]
Type=Application
Exec=sh -c "PATH=/packages/openvideopro/bin:$PATH LD_LIBRARY_PATH=/packages/openvideopro/lib64 /packages/openvideopro/bin/qjackctl"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=qjackctl
Name=qjackctl
Comment[en_US]=Launch openvideopro qjackctl / -GChriss
Comment=Launch openvideopro qjackctl / -GChriss

===


sudo updatedb

Stress-test CPU temperature stability (often necessary, proceed at own risk):
burnMMX & burnMMX & burnMMX & burnMMX


network-manager can sometimes be flaky, issue on an as-needed basis:
service network-manager restart


Start JACK either via command-line or 'Start' button in QjackCtl, launch GStreamer pipeline, then renice pipeline to -18 or so.


Personal tools


Main Page

Xiph.Org Projects

Audio—

Video—

Text—

Container—

Streaming—