JTK – Notes and Ramblings Things we have found …


mythbuntu 16.04 on the NUC

Filed under: General,MythTV,Router/PC Config — taing @ 1:33 am

The Gigabyte NUC GB-BXBT-1900 and Mythbuntu 16.04 have a few minor issues.

The first and biggest problem is the HDMI port shuts down after the monitor powers down. When the monitor is turned back on there is no display. Yikes.

The first part of the solution is a short shell script ~/screenfix.sh :


export DISPLAY=:0
export XAUTHORITY=/home/taine/.Xauthority
sleep 8
/usr/bin/xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

Be sure to make the script executable with chmod u+x screenfix.sh

The second step is to make this a keyboard shortcut in the Keyboard Settings Shortcut tab. I chose Windows-S for my shortcut. The short cut command is:

xrandr --verbose --display :0 --output HDMI1 --mode 1920x1080

The final step is to automate this based a UDEV rule triggered when the display connects. Create /etc/udev/rules.d/95-monitor-hotplug.rules :

ACTION=="change", SUBSYSTEM=="drm", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/youruser/.Xauthority", RUN+="/home/taine/screenfix.sh"

The sleep line in the shell script was required to give the display time to actually be seen as “connected”.

The connected status of the display can be found with cat /sys/class/drm/card0-HDMI-A-1/status

The triggering UDEV event can be seen with udevadm monitor

Use xrandr -d :0 to display current display info.

Another minor annoyance was the failure of the CTRL-Escape keyboard shortcut to bring up the application menu. The shortcut appears to be set for xfce4-popup-menu. This has been around for quite a while. Change CTRL-Escape to run xfce4-popup-applicationsmenu in the Keyboard Settings Shortcut tab.


MythTV mythlink.pl

Filed under: General,MythTV — taing @ 12:38 pm

mythlink.pl replaces the old functionality of mythrename.pl. It is far more useful once setup.

See https://www.mythtv.org/wiki/Mythlink.pl for the details.

For me this meant creating a folder as a peer to /var/lib/mythtv/recordings. My choice was /var/lib/mythtv/show_names. For this to work from Samba it was necessary to add “unix extensions = no” to the [Global] section of /etc/samba/smb.conf and “wide links = yes” to the specific share section. Without this the links will not be properly traversed when you access the share.

I then added two system events:

mythfilldatabase ran: /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link /var/lib/mythtv/show_names

recording started: /usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link /var/lib/mythtv/show_names --chanid "%CHANID%" --starttime "%STARTTIMEUTC%"

Notice the %STARTTIMEUTC% as opposed the wiki suggested %STARTTIME%. This solution comes to us from http://www.gossamer-threads.com/lists/mythtv/users/564185.

I decided to attach to the mythfilldatabase event instead of recording deleted or instead of adding to crontab. It will run daily and keep things clean.


Mythbuntu / XFCE and CRTL-ESC

Filed under: General,MythTV — taing @ 8:45 pm

After the latest upgrade to Mythbuntu 12.04 we found the previous keyboard shortcut to open the main menu was no longer working. Our solution was to remove the shortcut for CTRL-ESC from


We then adjusted


to include the line

<property name=”&lt;Primary&gt;Escape” type=”string” value=”xfce4-popup-applicationsmenu”></property>

in the <property name=”custom” type=”empty”> section.

This can be confirmed in the keyboard section of xfce4-settings-manager. xfce4-settings-manager is not to be run remotely. If you run it with “sudo” you will adjust the wrong settings file.


Mythbuntu Autologin

Filed under: General,MythTV — taing @ 11:34 pm

After upgrading to 12.04LTS we found autologin no longer worked. The secret was to add:


to /etc/lightdm/lightdm.conf.

Refer to the post at http://www.mattfischer.com/blog/?p=343 for more info. Or look in /usr/share/doc/lightdm/lightdm.conf.gz.

Reset the Haupauge WinTV unit

Filed under: General,MythTV — taing @ 11:24 pm

Once again after a restart the Haupauge unit was not seen by the backend.

The systems here are all upgraded to mythbuntu 12.04LTS and Myth .26.

I tried:

sudo usb_modeswitch -v 2040 -p 7501 -R

And had success. A “sudo shutdown -r now” with no sucess. In the past a power cycle of the devvice and the PC were required.


hostapd and mythbuntu

Filed under: General,MythTV — taing @ 10:16 pm

We were looking to use the wireless card in the Acer Revo mythbuntu box as a wireless access point to extend the wifi coverage in the system. The solution is the hostapd package and a bit of configuration.

In our setup, there is a separate machine acting as primary gateway/router to the internet/DSL modem. We want the new “access point” to have the same SSID and security settings as the existing WAP. We will configure it to use a different B/G channel. The Acer Revo is connected to the main WAP and the router/gateway by wired ethernet so we will bridge the wired ethernet to the wireless interface. In this configuration the existing router/gateway will provide the DHCP services and gateway to the internet.

There were two main articles on the web I used as reference: http://www.su-root.eu/computing/turn-your-linux-computer-in-a-wireless-access-point-using-hostapd and http://blog.robin.smidsrod.no/2008/08/08/how_to_setup_an_atheros_based_access_poi.

The basic steps are to install hostapd, enable IP forwarding disable “NetworkManager” and configure the bridge. The final step is to make this automatic at startup. Our systems are running Mythbuntu Lucid (10.4) and all went well.

The Avec Revo units have a wireless card based on an Atheros chipset. This allows you to use the ath9k kernel driver. For this driver the you must use hostapd to set Master mode for the card. You will not be able to do this with iwconfig alone.

After installing hostapd via apt-get, the second part of the setup is to disable “NetworkManager” and create the appropriate bridge configuration is /etc/network/interfaces :
auto lo
iface lo inet loopback

iface eth0 inet manual

auto br0
iface br0 inet dhcp
#for testing you may want to leave wlan0 out of the bridge and add manually when hostapd is running
bridge-ports eth0 wlan0

iface wlan0 inet manual

For testing you can add or remove the wlan0 interface from the bridge using brctl addif br0 wlan0 or brctl delif br0 wlan0.

You will need to enable IP forwarding with echo 1 > /proc/sys/net/ipv4/ip_forward. If you have iptables or other firewall setup you will need to edit the config to allow the correct traffic.

The sample /etc/hostapd/hostapd.conf file from the link article worked well:
#wireless interface to use as AP

#bridge device (needed for madwifi & nl80211 drivers)

#driver interface type (hostapd/wired/madwifi/prism54/test/none/nl80211/bsd)
# Use nl80211 for wifi drivers that implement MAC80211 interface
#You should set this to your relevant driver interface type

#Enables logging to standard output (useful for debugging)

#Set SSID to use

# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)
# note your card may not support every mode.

#Channel to use (1-13)



#Enable WPA2

#Set passphrase for WPA

# Set of accepted cipher suites (encryption algorithms) for pairwise keys
wpa_pairwise=TKIP CCMP
# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value)

For testing you can start hostapd with sudo hostapd -d /etc/hostapd/hostapd.conf. Once all is working well you can make this a bit more automatic. If you have wlan0 set as part of br0 in /etc/network/interfaces, the only step left is to edit /etc/defaults/hostapd to set RUN_DAEMON="yes". This will allow hostapd to start at boot and allow you to use /etc/init.d/hostapd start|stop|restart to control.

For debugging you can use brctl show to view the members of the bridge. You can use hostapd_cli to control the operation of the WAP service.


Problem after Mythbuntu 11.10 upgrade

Filed under: General,MythTV — taing @ 10:28 pm

After upgrading Mythbuntu to 11.10 we encountered an error that showed in syslog as a segfault in Unity-Greeter. Fortunately the system was still accessible via SSH and console. The solution was found in a thread on ubuntuforums.com.

The core of the solution is to edit /etc/lightdm/lightdm.conf and remove this line:


HVR-1950 – Mythbuntu 9.10 – Both tuners

Filed under: General,MythTV — taing @ 4:44 pm

This assumes you have read the earlier post and have the firmware loaded and the device detected.

In order to get both tuners to work and not to conflict there are a few steps to follow.

Under Capture Card setup:

For the analog side
Card Type: IVTV MPEG-2 encoder card – /dev/video0

For the digital side
Card Type: DVB DTV capture card
Under ‘Record Options’ make sure
“Wait for SEQ start header” is not checked
“Open DVB Card on demand” is checked
“Use DVB Card for active EIT scan” is not checked

Under Input Connections:

Be sure to create Input Groups. You will need to create a group and put both cards in the same group.

For the other tuners in the system you will need to create separate input groups.


hdhome run ir remote

Filed under: General,MythTV — taing @ 6:52 pm

You will need several files:

/etc/lirc/hardware.conf – defines the hardware and points to the ir def file
/etc/lirc/lircd.conf – the default location for the ir def file. Associates the IR from each button with an action code

~/.lircrc – often and include file for the application specific files
~/.lirc/mythtv – the mythtv specific file. Associates the action code with an application and response

~/.mythtv/lircrc – typically a link to ~/.lirc/mythtv

You will also need to set the hdhomerun device to talk to the proper frontend. The details can be found at http://www.silicondust.com/hdhomerun/instructions/mythtv.

hdhomerun_config <device id> set /ir/target "<lircd ip addr>:<port> store"

You can find the hdhomerun_config tar at http://www.silicondust.com/downloads.

You can use irrecord to create your lircd.conf file.
irrecord -H udp -d 5000 "name of remote"

This command must be run with lirc NOT running. You can then copy the created file to /etc/lirc/lircd.conf.


MythMusic on separate frontend

Filed under: General,MythTV — taing @ 11:26 pm

The mp3 files are stored on the Master Backend at /var/lib/mythtv/music.

This mp3 files is shared by samba at //backend//music/

On the Frontend machine /var/lib/mythtv/music is a mount point for the samba share(requires smbfs be installed).

The Fstab entry looks like:
//backend/music /var/lib/mythtv/music cifs auto,uid=taine,gid=mythtv,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0
This will mount the smb share at boot. The credentials are stored in a file that is readable only by root ofr somewhat better security.

The file /root/cifscredentials looks like:

Our other issue was to be sure to set the output device under Music Tools Setup to
We are using the Acer Revo 3610 with HDMI ouput to a Vizio LCD TV.


Vizio VX37L / Revo / Mythbuntu 9.10

Filed under: General,MythTV — taing @ 5:37 pm

The trick is in the /etc/X11/xorg.conf file, particularly the modeline :

Section "Screen"
        Identifier      "Default Screen"
        Device          "nvidia ION"
        Monitor         "Vizio VX37L"
        Defaultdepth    24
        SubSection "Display"
                Depth   24
                Modes   "1360x768C"  "1024x768@60"   "800x600@60"

Section "Device"
        Identifier      "nvidia ION"
        Driver  "nvidia"
        Option  "UseEvents"     "1"
        Option  "DPI"   "100x100"
        Option  "NoLogo"        "1"

Section "Monitor"
        Identifier      "Vizio VX37L"
        Vendorname      "Vizio"
        Modelname       "Vizio 37L"
        Horizsync       31.5-70
        Vertrefresh     50.0-85.0
        Option          "DPMS"
        Option          "ModeValidation" "NoWidthAlignmentCheck, NoDFPNativeResolutionCheck"
        Option          "ExactModeTimingsDVI" "TRUE"
        modeline  "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
        modeline  "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -vsync -hsync
        modeline  "1360x768C" 85.50 1366 1494 1624 1798 768 770 776 795 -hsync +vsync
        Gamma   1.0

The modeline for 1360×768 will also work for the SV421XVT. However the auto detected 1920×1200 work very well.

A nice trick is to ssh -Y user@host
xrandr -q --screen :0

This will show the screen info for screen:0 on the remote host.

HVR-1950 with Mythbuntu 9.10

Filed under: General,MythTV — taing @ 5:22 pm

The first thing one needs to do is be sure the firmware is loaded.

The firmware can be extracted from the Drivers folder on the CD shipped with the HVR-1950 using the script found at http://www.isely.net/downloads/fwextract.pl. The firmware gets placed in the /lib/firmware directory. There are four files v4l-cx2341x-enc.fw

More info can be found at http://www.isely.net/pvrusb2/pvrusb2.html

Older Posts »

Powered by WordPress