Mythbuntu
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. 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.
Contents
Typical Problems with Mythbuntu
- HDMI audio does not work by default
- pulseaudio server will not start
- smb/cifs not included by default
Customization
Use the The apt-get Package Management Tool to install packages.
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
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
extras
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
Easy way to secure transfer files
apt-get install lrzsz
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.
STATUS: UNRESOLVED. TV blanks on MythTV menu. Does not blank on livetv, player, or Xfce desktop. Unknown resolution. Workaround: press the input button on the remote to wake TV up.
Using VLC Player for playback
Using VideoLAN Player for playback in MythTV (otherwise known as VLC Player) for all video files or certain video files.
The subject is covered in the Official MythTV Wiki (MythTV VLC).
fstab example: persistent mounts using exposed credentials
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=yourpass,iocharset=utf8,sec=ntlm 0 0 //apollo/media/ /mnt/media cifs username=nicolep,password=yourpass,iocharset=utf8,sec=ntlm 0 0 //apollo/video/ /mnt/video cifs username=nicolep,password=yourpass,iocharset=utf8,sec=ntlm 0 0
- mount the shares
mount -a
- This provides read-only access to the network shares.
Example with file permission specified and full rw access
//apollo/public /mnt/public cifs defaults,dir_mode=0777,file_mode=0777,domain=workgroup,username=nicolep,password=yourpass,uid=1000
troubleshooting: devs keep breaking samba
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
FAILED TO CLOSE BROKEN PIPE
Update 2024 Kernel 5.15 Samba 2:4.15.13+dfsg-0ubuntu1.6 -
cp: failed to close 'filename': Broken pipe
A problem with this latest at the time samba Can't copy large files to Windows share - Error closing file: Input/output error issue workaround, specify prior version of cifs on fstab, see example:
//apollo/video/ /mnt/video cifs vers=2.0,defaults,domain=workgroup,username=nicolep,password=yourpass,uid=1000
See Linux CIFS Utils and Samba for more information on installing cifs-utils and mounting Microsoft Windows shares.
Troubleshooting
For troubleshooting it helps to know your Mythbuntu version
cat /etc/lsb-release
There's sound on line out, but not on HDMI
CORRECT IN MYTHTV SOFTWARE:
In MythTV this can be corrected easily. From the MythTV Frontend:
- Setup
- Audio
- 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:
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.
Keywords: mythubuntu mythbuntu myth-ubuntu mythtv myth-tv myth tv television capture pvr dvr linuxpvr linuxdvr