diseqc errors

Message ID 4DD8F6E0.8010500@tvdr.de
State New
Headers

Commit Message

Klaus Schmidinger May 22, 2011, 11:43 a.m. UTC
  On 05/22/11 13:21, Marco Göbenich wrote:
> Hi!
>
> Would there be a patch for 1.6.0?

The actual fix for version 1.6.0 is in the attached patch.

Klaus

> Am 22.05.2011 12:45, schrieb Klaus Schmidinger:
>> On 05/22/11 00:35, Klaus Schmidinger wrote:
>>> On 21.05.2011 23:51, Marco Göbenich wrote:
>>>> Hi!
>>>>
>>>> No, checked against vanilla vdr-1.6-0, diseq.c and diseq.h are not modified.
>>>> I looked again in the logs and it seems that this happens when a epg scan is triggered, all entries seem to occur on times when there are free devices.
>>> Sounds like two threads are accessing a cDiseqc object at the same time.
>>>
>>> For a quick test, can you please try adding the following two lines:
>>>
>>>
>>> char *cDiseqc::Codes(char *s)
>>> {
>>> static cMutex Mutex; //ADD
>>> cMutexLock MutexLock(&Mutex); //ADD
>>> char *e = strchr(s, ']');
>> Looks like cDiseqc::Execute(), if called at the same time from
>> two different threads, modified the member variable 'numCodes'
>> in both calls and thus one of them ended up getting too high.
>>
>> I have attached a patch that should fix this. It also makes
>> the whole thing more 'const'.
>>
>> Please let me know if this works in your environment.
>>
>> Klaus
>>
>>>> Am 21.05.2011 16:26, schrieb Klaus Schmidinger:
>>>>> On 04/25/11 23:37, Marco Göbenich wrote:
>>>>>> Hi!
>>>>>>
>>>>>> Forgot to say that I'm using vdr-1.6 with TechniSat Gigaswitch 9/20.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>> Marco
>>>>>>
>>>>>> Am 25.04.2011 23:25, schrieb Marco Göbenich:
>>>>>>> Hi!
>>>>>>>
>>>>>>> I get the following errors:
>>>>>>>
>>>>>>> Apr 25 22:22:56 vdr10 vdr: [7893] ERROR: too many codes in code sequence '[E0 10 38 F0] W15 A W15 t'
>>>>>>> Apr 25 22:25:44 vdr10 vdr: [7890] ERROR: too many codes in code sequence '[E0 10 38 F6] W15 B W15 t'
>>>>>>> Apr 25 22:25:44 vdr10 vdr: [7893] ERROR: too many codes in code sequence '[E0 10 38 F6] W15 B W15 t'
>>>>>>> Apr 25 22:40:36 vdr10 vdr: [7896] ERROR: too many codes in code sequence '[E0 10 38 F5] W15 B W15 T'
>>>>>>> Apr 25 22:46:45 vdr10 vdr: [7890] ERROR: too many codes in code sequence '[E0 10 38 F6] W15 B W15 t'
>>>>>>> Apr 25 22:52:21 vdr10 vdr: [7893] ERROR: too many codes in code sequence '[E0 10 38 F3] W15 A W15 T'
>>>>>>> Apr 25 23:19:42 vdr10 vdr: [7893] ERROR: too many codes in code sequence '[E0 10 38 F7] W15 B W15 T'
>>>>>>>
>>>>>>> No Problems with recordings so far, but my diseqc.conf is from the wiki
>>>>>>> and I don't know how to solve this..
>>>>>>>
>>>>>>> my diseqc.conf:
>>>>>>> S19.2E 11700 V 9750 t v W15 [E0 10 38 F0] W15 A W15 t
>>>>>>> S19.2E 99999 V 10600 t v W15 [E0 10 38 F1] W15 A W15 T
>>>>>>> S19.2E 11700 H 9750 t V W15 [E0 10 38 F2] W15 A W15 t
>>>>>>> S19.2E 99999 H 10600 t V W15 [E0 10 38 F3] W15 A W15 T
>>>>>>>
>>>>>>> S13.0E 11700 V 9750 t v W15 [E0 10 38 F4] W15 B W15 t
>>>>>>> S13.0E 99999 V 10600 t v W15 [E0 10 38 F5] W15 B W15 T
>>>>>>> S13.0E 11700 H 9750 t V W15 [E0 10 38 F6] W15 B W15 t
>>>>>>> S13.0E 99999 H 10600 t V W15 [E0 10 38 F7] W15 B W15 T
>>>>> I can't see why this error would occur, your diseqc.conf looks fine.
>>>>>
>>>>> Is your diseqc.h or diseqc.c source file patched in any way?
>>>>>
>>>>> KlAUS
  

Patch

--- diseqc.c	2008/02/10 14:09:27	1.6
+++ diseqc.c	2011/05/22 11:41:05
@@ -73,15 +73,18 @@ 
 {
   char *e = strchr(s, ']');
   if (e) {
-     numCodes = 0;
+     int NumCodes = 0;
      char *t = s;
      char *p = s;
      while (t < e) {
-           if (numCodes < MaxDiseqcCodes) {
+           if (NumCodes < MaxDiseqcCodes) {
               errno = 0;
               int n = strtol(t, &p, 16);
               if (!errno && p != t && 0 <= n && n <= 255) {
-                 codes[numCodes++] = n;
+                 if (parsing)
+                    codes[NumCodes++] = n;
+                    numCodes = NumCodes;
+                    }
                  t = skipspace(p);
                  }
               else {