Always have to manually restart mythtv-backend after reboot

Bug #182746 reported by jimmy
40
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Mythbuntu
Expired
Medium
Unassigned

Bug Description

I am on my second install of mythbuntu and I find after every reboot, that I have to restart mythtv-backend in order to watch tv.

sudo /etc/init.d/mythtv-backend restart

The error I get is the "all inputs are being used...".

Am I the only one this is happening to?

Just in case, here are some specs..
shuttle sn21g5 case, opteron 165, 1gig mem, nvidia 6600, turtle beach sound, 500GB seagate drive.

Thanks!!

Revision history for this message
Mario Limonciello (superm1) wrote :

Try setting up a static address. There is a known race condition for this and networking via NetworkManager.

Changed in mythbuntu:
status: New → Incomplete
Revision history for this message
jimmy (jubxie) wrote :

well, this appear to be a known issue with the hdhomerun tuner.

http://ubuntuforums.org/showthread.php?t=642646&highlight=mythtv-backend+restart

I can't find this bug anywhere, so the symptoms are in the above thread on the ubuntu forums. Sounds like mythtv-backend just needs to start a little later in the boot process to appease the hdhomerun tuner. Thanks!

Revision history for this message
Ian Bardsley (ifb777) wrote :

Have recently installed Mythbuntu 8.10 Alpha 4 in an effort to resolve random freezing problem with 8.04. I am seeing the same problem with back end not starting at boot time. Manual start enables a working system which then performs very well and is more stable than 8.04 (no random freezing).

FYI tuner is Hauppage Nova T 500

Hope this helps

Revision history for this message
Mario Limonciello (superm1) wrote :

Hi Ian:

If you are encountering this with a non-hd-homerun, how are you starting the backend after boot? Via the init script?

Revision history for this message
Ian Bardsley (ifb777) wrote : Re: [Bug 182746] Re: Always have to manually restart mythtv-backend after reboot

G'Day Mario

Yes, issuing "sudo /etc/init.d/mythtv-backend start" restores full
functionality with no apparent problems.

I have also recently discovered that making an entry in the XFCE
Autostart function, "/usr/bin/mythbackend" starts the backend at boot
time and Myth has full functionality without the need to resort to the
init script.

Hope this helps.

Regards

Ian Bardsley

Mario Limonciello wrote:
> Hi Ian:
>
> If you are encountering this with a non-hd-homerun, how are you starting
> the backend after boot? Via the init script?
>
>

Revision history for this message
Mario Limonciello (superm1) wrote : Re: [Bug 182746] Always have to manually restart mythtv-backend after reboot

Can you please post your output of mythbuntu-log-grabber so we can see
if there are some pending issues in there? I'm leaning towards a race
condition.

On 09/20/2008, Ian Bardsley <email address hidden> wrote:
> G'Day Mario
>
> Yes, issuing "sudo /etc/init.d/mythtv-backend start" restores full
> functionality with no apparent problems.
>
> I have also recently discovered that making an entry in the XFCE
> Autostart function, "/usr/bin/mythbackend" starts the backend at boot
> time and Myth has full functionality without the need to resort to the
> init script.
>
> Hope this helps.
>
> Regards
>
> Ian Bardsley
>
>
> Mario Limonciello wrote:
>> Hi Ian:
>>
>> If you are encountering this with a non-hd-homerun, how are you starting
>> the backend after boot? Via the init script?
>>
>>
>
> --
> Always have to manually restart mythtv-backend after reboot
> https://bugs.launchpad.net/bugs/182746
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to Mythbuntu.
>
> Status in Mythbuntu, Ubuntu derivative focused upon MythTV: Incomplete
>
> Bug description:
> I am on my second install of mythbuntu and I find after every reboot, that I
> have to restart mythtv-backend in order to watch tv.
>
> sudo /etc/init.d/mythtv-backend restart
>
> The error I get is the "all inputs are being used...".
>
> Am I the only one this is happening to?
>
> Just in case, here are some specs..
> shuttle sn21g5 case, opteron 165, 1gig mem, nvidia 6600, turtle beach sound,
> 500GB seagate drive.
>
> Thanks!!
>

--
Sent from my mobile device

Mario Limonciello
<email address hidden>

Revision history for this message
laga (laga) wrote :

This thread might be related:

http://ubuntuforums.org/showthread.php?t=925242

Basically, changing startup order seems to fix this issue for HDHR users.

Revision history for this message
Ian Bardsley (ifb777) wrote :

Hi Mario

I think I have done this correctly

http://mythbuntu.pastebin.com/f32005778

Pls let me know if i've screwed up

Regards

Ian Bardsley

Mario Limonciello wrote:
> Can you please post your output of mythbuntu-log-grabber so we can see
> if there are some pending issues in there? I'm leaning towards a race
> condition.
>
> On 09/20/2008, Ian Bardsley <email address hidden> wrote:
>
>> G'Day Mario
>>
>> Yes, issuing "sudo /etc/init.d/mythtv-backend start" restores full
>> functionality with no apparent problems.
>>
>> I have also recently discovered that making an entry in the XFCE
>> Autostart function, "/usr/bin/mythbackend" starts the backend at boot
>> time and Myth has full functionality without the need to resort to the
>> init script.
>>
>> Hope this helps.
>>
>> Regards
>>
>> Ian Bardsley
>>
>>
>> Mario Limonciello wrote:
>>
>>> Hi Ian:
>>>
>>> If you are encountering this with a non-hd-homerun, how are you starting
>>> the backend after boot? Via the init script?
>>>
>>>
>>>
>> --
>> Always have to manually restart mythtv-backend after reboot
>> https://bugs.launchpad.net/bugs/182746
>> You received this bug notification because you are a member of Mythbuntu
>> Bug Team, which is subscribed to Mythbuntu.
>>
>> Status in Mythbuntu, Ubuntu derivative focused upon MythTV: Incomplete
>>
>> Bug description:
>> I am on my second install of mythbuntu and I find after every reboot, that I
>> have to restart mythtv-backend in order to watch tv.
>>
>> sudo /etc/init.d/mythtv-backend restart
>>
>> The error I get is the "all inputs are being used...".
>>
>> Am I the only one this is happening to?
>>
>> Just in case, here are some specs..
>> shuttle sn21g5 case, opteron 165, 1gig mem, nvidia 6600, turtle beach sound,
>> 500GB seagate drive.
>>
>> Thanks!!
>>
>>
>
>

Revision history for this message
Mario Limonciello (superm1) wrote :

Ian Bardsley wrote:
> Hi Mario
>
> I think I have done this correctly
>
>
> http://mythbuntu.pastebin.com/f32005778
>
> Pls let me know if i've screwed up
>
> Regards
>
> Ian Bardsley
>
> Mario Limonciello wrote:
>
Hi Ian:

The way that I read that, it looks like you have multiple mythbackend processes
spawned simultaneously, and coincidently one of them starts to work. Try this:

1) Stop all mythbackend processes
2) Move (or remove) all logs from /var/log/mythtv
3) Restart your computer
4) Look at /var/log/mythtv/mythbackend.log immediately after starting up.

--
Mario Limonciello
<email address hidden>

Revision history for this message
Ian Bardsley (ifb777) wrote :

Mario Limonciello wrote:
> Ian Bardsley wrote:
>
>> Hi Mario
>>
>> I think I have done this correctly
>>
>>
>> http://mythbuntu.pastebin.com/f32005778
>>
>> Pls let me know if i've screwed up
>>
>> Regards
>>
>> Ian Bardsley
>>
>> Mario Limonciello wrote:
>>
>>
> Hi Ian:
>
> The way that I read that, it looks like you have multiple mythbackend processes
> spawned simultaneously, and coincidently one of them starts to work. Try this:
>
> 1) Stop all mythbackend processes
> 2) Move (or remove) all logs from /var/log/mythtv
> 3) Restart your computer
> 4) Look at /var/log/mythtv/mythbackend.log immediately after starting up.
>
>
Hi Mario

Have done as you suggested. I renamed all 3 log files in
/var/log/mythtv and rebooted. It is interesting to note that a new
backend log was not created at boot time and the backend was not
running. Issuing /etc/init.d/mythtv-backend start, started the backend,
created a log file and wrote the following:

2008-09-23 21:21:37.183 Using runtime prefix = /usr
2008-09-23 21:21:37.187 Empty LocalHostName.
2008-09-23 21:21:37.188 Using localhost value of mediacentre
2008-09-23 21:21:37.222 New DB connection, total: 1
2008-09-23 21:21:37.227 Connected to database 'mythconverg' at host:
localhost
2008-09-23 21:21:37.230 Closing DB connection named 'DBManager0'
2008-09-23 21:21:37.232 Connected to database 'mythconverg' at host:
localhost
2008-09-23 21:21:37.236 New DB connection, total: 2
2008-09-23 21:21:37.239 Connected to database 'mythconverg' at host:
localhost
2008-09-23 21:21:37.244 Current Schema Version: 1214
Starting up as the master server.
2008-09-23 21:21:37.538 New DB connection, total: 3
2008-09-23 21:21:37.540 Connected to database 'mythconverg' at host:
localhost
2008-09-23 21:21:38.461 New DB scheduler connection
2008-09-23 21:21:38.464 Connected to database 'mythconverg' at host:
localhost
2008-09-23 21:21:38.489 MediaServer:: Loopback address specified -
127.0.0.1. Disabling UPnP
2008-09-23 21:21:38.491 Main::Registering HttpStatus Extension
2008-09-23 21:21:38.495 mythbackend version: 0.21.20080304-1 www.mythtv.org
2008-09-23 21:21:38.498 Enabled verbose msgs: important general
2008-09-23 21:21:38.536 AutoExpire: CalcParams(): Max required Free
Space: 1.0 GB w/freq: 15 min
2008-09-23 21:21:41.468 Reschedule requested for id -1.
2008-09-23 21:21:41.523 Scheduled 0 items in 0.1 = 0.04 match + 0.01 place
2008-09-23 21:21:41.528 Seem to be woken up by USER

mediacentre is the Host Name of the myth installation

Mythtv then works as expected

I trust this is of assistance

Regards

Ian Bardsley

Revision history for this message
Mario Limonciello (superm1) wrote :
Download full text (3.6 KiB)

Okay Ian, next step then, what's the output of this:
ls -lR /etc/rc* | grep myth

On 09/23/2008, Ian Bardsley <email address hidden> wrote:
> Mario Limonciello wrote:
>> Ian Bardsley wrote:
>>
>>> Hi Mario
>>>
>>> I think I have done this correctly
>>>
>>>
>>> http://mythbuntu.pastebin.com/f32005778
>>>
>>> Pls let me know if i've screwed up
>>>
>>> Regards
>>>
>>> Ian Bardsley
>>>
>>> Mario Limonciello wrote:
>>>
>>>
>> Hi Ian:
>>
>> The way that I read that, it looks like you have multiple mythbackend
>> processes
>> spawned simultaneously, and coincidently one of them starts to work. Try
>> this:
>>
>> 1) Stop all mythbackend processes
>> 2) Move (or remove) all logs from /var/log/mythtv
>> 3) Restart your computer
>> 4) Look at /var/log/mythtv/mythbackend.log immediately after starting up.
>>
>>
> Hi Mario
>
> Have done as you suggested. I renamed all 3 log files in
> /var/log/mythtv and rebooted. It is interesting to note that a new
> backend log was not created at boot time and the backend was not
> running. Issuing /etc/init.d/mythtv-backend start, started the backend,
> created a log file and wrote the following:
>
> 2008-09-23 21:21:37.183 Using runtime prefix = /usr
> 2008-09-23 21:21:37.187 Empty LocalHostName.
> 2008-09-23 21:21:37.188 Using localhost value of mediacentre
> 2008-09-23 21:21:37.222 New DB connection, total: 1
> 2008-09-23 21:21:37.227 Connected to database 'mythconverg' at host:
> localhost
> 2008-09-23 21:21:37.230 Closing DB connection named 'DBManager0'
> 2008-09-23 21:21:37.232 Connected to database 'mythconverg' at host:
> localhost
> 2008-09-23 21:21:37.236 New DB connection, total: 2
> 2008-09-23 21:21:37.239 Connected to database 'mythconverg' at host:
> localhost
> 2008-09-23 21:21:37.244 Current Schema Version: 1214
> Starting up as the master server.
> 2008-09-23 21:21:37.538 New DB connection, total: 3
> 2008-09-23 21:21:37.540 Connected to database 'mythconverg' at host:
> localhost
> 2008-09-23 21:21:38.461 New DB scheduler connection
> 2008-09-23 21:21:38.464 Connected to database 'mythconverg' at host:
> localhost
> 2008-09-23 21:21:38.489 MediaServer:: Loopback address specified -
> 127.0.0.1. Disabling UPnP
> 2008-09-23 21:21:38.491 Main::Registering HttpStatus Extension
> 2008-09-23 21:21:38.495 mythbackend version: 0.21.20080304-1 www.mythtv.org
> 2008-09-23 21:21:38.498 Enabled verbose msgs: important general
> 2008-09-23 21:21:38.536 AutoExpire: CalcParams(): Max required Free
> Space: 1.0 GB w/freq: 15 min
> 2008-09-23 21:21:41.468 Reschedule requested for id -1.
> 2008-09-23 21:21:41.523 Scheduled 0 items in 0.1 = 0.04 match + 0.01 place
> 2008-09-23 21:21:41.528 Seem to be woken up by USER
>
> mediacentre is the Host Name of the myth installation
>
> Mythtv then works as expected
>
> I trust this is of assistance
>
> Regards
>
> Ian Bardsley
>
> --
> Always have to manually restart mythtv-backend after reboot
> https://bugs.launchpad.net/bugs/182746
> You received this bug notification because you are a member of Mythbuntu
> Bug Team, which is subscribed to Mythbuntu.
>
> Status in Mythbuntu, Ubuntu derivative focused upon MythTV: Incomplete
>
> Bug description:
> I am on my second instal...

Read more...

Revision history for this message
Ian Bardsley (ifb777) wrote :
Download full text (4.7 KiB)

Hello again Mario

The output of

ls -lR /etc/rc* | grep myth as follows:

lrwxrwxrwx 1 root root 24 2008-09-18 15:45 K20mythtv-backend -> ../init.d/mythtv-backend
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 K51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 24 2008-09-18 15:45 K20mythtv-backend -> ../init.d/mythtv-backend
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 K51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 S51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 S51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 S51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 S51mythtv-status -> ../init.d/mythtv-status
lrwxrwxrwx 1 root root 24 2008-09-18 15:45 K20mythtv-backend -> ../init.d/mythtv-backend
lrwxrwxrwx 1 root root 23 2008-09-18 15:41 K51mythtv-status -> ../init.d/mythtv-status

I have no idea what this means so over to you

Regards

Ian Bardsley

Mario Limonciello wrote:
> Okay Ian, next step then, what's the output of this:
> ls -lR /etc/rc* | grep myth
>
> On 09/23/2008, Ian Bardsley <email address hidden> wrote:
>
>> Mario Limonciello wrote:
>>
>>> Ian Bardsley wrote:
>>>
>>>
>>>> Hi Mario
>>>>
>>>> I think I have done this correctly
>>>>
>>>>
>>>> http://mythbuntu.pastebin.com/f32005778
>>>>
>>>> Pls let me know if i've screwed up
>>>>
>>>> Regards
>>>>
>>>> Ian Bardsley
>>>>
>>>> Mario Limonciello wrote:
>>>>
>>>>
>>>>
>>> Hi Ian:
>>>
>>> The way that I read that, it looks like you have multiple mythbackend
>>> processes
>>> spawned simultaneously, and coincidently one of them starts to work. Try
>>> this:
>>>
>>> 1) Stop all mythbackend processes
>>> 2) Move (or remove) all logs from /var/log/mythtv
>>> 3) Restart your computer
>>> 4) Look at /var/log/mythtv/mythbackend.log immediately after starting up.
>>>
>>>
>>>
>> Hi Mario
>>
>> Have done as you suggested. I renamed all 3 log files in
>> /var/log/mythtv and rebooted. It is interesting to note that a new
>> backend log was not created at boot time and the backend was not
>> running. Issuing /etc/init.d/mythtv-backend start, started the backend,
>> created a log file and wrote the following:
>>
>> 2008-09-23 21:21:37.183 Using runtime prefix = /usr
>> 2008-09-23 21:21:37.187 Empty LocalHostName.
>> 2008-09-23 21:21:37.188 Using localhost value of mediacentre
>> 2008-09-23 21:21:37.222 New DB connection, total: 1
>> 2008-09-23 21:21:37.227 Connected to database 'mythconverg' at host:
>> localhost
>> 2008-09-23 21:21:37.230 Closing DB connection named 'DBManager0'
>> 2008-09-23 21:21:37.232 Connected to database 'mythconverg' at host:
>> localhost
>> 2008-09-23 21:21:37.236 New DB connection, total: 2
>> 2008-09-23 21:21:37.239 Connected to database 'mythconverg' at host:
>> localhost
>> 2008-09-23 21:21:37.244 Current Schema Version: 1214
>> Starting up as the master server.
>> 2008-09-23 21:21:37.538 New DB connection, total: 3
>> 2008-09-23 21:21:37.540 Connected to database 'mythconverg' at host:
>> localhost
>> 2008-09-23 21:21:38.461 New DB scheduler connection
>> 2008-09-23 2...

Read more...

Revision history for this message
roystonvasey (mikestocks) wrote :

I can confirm this problem after a reinstall to Intrepid Alpha 4 accompanied by a change to a wireless network. mythtv-backend starts OK on system restart on a wired network but not on the wireless network.
I believe the problem is a race condition where NetworkManager is beaten by mythtv-backend.
I have found three solutions during my investigations:
 1. Configure a static IP address.
 2. Remove NetworkManager and configure the /etc/network/interfaces file manually.
 3. As above change the start-up order of mythtv-backend. This is my preferred solution I have mythtv-backend linked to /etc/rc2.d/S31mythtv-backend

Revision history for this message
Ian Bardsley (ifb777) wrote :

A brief update on this problem. After the last batch of updates on 9th and 10th October, this problem is no longer evident. Mythbackend now starts automagically after a reboot

No idea which of the updates corrected the problem but corrected it is

Changed in mythbuntu:
status: Incomplete → Fix Released
Revision history for this message
Dewey_Oxberger (jonb-cirris) wrote :

I just did a clean install of Mythbuntu 9.04 RC and this issue is still present:

The HDHomeRun is a network appliance. The network must be fully up before you bring mythbackend up or the backend will assume the tuner is missing.

The network init time is variable from pc to pc so you'll find lots of people with tweeks and hacks that work for them but not for other people.

I'll tinker and post back what I find.

Revision history for this message
Dewey_Oxberger (jonb-cirris) wrote :

I've added the script I use that waits for the HDHomeRun to be up.

I put this script after the network starts coming up but before mythfrontend starts.

Revision history for this message
cagney (andrew-cagney) wrote :

Same problem with Hauppauge usb receivers (PVR USB2, HVR-1950, HVR-950Q) where one or more haven't initialized before the backend starts. Both 9.04 and 9.10 releases have the problem; definitely not fixed.

My workaround was just to sleep 5 before starting mythtv-backend.

Changed in mythbuntu:
status: Fix Released → Confirmed
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) wrote :

Hello,

I am using Lucid Beta with a Hauppauge HVR-2200 dual DVB-T tuner. It takes a second or two to upload the firmware to the card in the initialisation process and it seems that it is causing this issue. If I type "sudo restart mythtv-backend" then all works correctly. Sometimes it works fine without this. From reading the logs (let me know if you would like me to upload them), it seems that this is simply because sometimes the firmware has loaded and the /dev/ nodes are set up before the backend is loaded and sometimes it is not (causing errors about the devices not existing).

Would it be possible for the mythtv-backend upstart job to wait until the DVB device nodes were properly set up?

Thomas Mashos (tgm4883)
Changed in mythbuntu:
importance: Undecided → Medium
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) wrote :

/etc/init/mythtv-backend.conf is the upstart script in charge of this. I have added:

Between "script" and USER, I have added:
        while ! [ -e /dev/dvb/adapter1/frontend0 ]; do
  sleep 1s;
 done
to the beginning of this file.

======
start on (local-filesystems and net-device-up IFACE=lo)
stop on starting shutstart on (local-filesystems and net-device-up IFACE=lo)
stop on starting shutdown

#expect fork
respawn

script
        USER=mythtv
        ARGS="--logfile /var/log/mythtv/mythbackend.log --user $USER"
        test -f /etc/default/mythtv-backend && . /etc/default/mythtv-backend || true
        /usr/bin/mythbackend $ARGS
end scriptdown

#expect fork
respawn

script
        USER=mythtv
        ARGS="--logfile /var/log/mythtv/mythbackend.log --user $USER"
        test -f /etc/default/mythtv-backend && . /etc/default/mythtv-backend || true
        /usr/bin/mythbackend $ARGS
end script
=======

/dev/dvb/adapter1/frontend0 would need to be whichever is the last adapter set up on the machine. It isn't a great solution, but it certainly works for me.

The best approach would probably to be to make the backend itself wait 10 secs or so for all cards that are set up on the machine to be ready. If the cards in the machine changed, this would mean a 10 second delay (which isn't that bad), but in all other circumstances, it would solve this problem.

Revision history for this message
MarcRandolph (mrand) wrote : Re: [Bug 182746] Re: Always have to manually restart mythtv-backend after reboot

Aaron, could you please try the fix that is proposed in
https://bugs.launchpad.net/bugs/556204 (after reverting your changes)
and report back if that resolves your issue or not?

Specifically, I'm referring to adding "and started udev-finish" to the
start on line.

Revision history for this message
johnbergqvist@live.co.uk (johnbergqvist) wrote :

I have the same problem, i'm using mythbuntu lucid x64 (hasnt happened in any previous editions of mythbuntu for me though) with dual HVR-1300 tuners, Can't get a lock when i boot up, yet if i restart the backend (sudo restart mythtv-backend), it then works. I tried the above solutions and it had absolutely no effect. This is now my mythtv-backend.conf file:

# MythTV Backend service

description "MythTV Backend"
author "Mario Limonciello <email address hidden>"
start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)

stop on starting shutdown

#expect fork
respawn

script
  while ! [ -e /dev/dvb/adapter1/frontend0 ]; do
  sleep 1s;
 done
 USER=mythtv
        ARGS="--logfile /var/log/mythtv/mythbackend.log --user $USER"
        test -f /etc/default/mythtv-backend&& . /etc/default/mythtv-backend|| true
        /usr/bin/mythbackend $ARGS
end script

I had the same problem in a previous install of lucid, and the error i got from looking at the logs was:
2010-05-15 11:34:00.015 DVBChan(1:/dev/dvb/adapter0/frontend0) Warning: Opening DVB frontend device failed.
   eno: Device or resource busy (16)
I got it for both cards. Strange, it doesnt mention that in the logs this time.

Revision history for this message
Thomas Mashos (tgm4883) wrote :

We really do appreciate you opening this ticket to help improve Mythbuntu, but it needs to be closed for a number of reasons. The biggest one is that upstream has moved on to a new version and believes this to be fixed. Could you please verify if this issue still exists in the latest version?

Please do not let the closing of this ticket dissuade you from opening a new ticket if this (or any other) problem occurs with the newer versions.

Thomas Mashos (tgm4883)
Changed in mythbuntu:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.