Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Possible race condition in tuning



Ralph Metzler wrote:
> 
> Klaus Schmidinger writes:
>  > I believe there is a possible race condition in dvb.c's 'mon_tune()'
>  > function.
>  >
>  > The function first sets dvb->mon_tuning=2, which triggers mon_zigzag()
>  > to do its zig-zag tuning, and then sets dvb->mon_fstate=1. If the scheduler
>  > switches tasks just after the dvb->mon_tuning=2 and before the dvb->mon_fstate=1,
>  > and if the previous call to mon_zigzag() counted the dvb->mon_fstate all the way
>  > up to 20, mon_zigzag() may fail immediately, instead of doing a zig-zag search.
> 
> How should this happen?
> The process will of course be continued right after the dvb->mon_tuning=2;
> How should it end up in mon_zigzag() before finishing mon_tune()?
> There is no other process belonging to the same dvb structure which
> calls mon_zigzag() or mon_thread(). Even if there were, it would be
> stopped by the semaphore.
> The only other function which messes with dvb->mon_tuning and runs in
> a different process is mon_do_tune() and it also uses the semaphore.

Ooops, sorry - I thought these two would run if different processes...
In that case, please disregard what I wrote.

> Did your patch change anything for you?

Nothing I could observe. I did have a strange case where the channel didn't
sync and there was no zig-zag tuning, so I thought this might have been the
cause. But since this is all running in the same process it can't be it.

> Btw., I still cannot reproduce those "tuning problems".
> I had your "ctest" running for 2 hours and had no problems.
> 
> Do you also have those problems when not using a CAM?

The problem happens on any of my three DVB cards (only the third one has a CAM).

Today I have done a lot of testing in that area and had several cases where
the zig-zag tuning didn't succeed, and even if I retried the entire tuning
sequence it never succeeded (by default VDR tries the tuning three times before
it gives up, but even increasing this to 10 times didn't change anything).
After tuning to different channels and later tuning back
to the one that had failed before, it suddenly tuned in just fine.

> I sometimes (very rarely) have problems with DiSEqC switching but only
> with one specific switch. With another switch I have no problems.
> But since it is connected to a different card and PC the problem could
> also be there.

I don't have any DiSEqC equipment, so I can't comment on this.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index