I think, I've got it now. Playback off an NFS share is flawless.
One major issue was (and still is) the limited main memory in the 128 MB CPU/GPU split.
So, I tried to save every last bit of system memory now by disabling all but the necessary daemons and services. The only daemons running are udevd, dropbear, and busybox ntpd.
Also, I disabled all but the first virtual terminal - and have xbmc started by a very minimalistic /etc/inittab, like so:
Code: Select all
# /etc/inittab: This file describes how the INIT process should set up
# the system in a certain run-level.
# Default runlevel.
id:3:initdefault:
# System initialization, mount local filesystems, etc.
si::sysinit:/sbin/rc sysinit
# Further system initialization, brings up the boot runlevel.
rc::bootwait:/sbin/rc boot
l0:0:wait:/sbin/rc shutdown
l0s:0:wait:/sbin/halt -dhp
l1:1:wait:/sbin/rc single
l2:2:wait:/sbin/rc nonetwork
l3:3:wait:/sbin/rc default
l4:4:wait:/sbin/rc default
l5:5:wait:/sbin/rc default
l6:6:wait:/sbin/rc reboot
l6r:6:wait:/sbin/reboot -dk
# new-style single-user
su0:S:wait:/sbin/rc single
su1:S:wait:/sbin/sulogin
# TERMINALS
#
c1:12345:respawn:/usr/lib/xbmc/xbmc.bin
#c1:12345:respawn:/bin/busybox getty 38400 tty1 linux
# SERIAL CONSOLES
s0:12345:respawn:/bin/busybox getty 115200 ttyAMA0 vt100
# What to do at the "Three Finger Salute".
ca:12345:ctrlaltdel:/sbin/shutdown -r now
x:a:once:/etc/X11/startDM.sh
Putting XBMC in inittab takes care of restarting the process whenever it runs out of memory (and is therefore killed by the kernel).
Also, by switching comments to
Code: Select all
[...]
# TERMINALS
#
#c1:12345:respawn:/usr/lib/xbmc/xbmc.bin
c1:12345:respawn:/bin/busybox getty 38400 tty1 linux
[...]
via ssh I can still re-enable a login VT for debugging, etc.
In addition, I added several tweaks to /etc/sysctl.conf
Code: Select all
# Memory tuning for XBMC
vm.min_free_kbytes = 1024
vm.swappiness = 0
vm.laptop_mode = 0
vm.overcommit_memory = 1
#vm.overcommit_ratio = 100
vm.page-cluster = 0
vm.vfs_cache_pressure = 100
And there's still room for optimization:
- At the moment, I'm running a very modular kernel, but it's far from minimalistic. I'll soon try to build a kernel that only incorporates the features and modules necessary to run a full fledged XBMC.
- I tried to enable as many of XBMC's features as possible for this first test. In a new build, I'll leave out things like libbluray...
Thanks to Gentoo's ebuild system, this is easily accomplished by setting the appropriate use flags.
- Last but not least, building with '-Os' in CFLAGS might still squeeze out some more bytes.
You might wonder why I built such a heavily loaded system in the first place. Well, it might be an odd approach, but I just wanted to have a full-featured system at first, deal with (compilation) issues, and just check out what the RasPI can take.
Now, I can make several copies of that system for different purposes, and then cut those down to a more "sane" level. In consequence, my SD card now holds Gnome3, Mate Desktop, LXDE, Samba, CUPS, Apache, MySQL, etc. - which is pretty amazing for such a small embedded device.
Thank you very much for this awesome device, Raspberry PI Foundation!!!
As for XBMC, I'll keep you posted...
Best,
Torsten