Subversion Repositories svnkaklik

Rev

Rev 476 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 476 Rev 477
Line 383... Line 383...
383
 
383
 
384
   output_record( &left, prefix, fsecs);
384
   output_record( &left, prefix, fsecs);
385
   if( mode == 2) output_record( &right, prefix, fsecs);
385
   if( mode == 2) output_record( &right, prefix, fsecs);
386
}
386
}
387
 
387
 
388
void check_los( struct CHAN *c)
388
void check_los( struct CHAN *c)      // checking for signal loss
389
{
389
{
390
   if( !c->los_state)
390
   if( !c->los_state)
391
   {
391
   {
392
      if( !c->los_time && c->peak < los_thresh) time( &c->los_time);
392
      if( !c->los_time && c->peak < los_thresh) time( &c->los_time);
393
      if( c->los_time && c->peak > los_thresh) c->los_time = 0;
393
      if( c->los_time && c->peak > los_thresh) c->los_time = 0;
Line 593... Line 593...
593
   int lino = 0, nf;
593
   int lino = 0, nf;
594
   FILE *f;
594
   FILE *f;
595
   char buff[100], *p, *fields[20];
595
   char buff[100], *p, *fields[20];
596
 
596
 
597
   if( (f=fopen( CONFIG_FILE, "r")) == NULL)
597
   if( (f=fopen( CONFIG_FILE, "r")) == NULL)
598
      bailout( "no config file found");
598
      bailout( "no config file found [%s]", CONFIG_FILE);
599
 
599
 
600
   while( fgets( buff, 99, f))
600
   while( fgets( buff, 99, f))
601
   {
601
   {
602
      lino++;
602
      lino++;
603
 
603
 
Line 671... Line 671...
671
      {
671
      {
672
         int left = atoi( fields[2]);
672
         int left = atoi( fields[2]);
673
         int right = atoi( fields[3]);
673
         int right = atoi( fields[3]);
674
         int gain = (right << 8) | left;
674
         int gain = (right << 8) | left;
675
 
675
 
676
         if( !strcasecmp( fields[1], "line"))
676
         if( !strcasecmp( fields[1], "line"))		// get line source
677
         {
677
         {
678
           req_lgain = gain;
678
           req_lgain = gain;
679
           mixer_recsrc = SOUND_MASK_LINE;
679
           mixer_recsrc = SOUND_MASK_LINE;
680
         }
680
         }
681
         else
681
         else
682
         if( !strcasecmp( fields[1], "mic"))
682
         if( !strcasecmp( fields[1], "mic"))		// get mic source
683
         { 
683
         { 
684
           req_mgain = gain;
684
           req_mgain = gain;
685
           mixer_recsrc = SOUND_MASK_MIC;
685
           mixer_recsrc = SOUND_MASK_MIC;
686
         }
686
         }
687
         else
687
         else
Line 725... Line 725...
725
   // We must at least have a line input.
725
   // We must at least have a line input.
726
 
726
 
727
   if( ioctl( fdm, SOUND_MIXER_READ_RECMASK, &mixer_recmask) < 0)
727
   if( ioctl( fdm, SOUND_MIXER_READ_RECMASK, &mixer_recmask) < 0)
728
      bailout( "cannot read mixer devmask");
728
      bailout( "cannot read mixer devmask");
729
 
729
 
730
   if( (mixer_recmask & SOUND_MASK_LINE) == 0)
730
/*   if( (mixer_recmask & SOUND_MASK_LINE) == 0)
731
      bailout( "mixer has no line device");
731
      bailout( "mixer has no line device");*/
732
 
732
 
733
   if( ioctl( fdm, SOUND_MIXER_READ_STEREODEVS, &mixer_stereo) < 0)
733
   if( ioctl( fdm, SOUND_MIXER_READ_STEREODEVS, &mixer_stereo) < 0)
734
      bailout( "cannot read mixer stereodevs");
734
      bailout( "cannot read mixer stereodevs");
735
 
735
 
736
   if( ioctl( fdm, SOUND_MIXER_READ_RECSRC, &mixer_recsrc) < 0)
736
   if( ioctl( fdm, SOUND_MIXER_READ_RECSRC, &mixer_recsrc) < 0)
737
      bailout( "cannot read mixer recsrc");
737
      bailout( "cannot read mixer recsrc");
738
 
738
 
739
   // Read the line input gain.  
739
/*   // Read the line input gain.  
740
   if( ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0)
740
   if( ioctl( fdm, SOUND_MIXER_READ_LINE, &mixer_line) < 0)
741
      bailout( "cannot read mixer line");
741
      bailout( "cannot read mixer line");*/
742
 
742
 
743
   // Read overall input gain?  Optional.
743
   // Read overall input gain?  Optional.
744
   if( (mixer_recmask & SOUND_MASK_IGAIN) &&
744
   if( (mixer_recmask & SOUND_MASK_IGAIN) &&
745
        ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0)
745
        ioctl( fdm, SOUND_MIXER_READ_IGAIN, &mixer_igain) < 0)
746
           bailout( "cannot read mixer igain");
746
           bailout( "cannot read mixer igain");
Line 834... Line 834...
834
 
834
 
835
      report( 1, "mixer record levels set to: left=%d right=%d", 
835
      report( 1, "mixer record levels set to: left=%d right=%d", 
836
                 mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff);
836
                 mixer_reclev & 0xff, (mixer_reclev >> 8) & 0xff);
837
   }
837
   }
838
 
838
 
839
//mixer_recsrc= SOUND_MASK_LINE;
-
 
840
mixer_recsrc= SOUND_MASK_MIC;
-
 
841
 
-
 
842
   switch (mixer_recsrc)
839
   switch (mixer_recsrc)
843
   {
840
   {
844
     case SOUND_MASK_MIC:
841
     case SOUND_MASK_MIC:
845
     
842
     
846
       if( ioctl( fdm, SOUND_MIXER_WRITE_RECSRC, &mixer_recsrc) < 0)
843
       if( ioctl( fdm, SOUND_MIXER_WRITE_RECSRC, &mixer_recsrc) < 0)