linux-avmb1:B1 PCI kann nicht rausfaxen unter SuSE 9.1 mit kernel 2.6.4

Joerg Sommrey jo at sommrey.de
Wed May 5 20:25:02 CEST 2004


Hallo Michael,

On Wed, May 05, 2004 at 09:06:35AM +0200, Michael Jandrey wrote:
> Hallo,
> 
> ich habe mein System von SuSE 8.2 auf  SuSE 9.1 umgestellt.
> 
> Beim Fax-Versand mit „c2faxsend“ (Capi4Hylafax-Paket) wählt meine AVB B1
> PCI-Karte die Nummer nur einmal kurz an und bricht dann ab.

so ein Problem hatte ich auch.  Nach vielem Suchen konnte ich bei mir
die Ursache finden: Die Funktion sem_wait() kehrte beim Auftreten von
SIGALRM zurück, ohne daß sem_post() aufgerufen wurde - keine
Ahnung weshalb.  Ich habe das nicht weiter untersucht, sondern einfach
auf pthread_cond umgestellt.  Seitdem funktioniert es problemlos.  Wenn
bei Dir dasselbe Problem vorliegt, sollte der angehängte Patch helfen.

Gruß
-jo

-- 
-rw-r--r--    1 jo       users          80 2004-05-05 08:36 /home/jo/.signature
-------------- next part --------------
diff -c -r capi4hylafax-01.02.02/ChangeLog capi4hylafax-01.02.02-jo/ChangeLog
*** capi4hylafax-01.02.02/ChangeLog	2003-01-17 00:00:00.000000000 +0100
--- capi4hylafax-01.02.02-jo/ChangeLog	2004-02-21 12:19:25.000000000 +0100
***************
*** 1,3 ****
--- 1,7 ----
+ 2004-02-21  Joerg Sommrey
+ 	* fixed string lengths for output to xferfaxlog in FaxBase.cpp
+ 	* corrected some spelling in FaxBase.cpp
+ 	* replaced semaphore in sendmain.cpp by pthread_cond, sem_wait had spourious wakeups from SIGALRM in 2.6 kernels 
  2003-01-08  Michael Rolf
  	* Workaround for the AVM C4 that it does not cut off the end of faxes anymore.
  2002-12-10  Michael Rolf
diff -c -r capi4hylafax-01.02.02/src/convert/BasicFax.cpp capi4hylafax-01.02.02-jo/src/convert/BasicFax.cpp
*** capi4hylafax-01.02.02/src/convert/BasicFax.cpp	2003-01-17 00:00:00.000000000 +0100
--- capi4hylafax-01.02.02-jo/src/convert/BasicFax.cpp	2004-02-21 11:56:52.000000000 +0100
***************
*** 229,235 ****
                        pDestination->GetPointer());
          } else {
              flock (fd, LOCK_EX);
!             if ((tUInt)write (fd, xferline.GetPointer(), xferline.GetSize()) != xferline.GetSize()) {
                  WriteLog (LOG_ERR, "Can't write xferfaxlog accounting record (dest=%s)!",
                            pDestination->GetPointer());
              }
--- 229,235 ----
                        pDestination->GetPointer());
          } else {
              flock (fd, LOCK_EX);
!             if ((tUInt)write (fd, xferline.GetPointer(), xferline.GetLen()) != xferline.GetLen()) {
                  WriteLog (LOG_ERR, "Can't write xferfaxlog accounting record (dest=%s)!",
                            pDestination->GetPointer());
              }
***************
*** 603,609 ****
          case iWrn_Filter_PageEnd:
              m_PageCount++;
              m_sSffFilter.PutPageHeader (vFalse);
!             WriteLog (LOG_INFO, "Page %d was sended.\n", m_PageCount);
              break;
          case iWrn_Filter_LastPageEnd: {
              tBool isFinish = vTrue;
--- 603,609 ----
          case iWrn_Filter_PageEnd:
              m_PageCount++;
              m_sSffFilter.PutPageHeader (vFalse);
!             WriteLog (LOG_INFO, "Page %d was sent.\n", m_PageCount);
              break;
          case iWrn_Filter_LastPageEnd: {
              tBool isFinish = vTrue;
***************
*** 624,630 ****
                          fret = iErr_File_NotExist;
                      }
                  } else if (m_sTifFilter.Open (m_pCurSendFile->GetPointer()) == vTrue) {
!                     WriteLog (LOG_INFO, "Page %d was sended.\n", m_PageCount);
                      tUInt Resolution = (m_VResolution) ? m_VResolution :
                                      (m_sTifFilter.GetYRes()) ? m_sTifFilter.GetYRes() : 196;
                      m_sSffFilter.SetVRes ((Resolution >= 196) ? 1 : 0);
--- 624,630 ----
                          fret = iErr_File_NotExist;
                      }
                  } else if (m_sTifFilter.Open (m_pCurSendFile->GetPointer()) == vTrue) {
!                     WriteLog (LOG_INFO, "Page %d was sent.\n", m_PageCount);
                      tUInt Resolution = (m_VResolution) ? m_VResolution :
                                      (m_sTifFilter.GetYRes()) ? m_sTifFilter.GetYRes() : 196;
                      m_sSffFilter.SetVRes ((Resolution >= 196) ? 1 : 0);
***************
*** 641,647 ****
              dprint ("i_LastPageEnd-Recv (isFinish=%x) ", isFinish);
              if (isFinish == vTrue) {
                  if (m_format != FaxFormat_G3) {
!                     WriteLog (LOG_INFO, "Page %d was sended. - Last Page!\n", m_PageCount);
                  }
                  m_finishedFaxFile++;
                  return fret;
--- 641,647 ----
              dprint ("i_LastPageEnd-Recv (isFinish=%x) ", isFinish);
              if (isFinish == vTrue) {
                  if (m_format != FaxFormat_G3) {
!                     WriteLog (LOG_INFO, "Page %d was sent. - Last Page!\n", m_PageCount);
                  }
                  m_finishedFaxFile++;
                  return fret;
diff -c -r capi4hylafax-01.02.02/src/faxsend/sendmain.cpp capi4hylafax-01.02.02-jo/src/faxsend/sendmain.cpp
*** capi4hylafax-01.02.02/src/faxsend/sendmain.cpp	2003-01-17 00:00:00.000000000 +0100
--- capi4hylafax-01.02.02-jo/src/faxsend/sendmain.cpp	2004-02-21 12:15:00.000000000 +0100
***************
*** 18,26 ****
  
  #include <stdio.h>
  #include <stdlib.h>
- #include <semaphore.h>
  #include <unistd.h>
  #include <syslog.h>
  #include "faxsend.h"
  #include "ConfAssi.h"
  #include "FilePars.h"
--- 18,26 ----
  
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>
  #include <syslog.h>
+ #include <pthread.h>
  #include "faxsend.h"
  #include "ConfAssi.h"
  #include "FilePars.h"
***************
*** 34,46 ****
  /*---------------------------------------------------------------------------*\
  \*---------------------------------------------------------------------------*/
  
! static sem_t syncsema;
  
  /*---------------------------------------------------------------------------*\
  \*---------------------------------------------------------------------------*/
  
  void FinishFunc (void) {
!     sem_post (&syncsema);
  }
  
  /*===========================================================================*\
--- 34,49 ----
  /*---------------------------------------------------------------------------*\
  \*---------------------------------------------------------------------------*/
  
! static int synccondvar = 0;
! static pthread_cond_t synccond = PTHREAD_COND_INITIALIZER;
! static pthread_mutex_t synccond_mutex = PTHREAD_MUTEX_INITIALIZER;
  
  /*---------------------------------------------------------------------------*\
  \*---------------------------------------------------------------------------*/
  
  void FinishFunc (void) {
!     synccondvar = 1;
!     pthread_cond_signal(&synccond);
  }
  
  /*===========================================================================*\
***************
*** 424,439 ****
          return 13;
      }
  
!     sem_init (&syncsema, 0, 0);
      if (fs.Send (TelNumber.GetPointer(),
                   &FaxFileList,
                   Resolution,
                   JobID,
                   &commID,
                   &PollStr) == i_Okay) {
!         sem_wait (&syncsema);
!     }
!     sem_destroy (&syncsema);
      dprint ("fs.exitState=%x ", fs.exitState);
      if (format == FaxFormat_Hylafax) {
          WriteQFile (argv[optind], commID, &fs, &statustext);
--- 427,446 ----
          return 13;
      }
  
!     pthread_mutex_lock(&synccond_mutex);
      if (fs.Send (TelNumber.GetPointer(),
                   &FaxFileList,
                   Resolution,
                   JobID,
                   &commID,
                   &PollStr) == i_Okay) {
! 	do {
!           pthread_cond_wait(&synccond, &synccond_mutex);
!         } while(synccondvar == 0);
!     }
!     pthread_mutex_unlock(&synccond_mutex);
!     pthread_mutex_destroy(&synccond_mutex);
!     pthread_cond_destroy(&synccond);
      dprint ("fs.exitState=%x ", fs.exitState);
      if (format == FaxFormat_Hylafax) {
          WriteQFile (argv[optind], commID, &fs, &statustext);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mlists.in-berlin.de/pipermail/linux-avmb1-mlists.in-berlin.de/attachments/20040505/7cda6bd3/attachment.pgp 


More information about the linux-avmb1 mailing list