[mythtv] what backend commands trigger a live tv show to be"recorded" and show in the recorded shows

Maclaren, James M maclaren at tulane.edu
Wed Jun 13 21:18:36 UTC 2007


>> I am trying to add the capability to "record" a live tv show in
>> mythroku.  I can watch livetv just fine now, but would like to do the
>> equivalent to pressing r in livetv in the front end  for mythroku.
>> I have tried passing the backend the message:
>> 
>> QUERY_RECORDER 3 SET_LIVE_RECORDING 1 (my recorder is 3)
>> 
>> and the backend replies ok. but the shows don't appear in the
recorded list.
>> When I watch the backend and press r on my regular frontend the same
>> commend is logged by the backend amongst others and it now shows up
in
>> the recorded shows  Can it be done simply with the backend prootocol?
>> If so any advice would be appreciated.

>Part of the work is actually done inside mythfrontend inside
>TV::ToggleRecord() in libmythtv.
>
>To toggle record ON for a LiveTV program, we do the following:
>
>  - set the recorded.autoexpire column to the default autoexpire
>    setting (AutoExpireDefault).
>  - set the recorded.recgroup column to 'Default'
>
>To toggle record OFF for a LiveTV program, we do the following:
>
>  - set the recorded.autoexpire column to 10000 (this is a const int in
>    libs/libmythtv/tv.h
>  - set the recorded.recgroup column to 'LiveTV'
>
>When the AutoExpirer runs every few minutes to expire LiveTV programs,
>it looks for recorded.recgroup == 'LiveTV'.  The autoexpirer == 10000
>puts these LiveTV programs before any other programs in the expire
>list when the expirer runs checking to see if it needs to free up
>disk space by deleting recordings.
>
>If you want to verify how we set the autoexpire and recgroup columns,
you
>can look at libs/libmythtv/programinfo.cpp at the following methods:
>
>  ProgramInfo::SetAutoExpire()
>  ProgramInfo::ApplyRecordRecGroupChange()
>
>--
>Chris
>_______________________________________________
>mythtv-dev mailing list
>mythtv-dev at mythtv.org
>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Thanks, that seems to work nicely, after a 
QUERY_RECORDER 3 SET_LIVE_RECORDING 1
I reset those two database fields.

On a somewhat related issue I had some problems setting livetv to work
for the hdhomerun from mythroku and couldn't figure out exactly how the
frontend did it.
Basically I spawned a new live tv and then checked the backend to see if
was was recording (as outlined on the wiki) then what I see in the
database is that for the tvchain table it would start with a DUMMY
cardtype whose startime and corresponding file name in the recorded
table was a 0 byte file.  Some seconds later a new entry of HDHOMERUN
appeared with a file name that corresponded to a slightly later time -
that was the right file.  Soon the dummy entry/file would go away.  I
never saw the dummy entry with my PVR 250.
I solved it somewhat inelegantly but polling the db and checking to see
if the cardtype was not equal to DUMMY.  If it was I used sleep(1) then
retried.  This seems to work.  Is there a better way?  How does the
frontend decide when the real file has been created.  I assume it is
because it takes a while to set up the hdhomerun as it is a network
tuner.
Thanks
James



More information about the mythtv-dev mailing list