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

2 Kommentare:

  1. Thanks mate, your howto made me solve some issues with Jaunty and XBMC. Thanks for sharing.

    Cheers
    Johannes

    AntwortenLöschen
  2. Hi, did you find any solution of controlling mpd through the xbmc interface?

    AntwortenLöschen