Results 1 to 10 of 10

Thread: How to delay launch of mythbackend?? (video device not found)

  1. #1
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question How to delay launch of mythbackend?? (video device not found)

    I'm migrating from an old MythTV config running on Gentoo to Mythbuntu 10.04.

    I have a Hauppauge PVR-150 tuner card. About half the time when I boot the system, the front-end's Information Center reports that the tuner card has an error. A reboot usually fixes it.

    The mythbackend log reports:
    Code:
    2010-11-20 17:18:40.498 Channel(/dev/videoPVR)::Open(): Can't open video device, error "No such file or directory"
    My present hypothesis is that the mythbackend process is trying to open the device before the PVR-150 card is "ready". I don't know why it wouldn't be "ready" (and I never had any such probems when using the Gentoo system). Perhaps adding a short delay to the initiation of the mythbackend process will work around the problem.

    Upon booting a Mythbuntu system, all sorts of magic happens. The myth user gets logged in, the mythfrontend process gets launched, as does the mythbackend process. Who or what is responsible for launching mythbackend? How might I introduce a small delay?

    Any other suggestions on why the PVR-150 device can't be opened and/or how to fix the root cause will be gratefully received.

    Thanks.

  2. #2
    Join Date
    May 2007
    Beans
    2,334

    Re: How to delay launch of mythbackend?? (video device not found)

    Hi,

    I'm not 100% sure with 10.04, but I think upstart is responsible for starting myth-backend. Have a look in the /etc/init directory for a file names mythbackend.conf.

    Code:
    # MythTV Backend service
    
    description     "MythTV Backend"
    author          "Mario Limonciello <superm1@ubuntu.com>"
    
    start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)
    stop on starting shutdown
    
    #expect fork
    respawn
    
    pre-start script
            sleep 5;
    end script
    
    exec /bin/su -c "/usr/bin/mythbackend --noupnp --logfile /var/log/mythtv/mythbackend.log --user mythtv -v eit" mythtv
    The prestart script waits 5 seconds before continuing.

    If your system doesn't use upstart then the script will be in /etc/init.d and be called something like mythbackend.

    Regards
    Ian Dobson
    Walking on water and writing software to specification is easy if they're frozen.

    My corner of the internet http://www.planet-ian.com

  3. #3
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    Quote Originally Posted by ian dobson View Post
    Hi,

    I'm not 100% sure with 10.04, but I think upstart is responsible for starting myth-backend. Have a look in the /etc/init directory for a file names mythbackend.conf.
    @Ian,
    I've never heard of "upstart" (shows how little I know about Ubuntu), but I did find the mythbackend file you referred to.

    Code:
    myth@myth-box:/etc/init$ cat mythtv-backend.conf 
    # MythTV Backend service
    
    description     "MythTV Backend"
    author          "Mario Limonciello <superm1@ubuntu.com>"
    
    start 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 script
    It's a little bit different than the one on your system; notably, there's no 5 second delay. Perhaps I'll try adding the pre-start script to my .conf file and see if that helps with my problem.

    In fact, looking at your version of the .conf file may shed some light on my issue. I note that your version doesn't initiate mythbackend until udev is finished its work. (that's how I interpret the ...and started udev-finish code). I've found it necessary to use udev rules to create symlinks for my two tuner cards in order to get unambiguous device names. As a result, mythbackend isn't trying to open /dev/video0 or /dev/video1. It's trying to open /dev/videoPVR (a symlink to whichever video device happens to be my PVR-150). Is it possible that my symlink hasn't yet been defined by udev when mythbackend is trying to open it? That could explain the error I'm seeing.

    Thanks,
    -kyphos
    Last edited by kyphos; November 21st, 2010 at 04:29 PM. Reason: clarification

  4. #4
    Join Date
    Jan 2009
    Location
    Oklahoma
    Beans
    73
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    Read this thread also, I had the same problem. Fixed it with the information shown.

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

  5. #5
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    @Senkoboy,

    Thanks for the link.

    This thread also has similar information, indicating this bug has already been fixed (by tgm4833):
    http://ubuntuforums.org/showthread.php?t=1511342


    I think I'm on the right track. But I don't understand how to get "auto-builds". After installing from a 10.04 Mythbuntu LiveCD, I ran Update Manager, and have done so a couple of times since. Hundreds of packages and over 100MB of updates were downloaded and installed. I would have expected that fixes to mythtv modules would have been part of these updates, but apparently not.

    What's the best practice for updating/maintaining a Mythbuntu installation?
    Last edited by kyphos; November 21st, 2010 at 08:54 PM.

  6. #6
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    @Ian,
    I want to thank you for your helpful reply at the top of this thread. Your pointer to /etc/init mythtv-backend.conf eventually led me to a solution.


    For others having similar problems with tuner cards not being found, here's the explanation.
    In the version of mythtv-backend.conf that Ian posted above, there was a fragment of code that did not exist in my version (..and started udev-finish). My installation came from a 10.04 Mythbuntu LiveCD. As a result, mythbackend could launch on my system before udev had finished its tasks, one of which is to define symlinks for my tuner cards. These symlinks are needed due to the non-deterministic behavior of Ubuntu when it boots up.

    After a bunch of googling, and helpful posts from others, I found that a patched version of mythtv-backend.conf had been released by the author (supermario) subsequent to the release of 10.04 Mythbuntu. This new version (see CODE below) contains the same 'started udev-finish' constraint which somehow got dropped from the 10.04 Mythbuntu build. Note that it doesn't have the 5 second delay present in the version that Ian posted.

    Code:
    myth@myth-box:/etc/init$ cat mythtv-backend.conf 
    # MythTV Backend service
    
    description     "MythTV Backend"
    author          "Mario Limonciello <superm1@ubuntu.com>"
    
    start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)
    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 script
    I surmise that by waiting for udev to finish, mythbackend can proceed to launch knowing that all required symlinks have been created.

    I had run Update Manager a few times after installing from the 10.04 Mythbuntu LiveCD. I naively assumed that would update my system. Little did I know that out of the box, Update Manager doesn't bother to update the mythtv components. That seems like a fairly serious omission in a Mythbuntu package, but that's the way it is, at least on the 10.04 Mythbuntu CD.

    Once I figured out how to obtain bug fixes (something formerly known as 'AutoBuilds'; another painful experience for a newcomer), I ran Update Manager again. This installed a new-and-improved version of mythbackend.conf, and it contains, once again, the 'started udev-finish' constraint. I won't know for a while if this is a solid fix for the problem I was having at boot time. Time will tell.

    Alas, today's Update Manager (updating 0.23.0 mythtv) broke other things, which I now have to troubleshoot.
    Last edited by kyphos; November 21st, 2010 at 11:36 PM. Reason: corrected typo

  7. #7
    Join Date
    Nov 2006
    Location
    Oregon
    Beans
    4,388
    Distro
    Ubuntu Development Release

    Re: How to delay launch of mythbackend?? (video device not found)

    MythTV updates are available by installing the mythbuntu-repos package from here www.mythbuntu.org/repos

    That is where you will find the updated package which includes the udev-finish line. This portion which was guessed correctly previously in this thread, makes mythbackend wait until udev has completely finished starting before it tries starting. That is likely the issue that you were running into there.

  8. #8
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    Quote Originally Posted by tgm4883 View Post
    MythTV updates are available by installing the mythbuntu-repos package from here www.mythbuntu.org/repos
    @TGM,
    Please forgive this really basic question. Is there any difference between what's found at www.mythbuntu.org/repos (which entails downloading the .deb file) versus opening the Mythbuntu Control Centre, selecting Repositories, and enabling the two checkboxes for mythtv and mythbuntu updates?

    Thanks a lot.

  9. #9
    Join Date
    Nov 2006
    Location
    Oregon
    Beans
    4,388
    Distro
    Ubuntu Development Release

    Re: How to delay launch of mythbackend?? (video device not found)

    Quote Originally Posted by kyphos View Post
    @TGM,
    Please forgive this really basic question. Is there any difference between what's found at www.mythbuntu.org/repos (which entails downloading the .deb file) versus opening the Mythbuntu Control Centre, selecting Repositories, and enabling the two checkboxes for mythtv and mythbuntu updates?

    Thanks a lot.
    Nope, if you have that availability in Mythbuntu control centre, then you already have the mythbuntu-repos package installed

  10. #10
    Join Date
    Nov 2010
    Location
    Up north
    Beans
    79
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to delay launch of mythbackend?? (video device not found)

    @TGM,
    Thanks. All seems to be working now, having used Update Manager to update 0.23.0 and thus obtained the patched /etc/init/mythtv-backend.conf

    I tried moving to 0.23.1 but it broke all sorts of things so I returned to 0.23.0.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •