New MythTV add-on using libcmyth - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136) +---- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 @Aubrien, Good log. I am investigating... RE: New MythTV add-on using libcmyth - fetzerch - 2012-10-07 (2012-10-07, 14:59)janbar Wrote: @Aubrien, @janbar: Did you have a closer look at the mythtv/mythfrontend sources and how they handle the chain updates and those 2 related events? The mythtv sources helped me a lot when implementing the multiplex detection. Both libcmyth and the myth protocol docs lack docs very often but mythtv's code itself is pretty readable. I'm almost done with the fileops rework. If you and aubrian have a proper fix for the 'show stopping' and the 'delayed start', I can help integrating those changes into my repo. RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 (2012-10-07, 02:23)Aubrien Wrote: Janbar, Ok, that is better with log. I understood what happened. The file switch for the program break is ok. Mythtv refill into the new buffer some data but quickly it has no more data to refill: 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)cmyth_livetv_chain_switch: file switch to 2 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): prog_update_callback 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)cmyth_file_data_conn_fd { 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)__cmyth_rcv_string: string received '1' 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)__cmyth_rcv_string: string received '22140' 20:00:06 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)__cmyth_rcv_string: string received '32768' 20:00:07 T:2644073280 DEBUG: Previous line repeats 12 times. 20:00:07 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)__cmyth_rcv_string: string received '26764' 20:00:07 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)__cmyth_rcv_string: string received '0' 20:00:07 T:2644073280 DEBUG: Previous line repeats 1 times. So by default if the buffer is empty, we try to switch to next file: 20:00:07 T:2644073280 DEBUG: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)cmyth_livetv_chain_switch: switch file: current=2 , dir=1 20:00:07 T:2644073280 ERROR: AddOnLog: PVR MythTV Client (cmyth): LibCMyth: (cmyth)cmyth_livetv_chain_switch: no more file 20:00:07 T:2644073280 INFO: AddOnLog: PVR MythTV Client (cmyth): ReadLiveStream: Read 0 Bytes! But there is no next file. This is the last. In your case we must wait refill of buffer. Also the timeout is activated only when livetv_watch != 1. That means only when we are waiting for the new program info (between message LIVETV_WATCH and DONE_RECORDING). Here we have new program info already. I must to update to enable timeout all the time. RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-07 I was trying to do something simple like adjusting the delay condition to as so... Code: if ( rec->rec_livetv_chain->livetv_watch != 1 || rec->rec_livetv_file==NULL || rec->rec_livetv_file->file_length<15000 ) { So it has to be safe to watch by the flag, the file has to exist, it it must be of a certain min size (15000). I left this on last night when I went o be and the kids messed with it before I got up so I don't know if it works yet but it does work for the first transition I saw before going to bed. Does this sound like it may be on the right track? I was also thinking about the channel change delay. Is this the same issue because it tries to read from the file too soon? Maybe the fix for this buffer related issue could remove the need for a channel tune delay if done right. Just read from the file when it is ready and have a max timout or something. RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 @Aubrien, I had a timeout on empty buffer to manage your case. It is not related to program break. Just player need to wait refilling buffer. commit is 4bb5093. I hope it close your issue. Think player retry x150 reads before closing live stream. So waiting 0.5s x 150 ~ 1 minute. At the moment i fixed 0.5s per retry. br. RE: New MythTV add-on using libcmyth - allen00se - 2012-10-07 Well.. all off a sudden my mythbackend server has become unstable, I get about 10 minutes of live tv before it just stops playing. Fortunately I dont believe it is related to the addon. I get the same crap if I try and watch tv from the frontend that is running on my backend server. Long story short I decided to push ahead to 0.26. I made the changes sugested earlier in this thread and built the addon. At first glance it didnt want to connect but then like magic it worked. Channels and EPg came across, but when I try to watch tv i get the spinning circle and then nothing happens. I checked the backend log and for some reason xbmc is trying to tune with all 4 of my tuners at the same time. Its getting late so im giving up, is anyone interested in taking a look at my logs or are we staying away from .26 for now? I wish i could get mythtv to be stable for a while, its killing me to have my live TV so buggy. RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-07 Thanks Janbar, When I start playback with the update it freezes a few seconds into playback forever now. Also, if I set the channel change delay to 0 and try to start playback it just shows a busy icon forever on the screen and freezes until I force quit. Something is causing a deadlock with the new code. I can send another log via email if needed but I will wait until you request it since I don't want to abuse your inbox. RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 (2012-10-07, 15:48)cfetzer Wrote:(2012-10-07, 14:59)janbar Wrote: @Aubrien, @cfetzer Yes had a look and to resolve it i added event LIVETV_WATCH to manage the program break. Now it is closed and i am preparing to merge with you. Aubrien has a special context needing a delay to refill buffer after each stage: spawn tv, switch channel and program break. At the moment libcmyth or xbmc player does not manage any delay before retry. So retries to read live stream loop without delay and after 150 retries in a short time the player close live stream. I try to find a global solution with him to manage this case without adding unnecessary waiting time. I think it is possible and it will be an improvement for the addon. Soon i will pull request to you. This merge it is an hard work and i don't want to break anything. br Also i will making more than one pull request to simplify the merge. My updated cmyth is fully compatible even without program break management. RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-07 janbar/cfetzer, Just wanted to take a minute to say thank you both! I am always posting data and logs and such but I need to take a moment to thank the developer(s) on the other end. Without the work of you then we would still be sitting idle waiting on tsp42. The community came together and made it happen and I really like that about the xbmc community. Now...I have some additional info on the freeze for the new buffer feature. Even though the playback is froze on the frontend, the blue light is on with the capture device so I know it is capturing. I saw in my log that I have a "Read 0 bytes!" entry (just once) so that is what must be causing the hang. I have found in my experiments that if I ever cause that then I cant recover and the stream is effectively dead. So it is slipping out of the guard clause and trying to read anyway when the buffer is empty. I agree that this feature would make the addon much better once working. One interesting thing to note is I bet alof of you are using a ceton digital tuner card which has fast channel changes. While this is an option for cable, if you use Dish Network or DirectTV then you cant use a digital tuner like the ceton because they dont support cablecards and it is not a clear qam signal. basically, if you use satellite then you are using a set top box and there is a good chance that you are using the Happague HD-PVR card I have and an IR blaster. Additionally, if you wanted to bypass any DRM and just own the raw files then the analog loophole provided by the HD-PVR is an attractive option. I have full 1080i HD video and 5.1 audio over fiber being captured by the device with no DRM. Not only will this make the addon better once working, but it is really an essential part of making the addon work across all setups. RE: New MythTV add-on using libcmyth - fetzerch - 2012-10-07 (2012-10-07, 20:02)janbar Wrote:(2012-10-07, 15:48)cfetzer Wrote:(2012-10-07, 14:59)janbar Wrote: @Aubrien, Great I'm done now with the cleanups. FileOps uses now XBMC's internal file system access methods and no more boost::filesystem and I also fixed the bug that images for new recordings were only present after a xbmc restart. Also the translations are now done via Transifex ( https://www.transifex.com/projects/p/pvrmythtvcmyth ). Anyone is welcome to contribute translations! @janbar: Yes, please add either different commits to a single PR or create multiple PRs. Please split / combine them by topics and please split all cmyth related commits (so they can be merged to libcmyth upstream at some time). Currently I have all cmyth related commits prefixed with [cmyth] and all plugin related commits with [mythtv-cmyth]. Then it would be great if you could either comment your changes quite verbose (either in the source files or in the PRs). That helps to understand all the details. And just let me know if you need any help with the merge! RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 (2012-10-07, 20:23)cfetzer Wrote:(2012-10-07, 20:02)janbar Wrote:(2012-10-07, 15:48)cfetzer Wrote: @janbar: Did you have a closer look at the mythtv/mythfrontend sources and how they handle the chain updates and those 2 related events? The mythtv sources helped me a lot when implementing the multiplex detection. Both libcmyth and the myth protocol docs lack docs very often but mythtv's code itself is pretty readable. GREAT work. I completed the merge and now program break runs perfectly. RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 @cfetzer I resolved lot of issues. Not only program break. I merged in one pass with meld because there was too many dependancies. The topics are: [cmyth] IPv6 issue resolved [cmyth] Enable atomic dec/inc for __X86_64__ to avoid disaster. [addon] Create an UID for MythProgram based on MythTV primary key. Filename path could be null ! [addon] Check NULL proginfo before inserting into map: Proginfo_fill() fails (segment fault and unsigned long chanid < 0 !). [cmyth] add materials to manage program break. [addon] two new triggers in event handler to manage program break. At the moment i merged with your master using xbmc api 1.3.0. I pushed to the branch janbar/new_master. RE: New MythTV add-on using libcmyth - janbar - 2012-10-07 @cfetzer: I just understand that now your cmyth is linked as static like my old_master. Great, It is better for the now. RE: New MythTV add-on using libcmyth - Aubrien - 2012-10-08 OK just so I understand; are we are all merged up and are now rebased in cfetzer only for development? It will be nice to have everything in one spot as well as being able to use it against the xbmc nightlies. I understand why it has been the way it is with tsp missing and all so please don't think I'm complaining. I just have to keep hopping around between source trees right now so I can test this stuff and its a bit time consuming and confusing sometimes. RE: New MythTV add-on using libcmyth - janbar - 2012-10-08 @Aubrien I am merging with cfetzer. If you need to test my last dev (timeout for empty buffer) then use my branch: old_master. Thanks. Also in my master you will find the addon pvr.mythtv.cmyth merged with cfetzer but with the api 1.3.0 (same as you have, not the nightly ). It is more stale. |