Sounds good! If anyone wants my quick fix for 0.20.08, here it is; I don't think this shoudl break anything and it adds very little overhead, and of course the message can be removed or relaced with g_print whatever that is... but if you have fixed the cause for the next version so much the better. on my system it ALWAYS hangs after playback, a problem that is hard to miss! so it must be system (sound card? driver module?) dependent if you or anyone has ever played back a selection without it hanging. I am guessing that it only plays complete blocks and reports back only integer multiples of the block size.

I now understand why the tool buttons do not respond during this loop, the control never gets back to the gtk routines. Perhaps it would be a good idea to include something like this in order to ensure that the loop terminates eventually? or, set a limit on the number of loops?


901 void stop_playback(int force)
 902 {
 903     if(!force) {
 904             /* Robert altered */
 905        int new_playback = audio_device_processed_bytes();
 906        int  old_playback;
 907         while(new_playback < playback_total_bytes) {
 908             /* Robert altered */
 909             //g_print("usleep 100\n") ;
 910             usleep(250) ;
 911             old_playback = new_playback;
 912             new_playback=audio_device_processed_bytes();
 913             /* check if more samples have been processed, if not,quit */
 914             if (old_playback==new_playback){
 915               fprintf(stderr,"Playback appears frozen\n Breaking\n");
 916               break;
 917             }
 918         }
 919         usleep(100) ;
 920     }
 921     audio_state = NOTHING ;
 922     audio_device_close() ;
 923 }
-----Original Message-----
From:   Jeff Welty []
Sent:   Fri 1/7/2005 8:41 PM
To:     Atwood, Robert C
Subject:        Re: [Gwc-general] gwc-0.20.08 -- hangs after playback
Thanks for the bug report.

I also caught the hanging problem and have a fix when 0.20-09 is
released.  What I wanted to achieve with
that little loop not closing the audio device prematurely, which I think
is one source of a small clicking sound
at the end of playback.  I think, though, I haven't got the problem
licked, because even though the audio
device has receieve all the bytes in it's internal buffer, it hasn't
played them all.

0.20-09 will also have a fix for snapping to markers when the markers
are close to each other,
as well as a lowpass iir filter, and amplify can now mix/crossfade from
the left/right channels.


Atwood, Robert C wrote:

> gwc certainly looks like it will serve the purpose of removing one
> more reason to run Windows on the machine! However, I experienced one
> significant problem already -- the program hangs when it reaches the
> end of a selected region upon play back.
> I debugged it, which led me to the following subroutine at
> audio_util.c:901
> ______________________________________
> void stop_playback(int force)
> {
>     if(!force) {
>         while(audio_device_processed_bytes() < playback_total_bytes) {
>             //g_print("usleep 100\n") ;
>             usleep(250) ;
>         }
>         usleep(100) ;
>     }
>     audio_state = NOTHING ;
>     audio_device_close() ;
> }
> ________________________________________