Building a home media hub based on UBUNTU+XBMC

Source: Internet
Author: User
Tags acer

As a high-definition enthusiast, has always wanted to configure a HTPC home to achieve high-definition playback plus Home server features. The Nvidia ion platform is naturally the hardware of choice for HD platforms, while the software side of the Home Media Center first considers the already mature open Source tool XBMC. XBMC itself supports multiple platforms (Linux, Mac OS X, Windows ...). , from a driver and configuration standpoint, it's natural to be based on windows, but ultimately the reason for Linux is: ssh . Linux SSH makes it easy for me to operate my Home Media Center host through other computers and even mobile phones.

So I finally chose the Acer Aspire R3700 on the hardware, the ion platform-based ultra-small host, configured as follows:

    • Cpu:intel atom™d525
    • Memory: 2G DDR3 800Mhz
    • HDD: 320G Sata
    • Graphics: Nvidia G320
    • Network: WLAN 802.11b/g/n
    • Interface: USB interface 6, HDMI output, multi-in-one read card slot
    • ...

In addition to buying the host comes with a mouse and keyboard, I also choose HDMI HD line and MCE remote control.

The system chose the Ubuntu 10.10 system with easy-to-install configuration (I started with Gentoo, but I compiled the crash bird). The following features are available for use with Ubuntu:

    1. Implement XBMC fully managed AV library and output to 46-inch TV in your home via HDMI
    2. Connect your home router over a wireless network to get rid of network cable ties
    3. Enable sshd to perform system maintenance operations via other computers or mobile phone SSH to home media host
    4. Open Transmission-daemon, use this host for high-definition download, and remote control bittorrent download
    5. Enable automatic access to the Media Center, using the remote control for media playback, to avoid the possibility of using the mouse
System Installation

Since the Acer Aspire R3700 itself does not have a built-in optical drive, the installation system can be LIVEUSB for USB drive installation. I made a liveusb to an SD card, directly into the machine's built-in card reader to boot the installation. Specifically how to make LiveUSB and install Ubuntu system is not redundant, you can refer to Ubuntu LiveUSB Production Tutorial: Installation from USB Stick Quick.

Note: I added a normal account named XBMC when I set up the system, the system hostname is HAL. This user name and host name are used instead.

On the partition I created a new 220G blank partition mounted in the /library directory for storing high-definition movie files, using XFS in the file format, formatted with the following command:

Susize=64m-d agcount=4-i attr=2,maxpct=5-l library/dev/sdx    

To /etc/fstab add a /library partition mount line in:

/dev/sdb5/libraryxfsnoatime,nodiratime,allocsize=512m02

allocsize=512mthe effect is that each time a file is written, the XFS partition pre-allocates 512Mb of space for one write to reduce file fragmentation. 512Mb is not large for high-definition files with a lot of G.

System Debug Remove Redundant components

Run the update source first after installing the system sudo apt-get update . Then remove some unnecessary self-brought software, such as OpenOffice, Evolution Mail, Brasero, etc. Specifically, the individual needs to be removed, for example to remove OpenOffice, and run sudo apt-get autoclean openoffice.org for a full cleanup.

Solve Ralink RT3090 NIC driver problem

Ubuntu 10.10 comes with a wireless card Ralink RT3090 Driver There is a problem that does not properly shut down, you need to install a third-party source of the compilation package, run the following command:

# # Add a third-party driver suadd-apt-repository ppa:markus-tisoft/rt3090## Update source information and install a third-party wireless card driver sudo apt-updatesudo apt-get install rt3090-dkms  

Edit the /etc/modprobe.d/blacklist.conf file and add the following lines to blacklist the system's own driver module:

# blacklist other Ralink modules in favour of 3090 DKMS modblacklist rt2860stablacklist rt2870stablacklist Rt2800pciblackl ist rt2800usbblacklist rt2x00libblacklist rt2x00pciblacklist Rt2x00usb
Installing the NVIDIA Driver

In order to fully exploit the HD hard solution performance of the Ion platform, it is necessary to install Nvidia's private drive. Run the sudo apt-get install nvidia-current installed driver. Installed XBMC will appear apparent high CPU occupancy problem, the solution is to install the Nvidia driver after the installation, edit the /etc/X11/xorg.conf file, add the NoFlip settings:

"Device"  Identifier"Device0"  Driver "nvidia" vendorname"nvidia Corporation"  Boardname"ION" Option# Join this line endsection         
Debug HDMI audio output

Ubuntu Debug Audio HDMI output is a bit complicated, specifically I refer to how-to set up HDMI audio on NVidia GeForce G210, GT220, or GT240 for debugging, here is a brief description of my debugging process:

  1. Run alsamixer , F6 switch to HDA nvidia sound card output, open master, PCM, Front, Mic, S/PDIF, S/PDIF Def.
  2. Edit /etc/modprobe.d/sound.conf , add the following line:
    Options Snd-hda-intel enable_msi=0 probe_mask=0xffff,0xfff2
  3. Edit /etc/pulse/default.pa , add the following line:
    load-module-alsa-sink device=hw:1,3  
  4. Edit/etc/asound.conf, add the following lines:
    #pcm.! Default Hdmi:Nvidiapcm.dmixer {Type DmixIpc_key1024Ipc_key_add_uidFalse Ipc_perm 0660 slave {  PCM  "hw:1,3"   rate 48000  channels 2  Period_time 0  period _size 1024  Buffer_time 0  Buffer_size 4096}}pcm.! default { type Plug SLAVE.PCM  "Dmixer"}                
Open Iptables+ssh

Since the machine is connected by a non-line, it is best to map the corresponding port on the router and bind a fixed IP to facilitate maintenance, which is no longer redundant. Since the system has been set up, you can remove the mouse by opening the SSHD service for remote operation and maintenance. For a more secure system, Iptables+sshguard is also indispensable.

Run the command to install iptables, SSH and Sshguard:

Su doapt-get install iptables openssh-server sshguard 

Modify /etc/ssh/sshd_config :

# Modify the default 22 port to any other port, for example 2727.

Then set the iptables rule, edit /etc/iptables (no new can be created):

# Generated by Iptables-save v1.4.7 on Sat, 20:03:22 2010*raw:prerouting Accept [21639:19095836]:output Accept [2290 4:4,573,912]commit# completedOn Sat2220:03:222010# Generatedby Iptables-save v1.4.7On Sat2220:03:222010*filter:INPUTDROP [7:2223]:forwardDROP [0:0]:OUTPUT ACCEPT [9409:1846937]:sshguard-[0:0]-aInput-s127.0.0.1/32-j accept-aInput-m State--state related,established-j ACCEPT # Set Intranet IP access, default allow-aInput-s192.168.1.100/32-j accept-aInput-s192.168.1.101/32-j accept# Open Transmission-daemon Port6666, of which9091 is transmission Web Port-Ainput-p tcp-m tcp--dport 6666-j accept-a input-p tc P-m TCP--dport 9091-j accept# allow router upnp#-a input-s  192.168.1.1-j accept# setting access to the sshd port (2727), First Sshguard to determine whether access is abnormal-A input-p tcp-m tcp--dport 2727-j sshguard-a input-p tcp-m tcp--dport 2727-j accept-a input-p tcp-m tcp-- Tcp-flags RST rst-j dropcommit# completed on Sat May 22 20:03:22 2010              

Then run the sudo iptables-restore < /etc/iptables import iptables settings directly. The tragedy is that Ubuntu does not automatically save the iptables settings, so you must load the settings at boot, edit the /etc/network/interfaces files, and add the following two lines at the end:

/etc/iptables

Run sudo apt-get install rcconf and rcconf start the self-running process by joining the SSH system. Then restart the computer, you can use the other host to operate, maintenance.

Installation of XBMC and related components installation XBMC

Before we get XBMC, we need to add a third-party source and run the following command to complete the XBMC installation:

Suadd-apt-repository ppa:team-xbmcsudo apt-updatesudo apt-get install XBMC xbmc-standalone 

First run XBMC will find the Chinese unrecognized problem, need to do is to copy a Chinese font come in, for example, I like to use the Google-made droid Sans fallback font, run:

sudo cp droidsansfallback.ttf/usr/share/xbmc/media/fonts/arial.ttfsed-e "s/language>english<\language/Language>chinese (Simple)</language/"-I ~/. xbmc/  userdata/guisettings.xmlsed- E "s/font>default<\font/font >arial<\font/" -i ~/. xbmc/userdata/guisettings.xml    
Install LIRC for remote playback XBMC

As part of the HTPC, it is essential that you leave the mouse to use the remote control for cinema playback, and I am using the remote control of Microsoft Media Center to add an infrared receiver via USB.

To allow the remote control to work, first install the LIRC, run the sudo apt-get install lirc installation, the first installation will eject the remote control Terminal Configuration interface:

    • Select Windows Media Center transceivers/remotes (All) in remote Control configuration
    • In IR transmitter, select Microsoft Windows Media Center V2 (USB) in the If present: Direct TV Receiver

Then add the LIRCD to the system from the START process, restart the computer, run in the terminal irw , press the remote control of the direction key to test, if the terminal will correctly identify the remote control operation instructions remote control is ready. If it is not recognized, you need to restart the sudo dpkg-reconfigure lirc configuration, or the remote control battery power is not enough (I just because of this silly reason blind toss the system for two hours).

Installing Transmission-daemon

As a high-definition downloader, the realization of BitTorrent download remote management is essential, the preferred transmission this cross-platform BitTorrent download weapon, especially its daemon mode, support Web remote operation, and web-side operations are UI-optimized for handheld devices like the iphone. Run the sudo apt-get install transmission-daemon installation. Follow the setup instructions on the site to change the Settings.json file configuration.

Since Transmission-daemon is running by default with the Debian-transmission user name, it needs to be changed to my username XBMC for better management. To modify a /etc/init.d/transmission-daemon file:

#USER =debian-transmission #注释此行, modify the user name to a custom USER=XBMC
Installing the XBMC Plugin

The great thing about XBMC is that it can be infinitely extended via plugins, I've installed Getlib, 7176, themoviedb a few movie-class scrapers to automatically get the cover and production information for a movie based on the file name. The THETVDB is installed in the series of the scraper, but also can install Xbmc-addons-chinese extension, add Youku and other online video playback, to better expand the network TV function.

In addition, transmission can be installed under the XBMC plug-in, can be downloaded through XBMC monitoring transmission, example diagram:

Mounting XBMC skin: Aeon Nox

XBMC The most beautiful skin is Aeon series, Aeon below have Aeon65, Aeon MQ2 and Aeon NOx three mod. The individual is more inclined to use Aeon Nox, the system resources occupy less than the previous two and the skin function is very strong, the entire UI is also very beautiful (see below "appreciation").

Installation method is very simple, go to XBMC expansion Library to find Aeon NOx installation, the download process may be a bit slow, after all, after the skin decompression volume of up to 60MB. However, after the installation of the skin problem is the lack of Chinese font support, the solution is:

Copy a Chinese font to the ~/.xbmc/addons/skin.aeon.nox/fonts directory and rename it to Arial.ttf (for simplicity).

Then modify the ~/.xbmc/addons/skin.aeon.nox/720p/Font.xml file to filename Replace all of the fonts in Arial.ttf.

Optimize system settings

In order to better realize the smooth experience of HTPC, some optimizations are needed for the post-installation system.

    1. set up password-free automatic login XBMC account
      Click Unlock in the login screen settings, administration, System, to set up the XBMC account for automatic login.
    2. Setting the XBMC shutdown function
      In the power-down mode of the XBMC system setup, the option in the Auto shutdown function is set to OFF, which can be turned off by pressing the off key on the remote control.

After the entire system is optimized, you can choose the default login Xbmc-standalone environment in GDM without entering the GNOME desktop environment to save unnecessary system resource usage.

Appreciate

Reference:
    1. How-to perform a miminal Ubuntu and XBMC Install on a Asus EeeBox PC EB1501
    2. How-to set up HDMI audio on NVidia GeForce G210, GT220, or GT240
    3. Setting up Ubuntu 10.10 on Revo 3700
    4. XBMC 10.04 + HD Hard solution in Chinese setting
End

In the end, I've added a new Seagate GoFlex Desk 2TB HDD to my HTPC to meet my high-definition needs, and Acer's R3700 hosts are running for days without noise or fever. Between the computer, the computer and the mobile phone through the wireless network interconnection, must use the 801.11n wireless router to satisfy the wireless network the data high-speed transmission.

Building a home media hub based on UBUNTU+XBMC

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.