Euhm, thinking a bit more
Wouldn't it be simpler to let the TV viewing app write a lockfile of the
device it is using (so in practice something like viewing.video0).
Then let ivtv_record test for that file when it wants to use that video
device. If the device is needed for recording, send a STOP to the TV
viewing thread and use the device.
BTW: I can not find any checks for recording lockfiles in ivtv_xine_tv
where is checked if you are not ruining a recording in progress by
starting to watch TV?
Paul
Paul Sijben wrote:
> Duncan,
>
> I have changed my recordingserver so it now also creates lockfiles
> with the video dev appended.
>
> I have looked at upsoon and that needs some work to make it work with
> parallel recording, it does not need to kill the TV viewing if there
> is another card available for recording (the policy I put into my
> patched recording server is that it will take the last item in
> VIDEO_GROUPS first and then work to the start to give TV viewing the
> best chance of working).
>
> So the test should be something like is there a recording coming up?
> If so, check if there is an equivalent video device available from
> record_groups, assume the recordserver will use that one and do nothing.
>
> That is more work than I can put into it right now. I'll look at that
> later.
>
> Paul
>
> Duncan Webb wrote:
>> Paul Sijben wrote:
>>
>>> I think that before this code is included in the main distribution a
>>> couple of loose ends need fixing:
>>>
>>> - how to check for the number of (ivtv) capture cards without naively
>>> checking against the length of VIDEO_GROUPS (input needed, is there a
>>> function to call for that???)
>>>
>>
>> I think you would need to scan the video devices using tv.v4l2 it
>> queries the devices capabilities. If you can read C check the
>> ivtv-detect program in the ivtv-0.8.1 driver.
>>
>>
>>> - I wrote:/ I am pretty sure I broke some system that handles
>>> interaction between TV viewing and recording. /This is because I changed
>>> the name of the lockfile to deal with multiple cards. So this needs to
>>> be aligned with other parts of freevo that look at this lockfile.
>>>
>>
>> IIRC, I changed the lockfile to use the video device name as a suffix,
>> but you may need to fix upsoon as this checks this device and sends a
>> stop to the player if the tv card's tuner is in use.
>>
>>
>>> - I think conflict resolution needs a bit more refinement
>>> - is there an elegant way (or even a need) to allow parallel recording
>>> over multiple card types?
>>>
>>
>> BTTV and saa713x cards use a raw video stream, which in turn needs
>> encoding in real-time (The raw files are massive, 27Mb/sec). Real-time
>> software encoding on more than one channel would put a very high load on
>> the system, but I've not tried it.
>>
>> Duncan
>>
>>
>>
>>> Duncan Webb wrote:
>>>
>>>> Paul Sijben wrote:
>>>>
>>>>
>>>>> OK here are the 1.6 files as patched.
>>>>>
>>>>> The patch allows recording multiple shows concurrently. It assumes
>>>>> that all TV channels are available from the same card type. (in this
>>>>> case ivtv, you can make a similar patch against other record types,
>>>>> just patch ????_record.py).
>>>>>
>>>>> I am using VIDEO_GROUPS as follows. (note that I also assume that this
>>>>> is the only kind of entries there are in video groups.I simply check
>>>>> for the number of cards by checking the length of VIDEO_GROUPS, there
>>>>> must be a more elegant way to do this...)
>>>>>
>>>>> VIDEO_GROUPS = [
>>>>> VideoGroup(vdev="/dev/video0",
>>>>> adev=None,
>>>>> input_type='tuner',
>>>>> # input_num=0,
>>>>> tuner_norm=CONF.tv,
>>>>> tuner_chanlist=CONF.chanlist,
>>>>> desc='Cable',
>>>>> group_type='ivtv',
>>>>> record_group=None),
>>>>> VideoGroup(vdev="/dev/video1",
>>>>> adev=None,
>>>>> input_type='tuner',
>>>>> # input_num=0,
>>>>> tuner_norm=CONF.tv,
>>>>> tuner_chanlist=CONF.chanlist,
>>>>> desc='Cable',
>>>>> group_type='ivtv',
>>>>> record_group=None)
>>>>> ]
>>>>>
>>>>> conflict resolution is now as follows:
>>>>> - are there unused capture cards, pick one of those, highest number
>>>>> first (as TV viewing is always done on video0)
>>>>> - if all are busy find a card where the show is to end now
>>>>> - otherwise pick an active card and use the normal conflict resolution
>>>>> code. (indeed this could use with some refining)
>>>>>
>>>>> Note: I am pretty sure I broke some system that handles interaction
>>>>> between TV viewing and recording.
>>>>>
>>>>>
>>>> I'm interested to get some feedback from anybody who has tried Paul's
>>>> changes, if some of you are using this and others want to use it then
>>>> I'm more than happy to add the changes into rel-1.
>>>>
>>>> Duncan
>>>>
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Freevo-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freevo-users
>>
>
> --
> Paul Sijben mailto:[EMAIL PROTECTED]
> Amersfoort, NL http://www.sijben.net
> tel:+31 334557522 fax:+31 33 4557523
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> Freevo-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freevo-users
>
--
Paul Sijben mailto:[EMAIL PROTECTED]
Amersfoort, NL http://www.sijben.net
tel:+31 334557522 fax:+31 33 4557523
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users