<br><br><div class="gmail_quote">On Nov 13, 2007 12:28 AM, Worldnet &lt;<a href="mailto:onley@worldnet.att.net">onley@worldnet.att.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>&gt; I still think:<br><br>&gt; a) the channel change script (which receives channel number and STB ID)<br>&gt; should write a file (this time I&#39;ll explicitly say, &quot;to a /shared/<br></div>
&gt; filesystem&quot;) with this infob) the user hits a button on the remote to go<br><div class="Ih2E3d">&gt; into &quot;interactive&quot; mode(i.e. so that Left/Right/Up/Down/Select are sent<br></div>&gt; to a script rather thanto mythfrontend (uses LIRC modes--though if you
<br>&gt; had another approach inmind, it should work just as well to kick off<br><div class="Ih2E3d">&gt; this process of&quot;retrieving&quot; the info)--since you need interactive<br></div>&gt; control, auser-initiated event to &quot;pull&quot; the info to the frontend
<br>&gt; shouldn&#39;t be anissuec) the script runs and looks for a local file to<br>&gt; give it the info aboutwhich STB is in use, but doesn&#39;t find itd) the<br><div class="Ih2E3d">&gt; script reads the shared file created by the channel change scriptand
<br>&gt; writes info to the local file--which is not at the same location asthe<br>&gt; shared file--then deletes the channel-change-script-created, sharedfile<br>&gt; (or just moves the channel-change-script-created file) then usesthis
<br>&gt; info to send the event to the appropriate STB (see man lircd andsearch<br>&gt; for --connect; there&#39;s no need for &quot;remote execution&quot; or a&quot;daemon&quot;<br>&gt; process or anything)d) next button press, the script runs again, sees
<br></div>&gt; the local file, anduses its info to send the event to the appropriate<br>&gt; STB (step d repeatedas required)e) when done controlling the STB (i.e.<br>&gt; once VOD begins), the user hits abutton on the remote to exit
<br>&gt; interactive mode (so that the remote nowcontrols mythfrontend, again)<br>&gt; and the same button is configured (ininteractive mode) to delete the<br>&gt; frontend-created local file with the STBinfo to &quot;reset&quot; the
<br><div class="Ih2E3d">&gt; configuration for next time<br>&gt; Of course, this does mean that if someone starts VOD on one STB and<br>&gt; doesn&#39;t start the process by sending an event to the interactive-mode<br>&gt; script, another person starting VOD on another STB would cause a race
<br></div><div class="Ih2E3d">&gt; VOD-portion of the channel change script until the shared file isremoved<br>&gt; (only the VOD-portion should be locked, though--that way, normal<br>&gt; recordings wouldn&#39;t be affected if you start a VOD right before a
<br>&gt; regularly-scheduled recording begins). You may also want to lock the<br>&gt; interactive mode script to queue commands in a first-in-first-out order<br>&gt; to prevent out-of-order execution due to the intricacies of kernel
<br>&gt; process scheduling (so you/your kids don&#39;t accidentally purchase a video<br>&gt; you don&#39;t want because commands went out of order).<br>&gt; The new script shouldn&#39;t be hard to create and the channel change script
<br>&gt; modifications should be easier than the new script. If I had any usefor<br></div>&gt; VOD, I would use this approach, but, hey, it&#39;s your box--feel freeto do<br><div class="Ih2E3d">&gt; it a different way.<br>
&gt; You do realize, though, that LiveTV will be broken up such that Myth<br>&gt; changes files on the half hour since you&#39;ll be lacking guide data forthe<br></div>&gt; channel. So, if you record a 1 1/2-hour on-demand movie from7:53-9:23
<br><div class="Ih2E3d">&gt; PM, you&#39;ll have part 1 (7:53-8:00), part 2 (8:00-8:30), part 3<br>&gt; (8:30-9:00), and part 4 (9:00-9:23). Therefore, the &quot;right&quot; way torecord<br></div>&gt; the show is using a manual recording rule. And, IIRC, thetvchain table
<br><div class="Ih2E3d">&gt; is used /only/ for LiveTV...<br>&gt; Mike<br><br></div>Thanks Mike,<br><br>There are some very good ideas here. I have some work to do to<br>decide exactly which route to take.<br><br><br>The reason the OnDemand is so important is that there is some very
<br>good kids content available for free so it would only ever be<br>live viewing.<br><div><div></div><div class="Wj3C7c"><br>_______________________________________________<br>mythtv-users mailing list<br><a href="mailto:mythtv-users@mythtv.org">
mythtv-users@mythtv.org</a><br><a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users" target="_blank">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a></div></div></blockquote><div><br><br>I dont think you can figure out the encoder being used from tvchain&#39;s chanid info.&nbsp; I checked the chanid&#39;s on my system and one set start with 1 (
i.e. 1007) and the second set start with 2(i.e. 2007) which means it is tied to the listings source( of which I have 2 ) and not encoders ( of which I have 4) .&nbsp; Still there&#39;s got to be a mysql way of determining&nbsp; the current encoder running in livetv mode for a specific mythfrontend.&nbsp; Perhaps you need to repost the question again on the list more specifically.&nbsp; 
<br><br>I even checked the status port xml and I dont see anything unique there to identify which encoder is attached to which frontend. <br><br>I see this as the biggest obstacle you have.&nbsp; Everything else seems very workable.&nbsp;&nbsp; For example, remote execution with mysql would work like this which would generate sql info that could be parsed with sed, tr, awk, grep.
<br><br><br>&nbsp;mysql -umythtv -pmythtv mythconverg -e &#39;SELECT * FROM tvchain WHERE chainid LIKE &quot;%mybedroom%&quot;&#39; -h mymythtv<br><br>Remote command execution of the channel change script would work like this (assuming you have passwordless ssh setup):
<br><br>ssh user@backendhostname &quot;changechannel encoder UP&quot;<br><br></div></div>And that could be called directly on the local mythfrontend&nbsp; by lirc via an irexec command.&nbsp; Switching modes in lirc is possible such that you can enter &quot;VOD mode&quot; by pressing a particular button (mode switch button?) , and all your buttons are immediately redefined.&nbsp; Pressing the mode switch button again allows you to leave &quot;VOD mode&quot; and go back to &quot;Default Mode&quot;.&nbsp; This is by using the mode and flags option in lirc.
<br><br><br>There might be another way to get around to the &quot;which frontend is using which encoder&quot; problem.&nbsp; If you setup a channel source for each encoder such that encoder 1 channels will start with 1 (i.e. 1007); encoder 2 will start with 2(
i.e. 2007), encoder 3 would start with 3(i.e. 3007) if that is indeed how the channel naming scheme works in mythtv.&nbsp; If that is the case, determining which encoder is active from the tvchain sql query amounts to checking for the value of chanid.&nbsp; 
<br><br>So, basically your script (taking one argument which is either UP, DOWN, etc) on the mythfrontends would do this :<br>1. Determine the hostname where the script is running <br><br>2. Determine the current time<br>
<br>3.&nbsp; query the remote mysql database as the above example, and parse the output selecting the results that match the current frontend hostname and the current time.<br><br>4.&nbsp; check for the chanid value to determine the encoder
<br><br>5.&nbsp; remotely call the channelchange script on the backend with first argument as&nbsp; encoder and second argument as&nbsp; UP,Down,etc.<br><br>6. Quit <br><br><br>Let us know how things work out.<br><br>Chris<br><br><br>&nbsp;