Kodi Community Forum

Full Version: Report: Building an XBMC-Linux based HTPC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm currently building an XBMC-Linux based HTPC and thought I'd share the experience, in the hope that it will be useful to others.

Goals
  • HTPC to support media playback and live TV (as a MythTV client)
  • Display device is a Full-HD LCD-TV, Audio and Video to be provided via HDMI
  • Judder-free display with automatic 24 Hz, 50 Hz and 60 Hz refresh rate switching
  • Playback of VC1/H.264 up to 1080p
  • IR remote control
  • Ability to switch to network booting later on

Background
I already have two HTPCs, Windows XP based, using ZoomPlayer and DVB Viewer (one driving a LCD TV in the bedroom, the other driving a projector in an dedicated HT room). Additionally, I'm using two XBOXen with XBMC each driving old-style CRT TVs. Media files are on a central server, in various formats (DVD, BR, .mkv, .avis, the works), live TV is provided using old-style star-topology DVB-S cabling. At least Fast Ethernet is available in all rooms.

One of the XBMC/CRT combos is now to be replaced with a larger LCD TV. Also, since the room it is in has no DVB-S cable, I've decided to look into streaming based live TV distribution, possible using a MythTV server.

I've looked at various options for media playback (PS3, Popcorn Hour etc.), however, since I was generally very happy with the XBMC UI, I decided to try and build a XBMC-Linux based HTPC from scratch.

Equipment used
TV: Samsung LE37-A616 Full HD. I already have a Samsung M86 in the bed room, and since I'm reasonably happy with the picture quality and esspecially the ability to playback 24p and 50p nativly without judder, I decided to go for Samsung again.

PC: Shuttle SN78SH7 Barebone. Acceptable form factor, Geforce 8200 board with HDMI out. Equipped with 2GB RAM and an Athlon X2 6000+.

IR: Igor USB plug and a spare remote (which came with a TT S2-3200 DVB card)

Base OS: Ubuntu 8.10 server edition. Server edition mainly to have a minimum base installation to build upon.

XBMC is being build from SVN, mostly since the refresh rate adapation options are not yet available in PPA.

Best Regards,
Olli
The board has Intel HDA audio. It actually has two distinct devices, one in the NVidia MCP for HDMI audio, and a Realtek ALC888DD codec with analog and an additional SPDIF output.

Initially, using the alsa drivers provided with Ubuntu 8.10, I didn't get HDMI audio to work. "HDMI" was shown as a subdevice on the realtek chip device, but apparently didn't output anything.

After installing "alsa-driver-1.0.18a" from source, a new device showed up on "card 0":

Quote:**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC888 Analog [ALC888 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC888 Digital [ALC888 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

In order to use it from XBMC, I defined an alias in .asoundrc:

Quote:owagner@fitnesspc:~$ cat .asoundrc
hdmi {
type hw
card 0
device 3
}

Afterwards, I could use "hdmi" as the device both for general and for passthrough audio in XBMC. Since the TV has no DD or DTS decoder, the respective options in XBMC had to be disabled, of course.
owagner Wrote:The board has Intel HDA audio. It actually has two distinct devices, one in the NVidia MCP for HDMI audio, and a Realtek ALC888DD codec with analog and an additional SPDIF output.

Initially, using the alsa drivers provided with Ubuntu 8.10, I didn't get HDMI audio to work. "HDMI" was shown as a subdevice on the realtek chip device, but apparently didn't output anything.

After installing "alsa-driver-1.0.18a" from source, a new device showed up on "card 0":



In order to use it from XBMC, I defined an alias in .asoundrc:



Afterwards, I could use "hdmi" as the device both for general and for passthrough audio in XBMC. Since the TV has no DD or DTS decoder, the respective options in XBMC had to be disabled, of course.

Thank you sir! This worked on my setup as well. Nod
quake101 Wrote:Thank you sir! This worked on my setup as well. Nod

By now, I found an issue with this setup, as of yet unsolved: If I play MP3s, they're playing slightly too fast. This sounds as if XBMC would be playing them back at 48000 insted of 44100.

Does this happen for you as well?

Best Regards,
Olli
I don't believe so. I'll double check tonight and report back. Smile
It works great for me by just adding this line to the asound.conf
Quote:defaults.pcm.device 3
I checked last night and everything other then FLV (youtube, etc) seems to be playing fine.
owagner Wrote:By now, I found an issue with this setup, as of yet unsolved: If I play MP3s, they're playing slightly too fast. This sounds as if XBMC would be playing them back at 48000 insted of 44100.

The problem appears to be that the HDMI out only supports 48000. XBMC actually detects this (visible in the debug log), and then happily continues with 48000 Hz, which causes the pitch shift.

I found a workaround for this by specifying an .asoundrc with rate conversion:

Code:
pcm.hdmiconv {
        type plug
        slave {
                pcm "hw:0,3"
                rate 48000
        }
}

Best Regards,
Olli
Is this a problem with all HDMI outputs, or particular to that board chipset? I don't hear any audible acceleration on my Asus m3n78-vm, but my ears suck. How do you check if it's at theright speed?
HDMI is specified for 44.1khz (and a lot of other sample rates) as well, so this may be specific to the NVidia chipset on the board.

I tried it just by playing a mp3 which I knew quite well. The speedup in the beat and the pitch shift was pretty obvious.

Best Regards,
Olli
We´re working on generalizing the audio chain so we can add dsps that would resample in these cases.

Cheers,
Tobias
Did you get SPDIF output working on this? AC3 passthrough?
Did you get LIRC working with the remote?

Cheers
owagner Wrote:In order to use it from XBMC, I defined an alias in .asoundrc:

Since I have the same hardware, I've been following this thread with interest.

My solution, which _seems_ to work:

+ Install Nvidia 1.77 drivers via the Ubuntu control panel,

+ Install latest release Alsa using an automated script found on the Ubuntu boards,

+ Change the BIOS to disable all external codecs for sound - leaving me with the default as being HDMI (and thus, not requiring an .asoundrc file).

Did you try disabling things in the BIOS? Seems to simplify life somewhat.

jh