Hang when moving between editing marks

Message ID 4D516C3CF4%linux@youmustbejoking.demon.co.uk
State New
Headers

Commit Message

Darren Salt March 26, 2005, 12:21 a.m. UTC
  The attached patch should fix a hang (livelock) which can occur when moving
between editing marks. Blame Timothy Baldwin if it doesn't work - he
suggested it ;-)
  

Comments

Sebastian Frei March 26, 2005, 4:32 p.m. UTC | #1
Am Samstag 26 März 2005 01:21 schrieb Darren Salt:
> The attached patch should fix a hang (livelock) which can occur when moving
> between editing marks. Blame Timothy Baldwin if it doesn't work - he
> suggested it ;-)
Hey, good work! This solves one of the last the NPTL problems and makes Noad 
and VDRConvert usable again.

S.
  
C.Y.M March 26, 2005, 4:46 p.m. UTC | #2
Sebastian Frei wrote:
> Am Samstag 26 März 2005 01:21 schrieb Darren Salt:
> 
>>The attached patch should fix a hang (livelock) which can occur when moving
>>between editing marks. Blame Timothy Baldwin if it doesn't work - he
>>suggested it ;-)
> 
> Hey, good work! This solves one of the last the NPTL problems and makes Noad 
> and VDRConvert usable again.
> 

Is NPTL working in vdr-1.3.23?  I seem to recall timers would cause vdr to exit
when using NPTL libs in previous vdr versions.

Best Regards,
  
Sebastian Frei March 26, 2005, 4:51 p.m. UTC | #3
Am Samstag 26 März 2005 17:46 schrieb C.Y.M:
> Sebastian Frei wrote:
> > Am Samstag 26 März 2005 01:21 schrieb Darren Salt:
> >>The attached patch should fix a hang (livelock) which can occur when
> >> moving between editing marks. Blame Timothy Baldwin if it doesn't work -
> >> he suggested it ;-)
> >
> > Hey, good work! This solves one of the last the NPTL problems and makes
> > Noad and VDRConvert usable again.
>
> Is NPTL working in vdr-1.3.23?  I seem to recall timers would cause vdr to
> exit when using NPTL libs in previous vdr versions.
>
> Best Regards,
>
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
My VDR works nice with the above patch. Sometimes it hangs when there is no 
signal, I heard this is also a NPTL problem.

S.
  
Klaus Schmidinger May 7, 2005, 2:11 p.m. UTC | #4
Darren Salt wrote:
> The attached patch should fix a hang (livelock) which can occur when moving
> between editing marks. Blame Timothy Baldwin if it doesn't work - he
> suggested it ;-)
> 
> 
> 
> ------------------------------------------------------------------------
> 
> #! /bin/sh /usr/share/dpatch/dpatch-run
> ## 10_livelock.dpatch by Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
> ##
> ## All lines beginning with `## DP:' are a description of the patch.
> ## DP: Fix a livelock problem when jumping between editing marks.
> 
> @DPATCH@
> diff -urNad vdr-1.3.23/dvbplayer.c /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c
> --- vdr-1.3.23/dvbplayer.c	2005-03-25 23:45:25.789555968 +0000
> +++ /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c	2005-03-25 23:53:11.273645683 +0000
> @@ -376,6 +376,7 @@
>          cPoller Poller;
>          if (DevicePoll(Poller, 100)) {
>  
> +           sched_yield();
>             LOCK_THREAD;
>  
>             // Read the next frame from the file:

Under which conditions do these lockups happen?

Which output device is in use (FF DVB card or some software player)?

I don't really see what difference this sched_yield() would make,
so I'd like to understand this before simply throwing it in...

Klaus
  
Darren Salt May 7, 2005, 3:07 p.m. UTC | #5
I demand that Klaus Schmidinger may or may not have written...

> Darren Salt wrote:
>> The attached patch should fix a hang (livelock) which can occur when
>> moving between editing marks. Blame Timothy Baldwin if it doesn't work -
>> he suggested it ;-)
[snip]

> Under which conditions do these lockups happen?

> Which output device is in use (FF DVB card or some software player)?

It's happened here: budget card, xine-lib.

> I don't really see what difference this sched_yield() would make, so I'd
> like to understand this before simply throwing it in...

Quoting from the mail which described the patch:

| It's livelock!

| The thread which executes cDvbPlayer::Action(void) (in dvbplayer.c) locks
| the cDvbPlayer object most of the time when an editing mark is first jumped
| to. The symptoms are cured by adding a call to sched_yield() before
| LOCK_THREAD in cDvbPlayer::Action(void).
  
Klaus Schmidinger May 7, 2005, 4:03 p.m. UTC | #6
Darren Salt wrote:
> I demand that Klaus Schmidinger may or may not have written...
> 
> 
>>Darren Salt wrote:
>>
>>>The attached patch should fix a hang (livelock) which can occur when
>>>moving between editing marks. Blame Timothy Baldwin if it doesn't work -
>>>he suggested it ;-)
> 
> [snip]
> 
> 
>>Under which conditions do these lockups happen?
> 
> 
>>Which output device is in use (FF DVB card or some software player)?
> 
> 
> It's happened here: budget card, xine-lib.

Ah, as I suspected ;-)

Could it be that the xine player doesn't implement
cDevice::Poll() the way it is supposed to?
My guess would be that in case of a still picture the xine player's
Poll() function returns immediately instead of waiting for the
given timeout. That would explain why everything appears to lock up.

Could you please verify this?

Klaus

>>I don't really see what difference this sched_yield() would make, so I'd
>>like to understand this before simply throwing it in...
> 
> 
> Quoting from the mail which described the patch:
> 
> | It's livelock!
> 
> | The thread which executes cDvbPlayer::Action(void) (in dvbplayer.c) locks
> | the cDvbPlayer object most of the time when an editing mark is first jumped
> | to. The symptoms are cured by adding a call to sched_yield() before
> | LOCK_THREAD in cDvbPlayer::Action(void).
  
Jose Alberto Reguero May 7, 2005, 4:34 p.m. UTC | #7
El Sábado, 7 de Mayo de 2005 16:11, Klaus Schmidinger escribió:
> Darren Salt wrote:
> > The attached patch should fix a hang (livelock) which can occur when
> > moving between editing marks. Blame Timothy Baldwin if it doesn't work -
> > he suggested it ;-)
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > #! /bin/sh /usr/share/dpatch/dpatch-run
> > ## 10_livelock.dpatch by Timothy Baldwin
> > <T.E.Baldwin99@members.leeds.ac.uk> ##
> > ## All lines beginning with `## DP:' are a description of the patch.
> > ## DP: Fix a livelock problem when jumping between editing marks.
> >
> > @DPATCH@
> > diff -urNad vdr-1.3.23/dvbplayer.c
> > /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c ---
> > vdr-1.3.23/dvbplayer.c	2005-03-25 23:45:25.789555968 +0000
> > +++ /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c	2005-03-25 23:53:11.273645683
> > +0000 @@ -376,6 +376,7 @@
> >          cPoller Poller;
> >          if (DevicePoll(Poller, 100)) {
> >
> > +           sched_yield();
> >             LOCK_THREAD;
> >
> >             // Read the next frame from the file:
>
> Under which conditions do these lockups happen?
>
> Which output device is in use (FF DVB card or some software player)?
>
> I don't really see what difference this sched_yield() would make,
> so I'd like to understand this before simply throwing it in...
>
> Klaus
>
This patch resolve also my problems with cpu load with recents kernels 
(2.6.11....).
Jose Alberto
  
Sebastian Frei May 8, 2005, 8:10 a.m. UTC | #8
Am Samstag 07 Mai 2005 16:11 schrieb Klaus Schmidinger:

>
> Under which conditions do these lockups happen?
>
> Which output device is in use (FF DVB card or some software player)?
>

It happens with my FF DVB-S. When jumping between cutmarks vdr hangs for a few 
minutes. I'm using NPTL and the patch fixes the problem.

S.
  
devzero May 8, 2005, 10:50 a.m. UTC | #9
Sebastian Frei schrieb:

I was using the "livelock" patch when I updated to 1.3.23 (a few days 
after release) - I'm not using NPTL and with the patch replay was 
hanging a lot. Not while moving cutting markings, just while normal 
watching a recording.


>Am Samstag 07 Mai 2005 16:11 schrieb Klaus Schmidinger:
>
>  
>
>>Under which conditions do these lockups happen?
>>
>>Which output device is in use (FF DVB card or some software player)?
>>    
>>
>>It happens with my FF DVB-S. When jumping between cutmarks vdr hangs for a few 
>>minutes. I'm using NPTL and the patch fixes the problem.
>>
>>S.
>>
>>_______________________________________________
>>vdr mailing list
>>vdr@linuxtv.org
>>http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>>
>>
>>    
>>
  

Patch

diff -urNad vdr-1.3.23/dvbplayer.c /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c
--- vdr-1.3.23/dvbplayer.c	2005-03-25 23:45:25.789555968 +0000
+++ /tmp/dpep.odvcge/vdr-1.3.23/dvbplayer.c	2005-03-25 23:53:11.273645683 +0000
@@ -376,6 +376,7 @@ 
         cPoller Poller;
         if (DevicePoll(Poller, 100)) {
 
+           sched_yield();
            LOCK_THREAD;
 
            // Read the next frame from the file: