Saturday 21 April 2012

XBMC Live Cursor showing up after power cycling TV

A massive annoyance on my XBMC live media centre (XBMC live (Eden) running on Foxconn NT-A3500). If I turn my TV off and on again, the X cursor remains on the screen. This didn't happen when i first installed XBMC live. I didn't consciously amend any settings to make this the case. The only way I could find to get around it is to either reboot the media centre or jump on the laptop and restart lightdm.

Then I got creative and wrote a quick script to run under cron (every 5 minutes) to detect when the TV is powered on and to restart lightdm.

#!/bin/bash
TVON="HDMI status: Pin=3 Presence_Detect=1 ELD_Valid=1"
for i in $(find /var/log/ -maxdepth 1 -name syslog -mmin -5)
do
{
TEST=$(grep "$TVON" "$i" | tail -n 1)
if [ "$TEST" != "" ] ; then
{
# Is this a new one?
TIMESTAMP=$(echo "$TEST" | awk '{print $6}' | sed 's/\[//g' | sed 's/\]//g')
OLD_TIMESTAMP=$(cat /tmp/old_timestamp.txt)
if [ "${TIMESTAMP}" != "${OLD_TIMESTAMP}" ] ; then
{
# we need to restart lightdm
service lighdm restart
echo ${TIMESTAMP} | sed 's/\[//g' | sed 's/\]//g' > /tmp/old_timestamp.txt
}
fi
}
fi
}
done

Not elegant, but currently functional (No idea if restarting XBMC this way could be the cause of my previous post?).

Cursor no more..... :-)

No comments:

Post a Comment