Multimedia - marco1475/linux-htpc GitHub Wiki

mplayer

  1. Install the mplayer package:

     sudo pacman -S mplayer
    
  2. Test that mplayer works:

     mplayer -ao alsa:device=hw=0.8 <file>
    

mpd

  1. Install the mpd and ncmpcpp packages:

     sudo pacman -S mpd ncmpcpp
    
  2. Add the mpd user to the group audio:

     sudo gpasswd -a mpd audio
    
  3. Edit the /etc/mpd.conf configuration file:

     # See: /usr/share/doc/mpd/mpdconf.example
     
     pid_file "/run/mpd/mpd.pid"
     db_file "/var/lib/mpd/mpd.db"
     state_file "/var/lib/mpd/mpdstate"
     
     playlist_directory "/data/audio/playlists"
     music_directory "/data/audio/music"
     
     user "mpd"
     password "<password>@read,add,control,admin"
     default_permissions "read,control"
     
     port "25286"
     
     filesystem_charset "UTF-8"
     auto_update "yes"
     
     audio_output {
             type "alsa"
             name "MPD HDMI"
             device "hw:0,8"
     }
     
     audio_output {
             type "httpd"
             name "MPD Stream"
             encoder "lame"
             port "65535"
             bitrate "192"
             always_on "yes"
     }
    
    • Remember, mpd clients are only controlling the music; to listen to the HTTP stream, you have to load the http://server:port address in a music player, e.g. VLC.

ncmpcpp

  1. Install the ncmpcpp package:

     sudo pacman -S ncmpcpp
    
  2. Set your desired options in ~/.ncmpcpp/config.

  3. If you are connecting through PuTTY and see qs and xs instead of horizontal and vertical lines, this is due to PuTTY ignoring VT100 "Alternate character set" commands in UTF-8 mode [0]. Run ncmpcpp through screen or tmux or tell ncurses to always use UTF-8 box-drawing characters:

     export NCURSES_NO_UTF8_ACS=1
    

Emby

  1. Install the emby-server package:

     sudo pacman -S emby-server
    
  2. Start the emby-server service and make sure it is started at boot:

     sudo systemctl start emby-server.service
     sudo systemctl enable emby-server.service
    
  3. Finish the server setup using a web browser by navigating to http://<server>:8096/.

Kodi

  1. Install the kodi package:

     sudo pacman -S kodi
    
  2. Install the kodi-standalone-service from AUR:

     mkdir ~/aur && cd ~/aur
     wget https://aur.archlinux.org/cgit/aur.git/snapshot/kodi-standalone-service.tar.gz .
     tar -xvf kodi-standalone-service.tar.gz
     cd kodi-standalone-service
     makepkg -sri    # Run this as normal user, not root!
    
  3. Start and enable the kodi.service:

     sudo systemctl start kodi.service
     sudo systemctl enable kodi.service
    
    • Once you start the kodi.service you should see Kodi running on your TV.
    • When you restart the server will automatically start Kodi.
    • The Kodi home directory for the service is /var/lib/kodi/.kodi.
  4. In Kodi, navigate to Main Menu -> Settings -> System Settings and set the Options level from Basic to Expert.

  5. Configure video:

    • Navigate to Main Menu -> Settings -> System Settings -> Video.
    • In the General category:
      • Keep Monitor as Default.
      • Keep Display mode as Full screen.
      • Ensure the Resolution is 1920x1080p.
  6. Configure audio:

    • Navigate to Main Menu -> Settings -> System Settings -> Audio.
    • In the Audio Decoder category:
      • Click on Audio output device and select HDA Intel, MEI Panasonic-TV on HDMI #2. (You should hear menu sounds after you do this.)
      • Set the Number of channels to 5.1.
    • In the Audio Passthrough category:
      • Enable Allow passthrough.
      • As the Passthrough output device select HDA Intel, MEI Panasonic-TV on HDMI #2.
      • Enable Dolby Digital (AC3) capable receiver, Dolby Digital Plus (E-AC3) capable receiver, DTS capable receiver, TrueHD capable receiver, and DTS-HD capable receiver.
  7. Configure interface settings:

    • Navigate to Main Menu -> Settings -> Interface Settings -> Regional.
    • In the Unit Formats category:
      • Region default format: USA (24h)
      • Timezone country: United States
      • Temperature Unit: C
    • Navigate to Main Menu -> Settings -> Interface Settings -> Screensaver.
      • Screensaver mode: Black

Emby for Kodi

  1. Enable installation of add-ons from unknown sources:
    1. Navigate to Main Menu -> Settings -> System Settings -> Add-ons.
    2. In the General category enable Unknown sources and agree to the pop-up.
  2. Add a source for the Emby for Kodi repository:
    1. Navigate to Main Menu -> Settings -> File manager.
    2. Click Add source.
    3. Create a source named Emby for Kodi (Source) with the URL http://kodi.emby.media.
  3. Install the Emby for Kodi repository:
    1. Navigate to Main Menu -> Add-ons and click Enter add-on browser.
    2. Click Install from zip file.
    3. Select "Emby for Kodi (Source)".
    4. Select repository.emby.kodi-X.X.X.zip and click OK.
  4. Install the Emby for Kodi add-on:
    1. Navigate to Main Menu -> Add-ons and click Enter add-on browser.
    2. Click Install from repository.
    3. Select "Kodi Emby Addons".
    4. Select "Video add-ons".
    5. Select "Emby".
    6. Click "Install".
  5. Configure the Emby for Kodi add-on:
    1. Click Manually add server:
    2. Select your user.
    3. Select Native (Direct Paths) as the Playback Mode.
    4. Do not add Network credentials to allow Kodi to access your content.
    5. Do not disable the Emby music library.
    6. Emby for Kodi should perform the initial sync.
  6. Create Kodi video nodes for each Emby library:
    • All files provided by Emby are tagged with the Emby library name in Kodi.
    • By default, the library type (movies, tv shows, etc.) determines how the files will be displayed in Kodi.
    • For mixed-content libraries you need to create video nodes that group files based on tags.
    • Custom skins (e.g. Aeon Nox), but not the default one, allow you to place links to video nodes in the main menu.
    • Make sure you are creating links to the entries found in Main Menu -> Videos (i.e. the ones that show you the "directory" contents) and not the Library Node Editor entries (which should you the Library Node Editor page).

File Permissions for Emby and Kodi

Both Emby and Kodi create their own users (emby and kodi respectively) as well as groups (emby and kodi respectively). However, Emby requires the ownership of any files it manages, while Kodi needs read rights for "native playback".

  1. Create a new media group:

     groupadd media
    
  2. Add the user, as well as the emby and kodi users to the media group:

     usermod -aG media <user>
     usermod -aG media emby
     usermod -aG media kodi
     usermod -aG media mpd
    
  3. Change the ownership of your media files to emby:media and apply the correct user permissions:

     chown -R emby:media <path>
     chmod -R 750 <path>
    
⚠️ **GitHub.com Fallback** ⚠️