1. XenForo 1.5.14 中文版——支持中文搜索!现已发布!查看详情
  2. Xenforo 爱好者讨论群:215909318 XenForo专区

ASRock Beebox N3000 使用 Ubuntu Kodi 搭建 HTPC

本帖由 admin2016-03-25 发布。版面名称:应用交流

  1. admin

    admin 管理员 管理成员

    注册:
    2011-11-01
    帖子:
    3,671
    赞:
    2,425
    安装Ubuntu 15.10 64 位镜像(过程略过)
    代码:
    http://releases.ubuntu.com/15.10/ubuntu-15.10-server-amd64.iso
    安装依赖(不要使用加密 encrypted home directory)
    代码:
    sudo apt-get update
    sudo apt-get install ssh python-software-properties software-properties-common xorg alsa-utils mesa-utils git-core librtmp1 lirc libmad0 lm-sensors libmpeg2-4 avahi-daemon libnfs8 libva1 vainfo libva-intel-vaapi-driver linux-firmware dbus-x11 udisks2 openbox pastebinit
    sudo apt-get dist-upgrade
    代码:
    sudo dpkg-reconfigure x11-common
    代码:
    sudo adduser kodi
    sudo usermod -a -G cdrom,audio,video,plugdev,users,dialout,dip,input kodi
    创建/etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
    代码:
    [Actions for kodi user]
    Identity=unix-user:kodi
    Action=org.freedesktop.login1.*;org.freedesktop.udisks.*
    ResultAny=yes
    ResultInactive=yes
    ResultActive=yes
    
    [Untrusted Upgrade]
    Identity=unix-user:kodi
    Action=org.debian.apt.upgrade-packages;org.debian.apt.update-cache
    ResultAny=yes
    ResultInactive=yes
    ResultActive=yes
    创建/etc/systemd/system/kodi.service
    代码:
    [Unit]
    Description = kodi-standalone using xinit
    After = systemd-user-sessions.service network.target sound.target network-online.target
    
    [Service]
    User = kodi
    Group = kodi
    Type = simple
    PAMName=login
    ExecStart = /usr/bin/xinit /usr/bin/dbus-launch --exit-with-session /usr/bin/openbox-session -- :0 -nolisten tcp vt7
    Restart = on-abort
    
    [Install]
    WantedBy = multi-user.target
    编辑/etc/security/limits.conf 下方加入
    代码:
    kodi             -       nice            -1
    代码:
    sudo ln -s /etc/systemd/system/kodi.service /etc/systemd/system/display-manager.service
    代码:
    sudo apt-add-repository ppa:wsnipex/vaapi
    sudo apt-add-repository ppa:wsnipex/xbmc-fernetmenta-master
    # the next one is needed for pvr addons
    sudo apt-add-repository ppa:team-xbmc/xbmc-nightly
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo apt-get install kodi kodi-bin
    代码:
    sudo mkdir -p /home/kodi/.config/openbox
    sudo touch /home/kodi/.config/openbox/autostart
    sudo chown kodi:kodi /home/kodi/.config -R
    创建/home/kodi/.config/openbox/autostart
    代码:
    OUTPUT=`xrandr -display :0 -q | sed '/ connected/!d;s/ .*//;q'`
    xrandr -display :0 --output $OUTPUT --set "Broadcast RGB" "Full"
    /usr/bin/kodi --standalone
    openbox --exit
    启动kodi
    代码:
    sudo systemctl start kodi
    配置遥控器
    编辑/etc/lirc/hardware.conf
    代码:
    # /etc/lirc/hardware.conf
    #
    #Chosen Remote Control
    REMOTE="Windows Media Center Transceivers/Remotes (all)"
    REMOTE_MODULES="lirc_dev mceusb"
    REMOTE_DRIVER=""
    REMOTE_DEVICE="/dev/lirc0"
    REMOTE_SOCKET=""
    REMOTE_LIRCD_CONF="/etc/lirc/lircd.conf.d/beebox.conf"
    REMOTE_LIRCD_ARGS=""
    
    #Chosen IR Transmitter
    TRANSMITTER="None"
    TRANSMITTER_MODULES=""
    TRANSMITTER_DRIVER=""
    TRANSMITTER_DEVICE=""
    TRANSMITTER_SOCKET=""
    TRANSMITTER_LIRCD_CONF=""
    TRANSMITTER_LIRCD_ARGS=""
    
    #Disable kernel support.
    #Typically, lirc will disable in-kernel support for ir devices in order to
    #handle them internally.  Set to false to prevent lirc from disabling this
    #in-kernel support.
    #DISABLE_KERNEL_SUPPORT="true"
    
    #Enable lircd
    START_LIRCD="true"
    
    #Don't start lircmd even if there seems to be a good config file
    #START_LIRCMD="false"
    
    #Try to load appropriate kernel modules
    LOAD_MODULES="true"
    
    # Default configuration files for your hardware if any
    LIRCMD_CONF=""
    
    #Forcing noninteractive reconfiguration
    #If lirc is to be reconfigured by an external application
    #that doesn't have a debconf frontend available, the noninteractive
    #frontend can be invoked and set to parse REMOTE and TRANSMITTER
    #It will then populate all other variables without any user input
    #If you would like to configure lirc via standard methods, be sure
    #to leave this set to "false"
    FORCE_NONINTERACTIVE_RECONFIGURATION="false"
    START_LIRCMD=""
    编辑/etc/lirc/lircd.conf.d/beebox.conf
    代码:
    # This config file was automatically generated
    # Command line used: irrecord --device=/dev/lirc0 MyRemote
    
    # Remote name (as of config file): beebox
    # Remote device model nr: 04G500002000AK
    # Remote device info url: http://www.asrock.com/nettop/Intel/Beebox%20Series/#Specifications
    # Type of device controlled: ASRock BeeBox, N3150-NUC
    
    begin remote
    
      name  beebox
      bits           16
      flags RC6|CONST_LENGTH
      eps            30
      aeps          100
    
      header       2800   941
      one           450   451
      zero          450   451
      pre_data_bits   21
      pre_data       0x37FF0
      gap          110494
      toggle_bit_mask 0x8000
      rc6_mask    0x100000000
    
          begin codes
              KEY_OK                   0x7BDD
              KEY_PAUSE                0x7BE7
              KEY_POWER                0x7BF3
              KEY_PLAY                 0x7BE9
              KEY_BACK                 0x7BDC
              KEY_FASTFORWARD          0x7BEB
              KEY_FRAMEFORWARD         0x7BE5
              KEY_FRAMEBACK            0x7BE4
              KEY_VOLUMEUP             0x7BEF
              KEY_VOLUMEDOWN           0x7BEE
              KEY_CHANNELDOWN          0x7BEC
              KEY_CHANNELUP            0x7BED
              KEY_MUTE                 0x7BF1
              KEY_UP                   0x7BE1
              KEY_DOWN                 0x7BE0
              KEY_LEFT                 0x7BDF
              KEY_RIGHT                0x7BDE
              KEY_RECORD               0x7BE8
              KEY_REWIND               0x7BEA
              KEY_STOP                 0x7BE6
          end codes
    
    end remote
    创建 /home/kodi/.kodi/userdata/Lircmap.xml
    代码:
    <lircmap>
      <remote device="beebox">
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <select>KEY_OK</select>
        <pause>KEY_PAUSE</pause>
        <play>KEY_PLAY</play>
        <back>KEY_BACK</back>
        <forward>KEY_FASTFORWARD</forward>
        <reverse>KEY_REWIND</reverse>
        <skipplus>KEY_FRAMEFORWARD</skipplus>
        <skipminus>KEY_FRAMEBACK</skipminus>
        <volumeplus>KEY_VOLUMEUP</volumeplus>
        <volumeminus>KEY_VOLUMEDOWN</volumeminus>
        <info>KEY_CHANNELUP</info>
        <start>KEY_CHANNELDOWN</start>
        <mute>KEY_MUTE</mute>
        <menu>KEY_RECORD</menu>
        <stop>KEY_STOP</stop>
        <power>KEY_POWER</power>
      </remote>
    </lircmap>
    创建 /home/kodi/.kodi/userdata/keymaps/remote.xml
    代码:
    <keymap>
      <global>
    
        <remote>
          <power>XBMC.ActivateWindow(ShutDownMenu)</power>
        </remote>
    
      </global>
    </keymap>
    如果需要遥控器直接关机而非关机菜单修改以上对应内容<power>XBMC.Shutdown()</power>

    参考资料:
    http://forum.kodi.tv/showthread.php?tid=231955
    https://github.com/thedemz/BeeBox
    http://forum.kodi.tv/showthread.php?tid=227363
     
    最后编辑: 2016-03-28
正在加载...