Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live TV causes MythTV to miss recording. #85

Closed
amais opened this issue Jan 31, 2013 · 17 comments
Closed

Live TV causes MythTV to miss recording. #85

amais opened this issue Jan 31, 2013 · 17 comments
Labels

Comments

@amais
Copy link

amais commented Jan 31, 2013

Watching LiveTV will cause MythTV to miss a scheduled recording. Myth will become "stuck" acting like it is recording, but will never finish. This is caused by XBMC locking a tuner.

http://forum.xbmc.org/showthread.php?tid=152511

1.6.7 is better than previous builds, but only if there are no tuners available. If you are actually watching TV and something is scheduled you get no notification that you will miss your show.

Ubuntu 12.04 LTS
XBMC 12 (Frodo) w/ cmyth 1.6.7
MythTV Version : v0.25.3-32-g79a24c9
MythTV Branch : fixes/0.25
Network Protocol : 72
Library API : 0.25.20130112-1
QT Version : 4.8.1
Options compiled in:
linux profile use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libxml2 using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_live using_mheg using_libass using_libxml2

@fetzerch
Copy link
Owner

fetzerch commented Feb 2, 2013

@amais: Could you test if the referenced at least solves the hanging recording for you?

@amais
Copy link
Author

amais commented Feb 3, 2013

I'm not that great at Git. Do I just download the source again, or is there something special I need to do to grab this?

@fetzerch
Copy link
Owner

fetzerch commented Feb 3, 2013

Ah sorry, here's a quick explanation: the PR is not yet merged to master, so you have to grab it as patch and apply it to my master branch. (I guess that's where your git head is currently)

Personally, I use the hub tool for this (https://github.com/defunkt/hub), a small git wrapper for github.
Then you can simply use the urls and run hub am https://github.com/fetzerch/xbmc-pvr-addons/pull/87 to apply that patch.

What it does (if you don't want to install hub):

> curl https://github.com/fetzerch/xbmc-pvr-addons/pull/87.patch -o /tmp/87.patch
> git am /tmp/87.patch

Let me know if that helps!

@amais
Copy link
Author

amais commented Feb 3, 2013

hub isn't really working for me. There seem to be some dependency issues. I got ruby installed per requirement, but not sure on the next one. Ubuntu keeps recommending different things for me to install.
xbmc@psycwave:/bin$ ./hub
./hub:6:in require': no such file to load -- hub (LoadError) from ./hub:6 xbmc@psycwave:~/bin$ ./hub am https://github.com/fetzerch/xbmc-pvr-addons/issues/87 ./hub:6:inrequire': no such file to load -- hub (LoadError)
from ./hub:6
xbmc@psycwave:
/bin$ hub am #87
No command 'hub' found, did you mean:
Command 'uhub' from package 'uhub' (universe)
Command 'mhub' from package 'libgii1-dev' (universe)
Command 'huh' from package 'orville-write' (universe)
Command 'hnb' from package 'hnb' (universe)
hub: command not found

Ok, so i'll skip hub for a min. How do I grab the patches? Using curl as you suggested, isn't working either as all i get is a file with a redirect HTML in it. And if I just use "#87" it fails.

I found this, which seems to make sense, but I can't figure out how to grab the file as all I get is HTML files downloaded. http://chem-bla-ics.blogspot.com/2011/01/github-tip-download-commits-as-patches.html

Or... can I follow this guide to download and apply the patch? https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git

Sorry, I know this is more than you wanted to deal with... On the bright side if I figure this out, I can help more ;)

@fetzerch
Copy link
Owner

fetzerch commented Feb 3, 2013

well you just need to download https://github.com/fetzerch/xbmc-pvr-addons/pull/87.patch (the .patch is important). Then curl / wget or your browser should be able to download the file.

@amais
Copy link
Author

amais commented Feb 3, 2013

Yay! :)
xbmc@psycwave:~/src/xbmc-pvr-addons$ git am /tmp/87.patch
Applying: Fix ASK_RECORDING
Applying: Stop the Live TV recorder on ASK_RECORDING

It's compiling now, I'll install it then start testing right away.
Thanks for your help.

@amais
Copy link
Author

amais commented Feb 3, 2013

It still is happening :(
I was watching LiveTV on channel 13_1, mythbackend was scheduled to record a show on 13_1 at 1pm.

Mythbackend thinks two shows are currently recording.
http://i.imgur.com/48Vvc2z.png

This is all that shows up on the recorded screen. It should have 2 shows, but one is missing.
http://i.imgur.com/8HtLGQ5.png

Changed channel after show started recording.
http://i.imgur.com/0Yx8Jp8.png

@fetzerch
Copy link
Owner

fetzerch commented Feb 3, 2013

Did LiveTV stop and did you see the notification "Stopping Live TV due to a conflicting recording"?
The code will do this now whenever the backend sends ASK_RECORDING.
Can you check the logs if it was sent by the backend and received in the addon?

When testing, my recording was on a different channel. Will check also for recordings on the same channel.

(Just because we had this problem several times: Tripple check if the addon .so file has the expected build date. Depending on how you build our addon sometimes is sometimes skipped and you end up running the old version. If you build as zip you need the make clean zip http://wiki.xbmc.org/index.php?title=PVR/Backend/MythTV/BuildFromSource )

@amais
Copy link
Author

amais commented Feb 3, 2013

First time I did not see a notification. I will double check everything. I wrote a bash script, which executes the following.

#!/bin/bash
rm -fR xbmc-pvr-addons
git clone git://github.com/fetzerch/xbmc-pvr-addons.git
cd xbmc-pvr-addons
curl https://github.com/fetzerch/xbmc-pvr-addons/pull/87.patch -o /tmp/87.patch
git am /tmp/87.patch
./bootstrap
./configure --enable-addons-with-dependencies
make clean zip
cp addons/pvr.mythtv.cmyth-linux-i486.zip $HOME

Just a nitpick, the source build wiki page should have "zip" added to the required packages needed for building. I'm using XBMCbuntu, and zip isn't included by default. Not a big deal for me, but might help others.

Second time, 3 shows scheduled to record. I was watching on a non scheduled channel. Didn't change, same result. Show stuck on mythbackend, and LiveTV didn't stop.

http://xbmclogs.com/show.php?id=32461

@amais
Copy link
Author

amais commented Feb 3, 2013

massive edit ;) I found the correct plugin, and it was wrong. I have removed it, installed the new one, now has the correct build date of Feb 3rd. I will commence testing.

Good News! (sorta)

15:59:33 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: rec=2 timeuntil=25 hasrec=0 haslater=0
15:59:33 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: title=
15:59:33 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: rec=4 timeuntil=25 hasrec=0 haslater=0
15:59:33 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: title=
15:59:37 T:2974489408 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
15:59:38 T:2714778432 WARNING: CDVDMessageQueue(video)::Get - asked for new data packet, with nothing available
16:00:05 T:2802023232   ERROR: AddOnLog: MythTV cmyth PVR Client: LiveTVChainUpdate failed on chainID: live-psycwave-2013-02-03T15:50:48
16:00:05 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: rec=1 timeuntil=25 hasrec=0 haslater=0
16:00:05 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: title=
16:00:08 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: rec=3 timeuntil=25 hasrec=0 haslater=0
16:00:08 T:2802023232  NOTICE: AddOnLog: MythTV cmyth PVR Client: Process: Event ASK_RECORDING: title=

Notification shows up, both shows are recording on mythbackend, but XBMC is locked up and "buffering" it finally stopped after about 3 minutes.

But it looks excellent... thanks for all your work!!

@amais
Copy link
Author

amais commented Feb 3, 2013

Built with #87 patch, it introduces a new issue. LiveTV now stops regardless if there is an open tuner or not.

Example:
Watching LiveTV on Tuner 0 (ATSC Tuner), scheduled recording on Tuner 9 (CC Tuner), all LiveTV is stopped.

@fetzerch
Copy link
Owner

fetzerch commented Feb 4, 2013

It's not very well documented, so most likely we need a couple of iterations. But we're getting there!

I've just pushed an update. It should now only react on the affected tuner and is also configurable.
I'll do some testing as well. Let me know what you think about it.
(to get rid of the old patchset: git reset --hard origin master , then reload the diff and reapply it)

@amais
Copy link
Author

amais commented Feb 4, 2013

I like the new conflict handling menu selection. With my first test, watching LiveTV message popped up that LiveTV will end. It ended quickly with no buffering/hanging issue I saw from the last build. Recordings all succeeded.

Here is the log from the channel change. http://xbmclogs.com/show.php?id=32717

Let me know if you want me to test each of the new conflict handling methods.

@amais
Copy link
Author

amais commented Feb 4, 2013

Looking a lot better, was just watching LiveTV and had 1 show scheduled to start, no issues. LiveTV continued and new show started recording.

http://xbmclogs.com/show.php?id=32726

@fetzerch
Copy link
Owner

fetzerch commented Feb 4, 2013

Thanks for testing. Could you please reapply the patch set once again?
It's just a very small change but now it will also work if you schedule a recording that starts immediately.

There's one more issue: When Live TV stops and you restart it within a few seconds, it might trigger the issue again, so we have to block the tuner the next couple of seconds.

I'll rework the code a bit and make the strings translatable.
In the meantime I'd appreciate if you could just continue using the patch for a few days and report if the issue is completely resolved for you. (keep posting logs if you find anything!)

@amais
Copy link
Author

amais commented Feb 5, 2013

I've been playing with this today, and it seems pretty solid.

@fetzerch
Copy link
Owner

fetzerch commented Feb 7, 2013

Thanks for reporting and helping to get this sorted out. I've merged the changes now to the master branch.

@fetzerch fetzerch closed this as completed Feb 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants