Mythbuntu

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search

Mythtvmythbuntulogo.png

November 06, 2016: Mythbuntu as a separate distribution will cease to exist. The Mythbuntu team recommends users who want to use Mythbuntu to install the latest release of the Xubuntu Linux operating system and then add the Mythbuntu PPA (Personal Package Archive), which will continue to provide the latest MythTV releases and other related packages.

Mythbuntu Alternative: LinHES Since the Mythbuntu distribution has been discontinued you have a number of options. Of course you can still install Ubuntu and then MythTV. Obtain Ubuntu by downloading and installing the latest Xubuntu or Ubuntu Desktop LTS version. MythTV is available through apt. Another alternative is to install Mint Linux and software package mythtv.

Mythbuntu is a media center linux distribution which combines an operating system (ubuntu) with software (mythtv) to achieve a complete DVR and video library system. Create a home theater PC (HTPC) or media center computer using Mythbuntu. Mythbuntu is an official Ubuntu flavor focused upon setting up a standalone MythTV based PVR system. Mythbuntu is a custom Ubuntu distribution with a prebuilt MythTV install, and it is a Ubuntu that has been optimized for use with MythTV.

Ubuntu is a linux distribution that typically uses Gnome Windows Manager. Mythbuntu does not use Gnome. Mythbuntu uses Xfce as the Window Manager.

MythTV is a software that runs on Linux to virtually turn a Linux desktop system into a DVR. MythTV can run entirely on a single system, or utilize a front-end back-end configuration.

MythTV is "beta" quality DVR software for a PC running Linux. Even under the most standard, typical hardware configurations Mythbuntu and MythTV work reasonably well but not without errors and annoyances. The use of the term "beta" is opinion rather than an official designation by the developers (-2014).

Typical Problems with Mythbuntu

  • HDMI audio does not work by default
  • pulseaudio server will not start
  • smb/cifs not included by default
  • unexplained crashes
  • scheduled recording fails when tuner on LiveTV
  • storage group design makes alternate video player fail
  • screen goes black

See the Section: Mythbuntu#Troubleshooting

unexplained crashes

While watching LiveTV, or while watching a recording which may be associated with a tuner active in recording another program at the time, popup crash messages appear. Messages are infrequent, however, seemingly random and very annoying.

Mythtv-sys-prog-prob-det-popup.jpg

The Cancel button is clicked. Playback of a recorded program continues, even during the error popup. The popup blocks part of the viewable screen space. Once the popup goes away, a new popup appears.

Mythtv-app-backend-setup-closed-unexpectedly-popup.jpg

Send an error report? Sounds like Microsoft! Click "Show Details" and lets find out what went wrong so it can be fixed.

Mythtv-app-backend-setup-closed-unexpectedly-popup-cr1.jpg

The error report itself has now crashed. Meanwhile the video is still playing behind all these popups. The cause for the error is never determined. The error report will not complete.

This is a fairly common problem with Mythbuntu installations on common PC hardware. Due to the attitude towards bug reports by the MythTV developers, it is unlikely the problem will be addressed in the near future. Fortunately, this tends to be a once-per-day type of error in most cases and like most things with buggy software in our modern age, simply gets tolerated.

RESOLUTION: none.

Customization

Use the The apt-get Package Management Tool to install packages.

Theme Notation

The most common screen resolution of an LCD panel television is 1920x1080 - which is 16:9 . Some themes do not work well on the common television.

  • Arclight - not recommended.
  • Steppes - fair. Glitches in media library view.
  • Mythbuntu 25.30 - excellent.

Key bindings to mimic VLC

I like to have the SPACE BAR pause and resume to mimic the behavior of VLC Player.

Setup, Edit Keys, TV Playback, Pause, and press the SPACEBAR when prompted in the empty slot after the "P."

The key binding conflicts with another which can easily be removed.

Setup, Edit Keys, Global, Select, and select the slot with SPACEBAR to remove the binding. Press ESCAPE and Save Changes.

Using VLC Player for playback

The MythTV internal player uses FFmpeg, which isn't a player, but it is the internals used by many popular players, such as mplayer. Many FFmpeg developers are also part of the MPlayer project. FFmpeg is used by VLC media player, MPlayer, xine, HandBrake, and others. With that being said, the MythTV implementation seems to have limitations. It's not the best at playing some types of media that might be in your media library outside of the recordings made by MythTV. It doesn't digest highly compressed H.264 video very well. It seems to have problems tracking and refreshing properly on them, much like can be observed with SMPlayer. In fact, I have found videos that play best in VLC and others that play best in SMPlayer. Although VLC, like the MythTV player, uses FFmpeg, VLC has a wide variety of internal codecs and can play certain videos much better.

Users want the option to use an alternate player other than the internal player for playing videos in their media library.


MythTV has an option in the settings to configure an alternate player to use IN ADDITION to the internal player! Our goal here is to configure VLC as the alternate player.

Using VideoLAN Player for playback in MythTV (otherwise known as VLC Player) for all video files or certain video files.

The location in the Front End is:

  • Setup, Media Settings, Video Settings, Player Settings

However, due to the way MythTV uses STORAGE GROUPS for your video files (those not recorded using MythTV), VLC will not find the video at the path passed to it by MythTV. If you have MythTV configured to access a path containing video files (such as a LAN path or NFS path, or even local) the MythTV Frontend sees this in a Storage Group. SG = Storage Group. MythTV will not allow Storage Group content to be played with an external player such as VLC.

For example, /var/lib/mythtv/videos is seen by MythTV and sent to the external player as myth://Videos@localhost, which is a storage group path.

There are two working hacks we will cover here:

HACK #1: Local Video Storage Hack:

If you choose not to use Storage Groups then simply don't define any of the above mentioned Storage Groups and set up your directories for videos and artwork on each individual front-end. On remote front-ends the directories will need to be mounted locally via NFS or Samba. As always, the mount points need to be identical on all front-ends. Then go to Utilities/Setup->Setup->Media Settings->Video Settings->General and point to the appropriate directories for Videos, Trailers, Fan art, Banners, Screenshots, and Cover art.

HACK #2: Parsing the Parameter with a Shell Script

This is by far the best hack of the two, because you can continue to use storage groups, and you need not set up the static paths on each individual front-end. Rather than setting the alternate player to vlc in (Setup, Media Settings, Video Settings, Player Settings) set it to the name of an intermediary shell script. I called my shell script by the name 'altplayer.'

You can put the video in a place like /usr/local/bin/ and after you finish with the code make the script executable.

vi /usr/local/bin/altplayer
chmod +x /usr/local/bin/altplayer

The code in my altplayer shell script is as follows:

#!/bin/bash
strPlayer=${1/"myth://Videos@192.168.1.2:6543"/"/mnt/video"} 
vlc -f "$strPlayer" --no-embedded-video vlc://quit
exit 0

The script will need to be modified for your particular network and cifs path. For additional information the subject is covered in the Official MythTV Wiki (MythTV VLC).

Now that you have VLC working as your alternate player, you may wish to remap the key that allows you to exit back to the MythTV Frontend to be consistent with the one that the MythTV internal player uses.

  1. On the VLC Menu bar click the Tools menu and choose "Preferences" from the menu. (or press ctrl-p)
  2. Click on the "Hotkeys" icon and find the value for "quit" and assign it to the escape key.

The default key to quit VLC is ctrl-q which might be fine for you so you won't need to change the mapping.

ISSUE: The xfce4 Panel May Sometimes Be Visible During VLC Full Screen Playback

This is a glitch part in the way VLC uses Qt. The Qt window states are: Normal, FullScreen, Minimized, Maximized. The glitch has to do with the way VLC was last used when ran independent of MythTV. If vlc was used in the Window Maximized state and exited in that state, later when launched from within MythTV, even though it is now in the FullScreen state, Qt glitch causes XFCE panel to remain visible. The issue is confirmed in Mythbuntu 12.04 Qt4 VLC 2.0.8. A simple workaround was implemented here by adding --no-embedded-video to the vlc command line in our altplayer script.

Paths: File Locations

MythTV DB does not care about the exact path to a recorded program video file. It only cares that the file resides somewhere in the configured root path, and the specific name.

With Mythbuntu, and perhaps most MythTV installs on Linux, media is stored under /var/lib/mythtv unless otherwise configured differently by the user. See these common directory names under /var/lib/mythtv

/var/lib/mythtv/ 
             banners  bare-client  coverart  db_backups  fanart  livetv  music  
             pictures  recordings  screenshots  streaming  trailers  videos
  • /var/lib/mythtv/livetv - all live TV contact for the current period (typically for the last 24hrs) that has been watched or recorded. Sometimes scheduled recordings fail to show up in the Media Library-Recordings list can be found here too. Names on FS are not meaningful and are associated with MythTV DB entries. SEE: MythTV Offical Wiki: LiveTV
  • /var/lib/mythtv/recordings - user recorded tv programs. auto configured to share as \\Mythtv\recordings on Windows network. Recorded programming is moved from /livetv to /recordings upon completion of scheduled recording or user initiated recording. So to speak, everything is recorded, that which is marked recorded is moved here.
  • /var/lib/mythtv/streaming -

MythTV directories that are shared to Windows network neighborhood are done so with Linux CIFS Utils and Samba with the configuration file {smb.conf) being at the path /etc/samba/smb.conf - example: Example Mythbuntu SMB Shares. If you modify smb.conf you will need to restart the service: service smbd restart && service nmbd restart

Menu Structure of Mythbuntu 25.30 Theme MENU

Mythfrontend 0.25 
|
+---Media Library
|   +---Watch Recordings
|   +---Watch Videos
|   +---Listen to Music
|   \---Image Gallery
|
+---Manage Recordings
|   +---Schedule Recordings
|   |   +---Program Guide
|   |   +---Program Finder
|   |   +---Search Words
|   |   +---Search Lists
|   |   \---Custom Record
|   |
|   +---Recording Rules
|   +---Upcoming Recordings
|   +---Previously Recorded
|   \---Set Priorities
|
+---Information Center
|   \---System Status
|
+---Optical Disks
|   +---Play Optical Disc
|   +---Import CD
|   \---Eject Media
|
+---Watch TV
\---Setup
    +---Setup Wizard
    +---General
    +---Appearance
    +---Theme Chooser
    +---Audio
    +---Video
    +---Media Settings
    +---System Event Handlers
    +---Edit Keys
    +---Artwork and Metadata Sources
    \---Screen Setup Wizards

Operating System Adjustments

Setup a static IP address for your MythTV box

From Xfce windows shell click

  • Applications -> Settings -> Network connections

From here you can modify the type of connection you have, typically "Wired" or "Wireless." Assign the static IP address you desire to the correct interface being used.

  • Click the "Edit button" under the correct interface tab.

It will be necessary to restart the network interface if you do not wish to reboot. From shell issue:

sudo service network-manager restart

For more information on configuring see the General Ubuntu help pages: Category:Ubuntu

useful packages

Install vim editor

apt-get install vim

Set VNC password

sudo x11vnc --storepasswd

To connect to windows shares you need cifs

apt-get install cifs-utils

Install Firefox, because Chromium doesn't support NoScript.

apt-get install firefox

The Adobe Flash Plugin is under the Restricted Formats in Ubuntu (as a result of Adobe licensing). Install the latest version of Flash Player for Ubuntu

Easy way to secure transfer files

apt-get install lrzsz

PulseAudio Volume Control: a simple GTK+ based volume control and mixer for PulseAudio which allows you to control both the volume of hardware devices and of each playback stream separately.

apt-get install pavucontrol

disable screen blanking

After my computer with ubuntu 12.04 has been idle for a short while, the screen will go blank, and even enter standby mode. Drop out of MythTV frontend to Xfce and on the menu in the upper left:

  • Applications, Settings, Screensaver

Change "Blank After" to 0 or any value you want. Change "Screensaver" to "none."

STATUS: update. TV blanks on MythTV menu. Does not blank on livetv, player, or Xfce desktop. Culprit is a communications issue on the HDMI interface. HDMI technology flaw, implementation flaw, failure for some television and monitor manufacturers to adhere to HDMI specifications. On a Vizio brand display exhibiting the problem changing the automatic luminance to disabled seems to resolve. Keep in mind that pressing a button like "input" on the remote will recover display.

sudo xset dpms 0 0 0 && xset s off && xset s noblank
xset q
xset -dpms
xset s off

Adding files from a windows share to MythTV media library

There are more than one ways to do this. This example uses cifs to permanently mount the shares so that they will be available after reboot. If the system complains add the 'noauto' parameter.

  • First edit your /etc/hosts file and add the hostname and IP address of the windows share or file server
  • Next create mount points in /mnt for each windows share
  • Make sure you have cifs installed
  • Edit /etc/fstab and add a line for each windows share, see examples:
//apollo/public/ /mnt/public cifs username=nicolep,password=mythtv,iocharset=utf8,sec=ntlm  0  0
//apollo/media/ /mnt/media cifs username=nicolep,password=mythtv,iocharset=utf8,sec=ntlm  0  0
//apollo/video/ /mnt/video cifs username=nicolep,password=mythtv,iocharset=utf8,sec=ntlm  0  0
  • mount the shares
mount -a
  • This provides read-only access to the network shares.

KERNEL CHANGE BREAKS CIFS.

Somewhere between kernel 4.10.0-38 4.15.0-20 a change was made that COULD PREVENT your cifs shares from mounting. Kernels at and before 4.10 used SMB (Server Message Block) version 1.0 as the default if not specified. Most folks did not specify it so it defaulted to 1.0 and worked. Microsoft ditched 1.0 in Windows 10 and dropped support. Linux kernel developers decided to change the kernel code to no longer default to SMB 1.0 and now default to a newer version. For people that are using legacy networks or NAS devices, it breaks the mounting example from above.

Solution: Specify the SMB version.

The solution is to tell mount.cifs to use the SMB2, SMB2.1 or SMB3.0 protocol using the "vers" parameter. in Linux CIFS Utils and Samba Specify 1.0, 2.0, 2.1, or 3.0.

For the following full line example a linux desktop is connecting to an older NAS device. It is necessary to specify SMB version 1.0. Example:

//apollo/video/ /mnt/video cifs defaults,vers=1.0,domain=workgroup,username=nicolep,password=mythtv,iocharset=utf8,sec=ntlm 0 0

See Linux CIFS Utils and Samba for more information on installing cifs-utils and mounting Microsoft Windows shares.

Now for any media such as video files from those shares to show up in MythTV-Frontend under "Media Library, Watch Videos" the backend configuration needs to be modified.

(Steps for that coming soon...)

Troubleshooting

For troubleshooting it helps to know your Mythbuntu version

cat /etc/lsb-release

There's sound on line out, but not on HDMI

Manifestations

  1. Audio present in MythTV frontend but not in X.org
  2. Audio absent in MythTV frontend and present in X.org
  3. No Audio in MythTV frontend and X.org

CORRECT IN MYTHTV SOFTWARE

In MythTV this can be corrected easily. From the MythTV Frontend:

  1. Setup
  2. Audio
  3. Change "Audio output device" to "ALSA:dmix:CARD=PCH,DEV=3" (or whatever soundcard and device tag matches your system)

The default here was "PulseAudio:default". When there are problems with PulseAudio, which is common, it is better to specify your soundcard and output device specifically. For our example we had an Intel ACH audio board.

CORRECT IN X11 (X.org) simple

This is a quick fix. Use this solution only if:

  • You previously had audio in X.org apps, perhaps before a reboot or other event
  • You already have PulseAudio Control installed "pavucontrol"
  • You use an HDMI cable for audio and video to a monitor TV

Sometimes users of Mythbuntu drop back into the xfce to run media software, such as VLC. Even though MythTV Frontend has a working audio configuration, the desktop may not. Once configured, users are noticing that Pulse Audio loses its setting after a reboot or other event, and audio for apps in X.org stop working.

Quick Fix: (assuming you have checked cables are not loose)

  • Simply open pavucontrol and click the configuration tab. If it is correctly set to "Digital Stereo (HDMI) Output" (or whichever you typically use) inwhich it should be working, and has in the past worked, but is now not working, change it to another option, and then change it back to "Digital Stereo (HDMI) Output." This basically "refreshes" or reminds Pulse Audio what output you wish to use. This seems to kick start the audio and get it working again for most people.

If your problem doesn't meet the 3 bullited criteria above or the Quick Fix solution fails, proceed to attempt the thorough troubleshooting that follows...

CORRECT IN X11 (X.org) thorough

If you go to console and type

aplay /usr/share/sounds/alsa/Front_Center.wav

and do not hear anything out of the TV via HDMI, but do hear if you connect speakers or headphones to the line-out jack, try this:

speaker-test -c 2 -r 48000 -D hw:0,3

Again, the test is on a system with Intel ACH audio and the HDMI puts it on hw:0,3 - yours could be on another like hw:0,7. Here is how to find out where yours is, type this:

aplay -l

Here we seen:

card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]

The card number and device number you need to know. Another test is to:

aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Center.wav

Substitute plughw:0,3 with the correct values for your card and HDMI based on the output of aplay -l

Install the mixer.

apt-get install pavucontrol

Open mixer

pavucontrol

In the mixer choose the "Output Devices" tab. If you do not see "HDMI / DisplayPort" listed in the dropdown then do the following:

  • click on the Configuration tab and select "Digital Stereo (HDMI) Output"
  • Go back to the Output Devices tab and look for "HDMI / DisplayPort"

If at this point you found and selected the HDMI DisplayPort option, and tested audio is working then stop here. Be sure to test within a program such as VLC and not using aplay from console. VLC will use the pulseaudio device you selected in pavucontrol.

If there is still no sound via HDMI, then proceed...

Now we need to edit the pulseaudio configuration file "/etc/pulse/default.pa" and uncomment, and edit a couple lines:

load-module module-alsa-sink
load-module module-alsa-source device=hw:0,3

Set the "device=hw:0,3" to the appropriate values for your card that you discovered though testing above.

Now start or restart pulseaudio

killall pulseaudio
start-pulseaudio-x11 

If it starts, then Good! Now you need to open the PulseAudio Volume Control applet in Xfce

  • Applications, MultiMedia, PulseAudio Volume Control

Now click the drop-down box named "Port" and choose "HDMI/DisplayPort"

Now the default audio is set to the HDMI into your television. Next time you reboot you might have a problem with PulseAudio again. See the troubleshooting below if this is the cause. It basically means you have to remark out those two lines in default.pa and manually start pulseaudio service "start-pulseaudio-x11"

pulseaudio: pa_context_connect() failed: Connection refused

pulseaudio does not start with system boot and you try to manually start it and get:

$ start-pulseaudio-x11
Connection failure: Connection refused
pa_context_connect() failed: Connection refused

The problem may be caused by an error in one of the pulseaudio config files. Those files are located in:

  • /etc/pulse

In order to get HDMI audio working, two lines that were enabled in default.pa later caused a problem after reboot.

load-module module-alsa-sink
load-module module-alsa-source device=hw:0,3

Those lines were uncommented in order to get HDMI sound working. After a reboot those lines needed commented out once again so that pulseaudio would start.

Why? Who the hell knows? pulseaudio is very buggy.

random screen blanking / goes black

This happens sometimes when I pause live TV, or sometimes when browsing the video library. It has nothing to do with inactivity. Screensaver off, DPMS off, not related to either. Screen goes black, MythTV is temporarily non-responsive on the HDMI display device (LCD TV). No discernible pattern or triggers. I can watch three hours of live TV and everything is fine. Another time the screen going black happens in the first 15 minutes of a show when I pause or try to skip past commercials. Again, no discernible pattern.

I mentioned my recorded buffer was being lost originally but that is my fault as it is happening with my keyboard actions trying to get the display back. I discovered if I connect with VNC viewer I can see the picture there. It is blanking on the HDMI device.

Screen blanking is also caused by the display device going into standby because it misunderstands the video signal. Vizio displays are infamous for this.

Login screen loops unless you login as Guest

I login and there's this black screen where I can only read some text or error (doesn't matter) and then it goes right back to the login screen. The graphical login just keeps coming back after the correct password. Other text consoles work.

Resolved: Lost permissions to /home/username/.XAuthority - it has been taken over by root owner. Go into /home/username and change it back to your ownership. Do this for ALL files in /home/username that were somehow taken over by root.

Backend Configuration

Adding an additional backend

On the backend machine, open the /etc/mysql/my.cnf file

sudo vi /etc/mysql/my.cnf

Comment the line that begins with bind-address by placing a # in front of it.

# bind-address          = 127.0.0.1

Now restart the MySQL server.

sudo service mysql restart

References:

Master Backend Info- Security Key

You will need this set to add additional mythtv frontends to the network.

  1. In the xfce windows interface use the dropdown menu in the upper left "Applications" and choose System, MythTV Backend Setup.
  2. In the MythTV backend setup choose: General, Security PIN (required)

Distribution Release Notes

Determine the version of MythTV you have

console type:

apt-cache policy mythtv

Or if you are in Xfce environment you can open a terminal (Applications -> System -> Xfce terminal) and type the following:

mythfrontend --version

The mythfrontend command won't work from a remote ssh terminal.

Determine the version of Ubuntu you have

type:

cat /etc/issue

Determine the version of the Linux kernel

type:

uname -r

Mythbuntu Releases

Mythbuntu distribution releases are listed on their official web site.

Starting with 12.04, the Mythbuntu team will only be doing Long Term Support (LTS) releases. Ubuntu does an LTS release about every two years. Mythbuntu ISOs will only be released for LTS releases. During the LTS life cycle, there will be point releases that roll up fixes into a new ISO. Even though Ubuntu LTS releases are usually every two years, MythTV releases are more frequent.

The Mythbuntu version coincides with the Ubuntu distribution version.

Mythbuntu 14.04.1 was released Thursday, July 24th, 2014. (point release)

  • MythTV:
  • Ubuntu: Trusty Tahr
  • Kernel: 3.13

Mythbuntu 14.04 was released on Thursday April 17th, 2014. (LTS)

  • MythTV: MythTV 0.27
  • Ubuntu: Trusty Tahr
  • Kernel: 3.13

Mythbuntu 12.04.3 was released on Thursday September 6th, 2013. (point release)

  • MythTV: 0.25
  • Ubuntu: Precise Pangolin
  • Kernel: 3.8
  • ISO filename: mythbuntu-12.04.3-desktop-amd64

Mythbuntu 12.04 (LTS)

  • Ubuntu: Precise Pangolin

 

Keywords: mythubuntu mythbuntu myth-ubuntu mythtv myth-tv myth tv television capture pvr dvr linuxpvr linuxdvr