diff --git a/a2d.f90 b/a2d.f90 index 7dc05af9f..4bdfe632b 100644 --- a/a2d.f90 +++ b/a2d.f90 @@ -11,6 +11,8 @@ subroutine a2d(iarg) ! This call does not normally return, as the background portion of ! JTaudio goes into a test-and-sleep loop. + write(*,1000) +1000 format('Using PortAudio.') idevin=ndevin idevout=ndevout call padevsub(numdevs,ndefin,ndefout,nchin,nchout) diff --git a/audio_init.f90 b/audio_init.f90 index 1cbe3207c..e4fd80935 100644 --- a/audio_init.f90 +++ b/audio_init.f90 @@ -60,7 +60,7 @@ subroutine audio_init(ndin,ndout) m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) m4=ResumeThread(Thread2) #else - print*,'Audio INIT called.' +! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & 11025,NSPB,TRPeriod,TxOK,ndebug,Transmitting, & Tsec,ngo,nmode,tbuf,ibuf,ndsec) diff --git a/fivehz.f90 b/fivehz.f90 index 9de6a2dd0..7fa92a8b1 100644 --- a/fivehz.f90 +++ b/fivehz.f90 @@ -40,7 +40,7 @@ subroutine fivehz ibuf00=-99 ncall=-1 tt0=tt - u=0.05d0 + u=0.1d0 fsample=11025.d0 maxms=0 mfsample=110250 @@ -51,8 +51,9 @@ subroutine fivehz ! Measure average sampling frequency over a recent interval ncall=ncall+1 - if(ncall.gt.0) then - fs=ncall*2048.d0/(tt-tt0) + if(ncall.eq.9) tt0=tt + if(ncall.ge.10 .and. mod(ncall,2).eq.1) then + fs=(ncall-9)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample=nint(10.d0*fsample) endif @@ -192,17 +193,17 @@ subroutine fivehztx ncall=-1 fsample=11025.d0 nsec0=-999 - u=0.05d0 + u=0.1d0 mfsample2=110250 + tt0=tt endif ncall=ncall+1 - if(ncall.eq.8) tt0=tt - if(ncall.gt.8) then - fs=(ncall-8)*2048.d0/(tt-tt0) + if(ncall.eq.9) tt0=tt + if(ncall.ge.10 .and. mod(ncall,2).eq.1) then + fs=(ncall-9)*2048.d0/(tt-tt0) fsample=u*fs + (1.d0-u)*fsample mfsample2=nint(10.d0*fsample) endif - return end subroutine fivehztx diff --git a/jtaudio.c b/jtaudio.c index c1a78b9ac..0df7a9808 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -341,7 +341,7 @@ int padevsub_(int *numdev, int *ndefin, int *ndefout, } - printf("\n Audio Input Output Device Name\n"); + printf("\nAudio Input Output Device Name\n"); printf("Device Channels Channels\n"); printf("------------------------------------------------------------------\n"); diff --git a/start_threads.c b/start_threads.c index bab0244bd..643fd9811 100644 --- a/start_threads.c +++ b/start_threads.c @@ -17,7 +17,7 @@ extern void a2d_(int *iarg); #ifdef USE_ALSA -#if 1 +#if 0 #define ALSA_LOG #define ALSA_LOG_BUFFERS #endif @@ -266,7 +266,7 @@ static int ao_alsa_open(alsa_driver_t *this_gen, int32_t *input_rate, snd_pcm_st /* Check for pause/resume support */ this->has_pause_resume = ( snd_pcm_hw_params_can_pause (params) && snd_pcm_hw_params_can_resume (params) ); - printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); + // printf( "audio_alsa_out:open pause_resume=%d\n", this->has_pause_resume); this->sample_rate_factor = (double) this->output_sample_rate / (double) this->input_sample_rate; this->bytes_per_frame = snd_pcm_frames_to_bytes (this->audio_fd, 1); /* @@ -534,10 +534,10 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; - printf("start_threads creating thread for decode1\n"); + // printf("start_threads: creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); /* Open audio card. */ - printf("Starting alsa routines\n"); + printf("Starting alsa routines.\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); ao_alsa_open(&alsa_driver_capture, &rate, SND_PCM_STREAM_CAPTURE); @@ -552,9 +552,9 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], #endif #ifdef USE_PORTAUDIO /* snd_pcm_start */ - printf("start_threads creating thread for a2d\n"); + // printf("start_threads: creating thread for a2d\n"); iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); - printf("start_threads creating thread for decode1_\n"); + // printf("start_threads: creating thread for decode1_\n"); iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif }