Mittwoch, 12. Mai 2010

XBMC & Music Player Daemon (MPD) on Zotac MAGHD-ND01

The Zotac MAGHD-ND001 plays 720p and 1080p mkv files without lagg. Fine! That's what a Media Center PC should be like. See the Zotac trailer for a similar device (ZOTAC ZBOX HD-ID11). The installation process should be the same

apt-get install python-software-properties
apt-add-repository ppa:team-xbmc/ppa
apt-add-repository ppa:nvidia-vdpau/ppa
apt-get update

Install kernel, XBMC and X

apt-get install linux-image-2.6.32-22-generic
reboot
After the Reboot install XBMC and it's dependencies
apt-get install xbmc xbmc-standalone
XBMC has a lot dependencies. Don't worry!

Autologin / Autostart XBMC without Gnome/KDE

Install rungetty
apt-get install rungetty
To autologin the user xbmc replace in /etc/init/tty1
#exec /sbin/getty -8 38400 tty1
exec /sbin/rungetty --autologin xbmc tty1
After the autologin x11 and XBMC should be started. Add a line to your .bashrc
echo "xinit xbmc-standalone" >> /home/xbmc/.bashrc

Sound via HDMI and FrontAudio

add-apt-repository ppa:ricotz/unstable
apt-get update
apt-get install pulseaudio pulseaudio-utils gstreamer0.10-pulseaudio pavumeter pavucontrol paprefs alsa-base alsa-utils
create/edit /etc/asound.conf
pcm.!default {
 type hw
 card 0
 device 3
}

Windows-Share / Samba

I want to fill my MAG Shares without entering a Username or Password. Backup /etc/samba/smb.conf and overwrite:
cp /etc/samba/smb.conf /etc/samba/smb.conf.ori
echo "[global]
        # Browsing / Identification
        netbios name = mag
        server string = smb.MAG
        workgroup = workgroup

        # Auth
        security = user
        encrypt passwords = true
        map to guest = bad user
        guest account = nobody

        passdb backend = tdbsam
        obey pam restrictions = yes
        invalid users = root

        dos charset = 1255
        unix charset = UTF-8
        display charset = UTF-8
        unix extensions = yes

        # Symlink Patch
        follow symlinks = yes
        wide symlinks = yes
        unix extensions = no

[Audio]
        comment = "MAG Audio files"
        path = /media/Audio
        writeable = yes
        read only = no
        guest ok = yes
        create mask = 0777
        directory mask = 0777
        group = entertainment

[Video]
        comment = "MAG Video files"
        path = /media/Video
        writeable = yes
        read only = no
        guest ok = yes
        create mask = 0777
        directory mask = 0777
        group = entertainment
" >> /etc/samba/smb.conf
Setup folders and permissions
mkdir /media/Audio
mkdir /media/Video
chown xbmc:entertainment /media/Audio
chown xbmc:entertainment /media/Video
chmod 777 /media/Audio
chmod 777 /media/Video

Music Player Daemon MPD

While XBMC uses the HDMI Audio Output, MPD should use Front-Audio to play movies (with sound on a TV) and music at the same time.

Open /etc/mpd.conf with an Editor of your choice and find the commented lines and replace them as shown here. should be
#zeroconf_enabled "yes"
zeroconf_enabled "yes"

#zeroconf_name "Music Player"
zeroconf_name "MAG Music Player"

#default_permissions             "read,add,control,admin"
default_permissions             "read,add,control,admin"
Know that MPD is configures without a password. This is a security risk!

Setup your audio device. You must Change "mixer_control" to "Front", because "PCM" (which is default) doesn't influence the Volume. Comment out all
audio_output {
        type            "alsa"
        name            "My ALSA Device"
        device          "hw:0,0"        # optional
        format          "44100:16:2"    # optional
        mixer_control   "Front"         # optional
}
Set permissions for mpd to use alsa and pulse
usermod -a -G pulse-access mpd
usermod -a -G audio mpd
Stop all instaces of mpd and create a Database. You should put music to /var/lib/mpd/music before you do that.
mpd --kill
mpd --create-db

nVidia 195.36.24 on Ubuntu 10.04 Lucid Lynx

Ubuntu 10.04 is running Nouveau driver as default for nVidia-GPUs. If you need vdpau for Video-Encoding you have to install nVidias proprietary Driver.

Uninstall Noveau

sudo apt-get remove nvidia*
apt-get remove xserver-xorg-video-nouveau
Add this lines to /etc/modprobe.d/blacklist.conf
blacklist nouveau
blacklist nvidiafb

Install driver from Packet Source

Install nVidia driver from Ubuntu repository to later upgrade it to the latest Version. I know it's not a clean way, but after hours of trying this is a working.
apt-get install libvdpau-dev libvdpau1 nvidia-kernel-common nvidia-185-modaliases nvidia-glx-185 nvidia-settings
Download the latest driver from nVidia Support and extract them
wget http://de.download.nvidia.com/XFree86/Linux-x86_64/195.36.24/NVIDIA-Linux-x86_64-195.36.24-pkg2.run
chmod a+x NVIDIA-Linux-x86_64-195.36.24-pkg2.run
./NVIDIA-Linux-x86_64-195.36.24-pkg2.run -x
You will also need your kernel headers. Download them if you haven't done yet.
apt-get install linux-headers-`uname -r`
ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux
You cannot install the nVidia drivers while X is running.
ERROR: You appear to be running an X server; please exit X before installing. For further details, please see the section INSTALLING THE NVIDIA DRIVER in the README available on the Linux driver download page at www.nvidia.com.
Let's switch the runlevel to kill X. The bootsplashscreen made some trouble for me so you'd better switch it off first and reboot.
Open /boot/grub/grub.cfg and find your first menuentry. In my case:
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set ba89659b-be12-4e7e-b075-5a5ffc80e65f
        linux   /vmlinuz-2.6.32-22-generic root=/dev/mapper/MAG-root ro   quiet splash
        initrd  /initrd.img-2.6.32-22-generic
}
remove "quiet splash", safe the file and reboot.
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set ba89659b-be12-4e7e-b075-5a5ffc80e65f
        linux   /vmlinuz-2.6.32-22-generic root=/dev/mapper/MAG-root ro 
        initrd  /initrd.img-2.6.32-22-generic
}
Now you can open TTY1 by pressing [Ctrl] + [Alt] + [F1], login as root (or use sudo) and execute
init 1
Select "drop to a root shell" (you do not need networking). The nVidia installer doesn't like the single mode, so now go to
init 3
Now run NVIDIA-Linux-x86_64-195.36.24-pkg2.run! If you use 64bit, please see 32bit OpenGL Modules to fix.
./NVIDIA-Linux-x86_64-195.36.24-pkg2/nvidia-installer


32bit OpenGL Modules

Warning: Unable to perform the runtime configuration check for 32-bit library 'libGL.so.1' ('/usr/lib32/libGL.so.195.36.24'); this is typically caused by the lack of a 32-bit compatibility environment. Assuming successful installation.
sudo apt-get install ia32-libs linux32 lib32asound2

Samstag, 8. Mai 2010

Google Chromium unter Ubuntu >= 9.10

Firefox ist reine Zeitverschwendung! Zugegeben, die vielen Plugins machen den Mozilla Firefox für Webentwickler unverzichtbar. Wer jedoch auf Geschwindigkeit beim Surfen Wert auf Geschwindigkeit legt (und damit ist vorallem die Javascript-Engine entscheident), sollte sich den OpenSource Browser Chromium ansehen. Wem die Geschwindigkeit egal ist, der hat das umso nötiger.

Dein Netbook wird es dir danken!

Zum Lesen vorab:
* sofern noch nicht gelöscht

Installation

unter Ubuntu 9.10 Karmic Koala oder Ubuntu 10.04 Lucid Lynx
sudo su
apt-add-repository ppa:chromium-daily/ppa
apt-get update
apt-get install chromium-browser chromium-codecs-ffmpeg-extra chromium-codecs-ffmpeg-nonfree
Es lohnt sich die HTML5 beta von youtube.com zu testen.