diff -ruN TiMidity++-2.5.0/ChangeLog TiMidity++-2.5.1/ChangeLog --- TiMidity++-2.5.0/ChangeLog Thu Aug 26 11:37:01 1999 +++ TiMidity++-2.5.1/ChangeLog Sat Aug 28 00:26:52 1999 @@ -1,3 +1,22 @@ +1999-08-27 Masanao Izumo + + * Version 2.5.1 released. + +1999-08-27 Masanao Izumo + + * timidity/aq.c: Bug fixed. Avoid infinite loop in aq_flush(); + * timidity/{output.h,aq.c,w32g_a.c} (PM_REQ_OUTPUT_FINISH): + * interface/{x_wrdt.c,x_sherry.c},configure.in (ENABLE_SHERRY): Bug fix. + +1999-08-26 Masanao Izumo + + * timidity/linux_a.c (ignore_processed_probrem, BYTES_PROCESSED_BUGFIX): + Obsoleted. + * timidity/linux_a.c (SNDCTL_DSP_GETOPTR, SNDCTL_DSP_GETODELAY): Use + SNDCTL_DSP_GETODELAY instead of SNDCTL_DSP_GETOPTR to calculate + sample point. + * interface/w32g_utl.c: Bug fixed about the chorus and reverb settings. + 1999-08-26 Masanao Izumo * Version 2.5.0 released. diff -ruN TiMidity++-2.5.0/NEWS TiMidity++-2.5.1/NEWS --- TiMidity++-2.5.0/NEWS Thu Aug 26 12:11:59 1999 +++ TiMidity++-2.5.1/NEWS Fri Aug 27 23:43:30 1999 @@ -1,3 +1,7 @@ +8/27, 1999 + * Version 2.5.1 released. + * Bug fix. + 8/26, 1999 * Version 2.5.0 released. * Upgrade Windows GUI. @@ -8,6 +12,8 @@ more than 16ch. * On Windows, recognize both `\' and `/' as path separator if the binary is compiled with Cygwin. + * Improvement for CSPLINE_INTERPOLATION and LAGRANGE_INTERPOLATION. + * Less CPU% in trace playing. * Bug fix. 8/11, 1999 diff -ruN TiMidity++-2.5.0/configs/msc-config.h TiMidity++-2.5.1/configs/msc-config.h --- TiMidity++-2.5.0/configs/msc-config.h Thu Aug 26 13:01:15 1999 +++ TiMidity++-2.5.1/configs/msc-config.h Sat Aug 28 00:30:47 1999 @@ -217,7 +217,7 @@ #define HAVE_MMSYSTEM_H /* In VDS Macro AAA=BBB is not available. */ -#define TIMID_VERSION "2.5.0" +#define TIMID_VERSION "2.5.1" #define DEFAULT_PATH ".\\" #define AU_W32 #define WINSOCK diff -ruN TiMidity++-2.5.0/configure TiMidity++-2.5.1/configure --- TiMidity++-2.5.0/configure Thu Aug 26 12:59:25 1999 +++ TiMidity++-2.5.1/configure Sat Aug 28 00:28:53 1999 @@ -856,7 +856,7 @@ PACKAGE=TiMidity++ -VERSION=2.5.0 +VERSION=2.5.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -7426,16 +7426,15 @@ enable_sherry_wrd=no fi - if test "$enable_sherry_wrd" = yes; then CPPFLAGS="$CPPFLAGS -DENABLE_SHERRY" lib_zip_opt=-lz lib_png_opt=-lpng - if test "x$have_xext" = xyes; then - lib_xext_opt=-lXext - fi else echo "configure: warning: Sherry WRD is disabled: png.h, libpng.a, libz.a are required" 1>&2 + fi + if test "x$have_xext" = xyes; then + lib_xext_opt=-lXext fi fi fi diff -ruN TiMidity++-2.5.0/configure.in TiMidity++-2.5.1/configure.in --- TiMidity++-2.5.0/configure.in Thu Aug 26 12:58:47 1999 +++ TiMidity++-2.5.1/configure.in Sat Aug 28 00:25:51 1999 @@ -53,7 +53,7 @@ AC_INIT(timidity/timidity.c) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(TiMidity++, 2.5.0, no-define) +AM_INIT_AUTOMAKE(TiMidity++, 2.5.1, no-define) dnl To use CONTAINS() macro (See acinclude.m4) CONTAINS_INIT @@ -973,16 +973,15 @@ AC_CHECK_LIB(z,zlibVersion,:,enable_sherry_wrd=no) AC_CHECK_HEADER(png.h,,enable_sherry_wrd=no) AC_CHECK_LIB(png,png_init_io,:,enable_sherry_wrd=no,-lz) - if test "$enable_sherry_wrd" = yes; then CPPFLAGS="$CPPFLAGS -DENABLE_SHERRY" lib_zip_opt=-lz lib_png_opt=-lpng - if test "x$have_xext" = xyes; then - lib_xext_opt=-lXext - fi else AC_MSG_WARN([Sherry WRD is disabled: png.h, libpng.a, libz.a are required]) + fi + if test "x$have_xext" = xyes; then + lib_xext_opt=-lXext fi fi ]) AM_CONDITIONAL(ENABLE_WRD, test "x$enable_wrd" = "xyes") diff -ruN TiMidity++-2.5.0/interface/w32g_utl.c TiMidity++-2.5.1/interface/w32g_utl.c --- TiMidity++-2.5.0/interface/w32g_utl.c Wed Aug 25 18:27:54 1999 +++ TiMidity++-2.5.1/interface/w32g_utl.c Thu Aug 26 16:28:58 1999 @@ -422,7 +422,7 @@ effect_lr_mode = st->effect_lr_mode; effect_lr_delay_msec = st->effect_lr_delay_msec; opt_reverb_control = st->opt_reverb_control; - opt_chorus_control = st->opt_reverb_control; + opt_chorus_control = st->opt_chorus_control; noise_sharp_type = st->noise_sharp_type; opt_evil_mode = st->opt_evil_mode; adjust_panning_immediately = SetFlag(st->adjust_panning_immediately); @@ -505,7 +505,7 @@ st->effect_lr_mode = effect_lr_mode; st->effect_lr_delay_msec = effect_lr_delay_msec; st->opt_reverb_control = opt_reverb_control; - st->opt_chorus_control = opt_reverb_control; + st->opt_chorus_control = opt_chorus_control; st->noise_sharp_type = noise_sharp_type; st->opt_evil_mode = SetFlag(opt_evil_mode); st->adjust_panning_immediately = SetFlag(adjust_panning_immediately); diff -ruN TiMidity++-2.5.0/interface/wrdt_x.c TiMidity++-2.5.1/interface/wrdt_x.c --- TiMidity++-2.5.0/interface/wrdt_x.c Wed Aug 18 02:08:56 1999 +++ TiMidity++-2.5.1/interface/wrdt_x.c Sat Aug 28 00:27:38 1999 @@ -65,7 +65,11 @@ 0, wrdt_open, wrdt_apply, +#ifdef ENABLE_SHERRY x_sry_wrdt_apply, +#else + NULL, +#endif wrdt_update_events, wrdt_start, wrdt_end, @@ -87,8 +91,10 @@ { if(current_wrd_mode == WRD_TRACE_MIMPI) WinEvent(); +#ifdef ENABLE_SHERRY else if(current_wrd_mode == WRD_TRACE_SHERRY) x_sry_event(); +#endif } static int wrdt_start(int mode) diff -ruN TiMidity++-2.5.0/interface/x_sherry.c TiMidity++-2.5.1/interface/x_sherry.c --- TiMidity++-2.5.0/interface/x_sherry.c Wed Aug 18 02:08:56 1999 +++ TiMidity++-2.5.1/interface/x_sherry.c Sat Aug 28 00:27:51 1999 @@ -2263,8 +2263,6 @@ memset(scr->data, transParent, size); return scr; } -#endif /* ENABLE_SHERRY */ - void x_sry_event(void) { @@ -2285,3 +2283,4 @@ XSync(theDisplay, False); } } +#endif /* ENABLE_SHERRY */ diff -ruN TiMidity++-2.5.0/timidity/aq.c TiMidity++-2.5.1/timidity/aq.c --- TiMidity++-2.5.0/timidity/aq.c Sat Aug 21 16:31:40 1999 +++ TiMidity++-2.5.1/timidity/aq.c Fri Aug 27 23:27:10 1999 @@ -521,6 +521,7 @@ return rc; } } + play_mode->acntl(PM_REQ_OUTPUT_FINISH, NULL); return RC_NONE; } @@ -530,8 +531,7 @@ int more_trace; /* to avoid infinite loop */ - double t1, t2, timeout_expect; - int32 last_point; + double t, timeout_expect; aq_add_count = 0; init_effect(); @@ -551,6 +551,7 @@ if(!IS_STREAM_TRACE) { play_mode->acntl(PM_REQ_FLUSH, NULL); + play_counter = play_offset_counter = 0; return RC_NONE; } @@ -559,9 +560,8 @@ return rc; more_trace = 1; - t1 = get_current_calender_time(); - last_point = aq_samples(); - timeout_expect = t1 + (double)aq_filled() / play_mode->rate; + t = get_current_calender_time(); + timeout_expect = t + (double)aq_filled() / play_mode->rate; while(more_trace || aq_filled() > 0) { @@ -572,27 +572,16 @@ flush_buckets(); return rc; } - aq_wait_ticks(); more_trace = trace_loop(); - t2 = get_current_calender_time(); - if(more_trace) - { - if(t2 - t1 > 1.0) - { - int32 cur; - cur = aq_samples(); - if(last_point == cur) - break; /* Must be bug */ - last_point = cur; - t1 = t2; - } - } + t = get_current_calender_time(); + if(t >= timeout_expect - 0.1) + break; + + if(!more_trace) + usleep((unsigned long)((timeout_expect - t) * 1000000)); else - { - if(t2 > timeout_expect) - break; - } + aq_wait_ticks(); } trace_flush(); diff -ruN TiMidity++-2.5.0/timidity/linux_a.c TiMidity++-2.5.1/timidity/linux_a.c --- TiMidity++-2.5.0/timidity/linux_a.c Thu Aug 26 11:11:01 1999 +++ TiMidity++-2.5.1/timidity/linux_a.c Fri Aug 27 21:35:30 1999 @@ -61,10 +61,6 @@ #include "playmidi.h" #include "miditrace.h" -/* It is possible count_info.bytes > written bytes. bug? */ -#define BYTES_PROCESSED_BUGFIX 1 -static int ignore_processed_probrem = 0; - #ifndef AFMT_S16_NE #ifdef LITTLE_ENDIAN #define AFMT_S16_NE AFMT_S16_LE @@ -78,6 +74,7 @@ static int output_data(char *buf, int32 nbytes); static int acntl(int request, void *arg); static int output_counter, counter_offset; +static int total_bytes; /* Maximum buffer size in bytes */ /* export the playback mode */ @@ -107,6 +104,9 @@ { int fd, tmp, i, warnings = 0; int include_enc, exclude_enc; +#ifdef SNDCTL_DSP_GETOSPACE + audio_buf_info info; +#endif /* SNDCTL_DSP_GETOSPACE */ /* Open the audio device */ fd = open(dpm.name, O_WRONLY); @@ -229,9 +229,15 @@ } #endif +#ifdef SNDCTL_DSP_GETOSPACE + if(ioctl(fd, SNDCTL_DSP_GETOSPACE, &info) != -1) + total_bytes = info.fragstotal * info.fragsize; + else +#endif /* SNDCTL_DSP_GETOSPACE */ + total_bytes = -1; /* Unknown */ + dpm.fd = fd; output_counter = counter_offset = 0; - ignore_processed_probrem = 0; return warnings; } @@ -240,20 +246,6 @@ { int n; -#ifdef BYTES_PROCESSED_BUGFIX - if(!ignore_processed_probrem) - { - count_info cinfo; - ioctl(dpm.fd, SNDCTL_DSP_GETOPTR, &cinfo); - if(output_counter < cinfo.bytes) - { - counter_offset += output_counter; - ioctl(dpm.fd, SNDCTL_DSP_SYNC); - output_counter = 0; - } - } -#endif /* BYTES_PROCESSED_BUGFIX */ - while(nbytes > 0) { if((n = write(dpm.fd, buf, nbytes)) == -1) @@ -293,83 +285,58 @@ static int acntl(int request, void *arg) { - audio_buf_info info; - count_info cinfo; - int total, bytes; + int i; switch(request) { - case PM_REQ_GETQSIZ: - if(ioctl(dpm.fd, SNDCTL_DSP_GETOSPACE, &info) == -1) - { - ignore_processed_probrem = 1; - return -1; - } - total = info.fragstotal * info.fragsize; - *((int *)arg) = total; - return 0; - case PM_REQ_DISCARD: counter_offset = output_counter = 0; - ignore_processed_probrem = 0; return ioctl(dpm.fd, SNDCTL_DSP_RESET); case PM_REQ_FLUSH: counter_offset = output_counter = 0; - ignore_processed_probrem = 0; return ioctl(dpm.fd, SNDCTL_DSP_SYNC); - case PM_REQ_RATE: { - int rate; - rate = *(int *)arg; - if(ioctl(dpm.fd, SNDCTL_DSP_SPEED, &rate) < 0) - return -1; - play_mode->rate = rate; - return 0; - } + case PM_REQ_RATE: + i = *(int *)arg; /* sample rate in and out */ + if(ioctl(dpm.fd, SNDCTL_DSP_SPEED, &i) < 0) + return -1; + play_mode->rate = i; + return 0; + + case PM_REQ_GETQSIZ: + if(total_bytes <= 0) + return -1; + *((int *)arg) = total_bytes; + return 0; - case PM_REQ_GETFILLABLE: - if(ioctl(dpm.fd, SNDCTL_DSP_GETOSPACE, &info) == -1) - { - ignore_processed_probrem = 1; - return -1; - } - total = info.fragstotal * info.fragsize; - bytes = info.bytes; - if(bytes > total) - bytes = total; - if(!(dpm.encoding & PE_MONO)) bytes >>= 1; - if(dpm.encoding & PE_16BIT) bytes >>= 1; - *((int *)arg) = bytes; - return 0; - - case PM_REQ_GETFILLED: - if(ioctl(dpm.fd, SNDCTL_DSP_GETOSPACE, &info) == -1) - { - ignore_processed_probrem = 1; - return -1; - } - total = info.fragstotal * info.fragsize; - bytes = info.bytes; - if(bytes > total) - bytes = total; - bytes = total - bytes; - if(!(dpm.encoding & PE_MONO)) bytes >>= 1; - if(dpm.encoding & PE_16BIT) bytes >>= 1; - *((int *)arg) = bytes; - return 0; - - case PM_REQ_GETSAMPLES: - if(ioctl(dpm.fd, SNDCTL_DSP_GETOPTR, &cinfo) == -1) - { - ignore_processed_probrem = 1; - return -1; - } - bytes = cinfo.bytes + counter_offset; - if(!(dpm.encoding & PE_MONO)) bytes >>= 1; - if(dpm.encoding & PE_16BIT) bytes >>= 1; - *((int *)arg) = bytes; - return 0; +#ifdef SNDCTL_DSP_GETODELAY + case PM_REQ_GETFILLED: + if(total_bytes <= 0 || ioctl(dpm.fd, SNDCTL_DSP_GETODELAY, &i) == -1) + return -1; + if(!(dpm.encoding & PE_MONO)) i >>= 1; + if(dpm.encoding & PE_16BIT) i >>= 1; + *((int *)arg) = i; + return 0; + + case PM_REQ_GETFILLABLE: + if(total_bytes <= 0 || ioctl(dpm.fd, SNDCTL_DSP_GETODELAY, &i) == -1) + return -1; + i = total_bytes - i; + if(!(dpm.encoding & PE_MONO)) i >>= 1; + if(dpm.encoding & PE_16BIT) i >>= 1; + *((int *)arg) = i; + return 0; + + case PM_REQ_GETSAMPLES: + if(total_bytes <= 0 || ioctl(dpm.fd, SNDCTL_DSP_GETODELAY, &i) == -1) + return -1; + i = output_counter - i; + if(!(dpm.encoding & PE_MONO)) i >>= 1; + if(dpm.encoding & PE_16BIT) i >>= 1; + *((int *)arg) = i; + return 0; +#endif /* SNDCTL_DSP_GETODELAY */ } return -1; } diff -ruN TiMidity++-2.5.0/timidity/output.h TiMidity++-2.5.1/timidity/output.h --- TiMidity++-2.5.0/timidity/output.h Sat Aug 21 16:31:36 1999 +++ TiMidity++-2.5.1/timidity/output.h Fri Aug 27 23:43:41 1999 @@ -95,6 +95,12 @@ PM_REQ_GETFILLED, /* ARG: int * Get filled device queue size */ + + PM_REQ_OUTPUT_FINISH /* ARG: not-used + * PM_REQ_OUTPUT_FINISH calls just after the last + * output_data(), and TiMidity would into + * waiting to flush the audio buffer. + */ }; diff -ruN TiMidity++-2.5.0/timidity/w32g_a.c TiMidity++-2.5.1/timidity/w32g_a.c --- TiMidity++-2.5.0/timidity/w32g_a.c Sat Aug 21 16:31:36 1999 +++ TiMidity++-2.5.1/timidity/w32g_a.c Fri Aug 27 23:24:26 1999 @@ -529,45 +529,45 @@ { case PM_REQ_GETQSIZ: #if 0 - *(int *)arg = data_block_num * AUDIO_BUFFER_SIZE; - if(!(dpm.encoding & PE_MONO)) - *(int *)arg *= 2; - if(dpm.encoding & PE_16BIT) - *(int *)arg *= 2; + *(int *)arg = data_block_num * AUDIO_BUFFER_SIZE; + if(!(dpm.encoding & PE_MONO)) + *(int *)arg *= 2; + if(dpm.encoding & PE_16BIT) + *(int *)arg *= 2; #else - *(int *)arg = data_block_num * data_block_size; + *(int *)arg = data_block_num * data_block_size; #endif - return 0; - case PM_REQ_DISCARD: - case PM_REQ_FLUSH: - if(!nBlocks && current_data_block == NULL) - return 0; - if(request == PM_REQ_DISCARD){ - waveOutReset(dev); - Wait(1); - } else - Wait(0); - EnterCriticalSection (&critSect); - reset_data_block(); - LeaveCriticalSection (&critSect); - return 0; - case PM_REQ_RATE: + return 0; + case PM_REQ_DISCARD: + case PM_REQ_FLUSH: + if(!nBlocks && current_data_block == NULL) + return 0; + if(request == PM_REQ_DISCARD){ + waveOutReset(dev); + Wait(1); + } else + Wait(0); + EnterCriticalSection (&critSect); + reset_data_block(); + LeaveCriticalSection (&critSect); + return 0; + case PM_REQ_RATE: break; - case PM_REQ_GETFILLABLE: + case PM_REQ_GETFILLABLE: break; - case PM_REQ_GETFILLED: + case PM_REQ_GETFILLED: break; - case PM_REQ_GETSAMPLES: + case PM_REQ_GETSAMPLES: break; - case PM_REQ_PLAY_END: - if(current_data_block != NULL && current_data_block->size > 0) - { - EnterCriticalSection (&critSect); - waveOutWriteBlock(current_data_block); - LeaveCriticalSection (&critSect); - } - current_data_block = NULL; - return 0; + case PM_REQ_OUTPUT_FINISH: + if(current_data_block != NULL && current_data_block->size > 0) + { + EnterCriticalSection (&critSect); + waveOutWriteBlock(current_data_block); + LeaveCriticalSection (&critSect); + } + current_data_block = NULL; + return 0; } return -1; }