Wednesday, November 2, 2011

Vagrant/puppet based graphite installation on fedora 15

Since short I have a github account. => https://github.com/svenvd

My first "project" on this link is a Vagrant/puppet based graphite auto-installation on a fedora 15 VM

Setting up mediacenter with xbmc and Fedora 15 part 3

I noticed the sound coming from my mediacenter wasn't quite clear.

To have a higher sound quality you need to edit /etc/pulse/daemon.conf.

The resample-method = line can have following values:

src-sinc-best-quality, src-sinc-medium-quality, src-sinc-fastest, speex-float-{10-0}, speex-fixed-{10-0}, ffmpeg, src-zero-order-hold, src-linear, trivial

The first value is the best quality but uses the most cpu time. Please try different values to find a good balance between sound quality and cpu usage.

For me, on a Intel(R) Atom(TM) CPU D525 @ 1.80GHz,   src-sinc-best-quality was a too high setting, but   src-sinc-medium-quality worked fine. By default the setting is speex-float-3.

Setting up mediacenter with xbmc and Fedora 15 part 2

In the previous post I explained how xbmc was set up, in this post I will explain how to enable autologin for gdm.

When your mediacenter boots, you want it to automatically start xbmc, without having to enter a password.

To achieve this in gnome 3 you have to edit config /etc/gdm/custom.conf.

At the daemon section you have to add following configuration options:
[daemon]
TimedLoginEnable=true
TimedLogin=<your mediacenter user>
TimedLoginDelay=0

replace   <your mediacenter user> with your user.

This will autologin your "mediacenter user" at boot, but this will not start xbmc.

To automatically start xbmc, login with your "mediacenter user" and run following command from a terminal:

gnome-session-properties

In the window that popups add a service, the path to xbmc is /usr/bin/xbmc.

Setting up mediacenter with xbmc and Fedora 15 part 1

This is my first (quick&dirty) tutorial:

During the years, I've gathered a lot of pictures and movies from personal trips to other countries etc..
I had no easy and good way to see them on the TV, so until now they have been gathering dust on my NAS.

So I recently purchased a ZOTAC ID41 mini-pc which I connect with HDMI to the TV.

First I made a USB stick that can be booted. I created this USB with a nice piece of software called Universal-USB-Installer. You can download it here.

I used the Fedora-15-x86_64-Live-Desktop iso.

Next I plugged this stick into the ZOTAC and pressed "del" at boot time to change boot order in BIOS. When the Fedora Live distribution was booted from USB, I used the option "install to hard disk" which can be located at the gnome 3 favorites list. As a "hard disk" I used a 8G sd card. After installation I booted of the sd card, now the real work can begin! (Please note I made my swap 2G so I have 6G of useful space)
After first boot I also disabled some services I don't use.

First you need to make sure the rpmfusion repos are enabled on your box:
To add the rpmfusion repositories to your Fedora installation follow their guidelines.

To fully make use of the nvidia ion chipset in this ZOTAC, you have to install the proprietary nvidia drivers
You can do this with command "yum -y install kmod-nvidia".

Now it's time to install xbmc, which can be retrieved from the rpmfusion repositories.
To install xbmc execute following command "yum -y install xbmc".

The goal was to retrieve the media from my custom made NAS (samba). To achieve this I added mounting of my media shares in fstab. Additionally I added mounting these drives in crontab to run every minute (in case the mediacenter was up before the NAS was up). Note: xbmc also has a built in samba client which can be used.

At this point I could play my media with xbmc from my samba share.

But there was one little problem... the sound was not routed through HDMI! (the analog output worked fine however).

I thought maybe something was buggy, so I first updated the whole system with "yum update". This however did not resolve the problem.

The solution was as follows:

You first need to define if sound is working with ALSA

Run the command alsamixer -c 0, press F6 to change sound card.
Make sure nothing is muted for soundcard HDA Nvidia. (You can unmute by pressing "m").

Then you need to lookup what your working HDMI output device is:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

I have 4 Nvidia devices. I tried to manually route some sound through it with:
speaker-test -D plughw:<card>,<device> -c 2 /dev/urandom
or use
aplay -D plughw: <card>,<device> /usr/share/sounds/alsa/Noise.wav
or you can use
mplayer -ao pulse: <card>,<device>  <some audio file>
(replace <card> and <device> with the one you want to test).

Only device 1,7 played the sound, so this means ALSA is working fine.

Next you need to tell pulseaudio to make use of this device:
Replace line #load-module module-alsa-sink with load-module module-alsa-sink device=plughw:1,7 in config file /etc/pulse/default.pa and reboot.

In the GUI tool PulseAudio manager (yum install paman) you should now see your added device in the devices tab. For me it had the description "High Definition Audio Controller".

Now you need to tell xbmc to make use of this new device.
Fire up your xbmc and go to system>system>Audio Output
  • In audio output option select HDMI
  • In audio output device, select the description you saw in paman (for me it was "High Definition Audio Controller")
Please test your xbmc, everything should work now.

To make use of the graphic processing of the nvidia ion chipset you may not forget to enable vdpau in xbmc.