[mythtv-users] Comcast OnDemand on Multiple STBs

Worldnet onley at worldnet.att.net
Mon Nov 12 02:46:37 UTC 2007

On Nov 11, 2007 2:06 PM, Worldnet <onley[at]worldnet.att.net> wrote:

>> On 11/11/07, David Shay <david[at]shay.net> wrote:>>>>>> <snip>>>  
> Reading the database is not really the right approach - querying the>>  
> backend via the protocol would be.Even that is not necessary for this>>  
> piece of information -- it isavailable via the status port on 6544. In>>  
> this case, you can get quite abit of info from the XML status on>>  
> http://my.myth.ip:6544/xml You get alist of encoders, and if one is>>  
> recording, you will see what program,callsign, and channel it is tuned>>  
> to.>>
> >> A complete solution could look like this:>> * Local .lircrc entries  
> on each frontend with appropriate irexec entries>> forthe keys which you  
> want to use to control the STB. I am assuming>> these willhave to be a  
> unique set of navigation and "enter" keys since>> otherwise theywould  
> conflict with the function and meaning of those in>> myth. These  
> irexecentries would call a script on the local frontend>> which would:>>  
> * call wget on the backend status port. Parse this to determine which the 
> >> video-on-demand tuner. Personally, I would cache this output for a   
> minute>> or two locally to avoid repeated unnecessary calls to the  
> status port.>> Oncethe tuner was determined use "rexec" or the  
> remote-execution>> mechanism ofyour choice to call an "irsend" script on  
> the backend with>> the desiredparameters.>>>>
>> I need to look into the remote execution, I've never done that before. 
>> Once I  learn how to do the that this idea addresses almost all of my  
>> issuesThe only issue left is with the info from the status port, it  
>> only listswhat encoder is on what channel. This will work if one  
>> frontend iswatchingOnDemand but if two frontends are watching OnDemand  
>> then they will bothshow that they are watching channel 1 and since the  
>> content is independentof myth there will be no program info to  
>> differentiate the two. I foundthistable in the database which gives the  
>> info that I need. I agree thatdirectaccess to the database is not the  
>> prefered route as a change to thedatabasewill render my work null not  
>> to mention the security and integrity issues. 
>> *************************** 6. row ***************************chanid:  
>> 1171starttime: 2007-11-10 21:00:00chainid:  
>> live-bedroom-2007-11-10T20:36:29chainpos: 1discontinuity: 0watching: 0 
>> hostprefix: myth:// MPEGinput: S-Video 1 
>> channame: 171endtime: 2007-11-10 21:30:01This table tells me which  
>> encoder is feeding the frontend host so Ihave confirmation of which STB  
>> I am watchingThis may seem slightly absurd on the surface but the  
>> reason we want theOnDemand is the kids love the content and it is quite  
>> possible that therewill be two frontends watching different things at  
>> the same time. I'mreluctant to roll out the myth system to the family  
>> until I know that itwill work so that there is no rebelion. I love the  
>> myth system but if therest of the family revolts then I'm finished. 
>> Thanks David_______________________________________________mythtv-users  
>> mailing listmythtv-users[at]mythtv.org 
>> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> What mysql query did you use to get that report from the database? Which  
> isthe STB id and which is the frontend id? You can execute mysql queries  
> frombash so it shouldn't be that hard to write the parsing script.
> Chris

mysql>  SELECT * FROM tvchain WHERE endtime > '2007-11-09 23:23:00' AND  
chainid LIKE "live-bedroom%"\G
*************************** 1. row ***************************
        chanid: 1108
     starttime: 2007-11-10 23:00:31
       chainid: live-bedroom-2007-11-10T20:36:29
      chainpos: 4
discontinuity: 0
      watching: 0
    hostprefix: myth://
      cardtype: MPEG
         input: S-Video 1
      channame: 108
       endtime: 2007-11-10 23:30:06

My query shows records for the bedroom frontend with an endtime
later than 23:23 Nov 11. The later than part would be created from
the current local time to get current records. The chainid is the
name of the frontend  and channame is the channel it is watching.
The input is the name given during mythtv-setup and the first
digit of chanid is related to the capture card though I don't
know the exact derivation. I would rather use a documented hook
to get the info as using this method will leave me in the dark if
the database changes with a future upgrade. This is all the info
I need in conjunction with a remote exection command (which I have
yet to figure out) to get the job done and cover all forseeable

Thanks for the suggestions guys, if anyone is interested in the
final notes let me know. I'm not sure now long it will take for
me to get all the pieces together but I have a plan now.

More information about the mythtv-users mailing list