Gentoo/Configuration HTPC ASRock Core 100HT

Page last edited 3,574 days ago
From Alon Bar-Lev's Site
Jump to navigation Jump to search

Alon Bar-Lev's HTPC ASRock Core 100HT

It took a lot of time to assemble a complete HTPC setup which is Linux compatible, small, quiet.

I use this configuration as Internet Radio, DVD, movies, game console, print server.

Following I describe my setup.

Hardware

Computer

ASRock Core 100HT

ASRock Core 100HT.jpg Vendor

Main features: A complete Intel chipset, small, quiet, many USB ports, HDMI 1080p.

The IR remote control is usable under Linux with some patches, however it is very primitive.

Input devices

Koribo Irad

Koribo Irad.png Vendor

USB:

ID 1241:0504 Belkin

I actually have bought the two separately (llro, XGene), so I have two receivers, unless the kit comes with special receiver, one does not work correctly with keyboard and remote.

Main features: Standard HID device, most of keys are operational under Linux.

The optical mouse is *AMAZING*!!!

Sony DualShock3 SixAxis

Sony DualShock3 SixAxis.png Vendor

Main features: Supported by Linux kernel, Full HID emulation, USB and Bluetooth medium support.

Communications

Nano Bluetooth USB Adapter.jpg

Main features: Supported by Linux kernel, Bluetooth 2 spec.

USB:

ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

Storage

Seagate Black Armor 110

Seagate BlackArmor 110.png Vendor

Main features: Network attached storage, CIFS, FTP, NFS. Decent security model.

System

Configure the following base of these references:

Profile:

/etc/portage/make.profile -> ../../var/gentoo/portage/profiles/default/linux/amd64/10.0/no-multilib
File: /etc/portage/make.conf
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
USE="${USE} mmx sse sse2 caps fam"
USE="${USE} bluetooth alsa joystick"
USE="${USE} kde qt4 qt3support X xinerama opengl"
USE="${USE} jpeg jpeg2k tiff png svg"
USE="${USE} mp3 ogg vorbis"
USE="${USE} mpeg"
USE="${USE} bidi"
USE="${USE} lzma"
USE="${USE} curl samba logrotate vim-syntax"
USE="${USE} -cups -gnome -qt3 -handbook"
USE="${USE} -cxx -ruby -perl -fortran -python -lua -java"
USE="${USE} -berkdb -gdbm -branding -esd -gstreamer -semantic-desktop -hal"
VIDEO_CARDS="intel"
INPUT_DEVICES="evdev"

Special USE flags:

media-video/vlc dbus id3tag ffmpeg aac a52 aalib taglib truetype cdda cddax cddb cdio dvd encode xv rtsp live ogmusepack run-as-root
media-libs/libsdl xv

Video

I have found that connecting TV using VGA gives a better resolution than using the HDMI device, I was quite surprised.

There is one challenge though, how to make the computer boot with TV turned off and set up correct resolution at the absent of DDC, and how to ignore the HDMI port.

Ended up with the following X11 video configuration, which forces resolution and ignores DDC override.

File: /etc/X11/xorg.conf
Section "ServerLayout"
        Identifier     "Default"
        Screen         "Screen1"
EndSection

Section "ServerFlags"
        Option      "blank time"    "10"    # 10 minutes
        Option      "standby time"  "20"
        Option      "suspend time"  "30"
        Option      "off time"      "60"
        Option      "DefaultServerLayout"   "Default"
EndSection

Section "dri"
        Group           0
        Mode            0666
EndSection

Section "Extensions"
        Option          "Composite"     "Enable"
EndSection

Section "Monitor"
        Identifier   "none"
        Option       "Ignore" "true"
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        ModeLine     "1360x768"  85.50  1360 1424 1536 1792  768 771 777 795 +hsync +vsync
EndSection

Section "Screen"
        Identifier   "Screen1"
        Device       "Card0"
        Monitor      "Monitor1"
        Option       "ConnectedMonitor" "Monitor1"
        SubSection   "Display"
                Depth 24
                Modes "1360x768"
        EndSubSection
EndSection

Section "Device"
        Identifier  "Card0"
        Driver      "intel"
        VendorName  "Intel Corporation"
        BoardName   "Arrandale Integrated Graphics Controller"
        BusID       "PCI:0:2:0"
        Option      "monitor-HDMI1" "none"
        Option      "monitor-VGA1" "Monitor1"
EndSection

Power

Common

File: /etc/hibernate/ususpend-ram.conf
USuspendRamForce yes

Bluetooth

Disable bluetooth during sleep.

File: /etc/hibernate/common.conf
OnSuspend 90 hciconfig hci0 down
OnResume  90 hciconfig hci0 up

Wakeup from LAN

emerge sys-apps/ethtool
File: /etc/hibernate/common.conf
OnSuspend 90 ethtool -s eth0 wol g

Wakeup from Input

In order to allow wakeup by remote control/keyboard, you need to determine which USB bus the receiver is connected, for example:

lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 002 Device 004: ID 1241:0504 Belkin 
Bus 002 Device 005: ID 1241:0504 Belkin 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

"Belkin" is the device, and it resides at bus 002 device 004 and 005, now, let's see which PCI controller it is:

ls -la /sys/bus/usb
total 0
drwxr-xr-x 2 root root 0 Nov 26 22:21 .
drwxr-xr-x 4 root root 0 Nov 26 22:21 ..
lrwxrwxrwx 1 root root 0 Nov 26 22:21 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:1a.0/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Nov 26 22:21 1-1 -> ../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1
lrwxrwxrwx 1 root root 0 Nov 26 22:21 1-1:1.0 -> ../../../devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1:1.0                                                                                                    
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.1 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0                                                                                                    
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.1:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.1:1.1 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.1                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.4 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.4:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.4:1.1 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.1                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.5 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.5:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 2-1.5:1.1 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.1                                                                                          
lrwxrwxrwx 1 root root 0 Nov 26 22:21 3-0:1.0 -> ../../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/usb3/3-0:1.0                                                                                           
lrwxrwxrwx 1 root root 0 Nov 26 22:21 4-0:1.0 -> ../../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/usb4/4-0:1.0                                                                                           
lrwxrwxrwx 1 root root 0 Nov 26 22:21 usb1 -> ../../../devices/pci0000:00/0000:00:1a.0/usb1
lrwxrwxrwx 1 root root 0 Nov 26 22:21 usb2 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2
lrwxrwxrwx 1 root root 0 Nov 26 22:21 usb3 -> ../../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/usb3                                                                                                      
lrwxrwxrwx 1 root root 0 Nov 26 22:21 usb4 -> ../../../devices/pci0000:00/0000:00:1c.1/0000:02:00.0/usb4                                                                                                      

We can see that these devices are at pci0000:00/0000:00:1d.0.

Now, let's see which ACPI event it is:

cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
P0P1      S4    *disabled  
P0P3      S4    *disabled  
P0P4      S4    *disabled  pci:0000:00:04.0
P0P5      S4    *disabled  
P0P6      S4    *disabled  
BR1E      S4    *disabled  pci:0000:00:1e.0
CIR       S4    *disabled  pnp:00:06
EUSB      S4    *disabled  
USB0      S4    *disabled  pci:0000:00:1d.0
USB1      S4    *disabled  
USB2      S4    *disabled  
USB3      S4    *disabled  
USBE      S4    *disabled  
USB4      S4    *disabled  pci:0000:00:1a.0
USB5      S4    *disabled  
USB6      S4    *disabled  
BR20      S4    *disabled  pci:0000:00:1c.0
BR21      S4    *disabled  pci:0000:00:1c.1
BR22      S4    *disabled  
BR23      S4    *disabled  
BR24      S4    *disabled  
BR25      S4    *disabled  
BR26      S4    *disabled  
BR27      S4    *disabled  

It is USB0!!!

So add the following to ensure wakeup:

File: /etc/hibernate/ram.conf
OnSuspend 90 cat /proc/acpi/wakeup | grep USB0 | grep disabled > /dev/null && echo USB0 > /proc/acpi/wakeup || true

Input

Acceleration

Both keyboard and remote control are acting as HID devices, however, I would like to have the keypad of remote control change radio stations.

I use app-misc/actkbd

File: ~/.actkbd/actkbd-kbd.conf
79:key::"/home/guest/Media/Radio/station1"
80:key::"/home/guest/Media/Radio/station2"
81:key::"/home/guest/Media/Radio/station3"
85:key::"/home/guest/Media/Radio/station4"
76:key::"/home/guest/Media/Radio/station5"
82:key::"/home/guest/Media/Radio/dvd"

Determine keys is done by executing the actkbd in foreground and in maximum verbosity. Refer to package documentation.

I use KDE, the following runs the actkbd at login:

File: ~/.kde4/Autostart/run-actkbd-kbd.sh
#!/bin/sh
exec actkbd --device /dev/input//by-path/pci-0000:00:1d.0-usb-0:1.4:1.0-event-kbd --config ~/.actkbd/actkbd-kbd.conf

User Interface

A user "guest" is defined, part of the following groups: audio, cdrom, users, games.

I use KDE as user interface, not much but usable.

x11-misc/slim is used as login manager, with the following altered, to enable auto login of guest user:

File: /etc/slim.conf
login_cmd           exec /bin/bash --login /etc/X11/Sessions/KDE-4
default_user        guest
auto_login          yes

Extra Packages

Games

I found the following games usable for my kids:

File: ~/.trigger/trigger.config
        <video
                width="1360"
                height="768"
                bpp="0"
                
                fullscreen="yes"
<snip>
        <joystick enable="yes">
<snip>

Maintainer

Alon Bar-Lev

Authors

Originally written by: Alon Bar-Lev - 2011-11-17


Authors are people who have worked on this document and have made significant changes to its content. If you have edited this article and wish to add yourself to the authors list please read "Who are Authors".