Author |
Message |
tzoom84
|
Posted: Tue Aug 19, 2008 5:43 am |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
Hey all, I didn't want to threadjack over here so I figured a fresh post was worthy.
I'm having problems with MythWelcome/MythBackend and I am having a hard time debugging. Essentially, in the past, mythwelcome would shutdown fine, and say "MythTV is idle and will shutdown in xxx seconds". But recently it just stopped counting down and just says "MythTV is idle". I checked the shutdown parameters and nothing has changed (the "block shutdown..." option is unchecked, mythwelcome shutdown is unlocked).
So I started investigating the source code for mythwelcome. It seems an internal variable (m_secondsToShutdown) isn't set because a MythEvent isn't triggered.
So, has someone run into this "MythTV is Idle" before?
Last edited by tzoom84 on Sat Aug 23, 2008 1:05 pm, edited 2 times in total.
|
|
Top |
|
 |
tzoom84
|
Posted: Sat Aug 23, 2008 12:53 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
Ok so the verbose mode was simple. "mythbackend --verbose [args]', changed in /etc/init.d/mythtv-backend file.
I still can't seem to find out why mythwelcome occassionally says "MythTV is Idle" without counting down. After looking in the mythwelcome code, and debug, I noticed the countdown starts only after SHUTDOWN_COUNTDOWN is set, which occurs through a MythEvent.
I also noticed that in the debug, when only "MythTV is Idle" is shown, no events occur. The events originate from scheduler.cpp, and are based on just simple logic. But I can't trace.
Any recommendations? Or anyone have issues with MythEvents not being sent from the scheduler?
|
|
Top |
|
 |
silentmic
|
Posted: Sat Aug 23, 2008 7:55 pm |
|
Joined: Fri Feb 03, 2006 11:36 pm
Posts: 63
Location:
Melbourne
|
I've seen this. I'm not sure of it, but one thing which I think can cause it is when it thinks there are other frontends connected. Sometimes I've had a frontend running on a linux desktop and I've hibernated the desktop without exiting that frontend. The backend doesn't get the message that the frontend has exited.
|
|
Top |
|
 |
mythman13
|
Posted: Sun Aug 24, 2008 8:22 am |
|
Joined: Sun Sep 02, 2007 2:30 pm
Posts: 94
|
Hi tzoom84,
Just to check, if you don't use remote frontends that the setting "Block remote shutdown before client connected" under mythtv-setup -> General _> Shutdown/Wakeup Options is unticked. Because when my shutdown kept cycling I think it was because this was ticked and I don't have any remote frontends.
Hope this helps,
Mythman
_________________ Running Knoppmyth R5.5 on a Compaq EVO D510 (sff) w/ P4 1.8GHz, 1GB RAM, 330GB 7200rpm Maxtor IDE HDD, XFX Nvidia GeForce 6200 (AGP low profile, p/n: PV-T44A-WANG) and Huappauge NOVA-T 500 DVB-T dual tuner PCI card.
|
|
Top |
|
 |
tzoom84
|
Posted: Sun Aug 24, 2008 4:14 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
The frontend I run is on the same machine as on the backend, and the "Block ..." setting is unticked.
|
|
Top |
|
 |
mythman13
|
Posted: Wed Sep 03, 2008 3:23 pm |
|
Joined: Sun Sep 02, 2007 2:30 pm
Posts: 94
|
This is kinda spooky but I've just run into this last night...
I switched by frontend / backend box on and watched a redorded show. Then wanted to watch another after deleting some old ones on my ext3 myth partition. But the screen just blanked with hard disk activity. This happens occasionaly and if you wait long enough it exits back to the menu with no error but this was a currently recording program and I couldn't wait for it to finish (I think it has trouble finding a bookmark or start of the show). So I pressed Ctrl-Alt-Backspace (not sure exactly what this does but it seems to have the desired effect of rebooting the frontend). Then it worked ok. So I left it recording some sport whilst I went to bed!
I woke the next morning to discover it was still on with nothing scheduled to record?! Mythwelcome said "MythTV is idle" but with NO countdown timer! There are no other frontends connected.
I haven't investigated it further except to say that the countdown does not occur after using Ctrl-Alt-Backspace.
_________________ Running Knoppmyth R5.5 on a Compaq EVO D510 (sff) w/ P4 1.8GHz, 1GB RAM, 330GB 7200rpm Maxtor IDE HDD, XFX Nvidia GeForce 6200 (AGP low profile, p/n: PV-T44A-WANG) and Huappauge NOVA-T 500 DVB-T dual tuner PCI card.
|
|
Top |
|
 |
tzoom84
|
Posted: Wed Sep 03, 2008 5:13 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
I ran into a deadend this weekend and decided I must've broken something while installing some other things. So I decided to reinstall/restore R5.5.
I'm slowly rolling out my custom updates until I see where it breaks. I'll report if I find anything.
|
|
Top |
|
 |
auttila
|
Posted: Thu Sep 04, 2008 12:49 pm |
|
Joined: Tue Nov 28, 2006 3:38 am
Posts: 82
Location:
Kangasala, Finland
|
I have a fresh R5.5 install with only v4l drivers installed. I have exatcly the same problem: no countdown occurs. So most likely it's not any of your custom updates.
Also a friend of mine (who is very accurate and has deeper knowledge in theses kind of things) has the same problem.
_________________ Jari-Matti
MBE&FE: GeForce MX440, Athlon XP 2000+, MSI KT333 Ultra, onboard audio, 512 MB, 2 x Technotrend T1500 DVB-T, LiteOn DVD±RW 16x DW1650-488C, Seagate 250 GB FE: 1500MHz Geforce MX200-V, int. audio, 256MB
|
|
Top |
|
 |
tzoom84
|
Posted: Sun Sep 07, 2008 8:06 am |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
Well, looks like with no other changes this has happened to me too again. I am at a complete loss for debugging, so I thought of a simple idea. The countdown works if I restart the backend when it locks up like this, so:
Write a background script that essentially runs the preshutdown check, external to mythtv. Have it start at boot up and poll every X seconds if it is ready to shut down. Basically, ensure
1. Mythfrontend is not running
2. "mythshutdown --check" returns 0.
If ok, don't shutdown, just restart the backend. That way it still goes through the mythtv built in shutdown process, but doesn't mess up recordings in the meantime.
What do you think? Am I missing something?
|
|
Top |
|
 |
tzoom84
|
Posted: Mon Sep 29, 2008 7:53 pm |
|
Joined: Sat May 26, 2007 9:51 pm
Posts: 130
|
I threw together a pretty simple script to fix the "MythTV is Idle" issue. It basically runs like the above post describes. Whenever the message is displayed, and the system is identified as Idle by MythShutdown, this script just restarts the backend so that the countdown can occur.
Code:
Code: #!/bin/bash # Script designed to run in the background # Monitors to ensure backend hasn't clogged up resulting in a "MythTV is Idle" # in MythWelcome with no countdown to shutdown # Checks (1) if MythFrontend is closed, and (2) mythshutdown --check returns 0 (otherwise idle) # Essentially it is manually running what MythWelcome should take care of when the backend # sends the right signal
# get some pretty date stuff # and set the exit state to default 0, or force shutdown mdy="`date +%Y-%m-%d`" hm1="`date +%T`" hm2="`date +%N | cut --bytes='1 2 3'`" hms="$hm1.$hm2" echo "$mdy $hms backendmonitor: TEST TOP!" >> /var/log/mythtv/mythpreshutdown.log
initval=7m
sleep $initval
# Set sleep large enough so it allows regular countdowns to occur without constantly restarting backend # (at least 2X the countdown time) sleeptimer=7m
echo "$mdy $hms backendmonitor: STARTING UP! (timer=$sleeptimer)" >> /var/log/mythtv/mythpreshutdown.log
while [ 1 ]; do # Run forever
mdy="`date +%Y-%m-%d`" hm1="`date +%T`" hm2="`date +%N | cut --bytes='1 2 3'`" hms="$hm1.$hm2"
#Clear flags reloadflag=0 frontendflag=0 builtincheck=0
# Execute mythfrontend check frontendflag=`ps axu | grep -c 'mythfrontend'` frontendflag=$[$frontendflag-1]
# Execute built in mythshutdown check command /usr/bin/mythshutdown -c builtincheck=$?
# Run check if it should reload if [[ $builtincheck -eq 0 && $frontendflag -eq 0 ]]; then reloadflag=1 fi
echo "$mdy $hms backendmonitor: Frontendflag = $frontendflag, Builtincheck = $builtincheck , ReloadFlag = $reloadflag" >> /var/log/mythtv/mythpreshutdown.log
# Reload backend if necessary if [ $reloadflag -eq 1 ]; then echo "$mdy $hms backendmonitor.sh: Restarting backend because it may have paused up" >> /var/log/mythtv/mythpreshutdown.log /etc/init.d/mythtv-backend restart reloadflag=0 sleep $sleeptimer # Wait some time to allow for real restart fi
sleep $sleeptimer echo "$mdy $hms backendmonitor: Checked ... (timer=$sleeptimer)" >> /var/log/mythtv/mythpreshutdown.log
done
I'm sure theres plenty of holes, but it has been good enough to get by for the past 2 weeks. As always, be sure to set up appropriate permissions, add it to your startup script, and set up sudo as needed.
|
|
Top |
|
 |