Friday, July 26, 2019

MythTV v30 Example Installation Steps with Ubuntu 18.04

I used the steps shown below to install MythTV v30 on Ubuntu 18.04.  MythTV is open source media center software for a home theater or television computer and is often used to watch and record TV content.  Ubuntu is one of the most popular Linux operating system distributions.  The steps below are based on the installation instructions found on the MythTV wiki and this blog post.

The MythTV frontend and backend was installed so the system can be used to watch and record TV content, and the system can be used by other MythTV frontends in my home.  An Asus H110T was used with Intel graphics.  A single hard drive was used for the operating system and all other files.  Also, an HDHomeRun Prime was used with Comcast Xfinity.  The guide data source is from SiliconDust and TVMaze, and this differs from the more commonly used Schedules Direct source.
  1. Install Ubuntu using the minimal install option.  The installation iso file and instructions for installing Ubuntu Desktop LTS can be found at https://ubuntu.com.
  2. Boot into Ubuntu and start Software Updater.
  3. Install all available updates.
  4. Reboot, and repeat steps two and three until Software Updater indicates there are no more updates.
  5. Set a static IP address:
    • Left click on the network icon on the top-right of the screen, left click on the right arrow next to the network connection, and left click Wired Settings.
    • Left click the gear icon next to the current working network connection.
    • Left click the IPv4 tab.
    • Left click Manual, and enter appropriate values for the address, netmask, and gateway.
    • Left click the toggle to turn automatic DNS off, and enter appropriate values for the DNS addresses.
    • The automatic routes can be left on.
  6. Reboot, start Firefox, and verify the connection is working.
  7. Left click the lower left Show Applications icon, and left click on Terminal.
  8. Install MythTV v30, plugins, and do some miscellaneous tasks by entering the following in the terminal:
    • sudo add-apt-repository ppa:mythbuntu/30
    • sudo apt install mythtv
    • sudo apt install mythplugins
    • sudo adduser $USER mythtv
    • mkdir -p $HOME/.mythtv
    • ln -s -f /etc/mythtv/config.xml ~/.mythtv/config.xml
  9. Reboot the PC.
  10. Setup the backend (part one):
    • In the terminal, enter "sudo systemctl stop mythtv-backend".
    • In the terminal, enter "mythtv-setup".
    • In General, set the security pin to 0000.
    • In General, set the IPv4 primary IP address to the address used in setting the static IP address above.
    • In Capture Cards, press enter with new capture card highlighted, press the down key to highlight new capture card, and press enter.
    • Select HDHomeRun networked tuner, press the right arrow key, press enter with use HDHomeRun... selected to enable it, and in Recording Options, deselect EIT scanning.
    • Repeat the above step three times for the three available tuners.
    • In Video Sources, create a new source, name it NG, set the listing grabber to no grabber, the CF table to default, and the network ID to -1.
    • In Input Connections, create three connections, name them Prime1, Prime2 and Prime3, set the name to MPEG2TS, and set the source to NG.
    • In Storage Directories, set the default to /var/lib/mythtv/recordings/, and set live TV to /var/lib/mythtv/livetv/.
    • Save, and press Esc to exit myth-setup.  Do not start the backend, and do not update the database when prompted upon exiting.
  11. Reboot the PC.
  12. Scan for channels and add channels to MythTV:
    • Start Firefox, and access the HDHomeRun Prime's web page interface by going to http://my.hdhomerun.com.
    • Left click HDHomeRun Prime.
    • Left click Channel Lineup.
    • Left click Detect Channels, and give it about 20 minutes to detect all channels.  The channel numbers should appear as the scan progresses.  Channels marked "DRM" will not work with MythTV.  With Comcast, only premium channels such as HBO are generally marked "DRM".
    • Add channels to MythTV using the hdhrchan2myth.py script.  The usage instructions can be found here.
  13. Setup the backend (part two):
    • In the terminal, enter "sudo systemctl stop mythtv-backend".
    • In the terminal, enter "mythtv-setup".
    • In Channels, delete the channels that are not needed.
    • Exit myth-setup.  Do not start the backend, and do not update the database when prompted upon exiting.
  14. Reboot the PC.
  15. Set the sound output in Ubuntu:
    • Left click the lower left Show Applications icon, and left click on Settings.
    • In Sound, set the output to HDMI/displayPort-Built-in Audio.
    • Close the settings window.
  16. Change settings in systemd so the backend will not start until the network is up:
    • In the terminal, enter "sudo systemctl edit mythtv-backend.service".
    • Once the nano edit mode starts, add only the following two lines:
      • [Unit]
      • After=NetworkManager-wait-online.service
    • Save and exit from nano edit mode.
    • Edit /etc/mysql/mysql.conf.d/mythtv.cnf, and delete "#" before "bind-address=::" if it is there
  17. Setup the frontend:
    • Left click the lower left Show Applications icon, and left click on MythTV Frontend.
    • In Setup, select Setup Wizard.
    • In the wizard, choose an audio device, and select Test Speakers.  Change the audio device and test again until the test sound can be heard.  
    • Also in the wizard, choose VAAPI Normal for the video playback profile.  After this step, it should be possible to watch live TV.
    • In Video, select Playback.
    • Use the arrow keys to highlight Current Video Playback Profile, and press the right arrow key.
    • For the vaapi entry, deselect Deblocking filter, and set the primary and fallback deinterlacer to none.
  18. Install hdhrepg2myth using the directions shown here.
  19. Install mythrecmaze using the directions shown here.
  20. Automatically start MythTV when the computer starts:
    • Open Terminal and enter "gnome-session-properties".
    • Left click on Add and enter bash -c "sleep 20 && mythfrontend --service" to start the MythTV frontend.  No entry is needed for the backend.

4 comments:

  1. Thank you Ted for a concise step by step installation for MythTV.

    Been using MythTV now since the early days. Always worked well.

    Way long time ago used it with a Nexus satellite card. Worked well.

    ReplyDelete
    Replies
    1. You're welcome. I'm glad you found it useful.

      Delete
  2. Are you able to watch and record all of the channels you subscribe to with Comcast?

    ReplyDelete
    Replies
    1. With the Digital Starter package, I am able to watch and record all of the channels except MoviePlex which Comcast considers a premium channel. Generally with Comcast, MythTV is compatible with channels other than premium channels. MoviePlex is available on the Xfinity Stream app.

      Delete