TIP Troubleshooting Gstreamer
From Gentoo Linux Wiki
| Terminals / Shells • Network • X Window System • Portage • System • Filesystems • Kernel • Other |
Contents |
[edit] Introduction
gstreamer is a very sensitive build and will compile correctly, but fail to run for the following reasons. I'm going to list them in somewhat reverse order because troubleshooting step-by-step isn't worth the time it takes. Do everything at once and it's sure to work. Some material was taken from a Gentoo Forums thread in the Gentoo Forums
[edit] GCC Hardened
If you're using gcc hardened you need to switch your profile to the vanilla version. Example:
| Code: vanillafy gcc |
gcc-config -l [1] i686-pc-linux-gnu-3.3.5-20050130 * [2] i686-pc-linux-gnu-3.3.5-20050130-hardenednopie [3] i686-pc-linux-gnu-3.3.5-20050130-hardenednossp [4] i686-pc-linux-gnu-3.3.5-20050130-vanilla gcc-config 4 env-update source /etc/profile |
[edit] prelink
| Code: unmerge prelink |
emerge -C prelink |
or
| File: /etc/env.d/60gstreamer-0.8 |
PRELINK_PATH_MASK=/usr/lib/gstreamer-0.8 |
| Code: update environment |
env-update source /etc/profile |
NOTE: this is already done by recent gstreamer builds
[edit] gst registry
Occasionally, the gstreamer registry become corrupt. As root:
| Code: recreate registry |
rm -f /root/.gstreamer-0.8/registry.xml
ls /home/ | while read USER; do rm -f /home/${USER}/.gstreamer-0.8/registry.xml; done
rm -f /var/lib/cache/gstreamer-0.8/registry.xml
gst-register
|
[edit] CFLAGS & LDFLAGS
Some of the seemingly safe CFLAGS, and even the default "safe" LDFLAGS can make gstreamer twitch. After you have done all of the steps above, re-emerge gstreamer explicitly without LDFLAGS. You shouldn't have to re-emerge the plugins, but it can't hurt.
export LDFLAGS=" "
export CFLAGS="-O -pipe -mcpu=i586"
export CXXFLAGS="${CFLAGS}"
-mcpu or -mtune can affect the stability but they do not seem to be so important. Removing any -f... CFLAGS (ex. -fomit-frame-pointers) and lowering to -O is crucial. For example: gstreamer-0.10.8 compiled with the above options but k8 instead of i586 on AMD64 Gentoo using a vanilla gcc 3.4.6 works fine.
remerge gstreamer gst-plugins, and all plugins
emerge gstreamer gst-plugins
ls /usr/portage/media-plugins/ | grep gst-plugins-| while read PLUGIN; do emerge ${PLUGIN}; done
similar but slightly alternative method
eix gst | grep '*' | grep media | cut -d' ' -f2 | while read GST; do emerge ${GST}; done
unset LDFLAGS unset CFLAGS unset CXXFLAGS
Known to NOT work:
- -Os in CFLAGS seems to yield failure
[edit] Other Notes
- Be sure that alsa is correctly configured Gentoo.org Alsa Guide
- Don't forget to set gcc back to hardened after emerging gstreamer packages
- Don't forget to emerge prelink again if you plan to use it
- If you go the step-by-step troubleshooting route, delete the registry each time you try something new
- Notice the space in LDFLAGS=" "
