Menu

#33 Interrupt live tv

Freevo 1.x series
closed
nobody
Plugins (215)
6
2006-10-24
2006-09-29
rvp_nl
No

Once in a while, while watching live TV, there
unfortunately is a program scheduled for recording at
the same time. When the recordserver then starts
recording, it obviously can not record video since the
device is already open (by xine or mplayer).

It would be nice to have Freevo interrupting the live
tv so that the scheduled program is not missed.
Optionally, Freevo can popup a dialog and ask if the
recording should be canceled and live tv continued.

Don't have the time to do this myself, and I think that
one needs a thorough understanding of Freevo internals
to implement this.

Would be very nice to have, though...

Richard.

Discussion

  • Duncan Webb

    Duncan Webb - 2006-09-29

    Logged In: YES
    user_id=104395

    Same with the radio, funny recording the radio instead of
    the tv program.

    Anybody any ideas on how to do this?

     
  • Duncan Webb

    Duncan Webb - 2006-09-29
    • milestone: --> 643498
    • labels: --> 896758
     
  • rvp_nl

    rvp_nl - 2006-09-29

    Logged In: YES
    user_id=182311

    Hm, let's try and answer this myself:

    A plugin can be written that ever 30 seconds or so checks if
    a recording will start within, let's say 30 seconds. If so,
    the plugin could send a STOP command through the freevo bus,
    and then popup a message that informs the user about the
    interruption. No questions asked for now. Prior to that, the
    plugin should check *if* there is a plugin that is currently
    playing video or radio. That's the part where my knowledge
    of Freevo ends. Recording commands and detecting START/STOP
    sequences (implement a little state machine) is one way to
    do it, but not the most elegant.

    It thus sounds not so hard to do, but someone needs to
    figure out things first.

    Richard.

     
  • John Molohan

    John Molohan - 2006-09-29

    Logged In: YES
    user_id=774680

    Couldn't it be done in the recordserver code? It already has
    a process to check for scheduled recordings every minute. If
    there's a recording about to start it could also check for
    the existence of a /var/cache/freevo/watching file which
    would be created by the viewing plugin and issue a stop command.

     
  • rvp_nl

    rvp_nl - 2006-09-29

    Logged In: YES
    user_id=182311

    Does the recordserver have access to the GUI? One would like
    to inform the user, and eventually let the user decide to
    cancel the recording or not.

     
  • Duncan Webb

    Duncan Webb - 2006-09-29

    Logged In: YES
    user_id=104395

    Not certain but I don't think that it can be done in the
    record server. The reason is the record server can't talk to
    the main application, at least I doesn't see user events. I
    found this out when writing my wakeup server, it had to be
    done through a client.

    This could be complete rubbish and I missed something.

     
  • rvp_nl

    rvp_nl - 2006-09-29

    Logged In: YES
    user_id=182311

    I think you're right, that was just my point.

    A Freevo plugin instead has access to all info, it just has
    to stop the plugin accessing /dev/video in-time so that the
    recordserver can start recording. I don't like the "in-time"
    part very much, but, extending the remote interface of the
    recordserver for this purpose would be just over the top for
    a pre-2.0 version of Freevo.

     
  • rvp_nl

    rvp_nl - 2006-09-29

    Logged In: YES
    user_id=182311

    I think you're right, that was just my point.

    A Freevo plugin instead has access to all info, it just has
    to stop the plugin accessing /dev/video in-time so that the
    recordserver can start recording. I don't like the "in-time"
    part very much, but, extending the remote interface of the
    recordserver for this purpose would be just over the top for
    a pre-2.0 version of Freevo.

     
  • Duncan Webb

    Duncan Webb - 2006-10-02
    • labels: 896758 -->
    • milestone: 643498 -->
     
  • Duncan Webb

    Duncan Webb - 2006-10-03

    Logged In: YES
    user_id=104395

    I have a prototype which at the moment can send or poll the
    record server to see if the a player is running.

    The problem is to determine how a player is running. The
    best way is to open /dev/video0 and if it fails then we know
    that either a player is reading the device or a recording is
    currently being used. May also need to read /dev/radio0.

    Can you think of a better way, I'm not sure if it's a good
    idea to do it this way?

     
  • Duncan Webb

    Duncan Webb - 2006-10-03

    Logged In: YES
    user_id=104395

    In r8305 the changes to the record server have been made
    that will allow the client to poll the record server to find
    when the next program is due to start. Added a small plugin,
    upsoon, that when activated will post, every 30 seconds, the
    title and start time of the next program to the OSD.

    upsoon calls findNextProgram in the record server and when
    the power button, on a remote, will print if playing exists
    in the freevo cache dir. It is pretty easy to do something
    useful with upsoon such as send a player stop event when the
    video device is blocked by a player.

    I'm interested if xine sees the osd messages, so can someone
    chack this out.

     
  • Duncan Webb

    Duncan Webb - 2006-10-05
    • labels: --> Plugins
    • milestone: --> Freevo 1.x series
    • priority: 5 --> 6
     
  • Duncan Webb

    Duncan Webb - 2006-10-05

    Logged In: YES
    user_id=104395

    In r8321 there is a working plugin called upsoon.py.

    There are two important questions at the end of the text...

    There is one problem in that I've hard coded the video and
    radio devices. The video device is /dev/video0 and the radio
    device is /dev/video24 (I'm using a ivtv card).

    The logic is pretty simple and it goes like this:
    Find the next start time of a program to be recorded.
    If the time now is less than the next start - PADDING_PRE -
    60 then:
    see if it is possible to read from the video device
    if not send a stop event.
    see if it is possible to read from the radio device
    if not send a stop event.

    polling these devices is a bit strange it has been setup to
    poll every 30 seconds but you can see from this log that
    it's not very acurate.
    upsoon.py (180): now=19:56:15 next_program=None
    upsoon.py (180): now=19:56:47 next_program=None
    upsoon.py (180): now=19:57:18 next_program=None
    upsoon.py (180): now=19:57:50 next_program=None
    upsoon.py (180): now=19:58:21 next_program=None
    upsoon.py (180): now=19:58:53 next_program=None
    upsoon.py (180): now=19:59:24 next_program=None
    upsoon.py (180): now=19:59:54 next_program=None

    Other than the hardcoded names and the irregular polling it
    seems to work fine.

    Question 1
    What's a good name for this plug-in?

    Question 2
    How can the device names be determined?

     
  • Duncan Webb

    Duncan Webb - 2006-10-06

    Logged In: YES
    user_id=104395

    Ok I figured question 1 out and it is ready for some serious
    testing.

    Still need someone to suggest a good name.

    It has been applied in r8325

     
  • Duncan Webb

    Duncan Webb - 2006-10-08
    • status: open --> pending
     
  • Duncan Webb

    Duncan Webb - 2006-10-08

    Logged In: YES
    user_id=104395

    An OSD message wil be displayed when watching or listening
    has been stopped.

     
  • SourceForge Robot

    • status: pending --> closed
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.